From d925ad8e73ecc91bf28c45c05e7f09429d07ffc4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 4 Jul 2026 00:25:22 +0000 Subject: [PATCH] chore: update to latest Copilot LSP --- copilot/js/main.js | 2054 +++++++++++++++++++------------------ copilot/js/tfidfWorker.js | 12 +- lua/copilot/util.lua | 2 +- 3 files changed, 1056 insertions(+), 1012 deletions(-) diff --git a/copilot/js/main.js b/copilot/js/main.js index 66722a76..c8e6005b 100644 --- a/copilot/js/main.js +++ b/copilot/js/main.js @@ -1,79 +1,93 @@ -"use strict";var Yso=Object.create;var Jve=Object.defineProperty;var Kso=Object.getOwnPropertyDescriptor;var Jso=Object.getOwnPropertyNames;var Zso=Object.getPrototypeOf,Xso=Object.prototype.hasOwnProperty;var x7r=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),w7r=t=>{throw TypeError(t)};var a=(t,e)=>Jve(t,"name",{value:e,configurable:!0});var _e=(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}},Ri=(t,e)=>{for(var r in e)Jve(t,r,{get:e[r],enumerable:!0})},R7r=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Jso(e))!Xso.call(t,o)&&o!==r&&Jve(t,o,{get:()=>e[o],enumerable:!(n=Kso(e,o))||n.enumerable});return t};var de=(t,e,r)=>(r=t!=null?Yso(Zso(t)):{},R7r(e||!t||!t.__esModule?Jve(r,"default",{value:t,enumerable:!0}):r,t)),_a=t=>R7r(Jve({},"__esModule",{value:!0}),t);var YRt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&w7r("Object expected");var n,o;r&&(n=e[x7r("asyncDispose")]),n===void 0&&(n=e[x7r("dispose")],r&&(o=n)),typeof n!="function"&&w7r("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},KRt=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),s=c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e};return s()};var importMetaUrlShim,p=_e(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var F7r,U7r=_e(()=>{p();F7r="ffffffff-ffff-ffff-ffff-ffffffffffff"});var Q7r,q7r=_e(()=>{p();Q7r="00000000-0000-0000-0000-000000000000"});var j7r,H7r=_e(()=>{p();j7r=/^(?:[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 dao(t){return typeof t=="string"&&j7r.test(t)}var H9,Zve=_e(()=>{p();H7r();a(dao,"validate");H9=dao});function fao(t){if(!H9(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 qB,Xve=_e(()=>{p();Zve();a(fao,"parse");qB=fao});function i_(t,e=0){return(tA[t[e+0]]+tA[t[e+1]]+tA[t[e+2]]+tA[t[e+3]]+"-"+tA[t[e+4]]+tA[t[e+5]]+"-"+tA[t[e+6]]+tA[t[e+7]]+"-"+tA[t[e+8]]+tA[t[e+9]]+"-"+tA[t[e+10]]+tA[t[e+11]]+tA[t[e+12]]+tA[t[e+13]]+tA[t[e+14]]+tA[t[e+15]]).toLowerCase()}function pao(t,e=0){let r=i_(t,e);if(!H9(r))throw TypeError("Stringified UUID is invalid");return r}var tA,G7r,jB=_e(()=>{p();Zve();tA=[];for(let t=0;t<256;++t)tA.push((t+256).toString(16).slice(1));a(i_,"unsafeStringify");a(pao,"stringify");G7r=pao});function HB(){return crypto.getRandomValues(hao)}var hao,m6e=_e(()=>{p();hao=new Uint8Array(16);a(HB,"rng")});function mao(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=$7r(t.random??t.rng?.()??HB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=HB();gao(eCe,s,c),n=$7r(c,eCe.msecs,eCe.nsecs,o?void 0:eCe.clockseq,o?void 0:eCe.node,e,r)}return e??i_(n)}function gao(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 eCe,g6e,tPt=_e(()=>{p();m6e();jB();eCe={};a(mao,"v1");a(gao,"updateV1State");a($7r,"v1Bytes");g6e=mao});function tCe(t){let e=typeof t=="string"?qB(t):t,r=Aao(e);return typeof t=="string"?i_(r):r}function Aao(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 rPt=_e(()=>{p();Xve();jB();a(tCe,"v1ToV6");a(Aao,"_v1ToV6")});function yao(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,V7r.createHash)("md5").update(t).digest()}var V7r,W7r,z7r=_e(()=>{p();V7r=require("node:crypto");a(yao,"md5");W7r=yao});function Eao(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 i_(u)}var A6e,y6e,nPt=_e(()=>{p();Xve();jB();a(Eao,"stringToBytes");A6e="6ba7b810-9dad-11d1-80b4-00c04fd430c8",y6e="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(rCe,"v35")});function iPt(t,e,r,n){return rCe(48,W7r,t,e,r,n)}var Y7r,K7r=_e(()=>{p();z7r();nPt();a(iPt,"v3");iPt.DNS=A6e;iPt.URL=y6e;Y7r=iPt});function _ao(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():vao(t,e,r)}function vao(t,e,r){t=t||{};let n=t.random??t.rng?.()??HB();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[r+o]=n[o];return e}return i_(n)}var Gt,J7r=_e(()=>{p();m6e();jB();a(_ao,"v4");a(vao,"_v4");Gt=_ao});function Cao(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,Z7r.createHash)("sha1").update(t).digest()}var Z7r,X7r,eQr=_e(()=>{p();Z7r=require("node:crypto");a(Cao,"sha1");X7r=Cao});function oPt(t,e,r,n){return rCe(80,X7r,t,e,r,n)}var tQr,rQr=_e(()=>{p();eQr();nPt();a(oPt,"v5");oPt.DNS=A6e;oPt.URL=y6e;tQr=oPt});function bao(t,e,r){t??={},r??=0;let n=g6e({...t,_v6:!0},new Uint8Array(16));if(n=tCe(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 i_(n)}var nQr,iQr=_e(()=>{p();jB();tPt();rPt();a(bao,"v6");nQr=bao});function sPt(t){let e=typeof t=="string"?qB(t):t,r=Sao(e);return typeof t=="string"?i_(r):r}function Sao(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 oQr=_e(()=>{p();Xve();jB();a(sPt,"v6ToV1");a(Sao,"_v6ToV1")});function Tao(t,e,r){let n;if(t)n=sQr(t.random??t.rng?.()??HB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=HB();Iao(aPt,o,s),n=sQr(s,aPt.msecs,aPt.seq,e,r)}return e??i_(n)}function Iao(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 sQr(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 aPt,aQr,cQr=_e(()=>{p();m6e();jB();aPt={};a(Tao,"v7");a(Iao,"updateV7State");a(sQr,"v7Bytes");aQr=Tao});function xao(t){if(!H9(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var lQr,uQr=_e(()=>{p();Zve();a(xao,"version");lQr=xao});var _c={};Ri(_c,{MAX:()=>F7r,NIL:()=>Q7r,parse:()=>qB,stringify:()=>G7r,v1:()=>g6e,v1ToV6:()=>tCe,v3:()=>Y7r,v4:()=>Gt,v5:()=>tQr,v6:()=>nQr,v6ToV1:()=>sPt,v7:()=>aQr,validate:()=>H9,version:()=>lQr});var jo=_e(()=>{p();U7r();q7r();Xve();jB();tPt();rPt();K7r();J7r();rQr();iQr();oQr();cQr();Zve();uQr()});var L0=I(cPt=>{"use strict";p();cPt.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})};cPt.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 fQr=I((Bil,dQr)=>{p();var G9=require("constants"),wao=process.cwd,E6e=null,Rao=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return E6e||(E6e=wao.call(process)),E6e};try{process.cwd()}catch{}typeof process.chdir=="function"&&(lPt=process.chdir,process.chdir=function(t){E6e=null,lPt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,lPt));var lPt;dQr.exports=Pao;function Pao(t){G9.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(){}),Rao==="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,G9.O_WRONLY|G9.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,G9.O_WRONLY|G9.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){G9.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,G9.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,G9.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(Pao,"patch")});var mQr=I((Uil,hQr)=>{p();var pQr=require("stream").Stream;hQr.exports=kao;function kao(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);pQr.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);pQr.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(kao,"legacy")});var AQr=I((jil,gQr)=>{"use strict";p();gQr.exports=Nao;var Dao=Object.getPrototypeOf||function(t){return t.__proto__};function Nao(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Dao(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a(Nao,"clone")});var toe=I(($il,fPt)=>{p();var tf=require("fs"),Mao=fQr(),Oao=mQr(),Bao=AQr(),_6e=require("util"),rA,C6e;typeof Symbol=="function"&&typeof Symbol.for=="function"?(rA=Symbol.for("graceful-fs.queue"),C6e=Symbol.for("graceful-fs.previous")):(rA="___graceful-fs.queue",C6e="___graceful-fs.previous");function Lao(){}a(Lao,"noop");function _Qr(t,e){Object.defineProperty(t,rA,{get:a(function(){return e},"get")})}a(_Qr,"publishQueue");var pW=Lao;_6e.debuglog?pW=_6e.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(pW=a(function(){var t=_6e.format.apply(_6e,arguments);t="GFS4: "+t.split(/\n/).join(` -GFS4: `),console.error(t)},"debug"));tf[rA]||(yQr=global[rA]||[],_Qr(tf,yQr),tf.close=(function(t){function e(r,n){return t.call(tf,r,function(o){o||EQr(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,C6e,{value:t}),e})(tf.close),tf.closeSync=(function(t){function e(r){t.apply(tf,arguments),EQr()}return a(e,"closeSync"),Object.defineProperty(e,C6e,{value:t}),e})(tf.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){pW(tf[rA]),require("assert").equal(tf[rA].length,0)}));var yQr;global[rA]||_Qr(global,tf[rA]);fPt.exports=uPt(Bao(tf));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!tf.__patched&&(fPt.exports=uPt(tf),tf.__patched=!0);function uPt(t){Mao(t),t.gracefulify=uPt,t.createReadStream=w,t.createWriteStream=R;var e=t.readFile;t.readFile=r;function r(D,N,B){return typeof N=="function"&&(B=N,N=null),L(D,N,B);function L(j,M,O,q){return e(j,M,function(Q){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?eoe([L,[j,M,O],Q,q||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}a(L,"go$readFile")}a(r,"readFile");var n=t.writeFile;t.writeFile=o;function o(D,N,B,L){return typeof B=="function"&&(L=B,B=null),j(D,N,B,L);function j(M,O,q,Q,U){return n(M,O,q,function(z){z&&(z.code==="EMFILE"||z.code==="ENFILE")?eoe([j,[M,O,q,Q],z,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(j,"go$writeFile")}a(o,"writeFile");var s=t.appendFile;s&&(t.appendFile=c);function c(D,N,B,L){return typeof B=="function"&&(L=B,B=null),j(D,N,B,L);function j(M,O,q,Q,U){return s(M,O,q,function(z){z&&(z.code==="EMFILE"||z.code==="ENFILE")?eoe([j,[M,O,q,Q],z,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(j,"go$appendFile")}a(c,"appendFile");var l=t.copyFile;l&&(t.copyFile=u);function u(D,N,B,L){return typeof B=="function"&&(L=B,B=0),j(D,N,B,L);function j(M,O,q,Q,U){return l(M,O,q,function(z){z&&(z.code==="EMFILE"||z.code==="ENFILE")?eoe([j,[M,O,q,Q],z,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(j,"go$copyFile")}a(u,"copyFile");var d=t.readdir;t.readdir=h;var f=/^v[0-5]\./;function h(D,N,B){typeof N=="function"&&(B=N,N=null);var L=f.test(process.version)?a(function(O,q,Q,U){return d(O,j(O,q,Q,U))},"go$readdir"):a(function(O,q,Q,U){return d(O,q,j(O,q,Q,U))},"go$readdir");return L(D,N,B);function j(M,O,q,Q){return function(U,z){U&&(U.code==="EMFILE"||U.code==="ENFILE")?eoe([L,[M,O,q],U,Q||Date.now(),Date.now()]):(z&&z.sort&&z.sort(),typeof q=="function"&&q.call(this,U,z))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=Oao(t);_=m.ReadStream,b=m.WriteStream}var g=t.ReadStream;g&&(_.prototype=Object.create(g.prototype),_.prototype.open=v);var A=t.WriteStream;A&&(b.prototype=Object.create(A.prototype),b.prototype.open=T),Object.defineProperty(t,"ReadStream",{get:a(function(){return _},"get"),set:a(function(D){_=D},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:a(function(){return b},"get"),set:a(function(D){b=D},"set"),enumerable:!0,configurable:!0});var y=_;Object.defineProperty(t,"FileReadStream",{get:a(function(){return y},"get"),set:a(function(D){y=D},"set"),enumerable:!0,configurable:!0});var E=b;Object.defineProperty(t,"FileWriteStream",{get:a(function(){return E},"get"),set:a(function(D){E=D},"set"),enumerable:!0,configurable:!0});function _(D,N){return this instanceof _?(g.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}a(_,"ReadStream");function v(){var D=this;P(D.path,D.flags,D.mode,function(N,B){N?(D.autoClose&&D.destroy(),D.emit("error",N)):(D.fd=B,D.emit("open",B),D.read())})}a(v,"ReadStream$open");function b(D,N){return this instanceof b?(A.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}a(b,"WriteStream");function T(){var D=this;P(D.path,D.flags,D.mode,function(N,B){N?(D.destroy(),D.emit("error",N)):(D.fd=B,D.emit("open",B))})}a(T,"WriteStream$open");function w(D,N){return new t.ReadStream(D,N)}a(w,"createReadStream");function R(D,N){return new t.WriteStream(D,N)}a(R,"createWriteStream");var x=t.open;t.open=P;function P(D,N,B,L){return typeof B=="function"&&(L=B,B=null),j(D,N,B,L);function j(M,O,q,Q,U){return x(M,O,q,function(z,$){z&&(z.code==="EMFILE"||z.code==="ENFILE")?eoe([j,[M,O,q,Q],z,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(j,"go$open")}return a(P,"open"),t}a(uPt,"patch");function eoe(t){pW("ENQUEUE",t[0].name,t[1]),tf[rA].push(t),dPt()}a(eoe,"enqueue");var v6e;function EQr(){for(var t=Date.now(),e=0;e2&&(tf[rA][e][3]=t,tf[rA][e][4]=t);dPt()}a(EQr,"resetQueue");function dPt(){if(clearTimeout(v6e),v6e=void 0,tf[rA].length!==0){var t=tf[rA].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)pW("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){pW("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?(pW("RETRY",e.name,r),e.apply(null,r.concat([o]))):tf[rA].push(t)}v6e===void 0&&(v6e=setTimeout(dPt,0))}}a(dPt,"retry")});var s_=I(GB=>{"use strict";p();var vQr=L0().fromCallback,o_=toe(),Fao=["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 o_[t]=="function");Object.assign(GB,o_);Fao.forEach(t=>{GB[t]=vQr(o_[t])});GB.exists=function(t,e){return typeof e=="function"?o_.exists(t,e):new Promise(r=>o_.exists(t,r))};GB.read=function(t,e,r,n,o,s){return typeof s=="function"?o_.read(t,e,r,n,o,s):new Promise((c,l)=>{o_.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};GB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?o_.write(t,e,...r):new Promise((n,o)=>{o_.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};GB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?o_.readv(t,e,...r):new Promise((n,o)=>{o_.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};GB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?o_.writev(t,e,...r):new Promise((n,o)=>{o_.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof o_.realpath.native=="function"?GB.realpath.native=vQr(o_.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var bQr=I((Kil,CQr)=>{"use strict";p();var Uao=require("path");CQr.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Uao.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var xQr=I((Xil,pPt)=>{"use strict";p();var SQr=s_(),{checkPath:TQr}=bQr(),IQr=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");pPt.exports.makeDir=async(t,e)=>(TQr(t),SQr.mkdir(t,{mode:IQr(e),recursive:!0}));pPt.exports.makeDirSync=(t,e)=>(TQr(t),SQr.mkdirSync(t,{mode:IQr(e),recursive:!0}))});var SP=I((rol,wQr)=>{"use strict";p();var Qao=L0().fromPromise,{makeDir:qao,makeDirSync:hPt}=xQr(),mPt=Qao(qao);wQr.exports={mkdirs:mPt,mkdirsSync:hPt,mkdirp:mPt,mkdirpSync:hPt,ensureDir:mPt,ensureDirSync:hPt}});var $9=I((iol,PQr)=>{"use strict";p();var jao=L0().fromPromise,RQr=s_();function Hao(t){return RQr.access(t).then(()=>!0).catch(()=>!1)}a(Hao,"pathExists");PQr.exports={pathExists:jao(Hao),pathExistsSync:RQr.existsSync}});var gPt=I((aol,kQr)=>{"use strict";p();var roe=s_(),Gao=L0().fromPromise;async function $ao(t,e,r){let n=await roe.open(t,"r+"),o=null;try{await roe.futimes(n,e,r)}finally{try{await roe.close(n)}catch(s){o=s}}if(o)throw o}a($ao,"utimesMillis");function Vao(t,e,r){let n=roe.openSync(t,"r+");return roe.futimesSync(n,e,r),roe.closeSync(n)}a(Vao,"utimesMillisSync");kQr.exports={utimesMillis:Gao($ao),utimesMillisSync:Vao}});var hW=I((uol,OQr)=>{"use strict";p();var noe=s_(),F0=require("path"),DQr=L0().fromPromise;function Wao(t,e,r){let n=r.dereference?o=>noe.stat(o,{bigint:!0}):o=>noe.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(Wao,"getStats");function zao(t,e,r){let n,o=r.dereference?c=>noe.statSync(c,{bigint:!0}):c=>noe.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(zao,"getStatsSync");async function Yao(t,e,r,n){let{srcStat:o,destStat:s}=await Wao(t,e,n);if(s){if(nCe(o,s)){let c=F0.basename(t),l=F0.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()&&APt(t,e))throw new Error(b6e(t,e,r));return{srcStat:o,destStat:s}}a(Yao,"checkPaths");function Kao(t,e,r,n){let{srcStat:o,destStat:s}=zao(t,e,n);if(s){if(nCe(o,s)){let c=F0.basename(t),l=F0.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()&&APt(t,e))throw new Error(b6e(t,e,r));return{srcStat:o,destStat:s}}a(Kao,"checkPathsSync");async function NQr(t,e,r,n){let o=F0.resolve(F0.dirname(t)),s=F0.resolve(F0.dirname(r));if(s===o||s===F0.parse(s).root)return;let c;try{c=await noe.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(nCe(e,c))throw new Error(b6e(t,r,n));return NQr(t,e,s,n)}a(NQr,"checkParentPaths");function MQr(t,e,r,n){let o=F0.resolve(F0.dirname(t)),s=F0.resolve(F0.dirname(r));if(s===o||s===F0.parse(s).root)return;let c;try{c=noe.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(nCe(e,c))throw new Error(b6e(t,r,n));return MQr(t,e,s,n)}a(MQr,"checkParentPathsSync");function nCe(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(nCe,"areIdentical");function APt(t,e){let r=F0.resolve(t).split(F0.sep).filter(o=>o),n=F0.resolve(e).split(F0.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(APt,"isSrcSubdir");function b6e(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a(b6e,"errMsg");OQr.exports={checkPaths:DQr(Yao),checkPathsSync:Kao,checkParentPaths:DQr(NQr),checkParentPathsSync:MQr,isSrcSubdir:APt,areIdentical:nCe}});var LQr=I((pol,BQr)=>{"use strict";p();async function Jao(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(Jao,"asyncIteratorConcurrentProcess");BQr.exports={asyncIteratorConcurrentProcess:Jao}});var jQr=I((gol,qQr)=>{"use strict";p();var Iy=s_(),iCe=require("path"),{mkdirs:Zao}=SP(),{pathExists:Xao}=$9(),{utimesMillis:eco}=gPt(),oCe=hW(),{asyncIteratorConcurrentProcess:tco}=LQr();async function rco(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 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; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:o}=await oCe.checkPaths(t,e,"copy",r);if(await oCe.checkParentPaths(t,n,e,"copy"),!await UQr(t,e,r))return;let c=iCe.dirname(e);await Xao(c)||await Zao(c),await QQr(o,t,e,r)}a(rco,"copy");async function UQr(t,e,r){return r.filter?r.filter(t,e):!0}a(UQr,"runFilter");async function QQr(t,e,r,n){let s=await(n.dereference?Iy.stat:Iy.lstat)(e);if(s.isDirectory())return sco(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return nco(s,t,e,r,n);if(s.isSymbolicLink())return aco(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(QQr,"getStatsAndPerformCopy");async function nco(t,e,r,n,o){if(!e)return FQr(t,r,n,o);if(o.overwrite)return await Iy.unlink(n),FQr(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(nco,"onFile");async function FQr(t,e,r,n){if(await Iy.copyFile(e,r),n.preserveTimestamps){ico(t.mode)&&await oco(r,t.mode);let o=await Iy.stat(e);await eco(r,o.atime,o.mtime)}return Iy.chmod(r,t.mode)}a(FQr,"copyFile");function ico(t){return(t&128)===0}a(ico,"fileIsNotWritable");function oco(t,e){return Iy.chmod(t,e|128)}a(oco,"makeFileWritable");async function sco(t,e,r,n,o){e||await Iy.mkdir(n),await tco(await Iy.opendir(r),async s=>{let c=iCe.join(r,s.name),l=iCe.join(n,s.name);if(await UQr(c,l,o)){let{destStat:d}=await oCe.checkPaths(c,l,"copy",o);await QQr(d,c,l,o)}}),e||await Iy.chmod(n,t.mode)}a(sco,"onDir");async function aco(t,e,r,n){let o=await Iy.readlink(e);if(n.dereference&&(o=iCe.resolve(process.cwd(),o)),!t)return Iy.symlink(o,r);let s=null;try{s=await Iy.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return Iy.symlink(o,r);throw c}if(n.dereference&&(s=iCe.resolve(process.cwd(),s)),o!==s){if(oCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(oCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return await Iy.unlink(r),Iy.symlink(o,r)}a(aco,"onLink");qQr.exports=rco});var WQr=I((Eol,VQr)=>{"use strict";p();var a_=toe(),sCe=require("path"),cco=SP().mkdirsSync,lco=gPt().utimesMillisSync,aCe=hW();function uco(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 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-WARN0002");let{srcStat:n,destStat:o}=aCe.checkPathsSync(t,e,"copy",r);if(aCe.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let s=sCe.dirname(e);return a_.existsSync(s)||cco(s),HQr(o,t,e,r)}a(uco,"copySync");function HQr(t,e,r,n){let s=(n.dereference?a_.statSync:a_.lstatSync)(e);if(s.isDirectory())return Aco(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return dco(s,t,e,r,n);if(s.isSymbolicLink())return _co(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(HQr,"getStats");function dco(t,e,r,n,o){return e?fco(t,r,n,o):GQr(t,r,n,o)}a(dco,"onFile");function fco(t,e,r,n){if(n.overwrite)return a_.unlinkSync(r),GQr(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}a(fco,"mayCopyFile");function GQr(t,e,r,n){return a_.copyFileSync(e,r),n.preserveTimestamps&&pco(t.mode,e,r),yPt(r,t.mode)}a(GQr,"copyFile");function pco(t,e,r){return hco(t)&&mco(r,t),gco(e,r)}a(pco,"handleTimestamps");function hco(t){return(t&128)===0}a(hco,"fileIsNotWritable");function mco(t,e){return yPt(t,e|128)}a(mco,"makeFileWritable");function yPt(t,e){return a_.chmodSync(t,e)}a(yPt,"setDestMode");function gco(t,e){let r=a_.statSync(t);return lco(e,r.atime,r.mtime)}a(gco,"setDestTimestamps");function Aco(t,e,r,n,o){return e?$Qr(r,n,o):yco(t.mode,r,n,o)}a(Aco,"onDir");function yco(t,e,r,n){return a_.mkdirSync(r),$Qr(e,r,n),yPt(r,t)}a(yco,"mkDirAndCopy");function $Qr(t,e,r){let n=a_.opendirSync(t);try{let o;for(;(o=n.readSync())!==null;)Eco(o.name,t,e,r)}finally{n.closeSync()}}a($Qr,"copyDir");function Eco(t,e,r,n){let o=sCe.join(e,t),s=sCe.join(r,t);if(n.filter&&!n.filter(o,s))return;let{destStat:c}=aCe.checkPathsSync(o,s,"copy",n);return HQr(c,o,s,n)}a(Eco,"copyDirItem");function _co(t,e,r,n){let o=a_.readlinkSync(e);if(n.dereference&&(o=sCe.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=sCe.resolve(process.cwd(),s)),o!==s){if(aCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(aCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return vco(o,r)}else return a_.symlinkSync(o,r)}a(_co,"onLink");function vco(t,e){return a_.unlinkSync(e),a_.symlinkSync(t,e)}a(vco,"copyLink");VQr.exports=uco});var S6e=I((Col,zQr)=>{"use strict";p();var Cco=L0().fromPromise;zQr.exports={copy:Cco(jQr()),copySync:WQr()}});var cCe=I((Sol,KQr)=>{"use strict";p();var YQr=toe(),bco=L0().fromCallback;function Sco(t,e){YQr.rm(t,{recursive:!0,force:!0},e)}a(Sco,"remove");function Tco(t){YQr.rmSync(t,{recursive:!0,force:!0})}a(Tco,"removeSync");KQr.exports={remove:bco(Sco),removeSync:Tco}});var iqr=I((xol,nqr)=>{"use strict";p();var Ico=L0().fromPromise,XQr=s_(),eqr=require("path"),tqr=SP(),rqr=cCe(),JQr=Ico(a(async function(e){let r;try{r=await XQr.readdir(e)}catch{return tqr.mkdirs(e)}return Promise.all(r.map(n=>rqr.remove(eqr.join(e,n))))},"emptyDir"));function ZQr(t){let e;try{e=XQr.readdirSync(t)}catch{return tqr.mkdirsSync(t)}e.forEach(r=>{r=eqr.join(t,r),rqr.removeSync(r)})}a(ZQr,"emptyDirSync");nqr.exports={emptyDirSync:ZQr,emptydirSync:ZQr,emptyDir:JQr,emptydir:JQr}});var cqr=I((Pol,aqr)=>{"use strict";p();var xco=L0().fromPromise,oqr=require("path"),$B=s_(),sqr=SP();async function wco(t){let e;try{e=await $B.stat(t)}catch{}if(e&&e.isFile())return;let r=oqr.dirname(t),n=null;try{n=await $B.stat(r)}catch(o){if(o.code==="ENOENT"){await sqr.mkdirs(r),await $B.writeFile(t,"");return}else throw o}n.isDirectory()?await $B.writeFile(t,""):await $B.readdir(r)}a(wco,"createFile");function Rco(t){let e;try{e=$B.statSync(t)}catch{}if(e&&e.isFile())return;let r=oqr.dirname(t);try{$B.statSync(r).isDirectory()||$B.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")sqr.mkdirsSync(r);else throw n}$B.writeFileSync(t,"")}a(Rco,"createFileSync");aqr.exports={createFile:xco(wco),createFileSync:Rco}});var pqr=I((Nol,fqr)=>{"use strict";p();var Pco=L0().fromPromise,lqr=require("path"),V9=s_(),uqr=SP(),{pathExists:kco}=$9(),{areIdentical:dqr}=hW();async function Dco(t,e){let r;try{r=await V9.lstat(e)}catch{}let n;try{n=await V9.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&dqr(n,r))return;let o=lqr.dirname(e);await kco(o)||await uqr.mkdirs(o),await V9.link(t,e)}a(Dco,"createLink");function Nco(t,e){let r;try{r=V9.lstatSync(e)}catch{}try{let s=V9.lstatSync(t);if(r&&dqr(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=lqr.dirname(e);return V9.existsSync(n)||uqr.mkdirsSync(n),V9.linkSync(t,e)}a(Nco,"createLinkSync");fqr.exports={createLink:Pco(Dco),createLinkSync:Nco}});var mqr=I((Bol,hqr)=>{"use strict";p();var W9=require("path"),lCe=s_(),{pathExists:Mco}=$9(),Oco=L0().fromPromise;async function Bco(t,e){if(W9.isAbsolute(t)){try{await lCe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=W9.dirname(e),n=W9.join(r,t);if(await Mco(n))return{toCwd:n,toDst:t};try{await lCe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:W9.relative(r,t)}}a(Bco,"symlinkPaths");function Lco(t,e){if(W9.isAbsolute(t)){if(!lCe.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=W9.dirname(e),n=W9.join(r,t);if(lCe.existsSync(n))return{toCwd:n,toDst:t};if(!lCe.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:W9.relative(r,t)}}a(Lco,"symlinkPathsSync");hqr.exports={symlinkPaths:Oco(Bco),symlinkPathsSync:Lco}});var yqr=I((Uol,Aqr)=>{"use strict";p();var gqr=s_(),Fco=L0().fromPromise;async function Uco(t,e){if(e)return e;let r;try{r=await gqr.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(Uco,"symlinkType");function Qco(t,e){if(e)return e;let r;try{r=gqr.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(Qco,"symlinkTypeSync");Aqr.exports={symlinkType:Fco(Uco),symlinkTypeSync:Qco}});var vqr=I((jol,_qr)=>{"use strict";p();var qco=L0().fromPromise,z9=require("path"),Kv=s_(),{mkdirs:jco,mkdirsSync:Hco}=SP(),{symlinkPaths:Gco,symlinkPathsSync:$co}=mqr(),{symlinkType:Vco,symlinkTypeSync:Wco}=yqr(),{pathExists:zco}=$9(),{areIdentical:Eqr}=hW();async function Yco(t,e,r){let n;try{n=await Kv.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(z9.isAbsolute(t))l=await Kv.stat(t);else{let d=z9.dirname(e),f=z9.join(d,t);try{l=await Kv.stat(f)}catch{l=await Kv.stat(t)}}let u=await Kv.stat(e);if(Eqr(l,u))return}let o=await Gco(t,e);t=o.toDst;let s=await Vco(o.toCwd,r),c=z9.dirname(e);return await zco(c)||await jco(c),Kv.symlink(t,e,s)}a(Yco,"createSymlink");function Kco(t,e,r){let n;try{n=Kv.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(z9.isAbsolute(t))l=Kv.statSync(t);else{let d=z9.dirname(e),f=z9.join(d,t);try{l=Kv.statSync(f)}catch{l=Kv.statSync(t)}}let u=Kv.statSync(e);if(Eqr(l,u))return}let o=$co(t,e);t=o.toDst,r=Wco(o.toCwd,r);let s=z9.dirname(e);return Kv.existsSync(s)||Hco(s),Kv.symlinkSync(t,e,r)}a(Kco,"createSymlinkSync");_qr.exports={createSymlink:qco(Yco),createSymlinkSync:Kco}});var Rqr=I(($ol,wqr)=>{"use strict";p();var{createFile:Cqr,createFileSync:bqr}=cqr(),{createLink:Sqr,createLinkSync:Tqr}=pqr(),{createSymlink:Iqr,createSymlinkSync:xqr}=vqr();wqr.exports={createFile:Cqr,createFileSync:bqr,ensureFile:Cqr,ensureFileSync:bqr,createLink:Sqr,createLinkSync:Tqr,ensureLink:Sqr,ensureLinkSync:Tqr,createSymlink:Iqr,createSymlinkSync:xqr,ensureSymlink:Iqr,ensureSymlinkSync:xqr}});var T6e=I((Wol,Pqr)=>{p();function Jco(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(Jco,"stringify");function Zco(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(Zco,"stripBom");Pqr.exports={stringify:Jco,stripBom:Zco}});var Mqr=I((Kol,Nqr)=>{p();var ioe;try{ioe=toe()}catch{ioe=require("fs")}var I6e=L0(),{stringify:kqr,stripBom:Dqr}=T6e();async function Xco(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||ioe,n="throws"in e?e.throws:!0,o=await I6e.fromCallback(r.readFile)(t,e);o=Dqr(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(Xco,"_readFile");var elo=I6e.fromPromise(Xco);function tlo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||ioe,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=Dqr(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(tlo,"readFileSync");async function rlo(t,e,r={}){let n=r.fs||ioe,o=kqr(e,r);await I6e.fromCallback(n.writeFile)(t,o,r)}a(rlo,"_writeFile");var nlo=I6e.fromPromise(rlo);function ilo(t,e,r={}){let n=r.fs||ioe,o=kqr(e,r);return n.writeFileSync(t,o,r)}a(ilo,"writeFileSync");Nqr.exports={readFile:elo,readFileSync:tlo,writeFile:nlo,writeFileSync:ilo}});var Bqr=I((Xol,Oqr)=>{"use strict";p();var x6e=Mqr();Oqr.exports={readJson:x6e.readFile,readJsonSync:x6e.readFileSync,writeJson:x6e.writeFile,writeJsonSync:x6e.writeFileSync}});var w6e=I((tsl,Uqr)=>{"use strict";p();var olo=L0().fromPromise,EPt=s_(),Lqr=require("path"),Fqr=SP(),slo=$9().pathExists;async function alo(t,e,r="utf-8"){let n=Lqr.dirname(t);return await slo(n)||await Fqr.mkdirs(n),EPt.writeFile(t,e,r)}a(alo,"outputFile");function clo(t,...e){let r=Lqr.dirname(t);EPt.existsSync(r)||Fqr.mkdirsSync(r),EPt.writeFileSync(t,...e)}a(clo,"outputFileSync");Uqr.exports={outputFile:olo(alo),outputFileSync:clo}});var qqr=I((isl,Qqr)=>{"use strict";p();var{stringify:llo}=T6e(),{outputFile:ulo}=w6e();async function dlo(t,e,r={}){let n=llo(e,r);await ulo(t,n,r)}a(dlo,"outputJson");Qqr.exports=dlo});var Hqr=I((asl,jqr)=>{"use strict";p();var{stringify:flo}=T6e(),{outputFileSync:plo}=w6e();function hlo(t,e,r){let n=flo(e,r);plo(t,n,r)}a(hlo,"outputJsonSync");jqr.exports=hlo});var $qr=I((usl,Gqr)=>{"use strict";p();var mlo=L0().fromPromise,c_=Bqr();c_.outputJson=mlo(qqr());c_.outputJsonSync=Hqr();c_.outputJSON=c_.outputJson;c_.outputJSONSync=c_.outputJsonSync;c_.writeJSON=c_.writeJson;c_.writeJSONSync=c_.writeJsonSync;c_.readJSON=c_.readJson;c_.readJSONSync=c_.readJsonSync;Gqr.exports=c_});var Kqr=I((fsl,Yqr)=>{"use strict";p();var glo=s_(),Vqr=require("path"),{copy:Alo}=S6e(),{remove:zqr}=cCe(),{mkdirp:ylo}=SP(),{pathExists:Elo}=$9(),Wqr=hW();async function _lo(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await Wqr.checkPaths(t,e,"move",r);await Wqr.checkParentPaths(t,o,e,"move");let c=Vqr.dirname(e);return Vqr.parse(c).root!==c&&await ylo(c),vlo(t,e,n,s)}a(_lo,"move");async function vlo(t,e,r,n){if(!n){if(r)await zqr(e);else if(await Elo(e))throw new Error("dest already exists.")}try{await glo.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await Clo(t,e,r)}}a(vlo,"doRename");async function Clo(t,e,r){return await Alo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),zqr(t)}a(Clo,"moveAcrossDevice");Yqr.exports=_lo});var tjr=I((msl,ejr)=>{"use strict";p();var Zqr=toe(),vPt=require("path"),blo=S6e().copySync,Xqr=cCe().removeSync,Slo=SP().mkdirpSync,Jqr=hW();function Tlo(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=Jqr.checkPathsSync(t,e,"move",r);return Jqr.checkParentPathsSync(t,o,e,"move"),Ilo(e)||Slo(vPt.dirname(e)),xlo(t,e,n,s)}a(Tlo,"moveSync");function Ilo(t){let e=vPt.dirname(t);return vPt.parse(e).root===e}a(Ilo,"isParentRoot");function xlo(t,e,r,n){if(n)return _Pt(t,e,r);if(r)return Xqr(e),_Pt(t,e,r);if(Zqr.existsSync(e))throw new Error("dest already exists.");return _Pt(t,e,r)}a(xlo,"doRename");function _Pt(t,e,r){try{Zqr.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return wlo(t,e,r)}}a(_Pt,"rename");function wlo(t,e,r){return blo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Xqr(t)}a(wlo,"moveAcrossDevice");ejr.exports=Tlo});var njr=I((ysl,rjr)=>{"use strict";p();var Rlo=L0().fromPromise;rjr.exports={move:Rlo(Kqr()),moveSync:tjr()}});var ojr=I((_sl,ijr)=>{"use strict";p();ijr.exports={...s_(),...S6e(),...iqr(),...Rqr(),...$qr(),...SP(),...njr(),...w6e(),...$9(),...cCe()}});var P6e=I((Csl,cjr)=>{p();var CPt=require("fs"),R6e=require("path"),uCe=R6e.join,Plo=R6e.dirname,sjr=CPt.accessSync&&function(t){try{CPt.accessSync(t)}catch{return!1}return!0}||CPt.existsSync||R6e.existsSync,ajr={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 klo(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(ajr).map(function(u){u in t||(t[u]=ajr[u])}),t.module_root||(t.module_root=Dlo(__filename)),R6e.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 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 Nlo=NI&&NI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Mlo=NI&&NI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ljr=NI&&NI.__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)&&Nlo(e,t,r);return Mlo(e,t),e};Object.defineProperty(NI,"__esModule",{value:!0});NI.setDeviceId=NI.getDeviceId=void 0;var k6e=ljr(require("path")),D6e=ljr(ojr()),ujr=process.platform==="win32"?P6e()("windows"):null,Olo="deviceid";function djr(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=k6e.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??k6e.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return k6e.join(t,"Microsoft","DeveloperTools")}a(djr,"getDirectory");function bPt(){return k6e.join(djr(),Olo)}a(bPt,"getDeviceIdFilePath");async function Blo(){return process.platform==="win32"?ujr?.GetDeviceId():await Llo(bPt())?D6e.readFile(bPt(),"utf8"):void 0}a(Blo,"getDeviceId");NI.getDeviceId=Blo;async function Llo(t){try{return await D6e.promises.access(t),!0}catch{return!1}}a(Llo,"exists");async function Flo(t){process.platform==="win32"?ujr?.SetDeviceId(t):(await D6e.ensureDir(djr()),await D6e.writeFile(bPt(),t,"utf8"))}a(Flo,"setDeviceId");NI.setDeviceId=Flo});var hjr=I($N=>{"use strict";p();var Ulo=$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]})),Qlo=$N&&$N.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qlo=$N&&$N.__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)&&Ulo(e,t,r);return Qlo(e,t),e};Object.defineProperty($N,"__esModule",{value:!0});$N.getDeviceId=void 0;var jlo=(jo(),_a(_c)),pjr=qlo(fjr());async function Hlo(){let t;try{t=await pjr.getDeviceId()}catch{}if(t)return t;{let e=(0,jlo.v4)().toLowerCase();return await pjr.setDeviceId(e),e}}a(Hlo,"getDeviceId");$N.getDeviceId=Hlo});var mjr=I(mW=>{"use strict";p();var Glo=mW&&mW.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$lo=mW&&mW.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Glo(e,t,r)};Object.defineProperty(mW,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");$lo(hjr(),mW)});var na=I((M6e,gjr)=>{p();(function(t,e){typeof M6e=="object"?gjr.exports=M6e=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(M6e,function(){var t=t||(function(e,r){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof global<"u"&&global.crypto&&(n=global.crypto),!n&&typeof require=="function")try{n=require("crypto")}catch{}var o=a(function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},"cryptoSecureRandomInt"),s=Object.create||(function(){function _(){}return a(_,"F"),function(v){var b;return _.prototype=v,b=new _,_.prototype=null,b}})(),c={},l=c.lib={},u=l.Base=(function(){return{extend:a(function(_){var v=s(this);return _&&v.mixIn(_),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},"extend"),create:a(function(){var _=this.extend();return _.init.apply(_,arguments),_},"create"),init:a(function(){},"init"),mixIn:a(function(_){for(var v in _)_.hasOwnProperty(v)&&(this[v]=_[v]);_.hasOwnProperty("toString")&&(this.toString=_.toString)},"mixIn"),clone:a(function(){return this.init.prototype.extend(this)},"clone")}})(),d=l.WordArray=u.extend({init:a(function(_,v){_=this.words=_||[],v!=r?this.sigBytes=v:this.sigBytes=_.length*4},"init"),toString:a(function(_){return(_||h).stringify(this)},"toString"),concat:a(function(_){var v=this.words,b=_.words,T=this.sigBytes,w=_.sigBytes;if(this.clamp(),T%4)for(var R=0;R>>2]>>>24-R%4*8&255;v[T+R>>>2]|=x<<24-(T+R)%4*8}else for(var P=0;P>>2]=b[P>>>2];return this.sigBytes+=w,this},"concat"),clamp:a(function(){var _=this.words,v=this.sigBytes;_[v>>>2]&=4294967295<<32-v%4*8,_.length=e.ceil(v/4)},"clamp"),clone:a(function(){var _=u.clone.call(this);return _.words=this.words.slice(0),_},"clone"),random:a(function(_){for(var v=[],b=0;b<_;b+=4)v.push(o());return new d.init(v,_)},"random")}),f=c.enc={},h=f.Hex={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push((R>>>4).toString(16)),T.push((R&15).toString(16))}return T.join("")},"stringify"),parse:a(function(_){for(var v=_.length,b=[],T=0;T>>3]|=parseInt(_.substr(T,2),16)<<24-T%8*4;return new d.init(b,v/2)},"parse")},m=f.Latin1={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push(String.fromCharCode(R))}return T.join("")},"stringify"),parse:a(function(_){for(var v=_.length,b=[],T=0;T>>2]|=(_.charCodeAt(T)&255)<<24-T%4*8;return new d.init(b,v)},"parse")},g=f.Utf8={stringify:a(function(_){try{return decodeURIComponent(escape(m.stringify(_)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:a(function(_){return m.parse(unescape(encodeURIComponent(_)))},"parse")},A=l.BufferedBlockAlgorithm=u.extend({reset:a(function(){this._data=new d.init,this._nDataBytes=0},"reset"),_append:a(function(_){typeof _=="string"&&(_=g.parse(_)),this._data.concat(_),this._nDataBytes+=_.sigBytes},"_append"),_process:a(function(_){var v,b=this._data,T=b.words,w=b.sigBytes,R=this.blockSize,x=R*4,P=w/x;_?P=e.ceil(P):P=e.max((P|0)-this._minBufferSize,0);var D=P*R,N=e.min(D*4,w);if(D){for(var B=0;B{p();(function(t,e){typeof O6e=="object"?Ajr.exports=O6e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(O6e,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 B6e=="object"?yjr.exports=B6e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(B6e,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 vjr=I((L6e,_jr)=>{p();(function(t,e){typeof L6e=="object"?_jr.exports=L6e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(L6e,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 Y9=I((F6e,Cjr)=>{p();(function(t,e){typeof F6e=="object"?Cjr.exports=F6e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(F6e,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 Sjr=I((U6e,bjr)=>{p();(function(t,e){typeof U6e=="object"?bjr.exports=U6e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(U6e,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 K9=I((Q6e,Tjr)=>{p();(function(t,e){typeof Q6e=="object"?Tjr.exports=Q6e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Q6e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[];(function(){for(var g=0;g<64;g++)l[g]=e.abs(e.sin(g+1))*4294967296|0})();var u=c.MD5=s.extend({_doReset:a(function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},"_doReset"),_doProcessBlock:a(function(g,A){for(var y=0;y<16;y++){var E=A+y,_=g[E];g[E]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360}var v=this._hash.words,b=g[A+0],T=g[A+1],w=g[A+2],R=g[A+3],x=g[A+4],P=g[A+5],D=g[A+6],N=g[A+7],B=g[A+8],L=g[A+9],j=g[A+10],M=g[A+11],O=g[A+12],q=g[A+13],Q=g[A+14],U=g[A+15],z=v[0],$=v[1],W=v[2],J=v[3];z=d(z,$,W,J,b,7,l[0]),J=d(J,z,$,W,T,12,l[1]),W=d(W,J,z,$,w,17,l[2]),$=d($,W,J,z,R,22,l[3]),z=d(z,$,W,J,x,7,l[4]),J=d(J,z,$,W,P,12,l[5]),W=d(W,J,z,$,D,17,l[6]),$=d($,W,J,z,N,22,l[7]),z=d(z,$,W,J,B,7,l[8]),J=d(J,z,$,W,L,12,l[9]),W=d(W,J,z,$,j,17,l[10]),$=d($,W,J,z,M,22,l[11]),z=d(z,$,W,J,O,7,l[12]),J=d(J,z,$,W,q,12,l[13]),W=d(W,J,z,$,Q,17,l[14]),$=d($,W,J,z,U,22,l[15]),z=f(z,$,W,J,T,5,l[16]),J=f(J,z,$,W,D,9,l[17]),W=f(W,J,z,$,M,14,l[18]),$=f($,W,J,z,b,20,l[19]),z=f(z,$,W,J,P,5,l[20]),J=f(J,z,$,W,j,9,l[21]),W=f(W,J,z,$,U,14,l[22]),$=f($,W,J,z,x,20,l[23]),z=f(z,$,W,J,L,5,l[24]),J=f(J,z,$,W,Q,9,l[25]),W=f(W,J,z,$,R,14,l[26]),$=f($,W,J,z,B,20,l[27]),z=f(z,$,W,J,q,5,l[28]),J=f(J,z,$,W,w,9,l[29]),W=f(W,J,z,$,N,14,l[30]),$=f($,W,J,z,O,20,l[31]),z=h(z,$,W,J,P,4,l[32]),J=h(J,z,$,W,B,11,l[33]),W=h(W,J,z,$,M,16,l[34]),$=h($,W,J,z,Q,23,l[35]),z=h(z,$,W,J,T,4,l[36]),J=h(J,z,$,W,x,11,l[37]),W=h(W,J,z,$,N,16,l[38]),$=h($,W,J,z,j,23,l[39]),z=h(z,$,W,J,q,4,l[40]),J=h(J,z,$,W,b,11,l[41]),W=h(W,J,z,$,R,16,l[42]),$=h($,W,J,z,D,23,l[43]),z=h(z,$,W,J,L,4,l[44]),J=h(J,z,$,W,O,11,l[45]),W=h(W,J,z,$,U,16,l[46]),$=h($,W,J,z,w,23,l[47]),z=m(z,$,W,J,b,6,l[48]),J=m(J,z,$,W,N,10,l[49]),W=m(W,J,z,$,Q,15,l[50]),$=m($,W,J,z,P,21,l[51]),z=m(z,$,W,J,O,6,l[52]),J=m(J,z,$,W,R,10,l[53]),W=m(W,J,z,$,j,15,l[54]),$=m($,W,J,z,T,21,l[55]),z=m(z,$,W,J,B,6,l[56]),J=m(J,z,$,W,U,10,l[57]),W=m(W,J,z,$,D,15,l[58]),$=m($,W,J,z,q,21,l[59]),z=m(z,$,W,J,x,6,l[60]),J=m(J,z,$,W,M,10,l[61]),W=m(W,J,z,$,w,15,l[62]),$=m($,W,J,z,L,21,l[63]),v[0]=v[0]+z|0,v[1]=v[1]+$|0,v[2]=v[2]+W|0,v[3]=v[3]+J|0},"_doProcessBlock"),_doFinalize:a(function(){var g=this._data,A=g.words,y=this._nDataBytes*8,E=g.sigBytes*8;A[E>>>5]|=128<<24-E%32;var _=e.floor(y/4294967296),v=y;A[(E+64>>>9<<4)+15]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,A[(E+64>>>9<<4)+14]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,g.sigBytes=(A.length+1)*4,this._process();for(var b=this._hash,T=b.words,w=0;w<4;w++){var R=T[w];T[w]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}return b},"_doFinalize"),clone:a(function(){var g=s.clone.call(this);return g._hash=this._hash.clone(),g},"clone")});function d(g,A,y,E,_,v,b){var T=g+(A&y|~A&E)+_+b;return(T<>>32-v)+A}a(d,"FF");function f(g,A,y,E,_,v,b){var T=g+(A&E|y&~E)+_+b;return(T<>>32-v)+A}a(f,"GG");function h(g,A,y,E,_,v,b){var T=g+(A^y^E)+_+b;return(T<>>32-v)+A}a(h,"HH");function m(g,A,y,E,_,v,b){var T=g+(y^(A|~E))+_+b;return(T<>>32-v)+A}a(m,"II"),r.MD5=s._createHelper(u),r.HmacMD5=s._createHmacHelper(u)})(Math),t.MD5})});var IPt=I((q6e,Ijr)=>{p();(function(t,e){typeof q6e=="object"?Ijr.exports=q6e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(q6e,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 H6e=I((j6e,xjr)=>{p();(function(t,e){typeof j6e=="object"?xjr.exports=j6e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(j6e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[],u=[];(function(){function h(y){for(var E=e.sqrt(y),_=2;_<=E;_++)if(!(y%_))return!1;return!0}a(h,"isPrime");function m(y){return(y-(y|0))*4294967296|0}a(m,"getFractionalBits");for(var g=2,A=0;A<64;)h(g)&&(A<8&&(l[A]=m(e.pow(g,1/2))),u[A]=m(e.pow(g,1/3)),A++),g++})();var d=[],f=c.SHA256=s.extend({_doReset:a(function(){this._hash=new o.init(l.slice(0))},"_doReset"),_doProcessBlock:a(function(h,m){for(var g=this._hash.words,A=g[0],y=g[1],E=g[2],_=g[3],v=g[4],b=g[5],T=g[6],w=g[7],R=0;R<64;R++){if(R<16)d[R]=h[m+R]|0;else{var x=d[R-15],P=(x<<25|x>>>7)^(x<<14|x>>>18)^x>>>3,D=d[R-2],N=(D<<15|D>>>17)^(D<<13|D>>>19)^D>>>10;d[R]=P+d[R-7]+N+d[R-16]}var B=v&b^~v&T,L=A&y^A&E^y&E,j=(A<<30|A>>>2)^(A<<19|A>>>13)^(A<<10|A>>>22),M=(v<<26|v>>>6)^(v<<21|v>>>11)^(v<<7|v>>>25),O=w+M+B+u[R]+d[R],q=j+L;w=T,T=b,b=v,v=_+O|0,_=E,E=y,y=A,A=O+q|0}g[0]=g[0]+A|0,g[1]=g[1]+y|0,g[2]=g[2]+E|0,g[3]=g[3]+_|0,g[4]=g[4]+v|0,g[5]=g[5]+b|0,g[6]=g[6]+T|0,g[7]=g[7]+w|0},"_doProcessBlock"),_doFinalize:a(function(){var h=this._data,m=h.words,g=this._nDataBytes*8,A=h.sigBytes*8;return m[A>>>5]|=128<<24-A%32,m[(A+64>>>9<<4)+14]=e.floor(g/4294967296),m[(A+64>>>9<<4)+15]=g,h.sigBytes=m.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h},"clone")});r.SHA256=s._createHelper(f),r.HmacSHA256=s._createHmacHelper(f)})(Math),t.SHA256})});var Rjr=I((G6e,wjr)=>{p();(function(t,e,r){typeof G6e=="object"?wjr.exports=G6e=e(na(),H6e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(G6e,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 xPt=I(($6e,Pjr)=>{p();(function(t,e,r){typeof $6e=="object"?Pjr.exports=$6e=e(na(),dCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})($6e,function(t){return(function(){var e=t,r=e.lib,n=r.Hasher,o=e.x64,s=o.Word,c=o.WordArray,l=e.algo;function u(){return s.create.apply(s,arguments)}a(u,"X64Word_create");var d=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(1816402316,1246189591)],f=[];(function(){for(var m=0;m<80;m++)f[m]=u()})();var h=l.SHA512=n.extend({_doReset:a(function(){this._hash=new c.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},"_doReset"),_doProcessBlock:a(function(m,g){for(var A=this._hash.words,y=A[0],E=A[1],_=A[2],v=A[3],b=A[4],T=A[5],w=A[6],R=A[7],x=y.high,P=y.low,D=E.high,N=E.low,B=_.high,L=_.low,j=v.high,M=v.low,O=b.high,q=b.low,Q=T.high,U=T.low,z=w.high,$=w.low,W=R.high,J=R.low,ne=x,H=P,re=D,ae=N,Be=B,ve=L,Ue=j,Pe=M,Z=O,ee=q,K=Q,he=U,X=z,ue=$,je=W,ie=J,le=0;le<80;le++){var Ne,we,Le=f[le];if(le<16)we=Le.high=m[g+le*2]|0,Ne=Le.low=m[g+le*2+1]|0;else{var rt=f[le-15],st=rt.high,_t=rt.low,kt=(st>>>1|_t<<31)^(st>>>8|_t<<24)^st>>>7,$t=(_t>>>1|st<<31)^(_t>>>8|st<<24)^(_t>>>7|st<<25),Ht=f[le-2],Ie=Ht.high,F=Ht.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),fe=f[le-7],Se=fe.high,Fe=fe.low,te=f[le-16],Te=te.high,Ge=te.low;Ne=$t+Fe,we=kt+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),Le.high=we,Le.low=Ne}var Y=Z&K^~Z&X,se=ee&he^~ee&ue,me=ne&re^ne&Be^re&Be,Ce=H&ae^H&ve^ae&ve,He=(ne>>>28|H<<4)^(ne<<30|H>>>2)^(ne<<25|H>>>7),$e=(H>>>28|ne<<4)^(H<<30|ne>>>2)^(H<<25|ne>>>7),et=(Z>>>14|ee<<18)^(Z>>>18|ee<<14)^(Z<<23|ee>>>9),ct=(ee>>>14|Z<<18)^(ee>>>18|Z<<14)^(ee<<23|Z>>>9),bt=d[le],ht=bt.high,We=bt.low,ce=ie+ct,Re=je+et+(ce>>>0>>0?1:0),ce=ce+se,Re=Re+Y+(ce>>>0>>0?1:0),ce=ce+We,Re=Re+ht+(ce>>>0>>0?1:0),ce=ce+Ne,Re=Re+we+(ce>>>0>>0?1:0),Me=$e+Ce,Ae=He+me+(Me>>>0<$e>>>0?1:0);je=X,ie=ue,X=K,ue=he,K=Z,he=ee,ee=Pe+ce|0,Z=Ue+Re+(ee>>>0>>0?1:0)|0,Ue=Be,Pe=ve,Be=re,ve=ae,re=ne,ae=H,H=ce+Me|0,ne=Re+Ae+(H>>>0>>0?1:0)|0}P=y.low=P+H,y.high=x+ne+(P>>>0>>0?1:0),N=E.low=N+ae,E.high=D+re+(N>>>0>>0?1:0),L=_.low=L+ve,_.high=B+Be+(L>>>0>>0?1:0),M=v.low=M+Pe,v.high=j+Ue+(M>>>0>>0?1:0),q=b.low=q+ee,b.high=O+Z+(q>>>0>>0?1:0),U=T.low=U+he,T.high=Q+K+(U>>>0>>0?1:0),$=w.low=$+ue,w.high=z+X+($>>>0>>0?1:0),J=R.low=J+ie,R.high=W+je+(J>>>0>>0?1:0)},"_doProcessBlock"),_doFinalize:a(function(){var m=this._data,g=m.words,A=this._nDataBytes*8,y=m.sigBytes*8;g[y>>>5]|=128<<24-y%32,g[(y+128>>>10<<5)+30]=Math.floor(A/4294967296),g[(y+128>>>10<<5)+31]=A,m.sigBytes=g.length*4,this._process();var E=this._hash.toX32();return E},"_doFinalize"),clone:a(function(){var m=n.clone.call(this);return m._hash=this._hash.clone(),m},"clone"),blockSize:1024/32});e.SHA512=n._createHelper(h),e.HmacSHA512=n._createHmacHelper(h)})(),t.SHA512})});var Djr=I((V6e,kjr)=>{p();(function(t,e,r){typeof V6e=="object"?kjr.exports=V6e=e(na(),dCe(),xPt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(V6e,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 Mjr=I((W6e,Njr)=>{p();(function(t,e,r){typeof W6e=="object"?Njr.exports=W6e=e(na(),dCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(W6e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.x64,l=c.Word,u=r.algo,d=[],f=[],h=[];(function(){for(var A=1,y=0,E=0;E<24;E++){d[A+5*y]=(E+1)*(E+2)/2%64;var _=y%5,v=(2*A+3*y)%5;A=_,y=v}for(var A=0;A<5;A++)for(var y=0;y<5;y++)f[A+5*y]=y+(2*A+3*y)%5*5;for(var b=1,T=0;T<24;T++){for(var w=0,R=0,x=0;x<7;x++){if(b&1){var P=(1<>>24)&16711935|(b<<24|b>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var w=E[v];w.high^=T,w.low^=b}for(var R=0;R<24;R++){for(var x=0;x<5;x++){for(var P=0,D=0,N=0;N<5;N++){var w=E[x+5*N];P^=w.high,D^=w.low}var B=m[x];B.high=P,B.low=D}for(var x=0;x<5;x++)for(var L=m[(x+4)%5],j=m[(x+1)%5],M=j.high,O=j.low,P=L.high^(M<<1|O>>>31),D=L.low^(O<<1|M>>>31),N=0;N<5;N++){var w=E[x+5*N];w.high^=P,w.low^=D}for(var q=1;q<25;q++){var P,D,w=E[q],Q=w.high,U=w.low,z=d[q];z<32?(P=Q<>>32-z,D=U<>>32-z):(P=U<>>64-z,D=Q<>>64-z);var $=m[f[q]];$.high=P,$.low=D}var W=m[0],J=E[0];W.high=J.high,W.low=J.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var q=x+5*N,w=E[q],ne=m[q],H=m[(x+1)%5+5*N],re=m[(x+2)%5+5*N];w.high=ne.high^~H.high&re.high,w.low=ne.low^~H.low&re.low}var w=E[0],ae=h[R];w.high^=ae.high,w.low^=ae.low}},"_doProcessBlock"),_doFinalize:a(function(){var A=this._data,y=A.words,E=this._nDataBytes*8,_=A.sigBytes*8,v=this.blockSize*32;y[_>>>5]|=1<<24-_%32,y[(e.ceil((_+1)/v)*v>>>5)-1]|=128,A.sigBytes=y.length*4,this._process();for(var b=this._state,T=this.cfg.outputLength/8,w=T/8,R=[],x=0;x>>24)&16711935|(D<<24|D>>>8)&4278255360,N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,R.push(N),R.push(D)}return new o.init(R,T)},"_doFinalize"),clone:a(function(){for(var A=s.clone.call(this),y=A._state=this._state.slice(0),E=0;E<25;E++)y[E]=y[E].clone();return A},"clone")});r.SHA3=s._createHelper(g),r.HmacSHA3=s._createHmacHelper(g)})(Math),t.SHA3})});var Bjr=I((z6e,Ojr)=>{p();(function(t,e){typeof z6e=="object"?Ojr.exports=z6e=e(na()):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.WordArray,s=n.Hasher,c=r.algo,l=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),d=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=o.create([0,1518500249,1859775393,2400959708,2840853838]),m=o.create([1352829926,1548603684,1836072691,2053994217,0]),g=c.RIPEMD160=s.extend({_doReset:a(function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(T,w){for(var R=0;R<16;R++){var x=w+R,P=T[x];T[x]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360}var D=this._hash.words,N=h.words,B=m.words,L=l.words,j=u.words,M=d.words,O=f.words,q,Q,U,z,$,W,J,ne,H,re;W=q=D[0],J=Q=D[1],ne=U=D[2],H=z=D[3],re=$=D[4];for(var ae,R=0;R<80;R+=1)ae=q+T[w+L[R]]|0,R<16?ae+=A(Q,U,z)+N[0]:R<32?ae+=y(Q,U,z)+N[1]:R<48?ae+=E(Q,U,z)+N[2]:R<64?ae+=_(Q,U,z)+N[3]:ae+=v(Q,U,z)+N[4],ae=ae|0,ae=b(ae,M[R]),ae=ae+$|0,q=$,$=z,z=b(U,10),U=Q,Q=ae,ae=W+T[w+j[R]]|0,R<16?ae+=v(J,ne,H)+B[0]:R<32?ae+=_(J,ne,H)+B[1]:R<48?ae+=E(J,ne,H)+B[2]:R<64?ae+=y(J,ne,H)+B[3]:ae+=A(J,ne,H)+B[4],ae=ae|0,ae=b(ae,O[R]),ae=ae+re|0,W=re,re=H,H=b(ne,10),ne=J,J=ae;ae=D[1]+U+H|0,D[1]=D[2]+z+re|0,D[2]=D[3]+$+W|0,D[3]=D[4]+q+J|0,D[4]=D[0]+Q+ne|0,D[0]=ae},"_doProcessBlock"),_doFinalize:a(function(){var T=this._data,w=T.words,R=this._nDataBytes*8,x=T.sigBytes*8;w[x>>>5]|=128<<24-x%32,w[(x+64>>>9<<4)+14]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,T.sigBytes=(w.length+1)*4,this._process();for(var P=this._hash,D=P.words,N=0;N<5;N++){var B=D[N];D[N]=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360}return P},"_doFinalize"),clone:a(function(){var T=s.clone.call(this);return T._hash=this._hash.clone(),T},"clone")});function A(T,w,R){return T^w^R}a(A,"f1");function y(T,w,R){return T&w|~T&R}a(y,"f2");function E(T,w,R){return(T|~w)^R}a(E,"f3");function _(T,w,R){return T&R|w&~R}a(_,"f4");function v(T,w,R){return T^(w|~R)}a(v,"f5");function b(T,w){return T<>>32-w}a(b,"rotl"),r.RIPEMD160=s._createHelper(g),r.HmacRIPEMD160=s._createHmacHelper(g)})(Math),t.RIPEMD160})});var K6e=I((Y6e,Ljr)=>{p();(function(t,e){typeof Y6e=="object"?Ljr.exports=Y6e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Y6e,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 J6e=="object"?Fjr.exports=J6e=e(na(),H6e(),K6e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(J6e,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 Z6e=="object"?Qjr.exports=Z6e=e(na(),IPt(),K6e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(Z6e,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 X6e=="object"?qjr.exports=X6e=e(na(),WB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(X6e,function(t){t.lib.Cipher||(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=n.BufferedBlockAlgorithm,l=r.enc,u=l.Utf8,d=l.Base64,f=r.algo,h=f.EvpKDF,m=n.Cipher=c.extend({cfg:o.extend(),createEncryptor:a(function(B,L){return this.create(this._ENC_XFORM_MODE,B,L)},"createEncryptor"),createDecryptor:a(function(B,L){return this.create(this._DEC_XFORM_MODE,B,L)},"createDecryptor"),init:a(function(B,L,j){this.cfg=this.cfg.extend(j),this._xformMode=B,this._key=L,this.reset()},"init"),reset:a(function(){c.reset.call(this),this._doReset()},"reset"),process:a(function(B){return this._append(B),this._process()},"process"),finalize:a(function(B){B&&this._append(B);var L=this._doFinalize();return L},"finalize"),keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function B(L){return typeof L=="string"?N:x}return a(B,"selectCipherStrategy"),function(L){return{encrypt:a(function(j,M,O){return B(M).encrypt(L,j,M,O)},"encrypt"),decrypt:a(function(j,M,O){return B(M).decrypt(L,j,M,O)},"decrypt")}}})()}),g=n.StreamCipher=m.extend({_doFinalize:a(function(){var B=this._process(!0);return B},"_doFinalize"),blockSize:1}),A=r.mode={},y=n.BlockCipherMode=o.extend({createEncryptor:a(function(B,L){return this.Encryptor.create(B,L)},"createEncryptor"),createDecryptor:a(function(B,L){return this.Decryptor.create(B,L)},"createDecryptor"),init:a(function(B,L){this._cipher=B,this._iv=L},"init")}),E=A.CBC=(function(){var B=y.extend();B.Encryptor=B.extend({processBlock:a(function(j,M){var O=this._cipher,q=O.blockSize;L.call(this,j,M,q),O.encryptBlock(j,M),this._prevBlock=j.slice(M,M+q)},"processBlock")}),B.Decryptor=B.extend({processBlock:a(function(j,M){var O=this._cipher,q=O.blockSize,Q=j.slice(M,M+q);O.decryptBlock(j,M),L.call(this,j,M,q),this._prevBlock=Q},"processBlock")});function L(j,M,O){var q,Q=this._iv;Q?(q=Q,this._iv=e):q=this._prevBlock;for(var U=0;U>>2]&255;B.sigBytes-=L},"unpad")},b=n.BlockCipher=m.extend({cfg:m.cfg.extend({mode:E,padding:v}),reset:a(function(){var B;m.reset.call(this);var L=this.cfg,j=L.iv,M=L.mode;this._xformMode==this._ENC_XFORM_MODE?B=M.createEncryptor:(B=M.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==B?this._mode.init(this,j&&j.words):(this._mode=B.call(M,this,j&&j.words),this._mode.__creator=B)},"reset"),_doProcessBlock:a(function(B,L){this._mode.processBlock(B,L)},"_doProcessBlock"),_doFinalize:a(function(){var B,L=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(L.pad(this._data,this.blockSize),B=this._process(!0)):(B=this._process(!0),L.unpad(B)),B},"_doFinalize"),blockSize:128/32}),T=n.CipherParams=o.extend({init:a(function(B){this.mixIn(B)},"init"),toString:a(function(B){return(B||this.formatter).stringify(this)},"toString")}),w=r.format={},R=w.OpenSSL={stringify:a(function(B){var L,j=B.ciphertext,M=B.salt;return M?L=s.create([1398893684,1701076831]).concat(M).concat(j):L=j,L.toString(d)},"stringify"),parse:a(function(B){var L,j=d.parse(B),M=j.words;return M[0]==1398893684&&M[1]==1701076831&&(L=s.create(M.slice(2,4)),M.splice(0,4),j.sigBytes-=16),T.create({ciphertext:j,salt:L})},"parse")},x=n.SerializableCipher=o.extend({cfg:o.extend({format:R}),encrypt:a(function(B,L,j,M){M=this.cfg.extend(M);var O=B.createEncryptor(j,M),q=O.finalize(L),Q=O.cfg;return T.create({ciphertext:q,key:j,iv:Q.iv,algorithm:B,mode:Q.mode,padding:Q.padding,blockSize:B.blockSize,formatter:M.format})},"encrypt"),decrypt:a(function(B,L,j,M){M=this.cfg.extend(M),L=this._parse(L,M.format);var O=B.createDecryptor(j,M).finalize(L.ciphertext);return O},"decrypt"),_parse:a(function(B,L){return typeof B=="string"?L.parse(B,this):B},"_parse")}),P=r.kdf={},D=P.OpenSSL={execute:a(function(B,L,j,M,O){if(M||(M=s.random(64/8)),O)var q=h.create({keySize:L+j,hasher:O}).compute(B,M);else var q=h.create({keySize:L+j}).compute(B,M);var Q=s.create(q.words.slice(L),j*4);return q.sigBytes=L*4,T.create({key:q,iv:Q,salt:M})},"execute")},N=n.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:D}),encrypt:a(function(B,L,j,M){M=this.cfg.extend(M);var O=M.kdf.execute(j,B.keySize,B.ivSize,M.salt,M.hasher);M.iv=O.iv;var q=x.encrypt.call(this,B,L,O.key,M);return q.mixIn(O),q},"encrypt"),decrypt:a(function(B,L,j,M){M=this.cfg.extend(M),L=this._parse(L,M.format);var O=M.kdf.execute(j,B.keySize,B.ivSize,L.salt,M.hasher);M.iv=O.iv;var q=x.decrypt.call(this,B,L,O.key,M);return q},"decrypt")})})()})});var Hjr=I((e9e,jjr)=>{p();(function(t,e,r){typeof e9e=="object"?jjr.exports=e9e=e(na(),Om()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(e9e,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 t9e=="object"?Gjr.exports=t9e=e(na(),Om()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(t9e,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 r9e=="object"?Vjr.exports=r9e=e(na(),Om()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(r9e,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 n9e=="object"?zjr.exports=n9e=e(na(),Om()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(n9e,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"?Kjr.exports=i9e=e(na(),Om()):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 Xjr=I((o9e,Zjr)=>{p();(function(t,e,r){typeof o9e=="object"?Zjr.exports=o9e=e(na(),Om()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(o9e,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 tHr=I((s9e,eHr)=>{p();(function(t,e,r){typeof s9e=="object"?eHr.exports=s9e=e(na(),Om()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(s9e,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 nHr=I((a9e,rHr)=>{p();(function(t,e,r){typeof a9e=="object"?rHr.exports=a9e=e(na(),Om()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(a9e,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 oHr=I((c9e,iHr)=>{p();(function(t,e,r){typeof c9e=="object"?iHr.exports=c9e=e(na(),Om()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(c9e,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 aHr=I((l9e,sHr)=>{p();(function(t,e,r){typeof l9e=="object"?sHr.exports=l9e=e(na(),Om()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(l9e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var lHr=I((u9e,cHr)=>{p();(function(t,e,r){typeof u9e=="object"?cHr.exports=u9e=e(na(),Om()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(u9e,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 dHr=I((d9e,uHr)=>{p();(function(t,e,r){typeof d9e=="object"?uHr.exports=d9e=e(na(),Y9(),K9(),WB(),Om()):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.BlockCipher,o=e.algo,s=[],c=[],l=[],u=[],d=[],f=[],h=[],m=[],g=[],A=[];(function(){for(var _=[],v=0;v<256;v++)v<128?_[v]=v<<1:_[v]=v<<1^283;for(var b=0,T=0,v=0;v<256;v++){var w=T^T<<1^T<<2^T<<3^T<<4;w=w>>>8^w&255^99,s[b]=w,c[w]=b;var R=_[b],x=_[R],P=_[x],D=_[w]*257^w*16843008;l[b]=D<<24|D>>>8,u[b]=D<<16|D>>>16,d[b]=D<<8|D>>>24,f[b]=D;var D=P*16843009^x*65537^R*257^b*16843008;h[w]=D<<24|D>>>8,m[w]=D<<16|D>>>16,g[w]=D<<8|D>>>24,A[w]=D,b?(b=R^_[_[_[P^R]]],T^=_[_[T]]):b=T=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],E=o.AES=n.extend({_doReset:a(function(){var _;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,b=v.words,T=v.sigBytes/4,w=this._nRounds=T+6,R=(w+1)*4,x=this._keySchedule=[],P=0;P6&&P%T==4&&(_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255]):(_=_<<8|_>>>24,_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255],_^=y[P/T|0]<<24),x[P]=x[P-T]^_);for(var D=this._invKeySchedule=[],N=0;N>>24]]^m[s[_>>>16&255]]^g[s[_>>>8&255]]^A[s[_&255]]}}},"_doReset"),encryptBlock:a(function(_,v){this._doCryptBlock(_,v,this._keySchedule,l,u,d,f,s)},"encryptBlock"),decryptBlock:a(function(_,v){var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b,this._doCryptBlock(_,v,this._invKeySchedule,h,m,g,A,c);var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b},"decryptBlock"),_doCryptBlock:a(function(_,v,b,T,w,R,x,P){for(var D=this._nRounds,N=_[v]^b[0],B=_[v+1]^b[1],L=_[v+2]^b[2],j=_[v+3]^b[3],M=4,O=1;O>>24]^w[B>>>16&255]^R[L>>>8&255]^x[j&255]^b[M++],Q=T[B>>>24]^w[L>>>16&255]^R[j>>>8&255]^x[N&255]^b[M++],U=T[L>>>24]^w[j>>>16&255]^R[N>>>8&255]^x[B&255]^b[M++],z=T[j>>>24]^w[N>>>16&255]^R[B>>>8&255]^x[L&255]^b[M++];N=q,B=Q,L=U,j=z}var q=(P[N>>>24]<<24|P[B>>>16&255]<<16|P[L>>>8&255]<<8|P[j&255])^b[M++],Q=(P[B>>>24]<<24|P[L>>>16&255]<<16|P[j>>>8&255]<<8|P[N&255])^b[M++],U=(P[L>>>24]<<24|P[j>>>16&255]<<16|P[N>>>8&255]<<8|P[B&255])^b[M++],z=(P[j>>>24]<<24|P[N>>>16&255]<<16|P[B>>>8&255]<<8|P[L&255])^b[M++];_[v]=q,_[v+1]=Q,_[v+2]=U,_[v+3]=z},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(E)})(),t.AES})});var pHr=I((f9e,fHr)=>{p();(function(t,e,r){typeof f9e=="object"?fHr.exports=f9e=e(na(),Y9(),K9(),WB(),Om()):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.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 mHr=I((p9e,hHr)=>{p();(function(t,e,r){typeof p9e=="object"?hHr.exports=p9e=e(na(),Y9(),K9(),WB(),Om()):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=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 AHr=I((h9e,gHr)=>{p();(function(t,e,r){typeof h9e=="object"?gHr.exports=h9e=e(na(),Y9(),K9(),WB(),Om()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(h9e,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 EHr=I((m9e,yHr)=>{p();(function(t,e,r){typeof m9e=="object"?yHr.exports=m9e=e(na(),Y9(),K9(),WB(),Om()):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.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 vHr=I((g9e,_Hr)=>{p();(function(t,e,r){typeof g9e=="object"?_Hr.exports=g9e=e(na(),Y9(),K9(),WB(),Om()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(g9e,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 A9e=="object"?CHr.exports=A9e=e(na(),dCe(),Ejr(),vjr(),Y9(),Sjr(),K9(),IPt(),H6e(),Rjr(),xPt(),Djr(),Mjr(),Bjr(),K6e(),Ujr(),WB(),Om(),Hjr(),$jr(),Wjr(),Yjr(),Jjr(),Xjr(),tHr(),nHr(),oHr(),aHr(),lHr(),dHr(),pHr(),mHr(),AHr(),EHr(),vHr()):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)})(A9e,function(t){return t})});var Ooe=I(Dy=>{"use strict";p();Object.defineProperty(Dy,"__esModule",{value:!0});Dy.stringArray=Dy.array=Dy.func=Dy.error=Dy.number=Dy.string=Dy.boolean=void 0;function lgo(t){return t===!0||t===!1}a(lgo,"boolean");Dy.boolean=lgo;function nVr(t){return typeof t=="string"||t instanceof String}a(nVr,"string");Dy.string=nVr;function ugo(t){return typeof t=="number"||t instanceof Number}a(ugo,"number");Dy.number=ugo;function dgo(t){return t instanceof Error}a(dgo,"error");Dy.error=dgo;function fgo(t){return typeof t=="function"}a(fgo,"func");Dy.func=fgo;function iVr(t){return Array.isArray(t)}a(iVr,"array");Dy.array=iVr;function pgo(t){return iVr(t)&&t.every(e=>nVr(e))}a(pgo,"stringArray");Dy.stringArray=pgo});var Zkt=I(fi=>{"use strict";p();Object.defineProperty(fi,"__esModule",{value:!0});fi.Message=fi.NotificationType9=fi.NotificationType8=fi.NotificationType7=fi.NotificationType6=fi.NotificationType5=fi.NotificationType4=fi.NotificationType3=fi.NotificationType2=fi.NotificationType1=fi.NotificationType0=fi.NotificationType=fi.RequestType9=fi.RequestType8=fi.RequestType7=fi.RequestType6=fi.RequestType5=fi.RequestType4=fi.RequestType3=fi.RequestType2=fi.RequestType1=fi.RequestType=fi.RequestType0=fi.AbstractMessageSignature=fi.ParameterStructures=fi.ResponseError=fi.ErrorCodes=void 0;var IW=Ooe(),wkt;(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})(wkt||(fi.ErrorCodes=wkt={}));var Rkt=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=IW.number(e)?e:wkt.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}};fi.ResponseError=Rkt;var nC=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}};fi.ParameterStructures=nC;nC.auto=new nC("auto");nC.byPosition=new nC("byPosition");nC.byName=new nC("byName");var Uu=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return nC.auto}};fi.AbstractMessageSignature=Uu;var Pkt=class extends Uu{static{a(this,"RequestType0")}constructor(e){super(e,0)}};fi.RequestType0=Pkt;var kkt=class extends Uu{static{a(this,"RequestType")}constructor(e,r=nC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};fi.RequestType=kkt;var Dkt=class extends Uu{static{a(this,"RequestType1")}constructor(e,r=nC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};fi.RequestType1=Dkt;var Nkt=class extends Uu{static{a(this,"RequestType2")}constructor(e){super(e,2)}};fi.RequestType2=Nkt;var Mkt=class extends Uu{static{a(this,"RequestType3")}constructor(e){super(e,3)}};fi.RequestType3=Mkt;var Okt=class extends Uu{static{a(this,"RequestType4")}constructor(e){super(e,4)}};fi.RequestType4=Okt;var Bkt=class extends Uu{static{a(this,"RequestType5")}constructor(e){super(e,5)}};fi.RequestType5=Bkt;var Lkt=class extends Uu{static{a(this,"RequestType6")}constructor(e){super(e,6)}};fi.RequestType6=Lkt;var Fkt=class extends Uu{static{a(this,"RequestType7")}constructor(e){super(e,7)}};fi.RequestType7=Fkt;var Ukt=class extends Uu{static{a(this,"RequestType8")}constructor(e){super(e,8)}};fi.RequestType8=Ukt;var Qkt=class extends Uu{static{a(this,"RequestType9")}constructor(e){super(e,9)}};fi.RequestType9=Qkt;var qkt=class extends Uu{static{a(this,"NotificationType")}constructor(e,r=nC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};fi.NotificationType=qkt;var jkt=class extends Uu{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};fi.NotificationType0=jkt;var Hkt=class extends Uu{static{a(this,"NotificationType1")}constructor(e,r=nC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};fi.NotificationType1=Hkt;var Gkt=class extends Uu{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};fi.NotificationType2=Gkt;var $kt=class extends Uu{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};fi.NotificationType3=$kt;var Vkt=class extends Uu{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};fi.NotificationType4=Vkt;var Wkt=class extends Uu{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};fi.NotificationType5=Wkt;var zkt=class extends Uu{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};fi.NotificationType6=zkt;var Ykt=class extends Uu{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};fi.NotificationType7=Ykt;var Kkt=class extends Uu{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};fi.NotificationType8=Kkt;var Jkt=class extends Uu{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};fi.NotificationType9=Jkt;var oVr;(function(t){function e(o){let s=o;return s&&IW.string(s.method)&&(IW.string(s.id)||IW.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&IW.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)&&(IW.string(s.id)||IW.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})(oVr||(fi.Message=oVr={}))});var e2t=I(dU=>{"use strict";p();var sVr;Object.defineProperty(dU,"__esModule",{value:!0});dU.LRUCache=dU.LinkedMap=dU.Touch=void 0;var Ny;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Ny||(dU.Touch=Ny={}));var X9e=class{static{a(this,"LinkedMap")}constructor(){this[sVr]="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=Ny.None){let n=this._map.get(e);if(n)return r!==Ny.None&&this.touch(n,r),n.value}set(e,r,n=Ny.None){let o=this._map.get(e);if(o)o.value=r,n!==Ny.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case Ny.None:this.addItemLast(o);break;case Ny.First:this.addItemFirst(o);break;case Ny.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}[(sVr=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!==Ny.First&&r!==Ny.Last)){if(r===Ny.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===Ny.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)}};dU.LinkedMap=X9e;var Xkt=class extends X9e{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=Ny.AsNew){return super.get(e,r)}peek(e){return super.get(e,Ny.None)}set(e,r){return super.set(e,r,Ny.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};dU.LRUCache=Xkt});var cVr=I(eUe=>{"use strict";p();Object.defineProperty(eUe,"__esModule",{value:!0});eUe.Disposable=void 0;var aVr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(aVr||(eUe.Disposable=aVr={}))});var fU=I(n2t=>{"use strict";p();Object.defineProperty(n2t,"__esModule",{value:!0});var t2t;function r2t(){if(t2t===void 0)throw new Error("No runtime abstraction layer installed");return t2t}a(r2t,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");t2t=r}a(e,"install"),t.install=e})(r2t||(r2t={}));n2t.default=r2t});var Loe=I(Boe=>{"use strict";p();Object.defineProperty(Boe,"__esModule",{value:!0});Boe.Emitter=Boe.Event=void 0;var hgo=fU(),lVr;(function(t){let e={dispose(){}};t.None=function(){return e}})(lVr||(Boe.Event=lVr={}));var i2t=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 i2t),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)}};Boe.Emitter=tUe;tUe._noop=function(){}});var iUe=I(Foe=>{"use strict";p();Object.defineProperty(Foe,"__esModule",{value:!0});Foe.CancellationTokenSource=Foe.CancellationToken=void 0;var mgo=fU(),ggo=Ooe(),o2t=Loe(),rUe;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:o2t.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:o2t.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||ggo.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})(rUe||(Foe.CancellationToken=rUe={}));var Ago=Object.freeze(function(t,e){let r=(0,mgo.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),nUe=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?Ago:(this._emitter||(this._emitter=new o2t.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},s2t=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new nUe),this._token}cancel(){this._token?this._token.cancel():this._token=rUe.Cancelled}dispose(){this._token?this._token instanceof nUe&&this._token.dispose():this._token=rUe.None}};Foe.CancellationTokenSource=s2t});var uVr=I(Uoe=>{"use strict";p();Object.defineProperty(Uoe,"__esModule",{value:!0});Uoe.SharedArrayReceiverStrategy=Uoe.SharedArraySenderStrategy=void 0;var ygo=iUe(),kCe;(function(t){t.Continue=0,t.Cancelled=1})(kCe||(kCe={}));var a2t=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]=kCe.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,kCe.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Uoe.SharedArraySenderStrategy=a2t;var c2t=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===kCe.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},l2t=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new c2t(e)}cancel(){}dispose(){}},u2t=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new ygo.CancellationTokenSource:new l2t(r)}};Uoe.SharedArrayReceiverStrategy=u2t});var f2t=I(oUe=>{"use strict";p();Object.defineProperty(oUe,"__esModule",{value:!0});oUe.Semaphore=void 0;var Ego=fU(),d2t=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,Ego.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()}}};oUe.Semaphore=d2t});var fVr=I(pU=>{"use strict";p();Object.defineProperty(pU,"__esModule",{value:!0});pU.ReadableStreamMessageReader=pU.AbstractMessageReader=pU.MessageReader=void 0;var h2t=fU(),Qoe=Ooe(),p2t=Loe(),_go=f2t(),dVr;(function(t){function e(r){let n=r;return n&&Qoe.func(n.listen)&&Qoe.func(n.dispose)&&Qoe.func(n.onError)&&Qoe.func(n.onClose)&&Qoe.func(n.onPartialMessage)}a(e,"is"),t.is=e})(dVr||(pU.MessageReader=dVr={}));var sUe=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new p2t.Emitter,this.closeEmitter=new p2t.Emitter,this.partialMessageEmitter=new p2t.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: ${Qoe.string(e.message)?e.message:"unknown"}`)}};pU.AbstractMessageReader=sUe;var m2t;(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,h2t.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(m2t||(m2t={}));var g2t=class extends sUe{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=m2t.fromOptions(r),this.buffer=(0,h2t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new _go.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,h2t.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))}};pU.ReadableStreamMessageReader=g2t});var AVr=I(hU=>{"use strict";p();Object.defineProperty(hU,"__esModule",{value:!0});hU.WriteableStreamMessageWriter=hU.AbstractMessageWriter=hU.MessageWriter=void 0;var pVr=fU(),DCe=Ooe(),vgo=f2t(),hVr=Loe(),Cgo="Content-Length: ",mVr=`\r -`,gVr;(function(t){function e(r){let n=r;return n&&DCe.func(n.dispose)&&DCe.func(n.onClose)&&DCe.func(n.onError)&&DCe.func(n.write)}a(e,"is"),t.is=e})(gVr||(hU.MessageWriter=gVr={}));var aUe=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new hVr.Emitter,this.closeEmitter=new hVr.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: ${DCe.string(e.message)?e.message:"unknown"}`)}};hU.AbstractMessageWriter=aUe;var A2t;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,pVr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,pVr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(A2t||(A2t={}));var y2t=class extends aUe{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=A2t.fromOptions(r),this.errorCount=0,this.writeSemaphore=new vgo.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(Cgo,n.byteLength.toString(),mVr),o.push(mVr),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()}};hU.WriteableStreamMessageWriter=y2t});var yVr=I(cUe=>{"use strict";p();Object.defineProperty(cUe,"__esModule",{value:!0});cUe.AbstractMessageBuffer=void 0;var bgo=13,Sgo=10,Tgo=`\r -`,E2t=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}};cUe.AbstractMessageBuffer=E2t});var bVr=I(No=>{"use strict";p();Object.defineProperty(No,"__esModule",{value:!0});No.createMessageConnection=No.ConnectionOptions=No.MessageStrategy=No.CancellationStrategy=No.CancellationSenderStrategy=No.CancellationReceiverStrategy=No.RequestCancellationReceiverStrategy=No.IdCancellationReceiverStrategy=No.ConnectionStrategy=No.ConnectionError=No.ConnectionErrors=No.LogTraceNotification=No.SetTraceNotification=No.TraceFormat=No.TraceValues=No.Trace=No.NullLogger=No.ProgressType=No.ProgressToken=void 0;var EVr=fU(),of=Ooe(),Wi=Zkt(),_Vr=e2t(),NCe=Loe(),_2t=iUe(),BCe;(function(t){t.type=new Wi.NotificationType("$/cancelRequest")})(BCe||(BCe={}));var v2t;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(v2t||(No.ProgressToken=v2t={}));var MCe;(function(t){t.type=new Wi.NotificationType("$/progress")})(MCe||(MCe={}));var C2t=class{static{a(this,"ProgressType")}constructor(){}};No.ProgressType=C2t;var b2t;(function(t){function e(r){return of.func(r)}a(e,"is"),t.is=e})(b2t||(b2t={}));No.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var vc;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(vc||(No.Trace=vc={}));var vVr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(vVr||(No.TraceValues=vVr={}));(function(t){function e(n){if(!of.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})(vc||(No.Trace=vc={}));var L1;(function(t){t.Text="text",t.JSON="json"})(L1||(No.TraceFormat=L1={}));(function(t){function e(r){return of.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(L1||(No.TraceFormat=L1={}));var S2t;(function(t){t.type=new Wi.NotificationType("$/setTrace")})(S2t||(No.SetTraceNotification=S2t={}));var lUe;(function(t){t.type=new Wi.NotificationType("$/logTrace")})(lUe||(No.LogTraceNotification=lUe={}));var OCe;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(OCe||(No.ConnectionErrors=OCe={}));var qoe=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};No.ConnectionError=qoe;var T2t;(function(t){function e(r){let n=r;return n&&of.func(n.cancelUndispatched)}a(e,"is"),t.is=e})(T2t||(No.ConnectionStrategy=T2t={}));var uUe;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&of.func(n.createCancellationTokenSource)&&(n.dispose===void 0||of.func(n.dispose))}a(e,"is"),t.is=e})(uUe||(No.IdCancellationReceiverStrategy=uUe={}));var I2t;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&of.func(n.createCancellationTokenSource)&&(n.dispose===void 0||of.func(n.dispose))}a(e,"is"),t.is=e})(I2t||(No.RequestCancellationReceiverStrategy=I2t={}));var dUe;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new _2t.CancellationTokenSource}});function e(r){return uUe.is(r)||I2t.is(r)}a(e,"is"),t.is=e})(dUe||(No.CancellationReceiverStrategy=dUe={}));var fUe;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(BCe.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&of.func(n.sendCancellation)&&of.func(n.cleanup)}a(e,"is"),t.is=e})(fUe||(No.CancellationSenderStrategy=fUe={}));var pUe;(function(t){t.Message=Object.freeze({receiver:dUe.Message,sender:fUe.Message});function e(r){let n=r;return n&&dUe.is(n.receiver)&&fUe.is(n.sender)}a(e,"is"),t.is=e})(pUe||(No.CancellationStrategy=pUe={}));var hUe;(function(t){function e(r){let n=r;return n&&of.func(n.handleMessage)}a(e,"is"),t.is=e})(hUe||(No.MessageStrategy=hUe={}));var CVr;(function(t){function e(r){let n=r;return n&&(pUe.is(n.cancellationStrategy)||T2t.is(n.connectionStrategy)||hUe.is(n.messageStrategy))}a(e,"is"),t.is=e})(CVr||(No.ConnectionOptions=CVr={}));var QP;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(QP||(QP={}));function Igo(t,e,r,n){let o=r!==void 0?r:No.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new _Vr.LinkedMap,E=new Map,_=new Set,v=new Map,b=vc.Off,T=L1.Text,w,R=QP.New,x=new NCe.Emitter,P=new NCe.Emitter,D=new NCe.Emitter,N=new NCe.Emitter,B=new NCe.Emitter,L=n&&n.cancellationStrategy?n.cancellationStrategy:pUe.Message;function j(Ie){if(Ie===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ie.toString()}a(j,"createRequestQueueKey");function M(Ie){return Ie===null?"res-unknown-"+(++l).toString():"res-"+Ie.toString()}a(M,"createResponseQueueKey");function O(){return"not-"+(++c).toString()}a(O,"createNotificationQueueKey");function q(Ie,F){Wi.Message.isRequest(F)?Ie.set(j(F.id),F):Wi.Message.isResponse(F)?Ie.set(M(F.id),F):Ie.set(O(),F)}a(q,"addMessageToQueue");function Q(Ie){}a(Q,"cancelUndispatched");function U(){return R===QP.Listening}a(U,"isListening");function z(){return R===QP.Closed}a(z,"isClosed");function $(){return R===QP.Disposed}a($,"isDisposed");function W(){(R===QP.New||R===QP.Listening)&&(R=QP.Closed,P.fire(void 0))}a(W,"closeHandler");function J(Ie){x.fire([Ie,void 0,void 0])}a(J,"readErrorHandler");function ne(Ie){x.fire(Ie)}a(ne,"writeErrorHandler"),t.onClose(W),t.onError(J),e.onClose(W),e.onError(ne);function H(){A||y.size===0||(A=(0,EVr.default)().timer.setImmediate(()=>{A=void 0,ae()}))}a(H,"triggerMessageQueue");function re(Ie){Wi.Message.isRequest(Ie)?ve(Ie):Wi.Message.isNotification(Ie)?Pe(Ie):Wi.Message.isResponse(Ie)?Ue(Ie):Z(Ie)}a(re,"handleMessage");function ae(){if(y.size===0)return;let Ie=y.shift();try{let F=n?.messageStrategy;hUe.is(F)?F.handleMessage(Ie,re):re(Ie)}finally{H()}}a(ae,"processMessageQueue");let Be=a(Ie=>{try{if(Wi.Message.isNotification(Ie)&&Ie.method===BCe.type.method){let F=Ie.params.id,be=j(F),Qe=y.get(be);if(Wi.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,X(Fe,Ie.method,Date.now()),e.write(Fe).catch(()=>o.error("Sending response for canceled message failed."));return}}let fe=v.get(F);if(fe!==void 0){fe.cancel(),je(Ie);return}else _.add(F)}q(y,Ie)}finally{H()}},"callback");function ve(Ie){if($())return;function F(Te,Ge,Y){let se={jsonrpc:u,id:Ie.id};Te instanceof Wi.ResponseError?se.error=Te.toJson():se.result=Te===void 0?null:Te,X(se,Ge,Y),e.write(se).catch(()=>o.error("Sending response failed."))}a(F,"reply");function be(Te,Ge,Y){let se={jsonrpc:u,id:Ie.id,error:Te.toJson()};X(se,Ge,Y),e.write(se).catch(()=>o.error("Sending response failed."))}a(be,"replyError");function Qe(Te,Ge,Y){Te===void 0&&(Te=null);let se={jsonrpc:u,id:Ie.id,result:Te};X(se,Ge,Y),e.write(se).catch(()=>o.error("Sending response failed."))}a(Qe,"replySuccess"),ue(Ie);let fe=f.get(Ie.method),Se,Fe;fe&&(Se=fe.type,Fe=fe.handler);let te=Date.now();if(Fe||d){let Te=Ie.id??String(Date.now()),Ge=uUe.is(L.receiver)?L.receiver.createCancellationTokenSource(Te):L.receiver.createCancellationTokenSource(Ie);Ie.id!==null&&_.has(Ie.id)&&Ge.cancel(),Ie.id!==null&&v.set(Te,Ge);try{let Y;if(Fe)if(Ie.params===void 0){if(Se!==void 0&&Se.numberOfParams!==0){be(new Wi.ResponseError(Wi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines ${Se.numberOfParams} params but received none.`),Ie.method,te);return}Y=Fe(Ge.token)}else if(Array.isArray(Ie.params)){if(Se!==void 0&&Se.parameterStructures===Wi.ParameterStructures.byName){be(new Wi.ResponseError(Wi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by name but received parameters by position`),Ie.method,te);return}Y=Fe(...Ie.params,Ge.token)}else{if(Se!==void 0&&Se.parameterStructures===Wi.ParameterStructures.byPosition){be(new Wi.ResponseError(Wi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by position but received parameters by name`),Ie.method,te);return}Y=Fe(Ie.params,Ge.token)}else d&&(Y=d(Ie.method,Ie.params,Ge.token));let se=Y;Y?se.then?se.then(me=>{v.delete(Te),F(me,Ie.method,te)},me=>{v.delete(Te),me instanceof Wi.ResponseError?be(me,Ie.method,te):me&&of.string(me.message)?be(new Wi.ResponseError(Wi.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${me.message}`),Ie.method,te):be(new Wi.ResponseError(Wi.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}):(v.delete(Te),F(Y,Ie.method,te)):(v.delete(Te),Qe(Y,Ie.method,te))}catch(Y){v.delete(Te),Y instanceof Wi.ResponseError?F(Y,Ie.method,te):Y&&of.string(Y.message)?be(new Wi.ResponseError(Wi.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${Y.message}`),Ie.method,te):be(new Wi.ResponseError(Wi.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}}else be(new Wi.ResponseError(Wi.ErrorCodes.MethodNotFound,`Unhandled method ${Ie.method}`),Ie.method,te)}a(ve,"handleRequest");function Ue(Ie){if(!$())if(Ie.id===null)Ie.error?o.error(`Received response message without id: Error is: -${JSON.stringify(Ie.error,void 0,4)}`):o.error("Received response message without id. No further error information provided.");else{let F=Ie.id,be=E.get(F);if(ie(Ie,be),be!==void 0){E.delete(F);try{if(Ie.error){let Qe=Ie.error;be.reject(new Wi.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 Pe(Ie){if($())return;let F,be;if(Ie.method===BCe.type.method){let Qe=Ie.params.id;_.delete(Qe),je(Ie);return}else{let Qe=m.get(Ie.method);Qe&&(be=Qe.handler,F=Qe.type)}if(be||h)try{if(je(Ie),be)if(Ie.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==Wi.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===MCe.type.method&&Qe.length===2&&v2t.is(Qe[0])?be({token:Qe[0],value:Qe[1]}):(F!==void 0&&(F.parameterStructures===Wi.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===Wi.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(Pe,"handleNotification");function Z(Ie){if(!Ie){o.error("Received empty message.");return}o.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(Ie,null,4)}`);let F=Ie;if(of.string(F.id)||of.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(Z,"handleInvalidMessage");function ee(Ie){if(Ie!=null)switch(b){case vc.Verbose:return JSON.stringify(Ie,null,4);case vc.Compact:return JSON.stringify(Ie);default:return}}a(ee,"stringifyTrace");function K(Ie){if(!(b===vc.Off||!w))if(T===L1.Text){let F;(b===vc.Verbose||b===vc.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} +`)),l.tries=r,l}a(Luo,"bindings");Wjr.exports=Luo;function Buo(t){for(var e=Ouo(t),r;;){if(e==="."&&(e=process.cwd()),$jr(xCe(e,"dist")))return xCe(e,"dist");if($jr(xCe(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=xCe(e,"..")}}a(Buo,"getRoot")});var Jjr=I(FI=>{"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)} -`),w.log(`Sending request '${Ie.method} - (${Ie.id})'.`,F)}else le("send-request",Ie)}a(K,"traceSendingRequest");function he(Ie){if(!(b===vc.Off||!w))if(T===L1.Text){let F;(b===vc.Verbose||b===vc.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)} `:F=`No parameters provided. -`),w.log(`Sending notification '${Ie.method}'.`,F)}else le("send-notification",Ie)}a(he,"traceSendingNotification");function X(Ie,F,be){if(!(b===vc.Off||!w))if(T===L1.Text){let Qe;(b===vc.Verbose||b===vc.Compact)&&(Ie.error&&Ie.error.data?Qe=`Error data: ${ee(Ie.error.data)} +`),w.log(`Sending notification '${Ie.method}'.`,F)}else ce("send-notification",Ie)}a(he,"traceSendingNotification");function Z(Ie,F,be){if(!(b===bc.Off||!w))if(T===G1.Text){let Qe;(b===bc.Verbose||b===bc.Compact)&&(Ie.error&&Ie.error.data?Qe=`Error data: ${ee(Ie.error.data)} `:Ie.result?Qe=`Result: ${ee(Ie.result)} `:Ie.error===void 0&&(Qe=`No result returned. -`)),w.log(`Sending response '${F} - (${Ie.id})'. Processing request took ${Date.now()-be}ms`,Qe)}else le("send-response",Ie)}a(X,"traceSendingResponse");function ue(Ie){if(!(b===vc.Off||!w))if(T===L1.Text){let F;(b===vc.Verbose||b===vc.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} +`)),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 le("receive-request",Ie)}a(ue,"traceReceivedRequest");function je(Ie){if(!(b===vc.Off||!w||Ie.method===lUe.type.method))if(T===L1.Text){let F;(b===vc.Verbose||b===vc.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)} `:F=`No parameters provided. -`),w.log(`Received notification '${Ie.method}'.`,F)}else le("receive-notification",Ie)}a(je,"traceReceivedNotification");function ie(Ie,F){if(!(b===vc.Off||!w))if(T===L1.Text){let be;if((b===vc.Verbose||b===vc.Compact)&&(Ie.error&&Ie.error.data?be=`Error data: ${ee(Ie.error.data)} +`),w.log(`Received notification '${Ie.method}'.`,F)}else ce("receive-notification",Ie)}a(qe,"traceReceivedNotification");function ne(Ie,F){if(!(b===bc.Off||!w))if(T===G1.Text){let be;if((b===bc.Verbose||b===bc.Compact)&&(Ie.error&&Ie.error.data?be=`Error data: ${ee(Ie.error.data)} `:Ie.result?be=`Result: ${ee(Ie.result)} `: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 le("receive-response",Ie)}a(ie,"traceReceivedResponse");function le(Ie,F){if(!w||b===vc.Off)return;let be={isLSPMessage:!0,type:Ie,message:F,timestamp:Date.now()};w.log(be)}a(le,"logLSPMessage");function Ne(){if(z())throw new qoe(OCe.Closed,"Connection is closed.");if($())throw new qoe(OCe.Disposed,"Connection is disposed.")}a(Ne,"throwIfClosedOrDisposed");function we(){if(U())throw new qoe(OCe.AlreadyListening,"Connection is already listening")}a(we,"throwIfListening");function Le(){if(!U())throw new Error("Call listen() first.")}a(Le,"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 kt(Ie,F){switch(Ie){case Wi.ParameterStructures.auto:return _t(F)?st(F):[rt(F)];case Wi.ParameterStructures.byName:if(!_t(F))throw new Error("Received parameters by name but param is not an object literal.");return st(F);case Wi.ParameterStructures.byPosition:return[rt(F)];default:throw new Error(`Unknown parameter structure ${Ie.toString()}`)}}a(kt,"computeSingleParam");function $t(Ie,F){let be,Qe=Ie.numberOfParams;switch(Qe){case 0:be=void 0;break;case 1:be=kt(Ie.parameterStructures,F[0]);break;default:be=[];for(let fe=0;fe{Ne();let be,Qe;if(of.string(Ie)){be=Ie;let Se=F[0],Fe=0,te=Wi.ParameterStructures.auto;Wi.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=kt(te,F[Fe]);break;default:if(te===Wi.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);Qe=F.slice(Fe,Te).map(Y=>rt(Y));break}}else{let Se=F;be=Ie.method,Qe=$t(Ie,Se)}let fe={jsonrpc:u,method:be,params:Qe};return he(fe),e.write(fe).catch(Se=>{throw o.error("Sending notification failed."),Se})},"sendNotification"),onNotification:a((Ie,F)=>{Ne();let be;return of.func(Ie)?h=Ie:F&&(of.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)=>Ht.sendNotification(MCe.type,{token:F,value:be}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((Ie,...F)=>{Ne(),Le();let be,Qe,fe;if(of.string(Ie)){be=Ie;let Te=F[0],Ge=F[F.length-1],Y=0,se=Wi.ParameterStructures.auto;Wi.ParameterStructures.is(Te)&&(Y=1,se=Te);let me=F.length;_2t.CancellationToken.is(Ge)&&(me=me-1,fe=Ge);let Ce=me-Y;switch(Ce){case 0:Qe=void 0;break;case 1:Qe=kt(se,F[Y]);break;default:if(se===Wi.ParameterStructures.byName)throw new Error(`Received ${Ce} parameters for 'by Name' request parameter structure.`);Qe=F.slice(Y,me).map(He=>rt(He));break}}else{let Te=F;be=Ie.method,Qe=$t(Ie,Te);let Ge=Ie.numberOfParams;fe=_2t.CancellationToken.is(Te[Ge])?Te[Ge]:void 0}let Se=s++,Fe;fe&&(Fe=fe.onCancellationRequested(()=>{let Te=L.sender.sendCancellation(Ht,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 L.sender.enableCancellation=="function"&&L.sender.enableCancellation(te),new Promise(async(Te,Ge)=>{let Y=a(Ce=>{Te(Ce),L.sender.cleanup(Se),Fe?.dispose()},"resolveWithCleanup"),se=a(Ce=>{Ge(Ce),L.sender.cleanup(Se),Fe?.dispose()},"rejectWithCleanup"),me={method:be,timerStart:Date.now(),resolve:Y,reject:se};try{await e.write(te),E.set(Se,me)}catch(Ce){throw o.error("Sending request failed."),me.reject(new Wi.ResponseError(Wi.ErrorCodes.MessageWriteError,Ce.message?Ce.message:"Unknown reason")),Ce}})},"sendRequest"),onRequest:a((Ie,F)=>{Ne();let be=null;return b2t.is(Ie)?(be=void 0,d=Ie):of.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,fe=L1.Text;be!==void 0&&(of.boolean(be)?Qe=be:(Qe=be.sendNotification||!1,fe=be.traceFormat||L1.Text)),b=Ie,T=fe,b===vc.Off?w=void 0:w=F,Qe&&!z()&&!$()&&await Ht.sendNotification(S2t.type,{value:vc.toString(Ie)})},"trace"),onError:x.event,onClose:P.event,onUnhandledNotification:D.event,onDispose:B.event,end:a(()=>{e.end()},"end"),dispose:a(()=>{if($())return;R=QP.Disposed,B.fire(void 0);let Ie=new Wi.ResponseError(Wi.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 _Vr.LinkedMap,of.func(e.dispose)&&e.dispose(),of.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Ne(),we(),R=QP.Listening,t.listen(Be)},"listen"),inspect:a(()=>{(0,EVr.default)().console.log("inspect")},"inspect")};return Ht.onNotification(lUe.type,Ie=>{if(b===vc.Off||!w)return;let F=b===vc.Verbose||b===vc.Compact;w.log(Ie.message,F?Ie.verbose:void 0)}),Ht.onNotification(MCe.type,Ie=>{let F=g.get(Ie.token);F?F(Ie.value):N.fire(Ie)}),Ht}a(Igo,"createMessageConnection");No.createMessageConnection=Igo});var mUe=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 nu=Zkt();Object.defineProperty(Bt,"Message",{enumerable:!0,get:a(function(){return nu.Message},"get")});Object.defineProperty(Bt,"RequestType",{enumerable:!0,get:a(function(){return nu.RequestType},"get")});Object.defineProperty(Bt,"RequestType0",{enumerable:!0,get:a(function(){return nu.RequestType0},"get")});Object.defineProperty(Bt,"RequestType1",{enumerable:!0,get:a(function(){return nu.RequestType1},"get")});Object.defineProperty(Bt,"RequestType2",{enumerable:!0,get:a(function(){return nu.RequestType2},"get")});Object.defineProperty(Bt,"RequestType3",{enumerable:!0,get:a(function(){return nu.RequestType3},"get")});Object.defineProperty(Bt,"RequestType4",{enumerable:!0,get:a(function(){return nu.RequestType4},"get")});Object.defineProperty(Bt,"RequestType5",{enumerable:!0,get:a(function(){return nu.RequestType5},"get")});Object.defineProperty(Bt,"RequestType6",{enumerable:!0,get:a(function(){return nu.RequestType6},"get")});Object.defineProperty(Bt,"RequestType7",{enumerable:!0,get:a(function(){return nu.RequestType7},"get")});Object.defineProperty(Bt,"RequestType8",{enumerable:!0,get:a(function(){return nu.RequestType8},"get")});Object.defineProperty(Bt,"RequestType9",{enumerable:!0,get:a(function(){return nu.RequestType9},"get")});Object.defineProperty(Bt,"ResponseError",{enumerable:!0,get:a(function(){return nu.ResponseError},"get")});Object.defineProperty(Bt,"ErrorCodes",{enumerable:!0,get:a(function(){return nu.ErrorCodes},"get")});Object.defineProperty(Bt,"NotificationType",{enumerable:!0,get:a(function(){return nu.NotificationType},"get")});Object.defineProperty(Bt,"NotificationType0",{enumerable:!0,get:a(function(){return nu.NotificationType0},"get")});Object.defineProperty(Bt,"NotificationType1",{enumerable:!0,get:a(function(){return nu.NotificationType1},"get")});Object.defineProperty(Bt,"NotificationType2",{enumerable:!0,get:a(function(){return nu.NotificationType2},"get")});Object.defineProperty(Bt,"NotificationType3",{enumerable:!0,get:a(function(){return nu.NotificationType3},"get")});Object.defineProperty(Bt,"NotificationType4",{enumerable:!0,get:a(function(){return nu.NotificationType4},"get")});Object.defineProperty(Bt,"NotificationType5",{enumerable:!0,get:a(function(){return nu.NotificationType5},"get")});Object.defineProperty(Bt,"NotificationType6",{enumerable:!0,get:a(function(){return nu.NotificationType6},"get")});Object.defineProperty(Bt,"NotificationType7",{enumerable:!0,get:a(function(){return nu.NotificationType7},"get")});Object.defineProperty(Bt,"NotificationType8",{enumerable:!0,get:a(function(){return nu.NotificationType8},"get")});Object.defineProperty(Bt,"NotificationType9",{enumerable:!0,get:a(function(){return nu.NotificationType9},"get")});Object.defineProperty(Bt,"ParameterStructures",{enumerable:!0,get:a(function(){return nu.ParameterStructures},"get")});var x2t=e2t();Object.defineProperty(Bt,"LinkedMap",{enumerable:!0,get:a(function(){return x2t.LinkedMap},"get")});Object.defineProperty(Bt,"LRUCache",{enumerable:!0,get:a(function(){return x2t.LRUCache},"get")});Object.defineProperty(Bt,"Touch",{enumerable:!0,get:a(function(){return x2t.Touch},"get")});var xgo=cVr();Object.defineProperty(Bt,"Disposable",{enumerable:!0,get:a(function(){return xgo.Disposable},"get")});var SVr=Loe();Object.defineProperty(Bt,"Event",{enumerable:!0,get:a(function(){return SVr.Event},"get")});Object.defineProperty(Bt,"Emitter",{enumerable:!0,get:a(function(){return SVr.Emitter},"get")});var TVr=iUe();Object.defineProperty(Bt,"CancellationTokenSource",{enumerable:!0,get:a(function(){return TVr.CancellationTokenSource},"get")});Object.defineProperty(Bt,"CancellationToken",{enumerable:!0,get:a(function(){return TVr.CancellationToken},"get")});var IVr=uVr();Object.defineProperty(Bt,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return IVr.SharedArraySenderStrategy},"get")});Object.defineProperty(Bt,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return IVr.SharedArrayReceiverStrategy},"get")});var w2t=fVr();Object.defineProperty(Bt,"MessageReader",{enumerable:!0,get:a(function(){return w2t.MessageReader},"get")});Object.defineProperty(Bt,"AbstractMessageReader",{enumerable:!0,get:a(function(){return w2t.AbstractMessageReader},"get")});Object.defineProperty(Bt,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return w2t.ReadableStreamMessageReader},"get")});var R2t=AVr();Object.defineProperty(Bt,"MessageWriter",{enumerable:!0,get:a(function(){return R2t.MessageWriter},"get")});Object.defineProperty(Bt,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return R2t.AbstractMessageWriter},"get")});Object.defineProperty(Bt,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return R2t.WriteableStreamMessageWriter},"get")});var wgo=yVr();Object.defineProperty(Bt,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return wgo.AbstractMessageBuffer},"get")});var sA=bVr();Object.defineProperty(Bt,"ConnectionStrategy",{enumerable:!0,get:a(function(){return sA.ConnectionStrategy},"get")});Object.defineProperty(Bt,"ConnectionOptions",{enumerable:!0,get:a(function(){return sA.ConnectionOptions},"get")});Object.defineProperty(Bt,"NullLogger",{enumerable:!0,get:a(function(){return sA.NullLogger},"get")});Object.defineProperty(Bt,"createMessageConnection",{enumerable:!0,get:a(function(){return sA.createMessageConnection},"get")});Object.defineProperty(Bt,"ProgressToken",{enumerable:!0,get:a(function(){return sA.ProgressToken},"get")});Object.defineProperty(Bt,"ProgressType",{enumerable:!0,get:a(function(){return sA.ProgressType},"get")});Object.defineProperty(Bt,"Trace",{enumerable:!0,get:a(function(){return sA.Trace},"get")});Object.defineProperty(Bt,"TraceValues",{enumerable:!0,get:a(function(){return sA.TraceValues},"get")});Object.defineProperty(Bt,"TraceFormat",{enumerable:!0,get:a(function(){return sA.TraceFormat},"get")});Object.defineProperty(Bt,"SetTraceNotification",{enumerable:!0,get:a(function(){return sA.SetTraceNotification},"get")});Object.defineProperty(Bt,"LogTraceNotification",{enumerable:!0,get:a(function(){return sA.LogTraceNotification},"get")});Object.defineProperty(Bt,"ConnectionErrors",{enumerable:!0,get:a(function(){return sA.ConnectionErrors},"get")});Object.defineProperty(Bt,"ConnectionError",{enumerable:!0,get:a(function(){return sA.ConnectionError},"get")});Object.defineProperty(Bt,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return sA.CancellationReceiverStrategy},"get")});Object.defineProperty(Bt,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return sA.CancellationSenderStrategy},"get")});Object.defineProperty(Bt,"CancellationStrategy",{enumerable:!0,get:a(function(){return sA.CancellationStrategy},"get")});Object.defineProperty(Bt,"MessageStrategy",{enumerable:!0,get:a(function(){return sA.MessageStrategy},"get")});var Rgo=fU();Bt.RAL=Rgo.default});var RVr=I(N2t=>{"use strict";p();Object.defineProperty(N2t,"__esModule",{value:!0});var xVr=require("util"),cL=mUe(),gUe=class t extends cL.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 xVr.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)}};gUe.emptyBuffer=Buffer.allocUnsafe(0);var P2t=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),cL.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),cL.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),cL.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),cL.Disposable.create(()=>this.stream.off("data",e))}},k2t=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),cL.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),cL.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),cL.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()}},wVr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new gUe(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 xVr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new P2t(t),"asReadableStream"),asWritableStream:a(t=>new k2t(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 D2t(){return wVr}a(D2t,"RIL");(function(t){function e(){cL.RAL.install(wVr)}a(e,"install"),t.install=e})(D2t||(D2t={}));N2t.default=D2t});var RW=I(Sa=>{"use strict";p();var Pgo=Sa&&Sa.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kgo=Sa&&Sa.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Pgo(e,t,r)};Object.defineProperty(Sa,"__esModule",{value:!0});Sa.createMessageConnection=Sa.createServerSocketTransport=Sa.createClientSocketTransport=Sa.createServerPipeTransport=Sa.createClientPipeTransport=Sa.generateRandomPipeName=Sa.StreamMessageWriter=Sa.StreamMessageReader=Sa.SocketMessageWriter=Sa.SocketMessageReader=Sa.PortMessageWriter=Sa.PortMessageReader=Sa.IPCMessageWriter=Sa.IPCMessageReader=void 0;var joe=RVr();joe.default.install();var PVr=require("path"),Dgo=require("os"),Ngo=require("crypto"),EUe=require("net"),F1=mUe();kgo(mUe(),Sa);var M2t=class extends F1.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),F1.Disposable.create(()=>this.process.off("message",e))}};Sa.IPCMessageReader=M2t;var O2t=class extends F1.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(){}};Sa.IPCMessageWriter=O2t;var B2t=class extends F1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new F1.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)}};Sa.PortMessageReader=B2t;var L2t=class extends F1.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(){}};Sa.PortMessageWriter=L2t;var xW=class extends F1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,joe.default)().stream.asReadableStream(e),r)}};Sa.SocketMessageReader=xW;var wW=class extends F1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,joe.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Sa.SocketMessageWriter=wW;var AUe=class extends F1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,joe.default)().stream.asReadableStream(e),r)}};Sa.StreamMessageReader=AUe;var yUe=class extends F1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,joe.default)().stream.asWritableStream(e),r)}};Sa.StreamMessageWriter=yUe;var kVr=process.env.XDG_RUNTIME_DIR,Mgo=new Map([["linux",107],["darwin",103]]);function Ogo(){let t=(0,Ngo.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;kVr?e=PVr.join(kVr,`vscode-ipc-${t}.sock`):e=PVr.join(Dgo.tmpdir(),`vscode-${t}.sock`);let r=Mgo.get(process.platform);return r!==void 0&&e.length>r&&(0,joe.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(Ogo,"generateRandomPipeName");Sa.generateRandomPipeName=Ogo;function Bgo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,EUe.createServer)(l=>{c.close(),r([new xW(l,e),new wW(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(Bgo,"createClientPipeTransport");Sa.createClientPipeTransport=Bgo;function Lgo(t,e="utf-8"){let r=(0,EUe.createConnection)(t);return[new xW(r,e),new wW(r,e)]}a(Lgo,"createServerPipeTransport");Sa.createServerPipeTransport=Lgo;function Fgo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,EUe.createServer)(l=>{c.close(),r([new xW(l,e),new wW(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(Fgo,"createClientSocketTransport");Sa.createClientSocketTransport=Fgo;function Ugo(t,e="utf-8"){let r=(0,EUe.createConnection)(t,"127.0.0.1");return[new xW(r,e),new wW(r,e)]}a(Ugo,"createServerSocketTransport");Sa.createServerSocketTransport=Ugo;function Qgo(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a(Qgo,"isReadableStream");function qgo(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(qgo,"isWritableStream");function jgo(t,e,r,n){r||(r=F1.NullLogger);let o=Qgo(t)?new AUe(t):t,s=qgo(e)?new yUe(e):e;return F1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,F1.createMessageConnection)(o,s,r,n)}a(jgo,"createMessageConnection");Sa.createMessageConnection=jgo});var F2t=I((TSl,DVr)=>{"use strict";p();DVr.exports=RW()});var LCe=I((NVr,_Ue)=>{p();(function(t){if(typeof _Ue=="object"&&typeof _Ue.exports=="object"){var e=t(require,NVr);e!==void 0&&(_Ue.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(ce){function Re(Me){return typeof Me=="string"}a(Re,"is"),ce.is=Re})(r||(e.DocumentUri=r={}));var n;(function(ce){function Re(Me){return typeof Me=="string"}a(Re,"is"),ce.is=Re})(n||(e.URI=n={}));var o;(function(ce){ce.MIN_VALUE=-2147483648,ce.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ce.MIN_VALUE<=Me&&Me<=ce.MAX_VALUE}a(Re,"is"),ce.is=Re})(o||(e.integer=o={}));var s;(function(ce){ce.MIN_VALUE=0,ce.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ce.MIN_VALUE<=Me&&Me<=ce.MAX_VALUE}a(Re,"is"),ce.is=Re})(s||(e.uinteger=s={}));var c;(function(ce){function Re(Ae,oe){return Ae===Number.MAX_VALUE&&(Ae=s.MAX_VALUE),oe===Number.MAX_VALUE&&(oe=s.MAX_VALUE),{line:Ae,character:oe}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.objectLiteral(oe)&&We.uinteger(oe.line)&&We.uinteger(oe.character)}a(Me,"is"),ce.is=Me})(c||(e.Position=c={}));var l;(function(ce){function Re(Ae,oe,ze,at){if(We.uinteger(Ae)&&We.uinteger(oe)&&We.uinteger(ze)&&We.uinteger(at))return{start:c.create(Ae,oe),end:c.create(ze,at)};if(c.is(Ae)&&c.is(oe))return{start:Ae,end:oe};throw new Error("Range#create called with invalid arguments[".concat(Ae,", ").concat(oe,", ").concat(ze,", ").concat(at,"]"))}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.objectLiteral(oe)&&c.is(oe.start)&&c.is(oe.end)}a(Me,"is"),ce.is=Me})(l||(e.Range=l={}));var u;(function(ce){function Re(Ae,oe){return{uri:Ae,range:oe}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.objectLiteral(oe)&&l.is(oe.range)&&(We.string(oe.uri)||We.undefined(oe.uri))}a(Me,"is"),ce.is=Me})(u||(e.Location=u={}));var d;(function(ce){function Re(Ae,oe,ze,at){return{targetUri:Ae,targetRange:oe,targetSelectionRange:ze,originSelectionRange:at}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.objectLiteral(oe)&&l.is(oe.targetRange)&&We.string(oe.targetUri)&&l.is(oe.targetSelectionRange)&&(l.is(oe.originSelectionRange)||We.undefined(oe.originSelectionRange))}a(Me,"is"),ce.is=Me})(d||(e.LocationLink=d={}));var f;(function(ce){function Re(Ae,oe,ze,at){return{red:Ae,green:oe,blue:ze,alpha:at}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.objectLiteral(oe)&&We.numberRange(oe.red,0,1)&&We.numberRange(oe.green,0,1)&&We.numberRange(oe.blue,0,1)&&We.numberRange(oe.alpha,0,1)}a(Me,"is"),ce.is=Me})(f||(e.Color=f={}));var h;(function(ce){function Re(Ae,oe){return{range:Ae,color:oe}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.objectLiteral(oe)&&l.is(oe.range)&&f.is(oe.color)}a(Me,"is"),ce.is=Me})(h||(e.ColorInformation=h={}));var m;(function(ce){function Re(Ae,oe,ze){return{label:Ae,textEdit:oe,additionalTextEdits:ze}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.objectLiteral(oe)&&We.string(oe.label)&&(We.undefined(oe.textEdit)||w.is(oe))&&(We.undefined(oe.additionalTextEdits)||We.typedArray(oe.additionalTextEdits,w.is))}a(Me,"is"),ce.is=Me})(m||(e.ColorPresentation=m={}));var g;(function(ce){ce.Comment="comment",ce.Imports="imports",ce.Region="region"})(g||(e.FoldingRangeKind=g={}));var A;(function(ce){function Re(Ae,oe,ze,at,Vt,gr){var cr={startLine:Ae,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"),ce.create=Re;function Me(Ae){var oe=Ae;return We.objectLiteral(oe)&&We.uinteger(oe.startLine)&&We.uinteger(oe.startLine)&&(We.undefined(oe.startCharacter)||We.uinteger(oe.startCharacter))&&(We.undefined(oe.endCharacter)||We.uinteger(oe.endCharacter))&&(We.undefined(oe.kind)||We.string(oe.kind))}a(Me,"is"),ce.is=Me})(A||(e.FoldingRange=A={}));var y;(function(ce){function Re(Ae,oe){return{location:Ae,message:oe}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.defined(oe)&&u.is(oe.location)&&We.string(oe.message)}a(Me,"is"),ce.is=Me})(y||(e.DiagnosticRelatedInformation=y={}));var E;(function(ce){ce.Error=1,ce.Warning=2,ce.Information=3,ce.Hint=4})(E||(e.DiagnosticSeverity=E={}));var _;(function(ce){ce.Unnecessary=1,ce.Deprecated=2})(_||(e.DiagnosticTag=_={}));var v;(function(ce){function Re(Me){var Ae=Me;return We.objectLiteral(Ae)&&We.string(Ae.href)}a(Re,"is"),ce.is=Re})(v||(e.CodeDescription=v={}));var b;(function(ce){function Re(Ae,oe,ze,at,Vt,gr){var cr={range:Ae,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"),ce.create=Re;function Me(Ae){var oe,ze=Ae;return We.defined(ze)&&l.is(ze.range)&&We.string(ze.message)&&(We.number(ze.severity)||We.undefined(ze.severity))&&(We.integer(ze.code)||We.string(ze.code)||We.undefined(ze.code))&&(We.undefined(ze.codeDescription)||We.string((oe=ze.codeDescription)===null||oe===void 0?void 0:oe.href))&&(We.string(ze.source)||We.undefined(ze.source))&&(We.undefined(ze.relatedInformation)||We.typedArray(ze.relatedInformation,y.is))}a(Me,"is"),ce.is=Me})(b||(e.Diagnostic=b={}));var T;(function(ce){function Re(Ae,oe){for(var ze=[],at=2;at0&&(Vt.arguments=ze),Vt}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.defined(oe)&&We.string(oe.title)&&We.string(oe.command)}a(Me,"is"),ce.is=Me})(T||(e.Command=T={}));var w;(function(ce){function Re(ze,at){return{range:ze,newText:at}}a(Re,"replace"),ce.replace=Re;function Me(ze,at){return{range:{start:ze,end:ze},newText:at}}a(Me,"insert"),ce.insert=Me;function Ae(ze){return{range:ze,newText:""}}a(Ae,"del"),ce.del=Ae;function oe(ze){var at=ze;return We.objectLiteral(at)&&We.string(at.newText)&&l.is(at.range)}a(oe,"is"),ce.is=oe})(w||(e.TextEdit=w={}));var R;(function(ce){function Re(Ae,oe,ze){var at={label:Ae};return oe!==void 0&&(at.needsConfirmation=oe),ze!==void 0&&(at.description=ze),at}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.objectLiteral(oe)&&We.string(oe.label)&&(We.boolean(oe.needsConfirmation)||oe.needsConfirmation===void 0)&&(We.string(oe.description)||oe.description===void 0)}a(Me,"is"),ce.is=Me})(R||(e.ChangeAnnotation=R={}));var x;(function(ce){function Re(Me){var Ae=Me;return We.string(Ae)}a(Re,"is"),ce.is=Re})(x||(e.ChangeAnnotationIdentifier=x={}));var P;(function(ce){function Re(ze,at,Vt){return{range:ze,newText:at,annotationId:Vt}}a(Re,"replace"),ce.replace=Re;function Me(ze,at,Vt){return{range:{start:ze,end:ze},newText:at,annotationId:Vt}}a(Me,"insert"),ce.insert=Me;function Ae(ze,at){return{range:ze,newText:"",annotationId:at}}a(Ae,"del"),ce.del=Ae;function oe(ze){var at=ze;return w.is(at)&&(R.is(at.annotationId)||x.is(at.annotationId))}a(oe,"is"),ce.is=oe})(P||(e.AnnotatedTextEdit=P={}));var D;(function(ce){function Re(Ae,oe){return{textDocument:Ae,edits:oe}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.defined(oe)&&z.is(oe.textDocument)&&Array.isArray(oe.edits)}a(Me,"is"),ce.is=Me})(D||(e.TextDocumentEdit=D={}));var N;(function(ce){function Re(Ae,oe,ze){var at={kind:"create",uri:Ae};return oe!==void 0&&(oe.overwrite!==void 0||oe.ignoreIfExists!==void 0)&&(at.options=oe),ze!==void 0&&(at.annotationId=ze),at}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return oe&&oe.kind==="create"&&We.string(oe.uri)&&(oe.options===void 0||(oe.options.overwrite===void 0||We.boolean(oe.options.overwrite))&&(oe.options.ignoreIfExists===void 0||We.boolean(oe.options.ignoreIfExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(N||(e.CreateFile=N={}));var B;(function(ce){function Re(Ae,oe,ze,at){var Vt={kind:"rename",oldUri:Ae,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"),ce.create=Re;function Me(Ae){var oe=Ae;return oe&&oe.kind==="rename"&&We.string(oe.oldUri)&&We.string(oe.newUri)&&(oe.options===void 0||(oe.options.overwrite===void 0||We.boolean(oe.options.overwrite))&&(oe.options.ignoreIfExists===void 0||We.boolean(oe.options.ignoreIfExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(B||(e.RenameFile=B={}));var L;(function(ce){function Re(Ae,oe,ze){var at={kind:"delete",uri:Ae};return oe!==void 0&&(oe.recursive!==void 0||oe.ignoreIfNotExists!==void 0)&&(at.options=oe),ze!==void 0&&(at.annotationId=ze),at}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return oe&&oe.kind==="delete"&&We.string(oe.uri)&&(oe.options===void 0||(oe.options.recursive===void 0||We.boolean(oe.options.recursive))&&(oe.options.ignoreIfNotExists===void 0||We.boolean(oe.options.ignoreIfNotExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(L||(e.DeleteFile=L={}));var j;(function(ce){function Re(Me){var Ae=Me;return Ae&&(Ae.changes!==void 0||Ae.documentChanges!==void 0)&&(Ae.documentChanges===void 0||Ae.documentChanges.every(function(oe){return We.string(oe.kind)?N.is(oe)||B.is(oe)||L.is(oe):D.is(oe)}))}a(Re,"is"),ce.is=Re})(j||(e.WorkspaceEdit=j={}));var M=(function(){function ce(Re,Me){this.edits=Re,this.changeAnnotations=Me}return a(ce,"TextEditChangeImpl"),ce.prototype.insert=function(Re,Me,Ae){var oe,ze;if(Ae===void 0?oe=w.insert(Re,Me):x.is(Ae)?(ze=Ae,oe=P.insert(Re,Me,Ae)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(Ae),oe=P.insert(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ce.prototype.replace=function(Re,Me,Ae){var oe,ze;if(Ae===void 0?oe=w.replace(Re,Me):x.is(Ae)?(ze=Ae,oe=P.replace(Re,Me,Ae)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(Ae),oe=P.replace(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ce.prototype.delete=function(Re,Me){var Ae,oe;if(Me===void 0?Ae=w.del(Re):x.is(Me)?(oe=Me,Ae=P.del(Re,Me)):(this.assertChangeAnnotations(this.changeAnnotations),oe=this.changeAnnotations.manage(Me),Ae=P.del(Re,oe)),this.edits.push(Ae),oe!==void 0)return oe},ce.prototype.add=function(Re){this.edits.push(Re)},ce.prototype.all=function(){return this.edits},ce.prototype.clear=function(){this.edits.splice(0,this.edits.length)},ce.prototype.assertChangeAnnotations=function(Re){if(Re===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},ce})(),O=(function(){function ce(Re){this._annotations=Re===void 0?Object.create(null):Re,this._counter=0,this._size=0}return a(ce,"ChangeAnnotations"),ce.prototype.all=function(){return this._annotations},Object.defineProperty(ce.prototype,"size",{get:a(function(){return this._size},"get"),enumerable:!1,configurable:!0}),ce.prototype.manage=function(Re,Me){var Ae;if(x.is(Re)?Ae=Re:(Ae=this.nextId(),Me=Re),this._annotations[Ae]!==void 0)throw new Error("Id ".concat(Ae," is already in use."));if(Me===void 0)throw new Error("No annotation provided for id ".concat(Ae));return this._annotations[Ae]=Me,this._size++,Ae},ce.prototype.nextId=function(){return this._counter++,this._counter.toString()},ce})(),q=(function(){function ce(Re){var Me=this;this._textEditChanges=Object.create(null),Re!==void 0?(this._workspaceEdit=Re,Re.documentChanges?(this._changeAnnotations=new O(Re.changeAnnotations),Re.changeAnnotations=this._changeAnnotations.all(),Re.documentChanges.forEach(function(Ae){if(D.is(Ae)){var oe=new M(Ae.edits,Me._changeAnnotations);Me._textEditChanges[Ae.textDocument.uri]=oe}})):Re.changes&&Object.keys(Re.changes).forEach(function(Ae){var oe=new M(Re.changes[Ae]);Me._textEditChanges[Ae]=oe})):this._workspaceEdit={}}return a(ce,"WorkspaceChange"),Object.defineProperty(ce.prototype,"edit",{get:a(function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},"get"),enumerable:!1,configurable:!0}),ce.prototype.getTextEditChange=function(Re){if(z.is(Re)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Me={uri:Re.uri,version:Re.version},Ae=this._textEditChanges[Me.uri];if(!Ae){var oe=[],ze={textDocument:Me,edits:oe};this._workspaceEdit.documentChanges.push(ze),Ae=new M(oe,this._changeAnnotations),this._textEditChanges[Me.uri]=Ae}return Ae}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var Ae=this._textEditChanges[Re];if(!Ae){var oe=[];this._workspaceEdit.changes[Re]=oe,Ae=new M(oe),this._textEditChanges[Re]=Ae}return Ae}},ce.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new O,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},ce.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},ce.prototype.createFile=function(Re,Me,Ae){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:Ae=Me;var ze,at;if(oe===void 0?ze=N.create(Re,Ae):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=N.create(Re,Ae,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ce.prototype.renameFile=function(Re,Me,Ae,oe){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var ze;R.is(Ae)||x.is(Ae)?ze=Ae:oe=Ae;var at,Vt;if(ze===void 0?at=B.create(Re,Me,oe):(Vt=x.is(ze)?ze:this._changeAnnotations.manage(ze),at=B.create(Re,Me,oe,Vt)),this._workspaceEdit.documentChanges.push(at),Vt!==void 0)return Vt},ce.prototype.deleteFile=function(Re,Me,Ae){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:Ae=Me;var ze,at;if(oe===void 0?ze=L.create(Re,Ae):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=L.create(Re,Ae,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ce})();e.WorkspaceChange=q;var Q;(function(ce){function Re(Ae){return{uri:Ae}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.defined(oe)&&We.string(oe.uri)}a(Me,"is"),ce.is=Me})(Q||(e.TextDocumentIdentifier=Q={}));var U;(function(ce){function Re(Ae,oe){return{uri:Ae,version:oe}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.defined(oe)&&We.string(oe.uri)&&We.integer(oe.version)}a(Me,"is"),ce.is=Me})(U||(e.VersionedTextDocumentIdentifier=U={}));var z;(function(ce){function Re(Ae,oe){return{uri:Ae,version:oe}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.defined(oe)&&We.string(oe.uri)&&(oe.version===null||We.integer(oe.version))}a(Me,"is"),ce.is=Me})(z||(e.OptionalVersionedTextDocumentIdentifier=z={}));var $;(function(ce){function Re(Ae,oe,ze,at){return{uri:Ae,languageId:oe,version:ze,text:at}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return We.defined(oe)&&We.string(oe.uri)&&We.string(oe.languageId)&&We.integer(oe.version)&&We.string(oe.text)}a(Me,"is"),ce.is=Me})($||(e.TextDocumentItem=$={}));var W;(function(ce){ce.PlainText="plaintext",ce.Markdown="markdown";function Re(Me){var Ae=Me;return Ae===ce.PlainText||Ae===ce.Markdown}a(Re,"is"),ce.is=Re})(W||(e.MarkupKind=W={}));var J;(function(ce){function Re(Me){var Ae=Me;return We.objectLiteral(Me)&&W.is(Ae.kind)&&We.string(Ae.value)}a(Re,"is"),ce.is=Re})(J||(e.MarkupContent=J={}));var ne;(function(ce){ce.Text=1,ce.Method=2,ce.Function=3,ce.Constructor=4,ce.Field=5,ce.Variable=6,ce.Class=7,ce.Interface=8,ce.Module=9,ce.Property=10,ce.Unit=11,ce.Value=12,ce.Enum=13,ce.Keyword=14,ce.Snippet=15,ce.Color=16,ce.File=17,ce.Reference=18,ce.Folder=19,ce.EnumMember=20,ce.Constant=21,ce.Struct=22,ce.Event=23,ce.Operator=24,ce.TypeParameter=25})(ne||(e.CompletionItemKind=ne={}));var H;(function(ce){ce.PlainText=1,ce.Snippet=2})(H||(e.InsertTextFormat=H={}));var re;(function(ce){ce.Deprecated=1})(re||(e.CompletionItemTag=re={}));var ae;(function(ce){function Re(Ae,oe,ze){return{newText:Ae,insert:oe,replace:ze}}a(Re,"create"),ce.create=Re;function Me(Ae){var oe=Ae;return oe&&We.string(oe.newText)&&l.is(oe.insert)&&l.is(oe.replace)}a(Me,"is"),ce.is=Me})(ae||(e.InsertReplaceEdit=ae={}));var Be;(function(ce){ce.asIs=1,ce.adjustIndentation=2})(Be||(e.InsertTextMode=Be={}));var ve;(function(ce){function Re(Me){var Ae=Me;return Ae&&(We.string(Ae.detail)||Ae.detail===void 0)&&(We.string(Ae.description)||Ae.description===void 0)}a(Re,"is"),ce.is=Re})(ve||(e.CompletionItemLabelDetails=ve={}));var Ue;(function(ce){function Re(Me){return{label:Me}}a(Re,"create"),ce.create=Re})(Ue||(e.CompletionItem=Ue={}));var Pe;(function(ce){function Re(Me,Ae){return{items:Me||[],isIncomplete:!!Ae}}a(Re,"create"),ce.create=Re})(Pe||(e.CompletionList=Pe={}));var Z;(function(ce){function Re(Ae){return Ae.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(Re,"fromPlainText"),ce.fromPlainText=Re;function Me(Ae){var oe=Ae;return We.string(oe)||We.objectLiteral(oe)&&We.string(oe.language)&&We.string(oe.value)}a(Me,"is"),ce.is=Me})(Z||(e.MarkedString=Z={}));var ee;(function(ce){function Re(Me){var Ae=Me;return!!Ae&&We.objectLiteral(Ae)&&(J.is(Ae.contents)||Z.is(Ae.contents)||We.typedArray(Ae.contents,Z.is))&&(Me.range===void 0||l.is(Me.range))}a(Re,"is"),ce.is=Re})(ee||(e.Hover=ee={}));var K;(function(ce){function Re(Me,Ae){return Ae?{label:Me,documentation:Ae}:{label:Me}}a(Re,"create"),ce.create=Re})(K||(e.ParameterInformation=K={}));var he;(function(ce){function Re(Me,Ae){for(var oe=[],ze=2;ze{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=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(Ae,"applyEdits"),ce.applyEdits=Ae;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;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(Me.length),this._lineOffsets=Re}return this._lineOffsets},ce.prototype.positionAt=function(Re){Re=Math.max(Math.min(Re,this._content.length),0);var Me=this.getLineOffsets(),Ae=0,oe=Me.length;if(oe===0)return c.create(0,Re);for(;AeRe?oe=ze:Ae=ze+1}var at=Ae-1;return c.create(at,Re-Me[at])},ce.prototype.offsetAt=function(Re){var Me=this.getLineOffsets();if(Re.line>=Me.length)return this._content.length;if(Re.line<0)return 0;var Ae=Me[Re.line],oe=Re.line+1"u"}a(Ae,"undefined"),ce.undefined=Ae;function oe(Yt){return Yt===!0||Yt===!1}a(oe,"boolean"),ce.boolean=oe;function ze(Yt){return Re.call(Yt)==="[object String]"}a(ze,"string"),ce.string=ze;function at(Yt){return Re.call(Yt)==="[object Number]"}a(at,"number"),ce.number=at;function Vt(Yt,_r,B0){return Re.call(Yt)==="[object Number]"&&_r<=Yt&&Yt<=B0}a(Vt,"numberRange"),ce.numberRange=Vt;function gr(Yt){return Re.call(Yt)==="[object Number]"&&-2147483648<=Yt&&Yt<=2147483647}a(gr,"integer"),ce.integer=gr;function cr(Yt){return Re.call(Yt)==="[object Number]"&&0<=Yt&&Yt<=2147483647}a(cr,"uinteger"),ce.uinteger=cr;function Mr(Yt){return Re.call(Yt)==="[object Function]"}a(Mr,"func"),ce.func=Mr;function Hr(Yt){return Yt!==null&&typeof Yt=="object"}a(Hr,"objectLiteral"),ce.objectLiteral=Hr;function Gr(Yt,_r){return Array.isArray(Yt)&&Yt.every(_r)}a(Gr,"typedArray"),ce.typedArray=Gr})(We||(We={}))})});var Rd=I(iC=>{"use strict";p();Object.defineProperty(iC,"__esModule",{value:!0});iC.ProtocolNotificationType=iC.ProtocolNotificationType0=iC.ProtocolRequestType=iC.ProtocolRequestType0=iC.RegistrationType=iC.MessageDirection=void 0;var Hoe=RW(),MVr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(MVr||(iC.MessageDirection=MVr={}));var U2t=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};iC.RegistrationType=U2t;var Q2t=class extends Hoe.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};iC.ProtocolRequestType0=Q2t;var q2t=class extends Hoe.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,Hoe.ParameterStructures.byName)}};iC.ProtocolRequestType=q2t;var j2t=class extends Hoe.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};iC.ProtocolNotificationType0=j2t;var H2t=class extends Hoe.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,Hoe.ParameterStructures.byName)}};iC.ProtocolNotificationType=H2t});var vUe=I(bh=>{"use strict";p();Object.defineProperty(bh,"__esModule",{value:!0});bh.objectLiteral=bh.typedArray=bh.stringArray=bh.array=bh.func=bh.error=bh.number=bh.string=bh.boolean=void 0;function Hgo(t){return t===!0||t===!1}a(Hgo,"boolean");bh.boolean=Hgo;function OVr(t){return typeof t=="string"||t instanceof String}a(OVr,"string");bh.string=OVr;function Ggo(t){return typeof t=="number"||t instanceof Number}a(Ggo,"number");bh.number=Ggo;function $go(t){return t instanceof Error}a($go,"error");bh.error=$go;function Vgo(t){return typeof t=="function"}a(Vgo,"func");bh.func=Vgo;function BVr(t){return Array.isArray(t)}a(BVr,"array");bh.array=BVr;function Wgo(t){return BVr(t)&&t.every(e=>OVr(e))}a(Wgo,"stringArray");bh.stringArray=Wgo;function zgo(t,e){return Array.isArray(t)&&t.every(e)}a(zgo,"typedArray");bh.typedArray=zgo;function Ygo(t){return t!==null&&typeof t=="object"}a(Ygo,"objectLiteral");bh.objectLiteral=Ygo});var UVr=I(CUe=>{"use strict";p();Object.defineProperty(CUe,"__esModule",{value:!0});CUe.ImplementationRequest=void 0;var LVr=Rd(),FVr;(function(t){t.method="textDocument/implementation",t.messageDirection=LVr.MessageDirection.clientToServer,t.type=new LVr.ProtocolRequestType(t.method)})(FVr||(CUe.ImplementationRequest=FVr={}))});var jVr=I(bUe=>{"use strict";p();Object.defineProperty(bUe,"__esModule",{value:!0});bUe.TypeDefinitionRequest=void 0;var QVr=Rd(),qVr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=QVr.MessageDirection.clientToServer,t.type=new QVr.ProtocolRequestType(t.method)})(qVr||(bUe.TypeDefinitionRequest=qVr={}))});var $Vr=I(Goe=>{"use strict";p();Object.defineProperty(Goe,"__esModule",{value:!0});Goe.DidChangeWorkspaceFoldersNotification=Goe.WorkspaceFoldersRequest=void 0;var SUe=Rd(),HVr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=SUe.MessageDirection.serverToClient,t.type=new SUe.ProtocolRequestType0(t.method)})(HVr||(Goe.WorkspaceFoldersRequest=HVr={}));var GVr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=SUe.MessageDirection.clientToServer,t.type=new SUe.ProtocolNotificationType(t.method)})(GVr||(Goe.DidChangeWorkspaceFoldersNotification=GVr={}))});var zVr=I(TUe=>{"use strict";p();Object.defineProperty(TUe,"__esModule",{value:!0});TUe.ConfigurationRequest=void 0;var VVr=Rd(),WVr;(function(t){t.method="workspace/configuration",t.messageDirection=VVr.MessageDirection.serverToClient,t.type=new VVr.ProtocolRequestType(t.method)})(WVr||(TUe.ConfigurationRequest=WVr={}))});var JVr=I($oe=>{"use strict";p();Object.defineProperty($oe,"__esModule",{value:!0});$oe.ColorPresentationRequest=$oe.DocumentColorRequest=void 0;var IUe=Rd(),YVr;(function(t){t.method="textDocument/documentColor",t.messageDirection=IUe.MessageDirection.clientToServer,t.type=new IUe.ProtocolRequestType(t.method)})(YVr||($oe.DocumentColorRequest=YVr={}));var KVr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=IUe.MessageDirection.clientToServer,t.type=new IUe.ProtocolRequestType(t.method)})(KVr||($oe.ColorPresentationRequest=KVr={}))});var eWr=I(Voe=>{"use strict";p();Object.defineProperty(Voe,"__esModule",{value:!0});Voe.FoldingRangeRefreshRequest=Voe.FoldingRangeRequest=void 0;var xUe=Rd(),ZVr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=xUe.MessageDirection.clientToServer,t.type=new xUe.ProtocolRequestType(t.method)})(ZVr||(Voe.FoldingRangeRequest=ZVr={}));var XVr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=xUe.MessageDirection.serverToClient,t.type=new xUe.ProtocolRequestType0(t.method)})(XVr||(Voe.FoldingRangeRefreshRequest=XVr={}))});var nWr=I(wUe=>{"use strict";p();Object.defineProperty(wUe,"__esModule",{value:!0});wUe.DeclarationRequest=void 0;var tWr=Rd(),rWr;(function(t){t.method="textDocument/declaration",t.messageDirection=tWr.MessageDirection.clientToServer,t.type=new tWr.ProtocolRequestType(t.method)})(rWr||(wUe.DeclarationRequest=rWr={}))});var sWr=I(RUe=>{"use strict";p();Object.defineProperty(RUe,"__esModule",{value:!0});RUe.SelectionRangeRequest=void 0;var iWr=Rd(),oWr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=iWr.MessageDirection.clientToServer,t.type=new iWr.ProtocolRequestType(t.method)})(oWr||(RUe.SelectionRangeRequest=oWr={}))});var uWr=I(mU=>{"use strict";p();Object.defineProperty(mU,"__esModule",{value:!0});mU.WorkDoneProgressCancelNotification=mU.WorkDoneProgressCreateRequest=mU.WorkDoneProgress=void 0;var Kgo=RW(),PUe=Rd(),aWr;(function(t){t.type=new Kgo.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(aWr||(mU.WorkDoneProgress=aWr={}));var cWr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=PUe.MessageDirection.serverToClient,t.type=new PUe.ProtocolRequestType(t.method)})(cWr||(mU.WorkDoneProgressCreateRequest=cWr={}));var lWr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=PUe.MessageDirection.clientToServer,t.type=new PUe.ProtocolNotificationType(t.method)})(lWr||(mU.WorkDoneProgressCancelNotification=lWr={}))});var hWr=I(gU=>{"use strict";p();Object.defineProperty(gU,"__esModule",{value:!0});gU.CallHierarchyOutgoingCallsRequest=gU.CallHierarchyIncomingCallsRequest=gU.CallHierarchyPrepareRequest=void 0;var Woe=Rd(),dWr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Woe.MessageDirection.clientToServer,t.type=new Woe.ProtocolRequestType(t.method)})(dWr||(gU.CallHierarchyPrepareRequest=dWr={}));var fWr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Woe.MessageDirection.clientToServer,t.type=new Woe.ProtocolRequestType(t.method)})(fWr||(gU.CallHierarchyIncomingCallsRequest=fWr={}));var pWr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Woe.MessageDirection.clientToServer,t.type=new Woe.ProtocolRequestType(t.method)})(pWr||(gU.CallHierarchyOutgoingCallsRequest=pWr={}))});var _Wr=I(oC=>{"use strict";p();Object.defineProperty(oC,"__esModule",{value:!0});oC.SemanticTokensRefreshRequest=oC.SemanticTokensRangeRequest=oC.SemanticTokensDeltaRequest=oC.SemanticTokensRequest=oC.SemanticTokensRegistrationType=oC.TokenFormat=void 0;var lL=Rd(),mWr;(function(t){t.Relative="relative"})(mWr||(oC.TokenFormat=mWr={}));var FCe;(function(t){t.method="textDocument/semanticTokens",t.type=new lL.RegistrationType(t.method)})(FCe||(oC.SemanticTokensRegistrationType=FCe={}));var gWr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=lL.MessageDirection.clientToServer,t.type=new lL.ProtocolRequestType(t.method),t.registrationMethod=FCe.method})(gWr||(oC.SemanticTokensRequest=gWr={}));var AWr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=lL.MessageDirection.clientToServer,t.type=new lL.ProtocolRequestType(t.method),t.registrationMethod=FCe.method})(AWr||(oC.SemanticTokensDeltaRequest=AWr={}));var yWr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=lL.MessageDirection.clientToServer,t.type=new lL.ProtocolRequestType(t.method),t.registrationMethod=FCe.method})(yWr||(oC.SemanticTokensRangeRequest=yWr={}));var EWr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=lL.MessageDirection.serverToClient,t.type=new lL.ProtocolRequestType0(t.method)})(EWr||(oC.SemanticTokensRefreshRequest=EWr={}))});var bWr=I(kUe=>{"use strict";p();Object.defineProperty(kUe,"__esModule",{value:!0});kUe.ShowDocumentRequest=void 0;var vWr=Rd(),CWr;(function(t){t.method="window/showDocument",t.messageDirection=vWr.MessageDirection.serverToClient,t.type=new vWr.ProtocolRequestType(t.method)})(CWr||(kUe.ShowDocumentRequest=CWr={}))});var IWr=I(DUe=>{"use strict";p();Object.defineProperty(DUe,"__esModule",{value:!0});DUe.LinkedEditingRangeRequest=void 0;var SWr=Rd(),TWr;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=SWr.MessageDirection.clientToServer,t.type=new SWr.ProtocolRequestType(t.method)})(TWr||(DUe.LinkedEditingRangeRequest=TWr={}))});var MWr=I(My=>{"use strict";p();Object.defineProperty(My,"__esModule",{value:!0});My.WillDeleteFilesRequest=My.DidDeleteFilesNotification=My.DidRenameFilesNotification=My.WillRenameFilesRequest=My.DidCreateFilesNotification=My.WillCreateFilesRequest=My.FileOperationPatternKind=void 0;var GI=Rd(),xWr;(function(t){t.file="file",t.folder="folder"})(xWr||(My.FileOperationPatternKind=xWr={}));var wWr;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=GI.MessageDirection.clientToServer,t.type=new GI.ProtocolRequestType(t.method)})(wWr||(My.WillCreateFilesRequest=wWr={}));var RWr;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=GI.MessageDirection.clientToServer,t.type=new GI.ProtocolNotificationType(t.method)})(RWr||(My.DidCreateFilesNotification=RWr={}));var PWr;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=GI.MessageDirection.clientToServer,t.type=new GI.ProtocolRequestType(t.method)})(PWr||(My.WillRenameFilesRequest=PWr={}));var kWr;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=GI.MessageDirection.clientToServer,t.type=new GI.ProtocolNotificationType(t.method)})(kWr||(My.DidRenameFilesNotification=kWr={}));var DWr;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=GI.MessageDirection.clientToServer,t.type=new GI.ProtocolNotificationType(t.method)})(DWr||(My.DidDeleteFilesNotification=DWr={}));var NWr;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=GI.MessageDirection.clientToServer,t.type=new GI.ProtocolRequestType(t.method)})(NWr||(My.WillDeleteFilesRequest=NWr={}))});var UWr=I(AU=>{"use strict";p();Object.defineProperty(AU,"__esModule",{value:!0});AU.MonikerRequest=AU.MonikerKind=AU.UniquenessLevel=void 0;var OWr=Rd(),BWr;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(BWr||(AU.UniquenessLevel=BWr={}));var LWr;(function(t){t.$import="import",t.$export="export",t.local="local"})(LWr||(AU.MonikerKind=LWr={}));var FWr;(function(t){t.method="textDocument/moniker",t.messageDirection=OWr.MessageDirection.clientToServer,t.type=new OWr.ProtocolRequestType(t.method)})(FWr||(AU.MonikerRequest=FWr={}))});var HWr=I(yU=>{"use strict";p();Object.defineProperty(yU,"__esModule",{value:!0});yU.TypeHierarchySubtypesRequest=yU.TypeHierarchySupertypesRequest=yU.TypeHierarchyPrepareRequest=void 0;var zoe=Rd(),QWr;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=zoe.MessageDirection.clientToServer,t.type=new zoe.ProtocolRequestType(t.method)})(QWr||(yU.TypeHierarchyPrepareRequest=QWr={}));var qWr;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=zoe.MessageDirection.clientToServer,t.type=new zoe.ProtocolRequestType(t.method)})(qWr||(yU.TypeHierarchySupertypesRequest=qWr={}));var jWr;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=zoe.MessageDirection.clientToServer,t.type=new zoe.ProtocolRequestType(t.method)})(jWr||(yU.TypeHierarchySubtypesRequest=jWr={}))});var VWr=I(Yoe=>{"use strict";p();Object.defineProperty(Yoe,"__esModule",{value:!0});Yoe.InlineValueRefreshRequest=Yoe.InlineValueRequest=void 0;var NUe=Rd(),GWr;(function(t){t.method="textDocument/inlineValue",t.messageDirection=NUe.MessageDirection.clientToServer,t.type=new NUe.ProtocolRequestType(t.method)})(GWr||(Yoe.InlineValueRequest=GWr={}));var $Wr;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=NUe.MessageDirection.serverToClient,t.type=new NUe.ProtocolRequestType0(t.method)})($Wr||(Yoe.InlineValueRefreshRequest=$Wr={}))});var KWr=I(EU=>{"use strict";p();Object.defineProperty(EU,"__esModule",{value:!0});EU.InlayHintRefreshRequest=EU.InlayHintResolveRequest=EU.InlayHintRequest=void 0;var Koe=Rd(),WWr;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Koe.MessageDirection.clientToServer,t.type=new Koe.ProtocolRequestType(t.method)})(WWr||(EU.InlayHintRequest=WWr={}));var zWr;(function(t){t.method="inlayHint/resolve",t.messageDirection=Koe.MessageDirection.clientToServer,t.type=new Koe.ProtocolRequestType(t.method)})(zWr||(EU.InlayHintResolveRequest=zWr={}));var YWr;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Koe.MessageDirection.serverToClient,t.type=new Koe.ProtocolRequestType0(t.method)})(YWr||(EU.InlayHintRefreshRequest=YWr={}))});var nzr=I($I=>{"use strict";p();Object.defineProperty($I,"__esModule",{value:!0});$I.DiagnosticRefreshRequest=$I.WorkspaceDiagnosticRequest=$I.DocumentDiagnosticRequest=$I.DocumentDiagnosticReportKind=$I.DiagnosticServerCancellationData=void 0;var rzr=RW(),Jgo=vUe(),Joe=Rd(),JWr;(function(t){function e(r){let n=r;return n&&Jgo.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})(JWr||($I.DiagnosticServerCancellationData=JWr={}));var ZWr;(function(t){t.Full="full",t.Unchanged="unchanged"})(ZWr||($I.DocumentDiagnosticReportKind=ZWr={}));var XWr;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Joe.MessageDirection.clientToServer,t.type=new Joe.ProtocolRequestType(t.method),t.partialResult=new rzr.ProgressType})(XWr||($I.DocumentDiagnosticRequest=XWr={}));var ezr;(function(t){t.method="workspace/diagnostic",t.messageDirection=Joe.MessageDirection.clientToServer,t.type=new Joe.ProtocolRequestType(t.method),t.partialResult=new rzr.ProgressType})(ezr||($I.WorkspaceDiagnosticRequest=ezr={}));var tzr;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Joe.MessageDirection.serverToClient,t.type=new Joe.ProtocolRequestType0(t.method)})(tzr||($I.DiagnosticRefreshRequest=tzr={}))});var uzr=I(Qf=>{"use strict";p();Object.defineProperty(Qf,"__esModule",{value:!0});Qf.DidCloseNotebookDocumentNotification=Qf.DidSaveNotebookDocumentNotification=Qf.DidChangeNotebookDocumentNotification=Qf.NotebookCellArrayChange=Qf.DidOpenNotebookDocumentNotification=Qf.NotebookDocumentSyncRegistrationType=Qf.NotebookDocument=Qf.NotebookCell=Qf.ExecutionSummary=Qf.NotebookCellKind=void 0;var UCe=LCe(),qP=vUe(),JN=Rd(),G2t;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(G2t||(Qf.NotebookCellKind=G2t={}));var $2t;(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 qP.objectLiteral(s)&&UCe.uinteger.is(s.executionOrder)&&(s.success===void 0||qP.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})($2t||(Qf.ExecutionSummary=$2t={}));var MUe;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return qP.objectLiteral(c)&&G2t.is(c.kind)&&UCe.DocumentUri.is(c.document)&&(c.metadata===void 0||qP.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)&&!$2t.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(OUe,"__esModule",{value:!0});OUe.InlineCompletionRequest=void 0;var dzr=Rd(),fzr;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=dzr.MessageDirection.clientToServer,t.type=new dzr.ProtocolRequestType(t.method)})(fzr||(OUe.InlineCompletionRequest=fzr={}))});var IYr=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=Rd(),hzr=LCe(),H0=vUe(),Zgo=UVr();Object.defineProperty(Ve,"ImplementationRequest",{enumerable:!0,get:a(function(){return Zgo.ImplementationRequest},"get")});var Xgo=jVr();Object.defineProperty(Ve,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return Xgo.TypeDefinitionRequest},"get")});var CYr=$Vr();Object.defineProperty(Ve,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return CYr.WorkspaceFoldersRequest},"get")});Object.defineProperty(Ve,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return CYr.DidChangeWorkspaceFoldersNotification},"get")});var eAo=zVr();Object.defineProperty(Ve,"ConfigurationRequest",{enumerable:!0,get:a(function(){return eAo.ConfigurationRequest},"get")});var bYr=JVr();Object.defineProperty(Ve,"DocumentColorRequest",{enumerable:!0,get:a(function(){return bYr.DocumentColorRequest},"get")});Object.defineProperty(Ve,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return bYr.ColorPresentationRequest},"get")});var SYr=eWr();Object.defineProperty(Ve,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return SYr.FoldingRangeRequest},"get")});Object.defineProperty(Ve,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return SYr.FoldingRangeRefreshRequest},"get")});var tAo=nWr();Object.defineProperty(Ve,"DeclarationRequest",{enumerable:!0,get:a(function(){return tAo.DeclarationRequest},"get")});var rAo=sWr();Object.defineProperty(Ve,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return rAo.SelectionRangeRequest},"get")});var K2t=uWr();Object.defineProperty(Ve,"WorkDoneProgress",{enumerable:!0,get:a(function(){return K2t.WorkDoneProgress},"get")});Object.defineProperty(Ve,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return K2t.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Ve,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return K2t.WorkDoneProgressCancelNotification},"get")});var J2t=hWr();Object.defineProperty(Ve,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return J2t.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return J2t.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return J2t.CallHierarchyPrepareRequest},"get")});var Xoe=_Wr();Object.defineProperty(Ve,"TokenFormat",{enumerable:!0,get:a(function(){return Xoe.TokenFormat},"get")});Object.defineProperty(Ve,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return Xoe.SemanticTokensRequest},"get")});Object.defineProperty(Ve,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return Xoe.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return Xoe.SemanticTokensRangeRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return Xoe.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return Xoe.SemanticTokensRegistrationType},"get")});var nAo=bWr();Object.defineProperty(Ve,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return nAo.ShowDocumentRequest},"get")});var iAo=IWr();Object.defineProperty(Ve,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return iAo.LinkedEditingRangeRequest},"get")});var PW=MWr();Object.defineProperty(Ve,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return PW.FileOperationPatternKind},"get")});Object.defineProperty(Ve,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return PW.DidCreateFilesNotification},"get")});Object.defineProperty(Ve,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return PW.WillCreateFilesRequest},"get")});Object.defineProperty(Ve,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return PW.DidRenameFilesNotification},"get")});Object.defineProperty(Ve,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return PW.WillRenameFilesRequest},"get")});Object.defineProperty(Ve,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return PW.DidDeleteFilesNotification},"get")});Object.defineProperty(Ve,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return PW.WillDeleteFilesRequest},"get")});var Z2t=UWr();Object.defineProperty(Ve,"UniquenessLevel",{enumerable:!0,get:a(function(){return Z2t.UniquenessLevel},"get")});Object.defineProperty(Ve,"MonikerKind",{enumerable:!0,get:a(function(){return Z2t.MonikerKind},"get")});Object.defineProperty(Ve,"MonikerRequest",{enumerable:!0,get:a(function(){return Z2t.MonikerRequest},"get")});var X2t=HWr();Object.defineProperty(Ve,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return X2t.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return X2t.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return X2t.TypeHierarchySupertypesRequest},"get")});var TYr=VWr();Object.defineProperty(Ve,"InlineValueRequest",{enumerable:!0,get:a(function(){return TYr.InlineValueRequest},"get")});Object.defineProperty(Ve,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return TYr.InlineValueRefreshRequest},"get")});var eDt=KWr();Object.defineProperty(Ve,"InlayHintRequest",{enumerable:!0,get:a(function(){return eDt.InlayHintRequest},"get")});Object.defineProperty(Ve,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return eDt.InlayHintResolveRequest},"get")});Object.defineProperty(Ve,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return eDt.InlayHintRefreshRequest},"get")});var QCe=nzr();Object.defineProperty(Ve,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return QCe.DiagnosticServerCancellationData},"get")});Object.defineProperty(Ve,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return QCe.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Ve,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return QCe.DocumentDiagnosticRequest},"get")});Object.defineProperty(Ve,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return QCe.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Ve,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return QCe.DiagnosticRefreshRequest},"get")});var ZN=uzr();Object.defineProperty(Ve,"NotebookCellKind",{enumerable:!0,get:a(function(){return ZN.NotebookCellKind},"get")});Object.defineProperty(Ve,"ExecutionSummary",{enumerable:!0,get:a(function(){return ZN.ExecutionSummary},"get")});Object.defineProperty(Ve,"NotebookCell",{enumerable:!0,get:a(function(){return ZN.NotebookCell},"get")});Object.defineProperty(Ve,"NotebookDocument",{enumerable:!0,get:a(function(){return ZN.NotebookDocument},"get")});Object.defineProperty(Ve,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return ZN.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Ve,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return ZN.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return ZN.NotebookCellArrayChange},"get")});Object.defineProperty(Ve,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return ZN.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return ZN.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return ZN.DidCloseNotebookDocumentNotification},"get")});var oAo=pzr();Object.defineProperty(Ve,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return oAo.InlineCompletionRequest},"get")});var V2t;(function(t){function e(r){let n=r;return H0.string(n)||H0.string(n.language)||H0.string(n.scheme)||H0.string(n.pattern)}a(e,"is"),t.is=e})(V2t||(Ve.TextDocumentFilter=V2t={}));var W2t;(function(t){function e(r){let n=r;return H0.objectLiteral(n)&&(H0.string(n.notebookType)||H0.string(n.scheme)||H0.string(n.pattern))}a(e,"is"),t.is=e})(W2t||(Ve.NotebookDocumentFilter=W2t={}));var z2t;(function(t){function e(r){let n=r;return H0.objectLiteral(n)&&(H0.string(n.notebook)||W2t.is(n.notebook))&&(n.language===void 0||H0.string(n.language))}a(e,"is"),t.is=e})(z2t||(Ve.NotebookCellTextDocumentFilter=z2t={}));var Y2t;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!H0.string(n)&&!V2t.is(n)&&!z2t.is(n))return!1;return!0}a(e,"is"),t.is=e})(Y2t||(Ve.DocumentSelector=Y2t={}));var mzr;(function(t){t.method="client/registerCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(mzr||(Ve.RegistrationRequest=mzr={}));var gzr;(function(t){t.method="client/unregisterCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(gzr||(Ve.UnregistrationRequest=gzr={}));var Azr;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(Azr||(Ve.ResourceOperationKind=Azr={}));var yzr;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(yzr||(Ve.FailureHandlingKind=yzr={}));var Ezr;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(Ezr||(Ve.PositionEncodingKind=Ezr={}));var _zr;(function(t){function e(r){let n=r;return n&&H0.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})(_zr||(Ve.StaticRegistrationOptions=_zr={}));var vzr;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||Y2t.is(n.documentSelector))}a(e,"is"),t.is=e})(vzr||(Ve.TextDocumentRegistrationOptions=vzr={}));var Czr;(function(t){function e(n){let o=n;return H0.objectLiteral(o)&&(o.workDoneProgress===void 0||H0.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&H0.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(Czr||(Ve.WorkDoneProgressOptions=Czr={}));var bzr;(function(t){t.method="initialize",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(bzr||(Ve.InitializeRequest=bzr={}));var Szr;(function(t){t.unknownProtocolVersion=1})(Szr||(Ve.InitializeErrorCodes=Szr={}));var Tzr;(function(t){t.method="initialized",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(Tzr||(Ve.InitializedNotification=Tzr={}));var Izr;(function(t){t.method="shutdown",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType0(t.method)})(Izr||(Ve.ShutdownRequest=Izr={}));var xzr;(function(t){t.method="exit",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType0(t.method)})(xzr||(Ve.ExitNotification=xzr={}));var wzr;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(wzr||(Ve.DidChangeConfigurationNotification=wzr={}));var Rzr;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(Rzr||(Ve.MessageType=Rzr={}));var Pzr;(function(t){t.method="window/showMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(Pzr||(Ve.ShowMessageNotification=Pzr={}));var kzr;(function(t){t.method="window/showMessageRequest",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(kzr||(Ve.ShowMessageRequest=kzr={}));var Dzr;(function(t){t.method="window/logMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(Dzr||(Ve.LogMessageNotification=Dzr={}));var Nzr;(function(t){t.method="telemetry/event",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(Nzr||(Ve.TelemetryEventNotification=Nzr={}));var Mzr;(function(t){t.None=0,t.Full=1,t.Incremental=2})(Mzr||(Ve.TextDocumentSyncKind=Mzr={}));var Ozr;(function(t){t.method="textDocument/didOpen",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(Ozr||(Ve.DidOpenTextDocumentNotification=Ozr={}));var Bzr;(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})(Bzr||(Ve.TextDocumentContentChangeEvent=Bzr={}));var Lzr;(function(t){t.method="textDocument/didChange",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(Lzr||(Ve.DidChangeTextDocumentNotification=Lzr={}));var Fzr;(function(t){t.method="textDocument/didClose",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(Fzr||(Ve.DidCloseTextDocumentNotification=Fzr={}));var Uzr;(function(t){t.method="textDocument/didSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(Uzr||(Ve.DidSaveTextDocumentNotification=Uzr={}));var Qzr;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(Qzr||(Ve.TextDocumentSaveReason=Qzr={}));var qzr;(function(t){t.method="textDocument/willSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(qzr||(Ve.WillSaveTextDocumentNotification=qzr={}));var jzr;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(jzr||(Ve.WillSaveTextDocumentWaitUntilRequest=jzr={}));var Hzr;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(Hzr||(Ve.DidChangeWatchedFilesNotification=Hzr={}));var Gzr;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Gzr||(Ve.FileChangeType=Gzr={}));var $zr;(function(t){function e(r){let n=r;return H0.objectLiteral(n)&&(hzr.URI.is(n.baseUri)||hzr.WorkspaceFolder.is(n.baseUri))&&H0.string(n.pattern)}a(e,"is"),t.is=e})($zr||(Ve.RelativePattern=$zr={}));var Vzr;(function(t){t.Create=1,t.Change=2,t.Delete=4})(Vzr||(Ve.WatchKind=Vzr={}));var Wzr;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(Wzr||(Ve.PublishDiagnosticsNotification=Wzr={}));var zzr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(zzr||(Ve.CompletionTriggerKind=zzr={}));var Yzr;(function(t){t.method="textDocument/completion",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(Yzr||(Ve.CompletionRequest=Yzr={}));var Kzr;(function(t){t.method="completionItem/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(Kzr||(Ve.CompletionResolveRequest=Kzr={}));var Jzr;(function(t){t.method="textDocument/hover",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(Jzr||(Ve.HoverRequest=Jzr={}));var Zzr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Zzr||(Ve.SignatureHelpTriggerKind=Zzr={}));var Xzr;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(Xzr||(Ve.SignatureHelpRequest=Xzr={}));var eYr;(function(t){t.method="textDocument/definition",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(eYr||(Ve.DefinitionRequest=eYr={}));var tYr;(function(t){t.method="textDocument/references",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(tYr||(Ve.ReferencesRequest=tYr={}));var rYr;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(rYr||(Ve.DocumentHighlightRequest=rYr={}));var nYr;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(nYr||(Ve.DocumentSymbolRequest=nYr={}));var iYr;(function(t){t.method="textDocument/codeAction",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(iYr||(Ve.CodeActionRequest=iYr={}));var oYr;(function(t){t.method="codeAction/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(oYr||(Ve.CodeActionResolveRequest=oYr={}));var sYr;(function(t){t.method="workspace/symbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(sYr||(Ve.WorkspaceSymbolRequest=sYr={}));var aYr;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(aYr||(Ve.WorkspaceSymbolResolveRequest=aYr={}));var cYr;(function(t){t.method="textDocument/codeLens",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(cYr||(Ve.CodeLensRequest=cYr={}));var lYr;(function(t){t.method="codeLens/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(lYr||(Ve.CodeLensResolveRequest=lYr={}));var uYr;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType0(t.method)})(uYr||(Ve.CodeLensRefreshRequest=uYr={}));var dYr;(function(t){t.method="textDocument/documentLink",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(dYr||(Ve.DocumentLinkRequest=dYr={}));var fYr;(function(t){t.method="documentLink/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(fYr||(Ve.DocumentLinkResolveRequest=fYr={}));var pYr;(function(t){t.method="textDocument/formatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(pYr||(Ve.DocumentFormattingRequest=pYr={}));var hYr;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(hYr||(Ve.DocumentRangeFormattingRequest=hYr={}));var mYr;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(mYr||(Ve.DocumentRangesFormattingRequest=mYr={}));var gYr;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(gYr||(Ve.DocumentOnTypeFormattingRequest=gYr={}));var AYr;(function(t){t.Identifier=1})(AYr||(Ve.PrepareSupportDefaultBehavior=AYr={}));var yYr;(function(t){t.method="textDocument/rename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(yYr||(Ve.RenameRequest=yYr={}));var EYr;(function(t){t.method="textDocument/prepareRename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(EYr||(Ve.PrepareRenameRequest=EYr={}));var _Yr;(function(t){t.method="workspace/executeCommand",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(_Yr||(Ve.ExecuteCommandRequest=_Yr={}));var vYr;(function(t){t.method="workspace/applyEdit",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType("workspace/applyEdit")})(vYr||(Ve.ApplyWorkspaceEditRequest=vYr={}))});var wYr=I(BUe=>{"use strict";p();Object.defineProperty(BUe,"__esModule",{value:!0});BUe.createProtocolConnection=void 0;var xYr=RW();function sAo(t,e,r,n){return xYr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,xYr.createMessageConnection)(t,e,r,n)}a(sAo,"createProtocolConnection");BUe.createProtocolConnection=sAo});var PYr=I(sC=>{"use strict";p();var aAo=sC&&sC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LUe=sC&&sC.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&aAo(e,t,r)};Object.defineProperty(sC,"__esModule",{value:!0});sC.LSPErrorCodes=sC.createProtocolConnection=void 0;LUe(RW(),sC);LUe(LCe(),sC);LUe(Rd(),sC);LUe(IYr(),sC);var cAo=wYr();Object.defineProperty(sC,"createProtocolConnection",{enumerable:!0,get:a(function(){return cAo.createProtocolConnection},"get")});var RYr;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(RYr||(sC.LSPErrorCodes=RYr={}))});var ri=I(XN=>{"use strict";p();var lAo=XN&&XN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kYr=XN&&XN.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lAo(e,t,r)};Object.defineProperty(XN,"__esModule",{value:!0});XN.createProtocolConnection=void 0;var uAo=F2t();kYr(F2t(),XN);kYr(PYr(),XN);function dAo(t,e,r,n){return(0,uAo.createMessageConnection)(t,e,r,n)}a(dAo,"createProtocolConnection");XN.createProtocolConnection=dAo});var a5t=I(pje=>{"use strict";p();Object.defineProperty(pje,"__esModule",{value:!0});pje.state=void 0;pje.state={instrumenterImplementation:void 0}});var cce=I((QBt,Orn)=>{p();var pHe=require("buffer"),BM=pHe.Buffer;function Mrn(t,e){for(var r in t)e[r]=t[r]}a(Mrn,"copyProps");BM.from&&BM.alloc&&BM.allocUnsafe&&BM.allocUnsafeSlow?Orn.exports=pHe:(Mrn(pHe,QBt),QBt.Buffer=uY);function uY(t,e,r){return BM(t,e,r)}a(uY,"SafeBuffer");uY.prototype=Object.create(BM.prototype);Mrn(BM,uY);uY.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return BM(t,e,r)};uY.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=BM(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};uY.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return BM(t)};uY.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return pHe.SlowBuffer(t)}});var qBt=I((HYl,Brn)=>{p();var hHe=cce().Buffer,ISo=require("stream"),xSo=require("util");function mHe(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=hHe.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=hHe.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(mHe,"DataStream");xSo.inherits(mHe,ISo);mHe.prototype.write=a(function(e){this.buffer=hHe.concat([this.buffer,hHe.from(e)]),this.emit("data",e)},"write");mHe.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");Brn.exports=mHe});var Frn=I((VYl,Lrn)=>{"use strict";p();function jBt(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(jBt,"getParamSize");var wSo={ES256:jBt(256),ES384:jBt(384),ES512:jBt(521)};function RSo(t){var e=wSo[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(RSo,"getParamBytesForAlg");Lrn.exports=RSo});var $rn=I((YYl,Grn)=>{"use strict";p();var gHe=cce().Buffer,Qrn=Frn(),AHe=128,qrn=0,PSo=32,kSo=16,DSo=2,jrn=kSo|PSo|qrn<<6,yHe=DSo|qrn<<6;function NSo(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(NSo,"base64Url");function Hrn(t){if(gHe.isBuffer(t))return t;if(typeof t=="string")return gHe.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(Hrn,"signatureAsBuffer");function MSo(t,e){t=Hrn(t);var r=Qrn(e),n=r+1,o=t.length,s=0;if(t[s++]!==jrn)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(AHe|1)&&(c=t[s++]),o-s=AHe;return o&&--n,n}a(Urn,"countPadding");function OSo(t,e){t=Hrn(t);var r=Qrn(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=Urn(t,0,r),s=Urn(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var LSe=require("buffer").Buffer,HBt=require("buffer").SlowBuffer;Vrn.exports=EHe;function EHe(t,e){if(!LSe.isBuffer(t)||!LSe.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var uce=cce().Buffer,Cx=require("crypto"),Yrn=$rn(),zrn=require("util"),FSo=`"%s" is not a valid algorithm. +`&&oe++}ye&&Me.length>0&&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. Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,FSe="secret must be a string or buffer",lce="key must be a string or a buffer",USo="key must be a string, a buffer or an object",$Bt=typeof Cx.createPublicKey=="function";$Bt&&(lce+=" or a KeyObject",FSe+="or a KeyObject");function Krn(t){if(!uce.isBuffer(t)&&typeof t!="string"&&(!$Bt||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw dk(lce)}a(Krn,"checkIsPublicKey");function Jrn(t){if(!uce.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw dk(USo)}a(Jrn,"checkIsPrivateKey");function QSo(t){if(!uce.isBuffer(t)){if(typeof t=="string")return t;if(!$Bt||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw dk(FSe)}}a(QSo,"checkIsSecretKey");function VBt(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(VBt,"fromBase64");function Zrn(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var KSo=require("buffer").Buffer;nnn.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||KSo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var lnn=I((aKl,cnn)=>{p();var JSo=cce().Buffer,inn=qBt(),ZSo=WBt(),XSo=require("stream"),onn=zBt(),YBt=require("util");function snn(t,e){return JSo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(snn,"base64url");function eTo(t,e,r){r=r||"utf8";var n=snn(onn(t),"binary"),o=snn(onn(e),r);return YBt.format("%s.%s",n,o)}a(eTo,"jwsSecuredInput");function ann(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=ZSo(e.alg),c=eTo(e,r,o),l=s.sign(c,n);return YBt.format("%s.%s",c,l)}a(ann,"jwsSign");function _He(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 inn(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new inn(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(_He,"SignStream");YBt.inherits(_He,XSo);_He.prototype.sign=a(function(){try{var e=ann({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");_He.sign=ann;cnn.exports=_He});var Enn=I((uKl,ynn)=>{p();var dnn=cce().Buffer,unn=qBt(),tTo=WBt(),rTo=require("stream"),fnn=zBt(),nTo=require("util"),iTo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function oTo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(oTo,"isObject");function sTo(t){if(oTo(t))return t;try{return JSON.parse(t)}catch{return}}a(sTo,"safeJsonParse");function pnn(t){var e=t.split(".",1)[0];return sTo(dnn.from(e,"base64").toString("binary"))}a(pnn,"headerFromJWS");function aTo(t){return t.split(".",2).join(".")}a(aTo,"securedInputFromJWS");function hnn(t){return t.split(".")[2]}a(hnn,"signatureFromJWS");function cTo(t,e){e=e||"utf8";var r=t.split(".")[1];return dnn.from(r,"base64").toString(e)}a(cTo,"payloadFromJWS");function mnn(t){return iTo.test(t)&&!!pnn(t)}a(mnn,"isValidJws");function gnn(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=fnn(t);var o=hnn(t),s=aTo(t),c=tTo(e);return c.verify(s,o,r)}a(gnn,"jwsVerify");function Ann(t,e){if(e=e||{},t=fnn(t),!mnn(t))return null;var r=pnn(t);if(!r)return null;var n=cTo(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:hnn(t)}}a(Ann,"jwsDecode");function dce(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 unn(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new unn(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(dce,"VerifyStream");nTo.inherits(dce,rTo);dce.prototype.verify=a(function(){try{var e=gnn(this.signature.buffer,this.algorithm,this.key.buffer),r=Ann(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");dce.decode=Ann;dce.isValid=mnn;dce.verify=gnn;ynn.exports=dce});var CHe=I(F7=>{p();var _nn=lnn(),vHe=Enn(),lTo=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];F7.ALGORITHMS=lTo;F7.sign=_nn.sign;F7.verify=vHe.verify;F7.decode=vHe.decode;F7.isValid=vHe.isValid;F7.createSign=a(function(e){return new _nn(e)},"createSign");F7.createVerify=a(function(e){return new vHe(e)},"createVerify")});var KBt=I((gKl,vnn)=>{p();var uTo=CHe();vnn.exports=function(t,e){e=e||{};var r=uTo.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 QSe=I((yKl,Cnn)=>{p();var bHe=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");bHe.prototype=Object.create(Error.prototype);bHe.prototype.constructor=bHe;Cnn.exports=bHe});var JBt=I((vKl,Snn)=>{p();var bnn=QSe(),SHe=a(function(t,e){bnn.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");SHe.prototype=Object.create(bnn.prototype);SHe.prototype.constructor=SHe;Snn.exports=SHe});var ZBt=I((SKl,Inn)=>{p();var Tnn=QSe(),THe=a(function(t,e){Tnn.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");THe.prototype=Object.create(Tnn.prototype);THe.prototype.constructor=THe;Inn.exports=THe});var XBt=I((xKl,xnn)=>{p();var fce=1e3,pce=fce*60,hce=pce*60,dY=hce*24,dTo=dY*7,fTo=dY*365.25;xnn.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return pTo(t);if(r==="number"&&isFinite(t))return e.long?mTo(t):hTo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function pTo(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*fTo;case"weeks":case"week":case"w":return r*dTo;case"days":case"day":case"d":return r*dY;case"hours":case"hour":case"hrs":case"hr":case"h":return r*hce;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*fce;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(pTo,"parse");function hTo(t){var e=Math.abs(t);return e>=dY?Math.round(t/dY)+"d":e>=hce?Math.round(t/hce)+"h":e>=pce?Math.round(t/pce)+"m":e>=fce?Math.round(t/fce)+"s":t+"ms"}a(hTo,"fmtShort");function mTo(t){var e=Math.abs(t);return e>=dY?IHe(t,e,dY,"day"):e>=hce?IHe(t,e,hce,"hour"):e>=pce?IHe(t,e,pce,"minute"):e>=fce?IHe(t,e,fce,"second"):t+" ms"}a(mTo,"fmtLong");function IHe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(IHe,"plural")});var eLt=I((PKl,wnn)=>{p();var gTo=XBt();wnn.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=gTo(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var mce=I((DKl,Rnn)=>{"use strict";p();var ATo="2.0.0",yTo=Number.MAX_SAFE_INTEGER||9007199254740991,ETo=16,_To=250,vTo=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Rnn.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:ETo,MAX_SAFE_BUILD_LENGTH:_To,MAX_SAFE_INTEGER:yTo,RELEASE_TYPES:vTo,SEMVER_SPEC_VERSION:ATo,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var qSe=I((MKl,Pnn)=>{"use strict";p();var CTo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Pnn.exports=CTo});var gce=I((LM,knn)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:tLt,MAX_SAFE_BUILD_LENGTH:bTo,MAX_LENGTH:STo}=mce(),TTo=qSe();LM=knn.exports={};var ITo=LM.re=[],xTo=LM.safeRe=[],Sn=LM.src=[],wTo=LM.safeSrc=[],Tn=LM.t={},RTo=0,rLt="[a-zA-Z0-9-]",PTo=[["\\s",1],["\\d",STo],[rLt,bTo]],kTo=a(t=>{for(let[e,r]of PTo)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Lo=a((t,e,r)=>{let n=kTo(e),o=RTo++;TTo(t,o,e),Tn[t]=o,Sn[o]=e,wTo[o]=n,ITo[o]=new RegExp(e,r?"g":void 0),xTo[o]=new RegExp(n,r?"g":void 0)},"createToken");Lo("NUMERICIDENTIFIER","0|[1-9]\\d*");Lo("NUMERICIDENTIFIERLOOSE","\\d+");Lo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${rLt}*`);Lo("MAINVERSION",`(${Sn[Tn.NUMERICIDENTIFIER]})\\.(${Sn[Tn.NUMERICIDENTIFIER]})\\.(${Sn[Tn.NUMERICIDENTIFIER]})`);Lo("MAINVERSIONLOOSE",`(${Sn[Tn.NUMERICIDENTIFIERLOOSE]})\\.(${Sn[Tn.NUMERICIDENTIFIERLOOSE]})\\.(${Sn[Tn.NUMERICIDENTIFIERLOOSE]})`);Lo("PRERELEASEIDENTIFIER",`(?:${Sn[Tn.NONNUMERICIDENTIFIER]}|${Sn[Tn.NUMERICIDENTIFIER]})`);Lo("PRERELEASEIDENTIFIERLOOSE",`(?:${Sn[Tn.NONNUMERICIDENTIFIER]}|${Sn[Tn.NUMERICIDENTIFIERLOOSE]})`);Lo("PRERELEASE",`(?:-(${Sn[Tn.PRERELEASEIDENTIFIER]}(?:\\.${Sn[Tn.PRERELEASEIDENTIFIER]})*))`);Lo("PRERELEASELOOSE",`(?:-?(${Sn[Tn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Sn[Tn.PRERELEASEIDENTIFIERLOOSE]})*))`);Lo("BUILDIDENTIFIER",`${rLt}+`);Lo("BUILD",`(?:\\+(${Sn[Tn.BUILDIDENTIFIER]}(?:\\.${Sn[Tn.BUILDIDENTIFIER]})*))`);Lo("FULLPLAIN",`v?${Sn[Tn.MAINVERSION]}${Sn[Tn.PRERELEASE]}?${Sn[Tn.BUILD]}?`);Lo("FULL",`^${Sn[Tn.FULLPLAIN]}$`);Lo("LOOSEPLAIN",`[v=\\s]*${Sn[Tn.MAINVERSIONLOOSE]}${Sn[Tn.PRERELEASELOOSE]}?${Sn[Tn.BUILD]}?`);Lo("LOOSE",`^${Sn[Tn.LOOSEPLAIN]}$`);Lo("GTLT","((?:<|>)?=?)");Lo("XRANGEIDENTIFIERLOOSE",`${Sn[Tn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Lo("XRANGEIDENTIFIER",`${Sn[Tn.NUMERICIDENTIFIER]}|x|X|\\*`);Lo("XRANGEPLAIN",`[v=\\s]*(${Sn[Tn.XRANGEIDENTIFIER]})(?:\\.(${Sn[Tn.XRANGEIDENTIFIER]})(?:\\.(${Sn[Tn.XRANGEIDENTIFIER]})(?:${Sn[Tn.PRERELEASE]})?${Sn[Tn.BUILD]}?)?)?`);Lo("XRANGEPLAINLOOSE",`[v=\\s]*(${Sn[Tn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Sn[Tn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Sn[Tn.XRANGEIDENTIFIERLOOSE]})(?:${Sn[Tn.PRERELEASELOOSE]})?${Sn[Tn.BUILD]}?)?)?`);Lo("XRANGE",`^${Sn[Tn.GTLT]}\\s*${Sn[Tn.XRANGEPLAIN]}$`);Lo("XRANGELOOSE",`^${Sn[Tn.GTLT]}\\s*${Sn[Tn.XRANGEPLAINLOOSE]}$`);Lo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${tLt}})(?:\\.(\\d{1,${tLt}}))?(?:\\.(\\d{1,${tLt}}))?`);Lo("COERCE",`${Sn[Tn.COERCEPLAIN]}(?:$|[^\\d])`);Lo("COERCEFULL",Sn[Tn.COERCEPLAIN]+`(?:${Sn[Tn.PRERELEASE]})?(?:${Sn[Tn.BUILD]})?(?:$|[^\\d])`);Lo("COERCERTL",Sn[Tn.COERCE],!0);Lo("COERCERTLFULL",Sn[Tn.COERCEFULL],!0);Lo("LONETILDE","(?:~>?)");Lo("TILDETRIM",`(\\s*)${Sn[Tn.LONETILDE]}\\s+`,!0);LM.tildeTrimReplace="$1~";Lo("TILDE",`^${Sn[Tn.LONETILDE]}${Sn[Tn.XRANGEPLAIN]}$`);Lo("TILDELOOSE",`^${Sn[Tn.LONETILDE]}${Sn[Tn.XRANGEPLAINLOOSE]}$`);Lo("LONECARET","(?:\\^)");Lo("CARETTRIM",`(\\s*)${Sn[Tn.LONECARET]}\\s+`,!0);LM.caretTrimReplace="$1^";Lo("CARET",`^${Sn[Tn.LONECARET]}${Sn[Tn.XRANGEPLAIN]}$`);Lo("CARETLOOSE",`^${Sn[Tn.LONECARET]}${Sn[Tn.XRANGEPLAINLOOSE]}$`);Lo("COMPARATORLOOSE",`^${Sn[Tn.GTLT]}\\s*(${Sn[Tn.LOOSEPLAIN]})$|^$`);Lo("COMPARATOR",`^${Sn[Tn.GTLT]}\\s*(${Sn[Tn.FULLPLAIN]})$|^$`);Lo("COMPARATORTRIM",`(\\s*)${Sn[Tn.GTLT]}\\s*(${Sn[Tn.LOOSEPLAIN]}|${Sn[Tn.XRANGEPLAIN]})`,!0);LM.comparatorTrimReplace="$1$2$3";Lo("HYPHENRANGE",`^\\s*(${Sn[Tn.XRANGEPLAIN]})\\s+-\\s+(${Sn[Tn.XRANGEPLAIN]})\\s*$`);Lo("HYPHENRANGELOOSE",`^\\s*(${Sn[Tn.XRANGEPLAINLOOSE]})\\s+-\\s+(${Sn[Tn.XRANGEPLAINLOOSE]})\\s*$`);Lo("STAR","(<|>)?=?\\s*\\*");Lo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Lo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var xHe=I((FKl,Dnn)=>{"use strict";p();var DTo=Object.freeze({loose:!0}),NTo=Object.freeze({}),MTo=a(t=>t?typeof t!="object"?DTo:t:NTo,"parseOptions");Dnn.exports=MTo});var nLt=I((qKl,Onn)=>{"use strict";p();var Nnn=/^[0-9]+$/,Mnn=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tMnn(e,t),"rcompareIdentifiers");Onn.exports={compareIdentifiers:Mnn,rcompareIdentifiers:OTo}});var pA=I((GKl,Lnn)=>{"use strict";p();var wHe=qSe(),{MAX_LENGTH:Bnn,MAX_SAFE_INTEGER:RHe}=mce(),{safeRe:PHe,t:kHe}=gce(),BTo=xHe(),{compareIdentifiers:iLt}=nLt(),LTo=a((t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;nBnn)throw new TypeError(`version is longer than ${Bnn} characters`);wHe("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?PHe[kHe.LOOSE]:PHe[kHe.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>RHe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>RHe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>RHe||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(wHe("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 iLt(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(wHe("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 iLt(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?PHe[kHe.PRERELEASELOOSE]:PHe[kHe.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]),LTo(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}};Lnn.exports=oLt});var U7=I((WKl,Unn)=>{"use strict";p();var Fnn=pA(),FTo=a((t,e,r=!1)=>{if(t instanceof Fnn)return t;try{return new Fnn(t,e)}catch(n){if(!r)return null;throw n}},"parse");Unn.exports=FTo});var qnn=I((KKl,Qnn)=>{"use strict";p();var UTo=U7(),QTo=a((t,e)=>{let r=UTo(t,e);return r?r.version:null},"valid");Qnn.exports=QTo});var Hnn=I((XKl,jnn)=>{"use strict";p();var qTo=U7(),jTo=a((t,e)=>{let r=qTo(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");jnn.exports=jTo});var Vnn=I((rJl,$nn)=>{"use strict";p();var Gnn=pA(),HTo=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Gnn(t instanceof Gnn?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");$nn.exports=HTo});var Ynn=I((oJl,znn)=>{"use strict";p();var Wnn=U7(),GTo=a((t,e)=>{let r=Wnn(t,null,!0),n=Wnn(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");znn.exports=GTo});var Jnn=I((cJl,Knn)=>{"use strict";p();var $To=pA(),VTo=a((t,e)=>new $To(t,e).major,"major");Knn.exports=VTo});var Xnn=I((dJl,Znn)=>{"use strict";p();var WTo=pA(),zTo=a((t,e)=>new WTo(t,e).minor,"minor");Znn.exports=zTo});var tin=I((hJl,ein)=>{"use strict";p();var YTo=pA(),KTo=a((t,e)=>new YTo(t,e).patch,"patch");ein.exports=KTo});var nin=I((AJl,rin)=>{"use strict";p();var JTo=U7(),ZTo=a((t,e)=>{let r=JTo(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");rin.exports=ZTo});var bx=I((_Jl,oin)=>{"use strict";p();var iin=pA(),XTo=a((t,e,r)=>new iin(t,r).compare(new iin(e,r)),"compare");oin.exports=XTo});var ain=I((bJl,sin)=>{"use strict";p();var eIo=bx(),tIo=a((t,e,r)=>eIo(e,t,r),"rcompare");sin.exports=tIo});var lin=I((IJl,cin)=>{"use strict";p();var rIo=bx(),nIo=a((t,e)=>rIo(t,e,!0),"compareLoose");cin.exports=nIo});var DHe=I((RJl,din)=>{"use strict";p();var uin=pA(),iIo=a((t,e,r)=>{let n=new uin(t,r),o=new uin(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");din.exports=iIo});var pin=I((DJl,fin)=>{"use strict";p();var oIo=DHe(),sIo=a((t,e)=>t.sort((r,n)=>oIo(r,n,e)),"sort");fin.exports=sIo});var min=I((OJl,hin)=>{"use strict";p();var aIo=DHe(),cIo=a((t,e)=>t.sort((r,n)=>aIo(n,r,e)),"rsort");hin.exports=cIo});var jSe=I((FJl,gin)=>{"use strict";p();var lIo=bx(),uIo=a((t,e,r)=>lIo(t,e,r)>0,"gt");gin.exports=uIo});var NHe=I((qJl,Ain)=>{"use strict";p();var dIo=bx(),fIo=a((t,e,r)=>dIo(t,e,r)<0,"lt");Ain.exports=fIo});var sLt=I((GJl,yin)=>{"use strict";p();var pIo=bx(),hIo=a((t,e,r)=>pIo(t,e,r)===0,"eq");yin.exports=hIo});var aLt=I((WJl,Ein)=>{"use strict";p();var mIo=bx(),gIo=a((t,e,r)=>mIo(t,e,r)!==0,"neq");Ein.exports=gIo});var MHe=I((KJl,_in)=>{"use strict";p();var AIo=bx(),yIo=a((t,e,r)=>AIo(t,e,r)>=0,"gte");_in.exports=yIo});var OHe=I((XJl,vin)=>{"use strict";p();var EIo=bx(),_Io=a((t,e,r)=>EIo(t,e,r)<=0,"lte");vin.exports=_Io});var cLt=I((rZl,Cin)=>{"use strict";p();var vIo=sLt(),CIo=aLt(),bIo=jSe(),SIo=MHe(),TIo=NHe(),IIo=OHe(),xIo=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 vIo(t,r,n);case"!=":return CIo(t,r,n);case">":return bIo(t,r,n);case">=":return SIo(t,r,n);case"<":return TIo(t,r,n);case"<=":return IIo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");Cin.exports=xIo});var Sin=I((oZl,bin)=>{"use strict";p();var wIo=pA(),RIo=U7(),{safeRe:BHe,t:LHe}=gce(),PIo=a((t,e)=>{if(t instanceof wIo)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?BHe[LHe.COERCEFULL]:BHe[LHe.COERCE]);else{let u=e.includePrerelease?BHe[LHe.COERCERTLFULL]:BHe[LHe.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 RIo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");bin.exports=PIo});var Iin=I((cZl,Tin)=>{"use strict";p();var kIo=U7(),DIo=mce(),NIo=pA(),MIo=a((t,e,r)=>{if(!DIo.RELEASE_TYPES.includes(e))return null;let n=OIo(t,r);return n&&BIo(n,e)},"truncate"),OIo=a((t,e)=>{let r=t instanceof NIo?t.version:t;return kIo(r,e)},"cloneInputVersion"),BIo=a((t,e)=>{if(LIo(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"),LIo=a(t=>t.startsWith("pre"),"isPrerelease");Tin.exports=MIo});var win=I((dZl,xin)=>{"use strict";p();var lLt=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}};xin.exports=lLt});var Sx=I((hZl,Din)=>{"use strict";p();var FIo=/\s+/g,uLt=class t{static{a(this,"Range")}constructor(e,r){if(r=QIo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof dLt)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(FIo," "),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=>!Pin(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&&YIo(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(zIo,"");let n=((this.options.includePrerelease&&VIo)|(this.options.loose&&WIo))+":"+e,o=Rin.get(n);if(o)return o;let s=this.options.loose,c=s?b_[hA.HYPHENRANGELOOSE]:b_[hA.HYPHENRANGE];e=e.replace(c,sxo(this.options.includePrerelease)),Wu("hyphen replace",e),e=e.replace(b_[hA.COMPARATORTRIM],HIo),Wu("comparator trim",e),e=e.replace(b_[hA.TILDETRIM],GIo),Wu("tilde trim",e),e=e.replace(b_[hA.CARETTRIM],$Io),Wu("caret trim",e);let l=e.split(" ").map(h=>KIo(h,this.options)).join(" ").split(/\s+/).map(h=>oxo(h,this.options));s&&(l=l.filter(h=>(Wu("loose invalid filter",h,this.options),!!h.match(b_[hA.COMPARATORLOOSE])))),Wu("range list",l);let u=new Map,d=l.map(h=>new dLt(h,this.options));for(let h of d){if(Pin(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return Rin.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>kin(n,r)&&e.set.some(o=>kin(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 qIo(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),YIo=a(t=>t.value==="","isAny"),kin=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"),KIo=a((t,e)=>(t=t.replace(b_[hA.BUILD],""),Wu("comp",t,e),t=exo(t,e),Wu("caret",t),t=ZIo(t,e),Wu("tildes",t),t=rxo(t,e),Wu("xrange",t),t=ixo(t,e),Wu("stars",t),t),"parseComparator"),Jm=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),JIo=a((t,e,r)=>Jm(t)&&!Jm(e)||Jm(e)&&r&&!Jm(r),"invalidXRangeOrder"),ZIo=a((t,e)=>t.trim().split(/\s+/).map(r=>XIo(r,e)).join(" "),"replaceTildes"),XIo=a((t,e)=>{let r=e.loose?b_[hA.TILDELOOSE]:b_[hA.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Wu("tilde",t,o,s,c,l,u);let d;return Jm(s)?d="":Jm(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Jm(l)?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:u?(Wu("replaceTilde pr",u),d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`):d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`,Wu("tilde return",d),d})},"replaceTilde"),exo=a((t,e)=>t.trim().split(/\s+/).map(r=>txo(r,e)).join(" "),"replaceCarets"),txo=a((t,e)=>{Wu("caret",t,e);let r=e.loose?b_[hA.CARETLOOSE]:b_[hA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Wu("caret",t,o,s,c,l,u);let d;return Jm(s)?d="":Jm(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Jm(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(Wu("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`):(Wu("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`),Wu("caret return",d),d})},"replaceCaret"),rxo=a((t,e)=>(Wu("replaceXRanges",t,e),t.split(/\s+/).map(r=>nxo(r,e)).join(" ")),"replaceXRanges"),nxo=a((t,e)=>{t=t.trim();let r=e.loose?b_[hA.XRANGELOOSE]:b_[hA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{if(Wu("xRange",t,n,o,s,c,l,u),JIo(s,c,l))return t;let d=Jm(s),f=d||Jm(c),h=f||Jm(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`),Wu("xRange return",n),n})},"replaceXRange"),ixo=a((t,e)=>(Wu("replaceStars",t,e),t.trim().replace(b_[hA.STAR],"")),"replaceStars"),oxo=a((t,e)=>(Wu("replaceGTE0",t,e),t.trim().replace(b_[e.includePrerelease?hA.GTE0PRE:hA.GTE0],"")),"replaceGTE0"),sxo=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(Jm(n)?r="":Jm(o)?r=`>=${n}.0.0${t?"-0":""}`:Jm(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Jm(d)?u="":Jm(f)?u=`<${+d+1}.0.0-0`:Jm(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"),axo=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 HSe=I((AZl,Fin)=>{"use strict";p();var GSe=Symbol("SemVer ANY"),hLt=class t{static{a(this,"Comparator")}static get ANY(){return GSe}constructor(e,r){if(r=Nin(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),pLt("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===GSe?this.value="":this.value=this.operator+this.semver.version,pLt("comp",this)}parse(e){let r=this.options.loose?Min[Oin.COMPARATORLOOSE]:Min[Oin.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 Bin(n[2],this.options.loose):this.semver=GSe}toString(){return this.value}test(e){if(pLt("Comparator.test",e,this.options.loose),this.semver===GSe||e===GSe)return!0;if(typeof e=="string")try{e=new Bin(e,this.options)}catch{return!1}return fLt(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 Lin(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Lin(this.value,r).test(e.semver):(r=Nin(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("=")||fLt(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||fLt(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Fin.exports=hLt;var Nin=xHe(),{safeRe:Min,t:Oin}=gce(),fLt=cLt(),pLt=qSe(),Bin=pA(),Lin=Sx()});var $Se=I((_Zl,Uin)=>{"use strict";p();var cxo=Sx(),lxo=a((t,e,r)=>{try{e=new cxo(e,r)}catch{return!1}return e.test(t)},"satisfies");Uin.exports=lxo});var qin=I((bZl,Qin)=>{"use strict";p();var uxo=Sx(),dxo=a((t,e)=>new uxo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");Qin.exports=dxo});var Hin=I((IZl,jin)=>{"use strict";p();var fxo=pA(),pxo=Sx(),hxo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new pxo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new fxo(n,r))}),n},"maxSatisfying");jin.exports=hxo});var $in=I((RZl,Gin)=>{"use strict";p();var mxo=pA(),gxo=Sx(),Axo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new gxo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new mxo(n,r))}),n},"minSatisfying");Gin.exports=Axo});var zin=I((DZl,Win)=>{"use strict";p();var mLt=pA(),yxo=Sx(),Vin=jSe(),Exo=a((t,e)=>{t=new yxo(t,e);let r=new mLt("0.0.0");if(t.test(r)||(r=new mLt("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new mLt(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||Vin(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||Vin(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");Win.exports=Exo});var Kin=I((OZl,Yin)=>{"use strict";p();var _xo=Sx(),vxo=a((t,e)=>{try{return new _xo(t,e).range||"*"}catch{return null}},"validRange");Yin.exports=vxo});var FHe=I((FZl,eon)=>{"use strict";p();var Cxo=pA(),Xin=HSe(),{ANY:bxo}=Xin,Sxo=Sx(),Txo=$Se(),Jin=jSe(),Zin=NHe(),Ixo=OHe(),xxo=MHe(),wxo=a((t,e,r,n)=>{t=new Cxo(t,n),e=new Sxo(e,n);let o,s,c,l,u;switch(r){case">":o=Jin,s=Ixo,c=Zin,l=">",u=">=";break;case"<":o=Zin,s=xxo,c=Jin,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Txo(t,e,n))return!1;for(let d=0;d{g.semver===bxo&&(g=new Xin(">=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");eon.exports=wxo});var ron=I((qZl,ton)=>{"use strict";p();var Rxo=FHe(),Pxo=a((t,e,r)=>Rxo(t,e,">",r),"gtr");ton.exports=Pxo});var ion=I((GZl,non)=>{"use strict";p();var kxo=FHe(),Dxo=a((t,e,r)=>kxo(t,e,"<",r),"ltr");non.exports=Dxo});var aon=I((WZl,son)=>{"use strict";p();var oon=Sx(),Nxo=a((t,e,r)=>(t=new oon(t,r),e=new oon(e,r),t.intersects(e,r)),"intersects");son.exports=Nxo});var lon=I((KZl,con)=>{"use strict";p();var Mxo=$Se(),Oxo=bx();con.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>Oxo(f,h,r));for(let f of c)Mxo(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 uon=Sx(),yLt=HSe(),{ANY:gLt}=yLt,ALt=$Se(),ELt=bx(),Bxo=a((t,e,r={})=>{if(t===e)return!0;t=new uon(t,r),e=new uon(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=Fxo(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),Lxo=[new yLt(">=0.0.0-0")],don=[new yLt(">=0.0.0")],Fxo=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===gLt){if(e.length===1&&e[0].semver===gLt)return!0;r.includePrerelease?t=Lxo:t=don}if(e.length===1&&e[0].semver===gLt){if(r.includePrerelease)return!0;e=don}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=fon(o,g,r):g.operator==="<"||g.operator==="<="?s=pon(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=ELt(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&&!ALt(g,String(o),r)||s&&!ALt(g,String(s),r))return null;for(let A of e)if(!ALt(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=fon(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=pon(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"),fon=a((t,e,r)=>{if(!t)return e;let n=ELt(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),pon=a((t,e,r)=>{if(!t)return e;let n=ELt(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");hon.exports=Bxo});var fk=I((tXl,yon)=>{"use strict";p();var _Lt=gce(),gon=mce(),Uxo=pA(),Aon=nLt(),Qxo=U7(),qxo=qnn(),jxo=Hnn(),Hxo=Vnn(),Gxo=Ynn(),$xo=Jnn(),Vxo=Xnn(),Wxo=tin(),zxo=nin(),Yxo=bx(),Kxo=ain(),Jxo=lin(),Zxo=DHe(),Xxo=pin(),ewo=min(),two=jSe(),rwo=NHe(),nwo=sLt(),iwo=aLt(),owo=MHe(),swo=OHe(),awo=cLt(),cwo=Sin(),lwo=Iin(),uwo=HSe(),dwo=Sx(),fwo=$Se(),pwo=qin(),hwo=Hin(),mwo=$in(),gwo=zin(),Awo=Kin(),ywo=FHe(),Ewo=ron(),_wo=ion(),vwo=aon(),Cwo=lon(),bwo=mon();yon.exports={parse:Qxo,valid:qxo,clean:jxo,inc:Hxo,diff:Gxo,major:$xo,minor:Vxo,patch:Wxo,prerelease:zxo,compare:Yxo,rcompare:Kxo,compareLoose:Jxo,compareBuild:Zxo,sort:Xxo,rsort:ewo,gt:two,lt:rwo,eq:nwo,neq:iwo,gte:owo,lte:swo,cmp:awo,coerce:cwo,truncate:lwo,Comparator:uwo,Range:dwo,satisfies:fwo,toComparators:pwo,maxSatisfying:hwo,minSatisfying:mwo,minVersion:gwo,validRange:Awo,outside:ywo,gtr:Ewo,ltr:_wo,intersects:vwo,simplifyRange:Cwo,subset:bwo,SemVer:Uxo,re:_Lt.re,src:_Lt.src,tokens:_Lt.t,SEMVER_SPEC_VERSION:gon.SEMVER_SPEC_VERSION,RELEASE_TYPES:gon.RELEASE_TYPES,compareIdentifiers:Aon.compareIdentifiers,rcompareIdentifiers:Aon.rcompareIdentifiers}});var _on=I((nXl,Eon)=>{p();var Swo=fk();Eon.exports=Swo.satisfies(process.version,">=15.7.0")});var Con=I((oXl,von)=>{p();var Two=fk();von.exports=Two.satisfies(process.version,">=16.9.0")});var vLt=I((aXl,bon)=>{p();var Iwo=_on(),xwo=Con(),wwo={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},Rwo={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};bon.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=wwo[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(Iwo)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=Rwo[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(xwo){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 CLt=I((lXl,Son)=>{p();var Pwo=fk();Son.exports=Pwo.satisfies(process.version,"^6.12.0 || >=8.0.0")});var xon=I((dXl,Ion)=>{p();var cu=QSe(),kwo=JBt(),Ton=ZBt(),Dwo=KBt(),Nwo=eLt(),Mwo=vLt(),Owo=CLt(),Bwo=CHe(),{KeyObject:Lwo,createSecretKey:Fwo,createPublicKey:Uwo}=require("crypto"),bLt=["RS256","RS384","RS512"],Qwo=["ES256","ES384","ES512"],SLt=["RS256","RS384","RS512"],qwo=["HS256","HS384","HS512"];Owo&&(bLt.splice(bLt.length,0,"PS256","PS384","PS512"),SLt.splice(SLt.length,0,"PS256","PS384","PS512"));Ion.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 cu("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new cu("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new cu("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new cu("jwt must be provided"));if(typeof t!="string")return o(new cu("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new cu("jwt malformed"));let l;try{l=Dwo(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new cu("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new cu("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 cu("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new cu("jwt signature is required"));if(m&&!h)return o(new cu("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new cu('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof Lwo))try{h=Uwo(h)}catch{try{h=Fwo(typeof h=="string"?Buffer.from(h):h)}catch{return o(new cu("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=qwo:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=SLt:h.asymmetricKeyType==="ec"?r.algorithms=Qwo:r.algorithms=bLt),r.algorithms.indexOf(l.header.alg)===-1)return o(new cu("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new cu(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new cu(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{Mwo(u.alg,h)}catch(y){return o(y)}let g;try{g=Bwo.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new cu("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new cu("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new kwo("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new cu("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new Ton("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 cu("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 cu("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new cu("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new cu("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new cu("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new cu("iat required when maxAge is specified"));let y=Nwo(r.maxAge,A.iat);if(typeof y>"u")return o(new cu('"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 Ton("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 Non=I((hXl,Don)=>{p();var won=1/0,Pon=9007199254740991,jwo=17976931348623157e292,Ron=NaN,Hwo="[object Arguments]",Gwo="[object Function]",$wo="[object GeneratorFunction]",Vwo="[object String]",Wwo="[object Symbol]",zwo=/^\s+|\s+$/g,Ywo=/^[-+]0x[0-9a-f]+$/i,Kwo=/^0b[01]+$/i,Jwo=/^0o[0-7]+$/i,Zwo=/^(?:0|[1-9]\d*)$/,Xwo=parseInt;function eRo(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&rRo(t,e,r)>-1}a(hRo,"includes");function mRo(t){return gRo(t)&&ILt.call(t,"callee")&&(!aRo.call(t,"callee")||QHe.call(t)==Hwo)}a(mRo,"isArguments");var kon=Array.isArray;function xLt(t){return t!=null&&yRo(t.length)&&!ARo(t)}a(xLt,"isArrayLike");function gRo(t){return wLt(t)&&xLt(t)}a(gRo,"isArrayLikeObject");function ARo(t){var e=TLt(t)?QHe.call(t):"";return e==Gwo||e==$wo}a(ARo,"isFunction");function yRo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Pon}a(yRo,"isLength");function TLt(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(TLt,"isObject");function wLt(t){return!!t&&typeof t=="object"}a(wLt,"isObjectLike");function ERo(t){return typeof t=="string"||!kon(t)&&wLt(t)&&QHe.call(t)==Vwo}a(ERo,"isString");function _Ro(t){return typeof t=="symbol"||wLt(t)&&QHe.call(t)==Wwo}a(_Ro,"isSymbol");function vRo(t){if(!t)return t===0?t:0;if(t=bRo(t),t===won||t===-won){var e=t<0?-1:1;return e*jwo}return t===t?t:0}a(vRo,"toFinite");function CRo(t){var e=vRo(t),r=e%1;return e===e?r?e-r:e:0}a(CRo,"toInteger");function bRo(t){if(typeof t=="number")return t;if(_Ro(t))return Ron;if(TLt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=TLt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(zwo,"");var r=Kwo.test(t);return r||Jwo.test(t)?Xwo(t.slice(2),r?2:8):Ywo.test(t)?Ron:+t}a(bRo,"toNumber");function SRo(t){return xLt(t)?uRo(t):dRo(t)}a(SRo,"keys");function TRo(t){return t?oRo(t,SRo(t)):[]}a(TRo,"values");Don.exports=hRo});var Oon=I((AXl,Mon)=>{p();var IRo="[object Boolean]",xRo=Object.prototype,wRo=xRo.toString;function RRo(t){return t===!0||t===!1||PRo(t)&&wRo.call(t)==IRo}a(RRo,"isBoolean");function PRo(t){return!!t&&typeof t=="object"}a(PRo,"isObjectLike");Mon.exports=RRo});var Qon=I((_Xl,Uon)=>{p();var Bon=1/0,kRo=17976931348623157e292,Lon=NaN,DRo="[object Symbol]",NRo=/^\s+|\s+$/g,MRo=/^[-+]0x[0-9a-f]+$/i,ORo=/^0b[01]+$/i,BRo=/^0o[0-7]+$/i,LRo=parseInt,FRo=Object.prototype,URo=FRo.toString;function QRo(t){return typeof t=="number"&&t==GRo(t)}a(QRo,"isInteger");function Fon(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(Fon,"isObject");function qRo(t){return!!t&&typeof t=="object"}a(qRo,"isObjectLike");function jRo(t){return typeof t=="symbol"||qRo(t)&&URo.call(t)==DRo}a(jRo,"isSymbol");function HRo(t){if(!t)return t===0?t:0;if(t=$Ro(t),t===Bon||t===-Bon){var e=t<0?-1:1;return e*kRo}return t===t?t:0}a(HRo,"toFinite");function GRo(t){var e=HRo(t),r=e%1;return e===e?r?e-r:e:0}a(GRo,"toInteger");function $Ro(t){if(typeof t=="number")return t;if(jRo(t))return Lon;if(Fon(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Fon(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(NRo,"");var r=ORo.test(t);return r||BRo.test(t)?LRo(t.slice(2),r?2:8):MRo.test(t)?Lon:+t}a($Ro,"toNumber");Uon.exports=QRo});var jon=I((bXl,qon)=>{p();var VRo="[object Number]",WRo=Object.prototype,zRo=WRo.toString;function YRo(t){return!!t&&typeof t=="object"}a(YRo,"isObjectLike");function KRo(t){return typeof t=="number"||YRo(t)&&zRo.call(t)==VRo}a(KRo,"isNumber");qon.exports=KRo});var Von=I((IXl,$on)=>{p();var JRo="[object Object]";function ZRo(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(ZRo,"isHostObject");function XRo(t,e){return function(r){return t(e(r))}}a(XRo,"overArg");var ePo=Function.prototype,Hon=Object.prototype,Gon=ePo.toString,tPo=Hon.hasOwnProperty,rPo=Gon.call(Object),nPo=Hon.toString,iPo=XRo(Object.getPrototypeOf,Object);function oPo(t){return!!t&&typeof t=="object"}a(oPo,"isObjectLike");function sPo(t){if(!oPo(t)||nPo.call(t)!=JRo||ZRo(t))return!1;var e=iPo(t);if(e===null)return!0;var r=tPo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Gon.call(r)==rPo}a(sPo,"isPlainObject");$on.exports=sPo});var zon=I((RXl,Won)=>{p();var aPo="[object String]",cPo=Object.prototype,lPo=cPo.toString,uPo=Array.isArray;function dPo(t){return!!t&&typeof t=="object"}a(dPo,"isObjectLike");function fPo(t){return typeof t=="string"||!uPo(t)&&dPo(t)&&lPo.call(t)==aPo}a(fPo,"isString");Won.exports=fPo});var Xon=I((DXl,Zon)=>{p();var pPo="Expected a function",Yon=1/0,hPo=17976931348623157e292,Kon=NaN,mPo="[object Symbol]",gPo=/^\s+|\s+$/g,APo=/^[-+]0x[0-9a-f]+$/i,yPo=/^0b[01]+$/i,EPo=/^0o[0-7]+$/i,_Po=parseInt,vPo=Object.prototype,CPo=vPo.toString;function bPo(t,e){var r;if(typeof e!="function")throw new TypeError(pPo);return t=wPo(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(bPo,"before");function SPo(t){return bPo(2,t)}a(SPo,"once");function Jon(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(Jon,"isObject");function TPo(t){return!!t&&typeof t=="object"}a(TPo,"isObjectLike");function IPo(t){return typeof t=="symbol"||TPo(t)&&CPo.call(t)==mPo}a(IPo,"isSymbol");function xPo(t){if(!t)return t===0?t:0;if(t=RPo(t),t===Yon||t===-Yon){var e=t<0?-1:1;return e*hPo}return t===t?t:0}a(xPo,"toFinite");function wPo(t){var e=xPo(t),r=e%1;return e===e?r?e-r:e:0}a(wPo,"toInteger");function RPo(t){if(typeof t=="number")return t;if(IPo(t))return Kon;if(Jon(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Jon(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(gPo,"");var r=yPo.test(t);return r||EPo.test(t)?_Po(t.slice(2),r?2:8):APo.test(t)?Kon:+t}a(RPo,"toNumber");Zon.exports=SPo});var csn=I((OXl,asn)=>{p();var esn=eLt(),PPo=CLt(),kPo=vLt(),tsn=CHe(),DPo=Non(),qHe=Oon(),rsn=Qon(),RLt=jon(),isn=Von(),Q7=zon(),NPo=Xon(),{KeyObject:MPo,createSecretKey:OPo,createPrivateKey:BPo}=require("crypto"),osn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];PPo&&osn.splice(3,0,"PS256","PS384","PS512");var LPo={expiresIn:{isValid:a(function(t){return rsn(t)||Q7(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return rsn(t)||Q7(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return Q7(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:DPo.bind(null,osn),message:'"algorithm" must be a valid string enum value'},header:{isValid:isn,message:'"header" must be an object'},encoding:{isValid:Q7,message:'"encoding" must be a string'},issuer:{isValid:Q7,message:'"issuer" must be a string'},subject:{isValid:Q7,message:'"subject" must be a string'},jwtid:{isValid:Q7,message:'"jwtid" must be a string'},noTimestamp:{isValid:qHe,message:'"noTimestamp" must be a boolean'},keyid:{isValid:Q7,message:'"keyid" must be a string'},mutatePayload:{isValid:qHe,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:qHe,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:qHe,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},FPo={iat:{isValid:RLt,message:'"iat" should be a number of seconds'},exp:{isValid:RLt,message:'"exp" should be a number of seconds'},nbf:{isValid:RLt,message:'"nbf" should be a number of seconds'}};function ssn(t,e,r,n){if(!isn(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(ssn,"validate");function UPo(t){return ssn(LPo,!1,t,"options")}a(UPo,"validateOptions");function QPo(t){return ssn(FPo,!0,t,"payload")}a(QPo,"validatePayload");var nsn={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},qPo=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];asn.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 MPo))try{e=BPo(e)}catch{try{e=OPo(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{QPo(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=qPo.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{UPo(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{kPo(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=esn(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=esn(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(nsn).forEach(function(d){let f=nsn[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&&NPo(n),tsn.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=tsn.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 usn=I((FXl,lsn)=>{p();lsn.exports={decode:KBt(),verify:xon(),sign:csn(),JsonWebTokenError:QSe(),NotBeforeError:JBt(),TokenExpiredError:ZBt()}});var s3t=I((Dau,uan)=>{p();function Hko(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=XBt(),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();mS.formatArgs=$ko;mS.save=Vko;mS.load=Wko;mS.useColors=Gko;mS.storage=zko();mS.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`."))}})();mS.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 Gko(){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(Gko,"useColors");function $ko(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+yGe.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($ko,"formatArgs");mS.log=console.debug||console.log||(()=>{});function Vko(t){try{t?mS.storage.setItem("debug",t):mS.storage.removeItem("debug")}catch{}}a(Vko,"save");function Wko(){let t;try{t=mS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(Wko,"load");function zko(){try{return localStorage}catch{}}a(zko,"localstorage");yGe.exports=s3t()(mS);var{formatters:Yko}=yGe.exports;Yko.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var pan=I((Lau,fan)=>{"use strict";p();fan.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 Kko=require("os"),han=require("tty"),Ix=pan(),{env:K0}=process,H7;Ix("no-color")||Ix("no-colors")||Ix("color=false")||Ix("color=never")?H7=0:(Ix("color")||Ix("colors")||Ix("color=true")||Ix("color=always"))&&(H7=1);"FORCE_COLOR"in K0&&(K0.FORCE_COLOR==="true"?H7=1:K0.FORCE_COLOR==="false"?H7=0:H7=K0.FORCE_COLOR.length===0?1:Math.min(parseInt(K0.FORCE_COLOR,10),3));function a3t(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a(a3t,"translateLevel");function c3t(t,e){if(H7===0)return 0;if(Ix("color=16m")||Ix("color=full")||Ix("color=truecolor"))return 3;if(Ix("color=256"))return 2;if(t&&!e&&H7===void 0)return 0;let r=H7||0;if(K0.TERM==="dumb")return r;if(process.platform==="win32"){let n=Kko.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in K0)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in K0)||K0.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in K0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(K0.TEAMCITY_VERSION)?1:0;if(K0.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in K0){let n=parseInt((K0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(K0.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(K0.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(K0.TERM)||"COLORTERM"in K0?1:r}a(c3t,"supportsColor");function Jko(t){let e=c3t(t,t&&t.isTTY);return a3t(e)}a(Jko,"getSupportLevel");man.exports={supportsColor:Jko,stdout:a3t(c3t(!0,han.isatty(1))),stderr:a3t(c3t(!0,han.isatty(2)))}});var Aan=I((gA,vGe)=>{p();var Zko=require("tty"),_Ge=require("util");gA.init=o2o;gA.log=r2o;gA.formatArgs=e2o;gA.save=n2o;gA.load=i2o;gA.useColors=Xko;gA.destroy=_Ge.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");gA.colors=[6,2,3,4,5,1];try{let t=EGe();t&&(t.stderr||t).level>=2&&(gA.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{}gA.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 Xko(){return"colors"in gA.inspectOpts?!!gA.inspectOpts.colors:Zko.isatty(process.stderr.fd)}a(Xko,"useColors");function e2o(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".`,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(` `).join(` -`+s),t.push(o+"m+"+vGe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=t2o()+e+" "+t[0]}a(e2o,"formatArgs");function t2o(){return gA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(t2o,"getDate");function r2o(...t){return process.stderr.write(_Ge.format(...t)+` -`)}a(r2o,"log");function n2o(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(n2o,"save");function i2o(){return process.env.DEBUG}a(i2o,"load");function o2o(t){t.inspectOpts={};let e=Object.keys(gA.inspectOpts);for(let r=0;re.trim()).join(" ")};gan.O=function(t){return this.inspectOpts.colors=this.useColors,_Ge.inspect(t,this.inspectOpts)}});var hk=I((Gau,l3t)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?l3t.exports=dan():l3t.exports=Aan()});var _an=I(vC=>{"use strict";p();var s2o=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]})),a2o=vC&&vC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),yan=vC&&vC.__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)&&s2o(e,t,r);return a2o(e,t),e};Object.defineProperty(vC,"__esModule",{value:!0});vC.req=vC.json=vC.toBuffer=void 0;var c2o=yan(require("http")),l2o=yan(require("https"));async function Ean(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a(Ean,"toBuffer");vC.toBuffer=Ean;async function u2o(t){let r=(await Ean(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(u2o,"json");vC.json=u2o;function d2o(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?l2o:c2o).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(d2o,"req");vC.req=d2o});var d3t=I(gS=>{"use strict";p();var Can=gS&&gS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),f2o=gS&&gS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ban=gS&&gS.__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)&&Can(e,t,r);return f2o(e,t),e},p2o=gS&&gS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Can(e,t,r)};Object.defineProperty(gS,"__esModule",{value:!0});gS.Agent=void 0;var h2o=ban(require("net")),van=ban(require("http")),m2o=require("https");p2o(_an(),gS);var qM=Symbol("AgentBaseInternalState"),u3t=class extends van.Agent{static{a(this,"Agent")}constructor(e){super(e),this[qM]={}}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 h2o.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))?m2o.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 van.Agent)return l.addRequest(e,o);this[qM].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[qM].currentSocket;if(this[qM].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[qM].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[qM]&&(this[qM].defaultPort=e)}get protocol(){return this[qM].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[qM]&&(this[qM].protocol=e)}};gS.Agent=u3t});var San=I(Pce=>{"use strict";p();var g2o=Pce&&Pce.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pce,"__esModule",{value:!0});Pce.parseProxyResponse=void 0;var A2o=g2o(hk()),CGe=(0,A2o.default)("https-proxy-agent:parse-proxy-response");function y2o(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(),CGe("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),CGe("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+"+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 \r -`);if(m===-1){CGe("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}CGe("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(y2o,"parseProxyResponse");Pce.parseProxyResponse=y2o});var p3t=I(xx=>{"use strict";p();var E2o=xx&&xx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_2o=xx&&xx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xan=xx&&xx.__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)&&E2o(e,t,r);return _2o(e,t),e},wan=xx&&xx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xx,"__esModule",{value:!0});xx.HttpsProxyAgent=void 0;var f3t=xan(require("net")),Tan=xan(require("tls")),v2o=wan(require("assert")),C2o=wan(hk()),b2o=d3t(),S2o=require("url"),T2o=San(),iTe=(0,C2o.default)("https-proxy-agent"),bGe=class extends b2o.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new S2o.URL(e):e,this.proxyHeaders=r?.headers??{},iTe("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?Ian(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:"){iTe("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=Tan.connect({...this.connectOpts,servername:m})}else iTe("Creating `net.Socket`: %o",this.connectOpts),o=f3t.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=f3t.isIPv6(r.host)?`[${r.host}]`:r.host,l=`CONNECT ${c}:${r.port} HTTP/1.1\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(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,T2o.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",I2o),r.secureEndpoint){iTe("Upgrading socket connection to TLS");let m=r.servername||r.host;return Tan.connect({...Ian(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new f3t.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{iTe("Replaying proxy buffer for failed request"),(0,v2o.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};bGe.protocols=["http","https"];xx.HttpsProxyAgent=bGe;function I2o(t){t.resume()}a(I2o,"resume");function Ian(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(Ian,"omit")});var h3t=I(wx=>{"use strict";p();var x2o=wx&&wx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),w2o=wx&&wx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Pan=wx&&wx.__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)&&x2o(e,t,r);return w2o(e,t),e},R2o=wx&&wx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wx,"__esModule",{value:!0});wx.HttpProxyAgent=void 0;var P2o=Pan(require("net")),k2o=Pan(require("tls")),D2o=R2o(hk()),N2o=require("events"),M2o=d3t(),Ran=require("url"),kce=(0,D2o.default)("http-proxy-agent"),SGe=class extends M2o.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new Ran.URL(e):e,this.proxyHeaders=r?.headers??{},kce("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?O2o(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 Ran.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;kce("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(kce("Patching connection write() output buffer with updated header"),n=e.outputData[0].data,o=n.indexOf(`\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 \r -`)+4,e.outputData[0].data=e._header+n.substring(o),kce("Output buffer: %o",e.outputData[0].data));let s;return this.proxy.protocol==="https:"?(kce("Creating `tls.Socket`: %o",this.connectOpts),s=k2o.connect(this.connectOpts)):(kce("Creating `net.Socket`: %o",this.connectOpts),s=P2o.connect(this.connectOpts)),await(0,N2o.once)(s,"connect"),s}};SGe.protocols=["http","https"];wx.HttpProxyAgent=SGe;function O2o(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(O2o,"omit")});var G7={};Ri(G7,{__addDisposableResource:()=>ocn,__assign:()=>PGe,__asyncDelegator:()=>Zan,__asyncGenerator:()=>oTe,__asyncValues:()=>NGe,__await:()=>AS,__awaiter:()=>Van,__classPrivateFieldGet:()=>rcn,__classPrivateFieldIn:()=>icn,__classPrivateFieldSet:()=>ncn,__createBinding:()=>DGe,__decorate:()=>Uan,__disposeResources:()=>scn,__esDecorate:()=>qan,__exportStar:()=>zan,__extends:()=>Lan,__generator:()=>Wan,__importDefault:()=>tcn,__importStar:()=>ecn,__makeTemplateObject:()=>Xan,__metadata:()=>$an,__param:()=>Qan,__propKey:()=>Han,__read:()=>_3t,__rest:()=>Fan,__rewriteRelativeImportExtension:()=>acn,__runInitializers:()=>jan,__setFunctionName:()=>Gan,__spread:()=>Yan,__spreadArray:()=>Jan,__spreadArrays:()=>Kan,__values:()=>kGe,default:()=>W2o});function Lan(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");y3t(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Fan(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 Qan(t,e){return function(r,n){e(r,n,t)}}function qan(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 jan(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 _3t(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 Yan(){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 AS?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 Zan(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:AS(t[o](c)),done:!1}:s?s(c):c}:s}}function NGe(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 kGe=="function"?kGe(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 Xan(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function ecn(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=E3t(t),n=0;n{p();y3t=a(function(t,e){return y3t=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])},y3t(t,e)},"extendStatics");a(Lan,"__extends");PGe=a(function(){return PGe=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(GGe,"__esModule",{value:!0});GGe.state=void 0;GGe.state={operationRequestMap:new WeakMap}});function zDo(){try{return W3t.default.statSync("/.dockerenv"),!0}catch{return!1}}function YDo(){try{return W3t.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function z3t(){return V3t===void 0&&(V3t=zDo()||YDo()),V3t}var W3t,V3t,Qcn=_e(()=>{p();W3t=de(require("node:fs"),1);a(zDo,"hasDockerEnv");a(YDo,"hasDockerCGroup");a(z3t,"isDocker")});function Oce(){return Y3t===void 0&&(Y3t=KDo()||z3t()),Y3t}var qcn,Y3t,KDo,K3t=_e(()=>{p();qcn=de(require("node:fs"),1);Qcn();KDo=a(()=>{try{return qcn.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a(Oce,"isInsideContainer")});var J3t,Hcn,Gcn,jcn,z7,Z3t=_e(()=>{p();J3t=de(require("node:process"),1),Hcn=de(require("node:os"),1),Gcn=de(require("node:fs"),1);K3t();jcn=a(()=>{if(J3t.default.platform!=="linux")return!1;if(Hcn.default.release().toLowerCase().includes("microsoft"))return!Oce();try{return Gcn.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Oce():!1}catch{return!1}},"isWsl"),z7=J3t.default.env.__IS_WSL_TEST__?jcn:jcn()});var X3t,dTe,JDo,ZDo,eFt,$cn=_e(()=>{p();X3t=de(require("node:process"),1),dTe=de(require("node:fs/promises"),1);Z3t();Z3t();JDo=(()=>{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}})(),ZDo=a(async()=>`${await JDo()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),eFt=a(async()=>z7?ZDo():`${X3t.default.env.SYSTEMROOT||X3t.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function Y7(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 Vcn=_e(()=>{p();a(Y7,"defineLazyProperty")});async function tFt(){if(zcn.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await XDo("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var Wcn,zcn,Ycn,XDo,Kcn=_e(()=>{p();Wcn=require("node:util"),zcn=de(require("node:process"),1),Ycn=require("node:child_process"),XDo=(0,Wcn.promisify)(Ycn.execFile);a(tFt,"defaultBrowserId")});async function Xcn(t,{humanReadableOutput:e=!0}={}){if(Jcn.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await eNo("osascript",["-e",t,r]);return n.trim()}var Jcn,Zcn,rFt,eNo,eln=_e(()=>{p();Jcn=de(require("node:process"),1),Zcn=require("node:util"),rFt=require("node:child_process"),eNo=(0,Zcn.promisify)(rFt.execFile);a(Xcn,"runAppleScript")});async function nFt(t){return Xcn(`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 tln=_e(()=>{p();eln();a(nFt,"bundleName")});async function iFt(t=tNo){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 VGe(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=rNo[n];if(!o)throw new VGe(`Unknown browser ID: ${n}`);return o}var rln,nln,tNo,rNo,VGe,iln=_e(()=>{p();rln=require("node:util"),nln=require("node:child_process"),tNo=(0,rln.promisify)(nln.execFile),rNo={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"}},VGe=class extends Error{static{a(this,"UnknownBrowserError")}};a(iFt,"defaultBrowser")});async function oFt(){if(WGe.default.platform==="darwin"){let t=await tFt();return{name:await nFt(t),id:t}}if(WGe.default.platform==="linux"){let{stdout:t}=await nNo("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:iNo(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(WGe.default.platform==="win32")return iFt();throw new Error("Only macOS, Linux, and Windows are supported")}var oln,WGe,sln,nNo,iNo,aln=_e(()=>{p();oln=require("node:util"),WGe=de(require("node:process"),1),sln=require("node:child_process");Kcn();tln();iln();nNo=(0,oln.promisify)(sln.execFile),iNo=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(oFt,"defaultBrowser")});var hln={};Ri(hln,{apps:()=>K7,default:()=>pTe,openApp:()=>cNo});async function sNo(){let t=await eFt(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=cFt.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await oNo(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 dln(t){if(typeof t=="string"||Array.isArray(t))return t;let{[lln]:e}=t;if(!e)throw new Error(`${lln} is not supported`);return e}function YGe({[Bce]:t},{wsl:e}){if(e&&z7)return dln(e);if(!t)throw new Error(`${Bce} is not supported`);return dln(t)}var aFt,cFt,lFt,fln,pln,uFt,zGe,oNo,sFt,cln,Bce,lln,uln,fTe,aNo,cNo,K7,pTe,KGe=_e(()=>{p();aFt=de(require("node:process"),1),cFt=require("node:buffer"),lFt=de(require("node:path"),1),fln=require("node:url"),pln=require("node:util"),uFt=de(require("node:child_process"),1),zGe=de(require("node:fs/promises"),1);$cn();Vcn();aln();K3t();oNo=(0,pln.promisify)(uFt.default.execFile),sFt=lFt.default.dirname((0,fln.fileURLToPath)(importMetaUrlShim)),cln=lFt.default.join(sFt,"xdg-open"),{platform:Bce,arch:lln}=aFt.default;a(sNo,"getWindowsDefaultBrowserFromWsl");uln=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),fTe=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return uln(t.app,l=>fTe({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return uln(e,l=>fTe({...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=z7?await sNo():await oFt();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),fTe({...t,app:{name:K7[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(Bce==="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(Bce==="win32"||z7&&!Oce()&&!e){n=await eFt(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),z7||(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=cFt.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!sFt||sFt==="/",u=!1;try{await zGe.default.access(cln,zGe.constants.X_OK),u=!0}catch{}n=aFt.default.versions.electron??(Bce==="android"||l||!u)?"xdg-open":cln}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}Bce==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=uFt.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"),aNo=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return fTe({...e,target:t})},"open"),cNo=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 fTe({...e,app:{name:t,arguments:r}})},"openApp");a(dln,"detectArchBinary");a(YGe,"detectPlatformBinary");K7={};Y7(K7,"chrome",()=>YGe({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"]}}));Y7(K7,"brave",()=>YGe({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"]}}));Y7(K7,"firefox",()=>YGe({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Y7(K7,"edge",()=>YGe({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Y7(K7,"browser",()=>"browser");Y7(K7,"browserPrivate",()=>"browserPrivate");pTe=aNo});var MFt=I((rTu,_un)=>{"use strict";p();_un.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 Cun=I((oTu,vun)=>{"use strict";p();var g5o=MFt();function A5o(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=g5o(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(A5o,"parsePath");vun.exports=A5o});var wun=I((cTu,xun)=>{"use strict";p();var y5o=Cun();function E5o(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(E5o,"_interopDefaultLegacy");var _5o=E5o(y5o);function v5o(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(v5o,"getAugmentedNamespace");var Sun={},C5o="text/plain",b5o="us-ascii",bun=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),S5o=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===b5o)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==C5o)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function T5o(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 S5o(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];bun(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()])bun(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(T5o,"normalizeUrl");var I5o=Object.freeze({__proto__:null,default:T5o}),x5o=v5o(I5o);Object.defineProperty(Sun,"__esModule",{value:!0});var w5o=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},R5o=x5o,P5o=Tun(R5o),k5o=_5o.default,D5o=Tun(k5o);function Tun(t){return t&&t.__esModule?t:{default:t}}a(Tun,"_interopRequireDefault");var Iun=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":w5o(r))!=="object"&&(r={stripHash:!1}),e=(0,P5o.default)(e,r));var s=(0,D5o.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");Iun.MAX_INPUT_LENGTH=2048;var N5o=Sun.default=Iun;xun.exports=N5o});var kun=I((dTu,Pun)=>{"use strict";p();var M5o=MFt();function Run(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=M5o(t);if(t=t.substring(t.indexOf("://")+3),Run(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var O5o=wun(),Dun=kun();function B5o(t){let e=O5o(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),Dun(e.protocols)||e.protocols.length===0&&Dun(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(B5o,"gitUp");Nun.exports=B5o});var Lun=I((ATu,Oun)=>{"use strict";p();var L5o=Mun();function OFt(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=L5o(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return OFt.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=Q5o(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(OFt,"gitUrlParse");OFt.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?F5o(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+U5o(t)+o;default:return t.href}};function F5o(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(F5o,"buildToken");function U5o(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(U5o,"buildPath");function Q5o(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a(Q5o,"findLongestMatchingSubstring");Oun.exports=OFt});var $ce=I((exports,module)=>{p();var Module=typeof Module<"u"?Module:{},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",TreeSitter=(function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{static{a(this,"Parser")}constructor(){this.initialize()}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=a((t,e)=>{throw e},"quit_"),scriptDirectory="";function locateFile(t){return Module.locateFile?Module.locateFile(t,scriptDirectory):scriptDirectory+t}a(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");scriptDirectory=__dirname+"/",readBinary=a(t=>{t=isFileURI(t)?new URL(t):nodePath.normalize(t);var e=fs.readFileSync(t);return e},"readBinary"),readAsync=a((t,e=!0)=>(t=isFileURI(t)?new URL(t):nodePath.normalize(t),new Promise((r,n)=>{fs.readFile(t,e?void 0:"utf8",(o,s)=>{o?n(o):r(e?s.buffer:s)})})),"readAsync"),!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=a((t,e)=>{throw process.exitCode=t,e},"quit_")}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),ENVIRONMENT_IS_WORKER&&(readBinary=a(t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)},"readBinary")),readAsync=a(t=>isFileURI(t)?new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{(n.status==200||n.status==0&&n.response)&&r(n.response),e(n.status)},n.onerror=e,n.send(null)}):fetch(t,{credentials:"same-origin"}).then(e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url))),"readAsync"));var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var wasmMemory,ABORT=!1,EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP_DATA_VIEW;function updateMemoryViews(){var t=wasmMemory.buffer;Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(t),Module.HEAP8=HEAP8=new Int8Array(t),Module.HEAP16=HEAP16=new Int16Array(t),Module.HEAPU8=HEAPU8=new Uint8Array(t),Module.HEAPU16=HEAPU16=new Uint16Array(t),Module.HEAP32=HEAP32=new Int32Array(t),Module.HEAPU32=HEAPU32=new Uint32Array(t),Module.HEAPF32=HEAPF32=new Float32Array(t),Module.HEAPF64=HEAPF64=new Float64Array(t)}if(a(updateMemoryViews,"updateMemoryViews"),Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:2147483648/65536})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}a(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__)}a(initRuntime,"initRuntime");function preMain(){callRuntimeCallbacks(__ATMAIN__)}a(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}a(postRun,"postRun");function addOnPreRun(t){__ATPRERUN__.unshift(t)}a(addOnPreRun,"addOnPreRun");function addOnInit(t){__ATINIT__.unshift(t)}a(addOnInit,"addOnInit");function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}a(addOnPostRun,"addOnPostRun");var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(t){return t}a(getUniqueRunDependency,"getUniqueRunDependency");function addRunDependency(t){runDependencies++,Module.monitorRunDependencies?.(runDependencies)}a(addRunDependency,"addRunDependency");function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e()}}a(removeRunDependency,"removeRunDependency");function abort(t){Module.onAbort?.(t),t="Aborted("+t+")",err(t),ABORT=!0,EXITSTATUS=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw e}a(abort,"abort");var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=a(t=>t.startsWith(dataURIPrefix),"isDataURI"),isFileURI=a(t=>t.startsWith("file://"),"isFileURI");function findWasmBinary(){var t="tree-sitter.wasm";return isDataURI(t)?t:locateFile(t)}a(findWasmBinary,"findWasmBinary");var wasmBinaryFile;function getBinarySync(t){if(t==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(t);throw"both async and sync fetching of the wasm failed"}a(getBinarySync,"getBinarySync");function getBinaryPromise(t){return wasmBinary?Promise.resolve().then(()=>getBinarySync(t)):readAsync(t).then(e=>new Uint8Array(e),()=>getBinarySync(t))}a(getBinaryPromise,"getBinaryPromise");function instantiateArrayBuffer(t,e,r){return getBinaryPromise(t).then(n=>WebAssembly.instantiate(n,e)).then(r,n=>{err(`failed to asynchronously prepare wasm: ${n}`),abort(n)})}a(instantiateArrayBuffer,"instantiateArrayBuffer");function instantiateAsync(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(e)&&!isFileURI(e)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(o=>{var s=WebAssembly.instantiateStreaming(o,r);return s.then(n,function(c){return err(`wasm streaming compile failed: ${c}`),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(e,r,n)})}):instantiateArrayBuffer(e,r,n)}a(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}a(getWasmImports,"getWasmImports");function createWasm(){var t=getWasmImports();function e(n,o){wasmExports=n.exports,wasmExports=relocateExports(wasmExports,1024);var s=getDylinkMetadata(o);return s.neededDynlibs&&(dynamicLibraries=s.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}a(e,"receiveInstance"),addRunDependency("wasm-instantiate");function r(n){e(n.instance,n.module)}if(a(r,"receiveInstantiationResult"),Module.instantiateWasm)try{return Module.instantiateWasm(t,e)}catch(n){return err(`Module.instantiateWasm callback failed with error: ${n}`),!1}return wasmBinaryFile||(wasmBinaryFile=findWasmBinary()),instantiateAsync(wasmBinary,wasmBinaryFile,t,r),{}}a(createWasm,"createWasm");var ASM_CONSTS={};function ExitStatus(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}a(ExitStatus,"ExitStatus");var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(t,e){var r=GOT[e];return r||(r=GOT[e]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(e)||(r.required=!0),r}},LE_HEAP_LOAD_F32=a(t=>HEAP_DATA_VIEW.getFloat32(t,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=a(t=>HEAP_DATA_VIEW.getFloat64(t,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=a(t=>HEAP_DATA_VIEW.getInt16(t,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=a(t=>HEAP_DATA_VIEW.getInt32(t,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_U32=a(t=>HEAP_DATA_VIEW.getUint32(t,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=a((t,e)=>HEAP_DATA_VIEW.setFloat32(t,e,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=a((t,e)=>HEAP_DATA_VIEW.setFloat64(t,e,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=a((t,e)=>HEAP_DATA_VIEW.setInt16(t,e,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=a((t,e)=>HEAP_DATA_VIEW.setInt32(t,e,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_U32=a((t,e)=>HEAP_DATA_VIEW.setUint32(t,e,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=a(t=>{for(;t.length>0;)t.shift()(Module)},"callRuntimeCallbacks"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=a((t,e,r)=>{for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,o));for(var s="";e>10,56320|d&1023)}}return s},"UTF8ArrayToString"),getDylinkMetadata=a(t=>{var e=0,r=0;function n(){return t[e++]}a(n,"getU8");function o(){for(var j=0,M=1;;){var O=t[e++];if(j+=(O&127)*M,M*=128,!(O&128))break}return j}a(o,"getLEB");function s(){var j=o();return e+=j,UTF8ArrayToString(t,e-j,j)}a(s,"getString");function c(j,M){if(j)throw new Error(M)}a(c,"failIf");var l="dylink.0";if(t instanceof WebAssembly.Module){var u=WebAssembly.Module.customSections(t,l);u.length===0&&(l="dylink",u=WebAssembly.Module.customSections(t,l)),c(u.length===0,"need dylink section"),t=new Uint8Array(u[0]),r=t.length}else{var d=new Uint32Array(new Uint8Array(t.subarray(0,24)).buffer),f=d[0]==1836278016||d[0]==6386541;c(!f,"need to see wasm magic number"),c(t[8]!==0,"need the dylink section to be first"),e=9;var h=o();r=e+h,l=s()}var m={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(l=="dylink"){m.memorySize=o(),m.memoryAlign=o(),m.tableSize=o(),m.tableAlign=o();for(var g=o(),A=0;A>1)*2);case"i32":return LE_HEAP_LOAD_I32((t>>2)*4);case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return LE_HEAP_LOAD_F32((t>>2)*4);case"double":return LE_HEAP_LOAD_F64((t>>3)*8);case"*":return LE_HEAP_LOAD_U32((t>>2)*4);default:abort(`invalid type for getValue: ${e}`)}}a(getValue,"getValue");var newDSO=a((t,e,r)=>{var n={refcount:1/0,name:t,exports:r,global:!0};return LDSO.loadedLibsByName[t]=n,e!=null&&(LDSO.loadedLibsByHandle[e]=n),n},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78112,zeroMemory=a((t,e)=>(HEAPU8.fill(0,t,t+e),t),"zeroMemory"),alignMemory=a((t,e)=>Math.ceil(t/e)*e,"alignMemory"),getMemory=a(t=>{if(runtimeInitialized)return zeroMemory(_malloc(t),t);var e=___heap_base,r=e+alignMemory(t,16);return ___heap_base=r,GOT.__heap_base.value=r,e},"getMemory"),isInternalSym=a(t=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(t)||t.startsWith("__em_js__"),"isInternalSym"),uleb128Encode=a((t,e)=>{t<128?e.push(t):e.push(t%128|128,t>>7)},"uleb128Encode"),sigToWasmTypes=a(t=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:t[0]=="v"?[]:[e[t[0]]]},n=1;n{var r=t.slice(0,1),n=t.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};e.push(96),uleb128Encode(n.length,e);for(var s=0;s{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(e),t);var r=[1];generateFuncType(e,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push(...r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(n)),s=new WebAssembly.Instance(o,{e:{f:t}}),c=s.exports.f;return c},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:28,element:"anyfunc"}),getWasmTableEntry=a(t=>{var e=wasmTableMirror[t];return e||(t>=wasmTableMirror.length&&(wasmTableMirror.length=t+1),wasmTableMirror[t]=e=wasmTable.get(t)),e},"getWasmTableEntry"),updateTableMap=a((t,e)=>{if(functionsInTableMap)for(var r=t;r(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(t)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=a(()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(t){throw t instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":t}return wasmTable.length-1},"getEmptyTableSlot"),setWasmTableEntry=a((t,e)=>{wasmTable.set(t,e),wasmTableMirror[t]=wasmTable.get(t)},"setWasmTableEntry"),addFunction=a((t,e)=>{var r=getFunctionAddress(t);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,t)}catch(s){if(!(s instanceof TypeError))throw s;var o=convertJsFunctionToWasm(t,e);setWasmTableEntry(n,o)}return functionsInTableMap.set(t,n),n},"addFunction"),updateGOT=a((t,e)=>{for(var r in t)if(!isInternalSym(r)){var n=t[r];r.startsWith("orig$")&&(r=r.split("$")[1],e=!0),GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(e||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},"updateGOT"),relocateExports=a((t,e,r)=>{var n={};for(var o in t){var s=t[o];typeof s=="object"&&(s=s.value),typeof s=="number"&&(s+=e),n[o]=s}return updateGOT(n,r),n},"relocateExports"),isSymbolDefined=a(t=>{var e=wasmImports[t];return!(!e||e.stub)},"isSymbolDefined"),dynCallLegacy=a((t,e,r)=>{t=t.replace(/p/g,"i");var n=Module["dynCall_"+t];return n(e,...r)},"dynCallLegacy"),dynCall=a((t,e,r=[])=>{if(t.includes("j"))return dynCallLegacy(t,e,r);var n=getWasmTableEntry(e)(...r);return n},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(t=>__emscripten_stack_restore(t),"stackRestore"),createInvokeFunction=a(t=>(e,...r)=>{var n=stackSave();try{return dynCall(t,e,r)}catch(o){if(stackRestore(n),o!==o+0)throw o;_setThrew(1,0)}},"createInvokeFunction"),resolveGlobalSymbol=a((t,e=!1)=>{var r;return e&&"orig$"+t in wasmImports&&(t="orig$"+t),isSymbolDefined(t)?r=wasmImports[t]:t.startsWith("invoke_")&&(r=wasmImports[t]=createInvokeFunction(t.split("_")[1])),{sym:r,name:t}},"resolveGlobalSymbol"),UTF8ToString=a((t,e)=>t?UTF8ArrayToString(HEAPU8,t,e):"","UTF8ToString"),loadWebAssemblyModule=a((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize))}else memoryBase=LE_HEAP_LOAD_U32((handle+12>>2)*4),tableBase=LE_HEAP_LOAD_U32((handle+20>>2)*4);var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(t){var e=resolveGlobalSymbol(t).sym;return!e&&localScope&&(e=localScope[t]),e||(e=moduleExports[t]),e}a(resolveSymbol,"resolveSymbol");var proxyHandler={get(t,e){switch(e){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(e in wasmImports&&!wasmImports[e].stub)return wasmImports[e];if(!(e in t)){var r;t[e]=(...n)=>(r||=resolveSymbol(e),r(...n))}return t[e]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(a(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start ${body};`;moduleExports[name]=eval(func)}a(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(a(postInstantiation,"postInstantiation"),flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(t=>postInstantiation(t.module,t.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return a(loadModule,"loadModule"),flags.loadAsync?metadata.neededDynlibs.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(t=>loadDynamicLibrary(t,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=a((t,e)=>{for(var[r,n]of Object.entries(t)){let o=a(c=>{isSymbolDefined(c)||(wasmImports[c]=n)},"setImport");o(r);let s="__main_argc_argv";r=="main"&&o(s),r==s&&o("main"),r.startsWith("dynCall_")&&!Module.hasOwnProperty(r)&&(Module[r]=n)}},"mergeLibSymbols"),asyncLoad=a((t,e,r,n)=>{var o=n?"":`al ${t}`;readAsync(t).then(s=>{e(new Uint8Array(s)),o&&removeRunDependency(o)},s=>{if(r)r();else throw`Loading data file "${t}" failed.`}),o&&addRunDependency(o)},"asyncLoad");function loadDynamicLibrary(t,e={global:!0,nodelete:!0},r,n){var o=LDSO.loadedLibsByName[t];if(o)return e.global?o.global||(o.global=!0,mergeLibSymbols(o.exports,t)):r&&Object.assign(r,o.exports),e.nodelete&&o.refcount!==1/0&&(o.refcount=1/0),o.refcount++,n&&(LDSO.loadedLibsByHandle[n]=o),e.loadAsync?Promise.resolve(!0):!0;o=newDSO(t,n,"loading"),o.refcount=e.nodelete?1/0:1,o.global=e.global;function s(){if(n){var u=LE_HEAP_LOAD_U32((n+28>>2)*4),d=LE_HEAP_LOAD_U32((n+32>>2)*4);if(u&&d){var f=HEAP8.slice(u,u+d);return e.loadAsync?Promise.resolve(f):f}}var h=locateFile(t);if(e.loadAsync)return new Promise(function(m,g){asyncLoad(h,m,g)});if(!readBinary)throw new Error(`${h}: file not found, and synchronous loading of external files is not available`);return readBinary(h)}a(s,"loadLibData");function c(){return e.loadAsync?s().then(u=>loadWebAssemblyModule(u,e,t,r,n)):loadWebAssemblyModule(s(),e,t,r,n)}a(c,"getExports");function l(u){o.global?mergeLibSymbols(u,t):r&&Object.assign(r,u),o.exports=u}return a(l,"moduleLoaded"),e.loadAsync?c().then(u=>(l(u),!0)):(l(c()),!0)}a(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=a(()=>{for(var[t,e]of Object.entries(GOT))if(e.value==0){var r=resolveGlobalSymbol(t,!0).sym;if(!r&&!e.required)continue;if(typeof r=="function")e.value=addFunction(r,r.sig);else if(typeof r=="number")e.value=r;else throw new Error(`bad export type for '${t}': ${typeof r}`)}},"reportUndefinedSymbols"),loadDylibs=a(()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},"loadDylibs"),noExitRuntime=Module.noExitRuntime||!0;function setValue(t,e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":HEAP8[t]=e;break;case"i8":HEAP8[t]=e;break;case"i16":LE_HEAP_STORE_I16((t>>1)*2,e);break;case"i32":LE_HEAP_STORE_I32((t>>2)*4,e);break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":LE_HEAP_STORE_F32((t>>2)*4,e);break;case"double":LE_HEAP_STORE_F64((t>>3)*8,e);break;case"*":LE_HEAP_STORE_U32((t>>2)*4,e);break;default:abort(`invalid type for setValue: ${r}`)}}a(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78112),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=a(()=>{abort("")},"__abort_js");__abort_js.sig="v";var nowIsMonotonic=1,__emscripten_get_now_is_monotonic=a(()=>nowIsMonotonic,"__emscripten_get_now_is_monotonic");__emscripten_get_now_is_monotonic.sig="i";var __emscripten_memcpy_js=a((t,e,r)=>HEAPU8.copyWithin(t,e,e+r),"__emscripten_memcpy_js");__emscripten_memcpy_js.sig="vppp";var _emscripten_date_now=a(()=>Date.now(),"_emscripten_date_now");_emscripten_date_now.sig="d";var _emscripten_get_now;_emscripten_get_now=a(()=>performance.now(),"_emscripten_get_now"),_emscripten_get_now.sig="d";var getHeapMax=a(()=>2147483648,"getHeapMax"),growMemory=a(t=>{var e=wasmMemory.buffer,r=(t-e.byteLength+65535)/65536;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=a(t=>{var e=HEAPU8.length;t>>>=0;var r=getHeapMax();if(t>r)return!1;for(var n=a((u,d)=>u+(d-u%d)%d,"alignUp"),o=1;o<=4;o*=2){var s=e*(1+.2/o);s=Math.min(s,t+100663296);var c=Math.min(r,n(Math.max(t,s),65536)),l=growMemory(c);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=a(t=>52,"_fd_close");_fd_close.sig="ii";var convertI32PairToI53Checked=a((t,e)=>e+2097152>>>0<4194305-!!t?(t>>>0)+e*4294967296:NaN,"convertI32PairToI53Checked");function _fd_seek(t,e,r,n,o){var s=convertI32PairToI53Checked(e,r);return 70}a(_fd_seek,"_fd_seek"),_fd_seek.sig="iiiiip";var printCharBuffers=[null,[],[]],printChar=a((t,e)=>{var r=printCharBuffers[t];e===0||e===10?((t===1?out:err)(UTF8ArrayToString(r,0)),r.length=0):r.push(e)},"printChar"),_fd_write=a((t,e,r,n)=>{for(var o=0,s=0;s>2)*4),l=LE_HEAP_LOAD_U32((e+4>>2)*4);e+=8;for(var u=0;u>2)*4,o),0},"_fd_write");_fd_write.sig="iippp";function _tree_sitter_log_callback(t,e){if(currentLogCallback){let r=UTF8ToString(e);currentLogCallback(r,t!==0)}}a(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(t,e,r,n,o){let c=currentParseCallback(e,{row:r,column:n});typeof c=="string"?(setValue(o,c.length,"i32"),stringToUTF16(c,t,10240)):setValue(o,0,"i32")}a(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");var runtimeKeepaliveCounter=0,keepRuntimeAlive=a(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=a(t=>{EXITSTATUS=t,keepRuntimeAlive()||(Module.onExit?.(t),ABORT=!0),quit_(t,new ExitStatus(t))},"_proc_exit");_proc_exit.sig="vi";var exitJS=a((t,e)=>{EXITSTATUS=t,_proc_exit(t)},"exitJS"),handleException=a(t=>{if(t instanceof ExitStatus||t=="unwind")return EXITSTATUS;quit_(1,t)},"handleException"),lengthBytesUTF8=a(t=>{for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3}return e},"lengthBytesUTF8"),stringToUTF8Array=a((t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,s=r+n-1,c=0;c=55296&&l<=57343){var u=t.charCodeAt(++c);l=65536+((l&1023)<<10)|u&1023}if(l<=127){if(r>=s)break;e[r++]=l}else if(l<=2047){if(r+1>=s)break;e[r++]=192|l>>6,e[r++]=128|l&63}else if(l<=65535){if(r+2>=s)break;e[r++]=224|l>>12,e[r++]=128|l>>6&63,e[r++]=128|l&63}else{if(r+3>=s)break;e[r++]=240|l>>18,e[r++]=128|l>>12&63,e[r++]=128|l>>6&63,e[r++]=128|l&63}}return e[r]=0,r-o},"stringToUTF8Array"),stringToUTF8=a((t,e,r)=>stringToUTF8Array(t,HEAPU8,e,r),"stringToUTF8"),stackAlloc=a(t=>__emscripten_stack_alloc(t),"stackAlloc"),stringToUTF8OnStack=a(t=>{var e=lengthBytesUTF8(t)+1,r=stackAlloc(e);return stringToUTF8(t,r,e),r},"stringToUTF8OnStack"),stringToUTF16=a((t,e,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var n=e,o=r>1)*2,c),e+=2}return LE_HEAP_STORE_I16((e>>1)*2,0),e-n},"stringToUTF16"),AsciiToString=a(t=>{for(var e="";;){var r=HEAPU8[t++];if(!r)return e;e+=String.fromCharCode(r)}},"AsciiToString"),wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_memcpy_js:__emscripten_memcpy_js,emscripten_get_now:_emscripten_get_now,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback},wasmExports=createWasm(),___wasm_call_ctors=a(()=>(___wasm_call_ctors=wasmExports.__wasm_call_ctors)(),"___wasm_call_ctors"),___wasm_apply_data_relocs=a(()=>(___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs)(),"___wasm_apply_data_relocs"),_malloc=Module._malloc=t=>(_malloc=Module._malloc=wasmExports.malloc)(t),_calloc=Module._calloc=(t,e)=>(_calloc=Module._calloc=wasmExports.calloc)(t,e),_realloc=Module._realloc=(t,e)=>(_realloc=Module._realloc=wasmExports.realloc)(t,e),_free=Module._free=t=>(_free=Module._free=wasmExports.free)(t),_ts_language_symbol_count=Module._ts_language_symbol_count=t=>(_ts_language_symbol_count=Module._ts_language_symbol_count=wasmExports.ts_language_symbol_count)(t),_ts_language_state_count=Module._ts_language_state_count=t=>(_ts_language_state_count=Module._ts_language_state_count=wasmExports.ts_language_state_count)(t),_ts_language_version=Module._ts_language_version=t=>(_ts_language_version=Module._ts_language_version=wasmExports.ts_language_version)(t),_ts_language_field_count=Module._ts_language_field_count=t=>(_ts_language_field_count=Module._ts_language_field_count=wasmExports.ts_language_field_count)(t),_ts_language_next_state=Module._ts_language_next_state=(t,e,r)=>(_ts_language_next_state=Module._ts_language_next_state=wasmExports.ts_language_next_state)(t,e,r),_ts_language_symbol_name=Module._ts_language_symbol_name=(t,e)=>(_ts_language_symbol_name=Module._ts_language_symbol_name=wasmExports.ts_language_symbol_name)(t,e),_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=(t,e,r,n)=>(_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name)(t,e,r,n),_strncmp=Module._strncmp=(t,e,r)=>(_strncmp=Module._strncmp=wasmExports.strncmp)(t,e,r),_ts_language_symbol_type=Module._ts_language_symbol_type=(t,e)=>(_ts_language_symbol_type=Module._ts_language_symbol_type=wasmExports.ts_language_symbol_type)(t,e),_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=(t,e)=>(_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id)(t,e),_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=(t,e)=>(_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new)(t,e),_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=t=>(_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete)(t),_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=(t,e)=>(_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state)(t,e),_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=(t,e,r)=>(_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset)(t,e,r),_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=t=>(_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next)(t),_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=t=>(_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol)(t),_memset=Module._memset=(t,e,r)=>(_memset=Module._memset=wasmExports.memset)(t,e,r),_memcpy=Module._memcpy=(t,e,r)=>(_memcpy=Module._memcpy=wasmExports.memcpy)(t,e,r),_ts_parser_delete=Module._ts_parser_delete=t=>(_ts_parser_delete=Module._ts_parser_delete=wasmExports.ts_parser_delete)(t),_ts_parser_reset=Module._ts_parser_reset=t=>(_ts_parser_reset=Module._ts_parser_reset=wasmExports.ts_parser_reset)(t),_ts_parser_set_language=Module._ts_parser_set_language=(t,e)=>(_ts_parser_set_language=Module._ts_parser_set_language=wasmExports.ts_parser_set_language)(t,e),_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=t=>(_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros)(t),_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=(t,e,r)=>(_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros)(t,e,r),_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=(t,e,r)=>(_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges)(t,e,r),_memmove=Module._memmove=(t,e,r)=>(_memmove=Module._memmove=wasmExports.memmove)(t,e,r),_memcmp=Module._memcmp=(t,e,r)=>(_memcmp=Module._memcmp=wasmExports.memcmp)(t,e,r),_ts_query_new=Module._ts_query_new=(t,e,r,n,o)=>(_ts_query_new=Module._ts_query_new=wasmExports.ts_query_new)(t,e,r,n,o),_ts_query_delete=Module._ts_query_delete=t=>(_ts_query_delete=Module._ts_query_delete=wasmExports.ts_query_delete)(t),_iswspace=Module._iswspace=t=>(_iswspace=Module._iswspace=wasmExports.iswspace)(t),_iswalnum=Module._iswalnum=t=>(_iswalnum=Module._iswalnum=wasmExports.iswalnum)(t),_ts_query_pattern_count=Module._ts_query_pattern_count=t=>(_ts_query_pattern_count=Module._ts_query_pattern_count=wasmExports.ts_query_pattern_count)(t),_ts_query_capture_count=Module._ts_query_capture_count=t=>(_ts_query_capture_count=Module._ts_query_capture_count=wasmExports.ts_query_capture_count)(t),_ts_query_string_count=Module._ts_query_string_count=t=>(_ts_query_string_count=Module._ts_query_string_count=wasmExports.ts_query_string_count)(t),_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=(t,e,r)=>(_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id)(t,e,r),_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=(t,e,r)=>(_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id)(t,e,r),_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=(t,e,r)=>(_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern)(t,e,r),_ts_query_disable_capture=Module._ts_query_disable_capture=(t,e,r)=>(_ts_query_disable_capture=Module._ts_query_disable_capture=wasmExports.ts_query_disable_capture)(t,e,r),_ts_tree_copy=Module._ts_tree_copy=t=>(_ts_tree_copy=Module._ts_tree_copy=wasmExports.ts_tree_copy)(t),_ts_tree_delete=Module._ts_tree_delete=t=>(_ts_tree_delete=Module._ts_tree_delete=wasmExports.ts_tree_delete)(t),_ts_init=Module._ts_init=()=>(_ts_init=Module._ts_init=wasmExports.ts_init)(),_ts_parser_new_wasm=Module._ts_parser_new_wasm=()=>(_ts_parser_new_wasm=Module._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm)(),_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=(t,e)=>(_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm)(t,e),_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=(t,e,r,n,o)=>(_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm)(t,e,r,n,o),_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=t=>(_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm)(t),_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=(t,e)=>(_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm)(t,e),_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=(t,e)=>(_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm)(t,e),_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=t=>(_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm)(t),_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=t=>(_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm)(t),_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=t=>(_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm)(t),_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=t=>(_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm)(t),_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=(t,e)=>(_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm)(t,e),_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=t=>(_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm)(t),_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=t=>(_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm)(t),_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=t=>(_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm)(t),_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=(t,e)=>(_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm)(t,e),_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=t=>(_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm)(t),_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=t=>(_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm)(t),_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=t=>(_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(t),_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=t=>(_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(t),_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=t=>(_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(t),_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=t=>(_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(t),_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=(t,e)=>(_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm)(t,e),_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=t=>(_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm)(t),_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=t=>(_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm)(t),_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=t=>(_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm)(t),_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=t=>(_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm)(t),_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=t=>(_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(t),_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=t=>(_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm)(t),_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=t=>(_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm)(t),_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=t=>(_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm)(t),_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=t=>(_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm)(t),_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=t=>(_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm)(t),_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=t=>(_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm)(t),_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=t=>(_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm)(t),_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=t=>(_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm)(t),_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=t=>(_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm)(t),_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=t=>(_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm)(t),_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=(t,e)=>(_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm)(t,e),_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=(t,e)=>(_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm)(t,e),_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=t=>(_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm)(t),_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=t=>(_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm)(t),_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=t=>(_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm)(t),_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=t=>(_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm)(t),_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=t=>(_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm)(t),_ts_node_child_wasm=Module._ts_node_child_wasm=(t,e)=>(_ts_node_child_wasm=Module._ts_node_child_wasm=wasmExports.ts_node_child_wasm)(t,e),_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=(t,e)=>(_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm)(t,e),_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=(t,e)=>(_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm)(t,e),_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=t=>(_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm)(t),_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=t=>(_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm)(t),_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=t=>(_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm)(t),_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=t=>(_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm)(t),_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=t=>(_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm)(t),_ts_node_parent_wasm=Module._ts_node_parent_wasm=t=>(_ts_node_parent_wasm=Module._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm)(t),_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=t=>(_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm)(t),_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=t=>(_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm)(t),_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=t=>(_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm)(t),_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=t=>(_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm)(t),_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=t=>(_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm)(t),_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=t=>(_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm)(t),_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=t=>(_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm)(t),_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=t=>(_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm)(t),_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=t=>(_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm)(t),_ts_node_children_wasm=Module._ts_node_children_wasm=t=>(_ts_node_children_wasm=Module._ts_node_children_wasm=wasmExports.ts_node_children_wasm)(t),_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=t=>(_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm)(t),_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=(t,e,r,n,o,s,c)=>(_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm)(t,e,r,n,o,s,c),_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=t=>(_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm)(t),_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=t=>(_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm)(t),_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=t=>(_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm)(t),_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=t=>(_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm)(t),_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=t=>(_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm)(t),_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=t=>(_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm)(t),_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=t=>(_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm)(t),_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=t=>(_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm)(t),_ts_query_matches_wasm=Module._ts_query_matches_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_matches_wasm=Module._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm)(t,e,r,n,o,s,c,l,u,d),_ts_query_captures_wasm=Module._ts_query_captures_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_captures_wasm=Module._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm)(t,e,r,n,o,s,c,l,u,d),_iswalpha=Module._iswalpha=t=>(_iswalpha=Module._iswalpha=wasmExports.iswalpha)(t),_iswblank=Module._iswblank=t=>(_iswblank=Module._iswblank=wasmExports.iswblank)(t),_iswdigit=Module._iswdigit=t=>(_iswdigit=Module._iswdigit=wasmExports.iswdigit)(t),_iswlower=Module._iswlower=t=>(_iswlower=Module._iswlower=wasmExports.iswlower)(t),_iswupper=Module._iswupper=t=>(_iswupper=Module._iswupper=wasmExports.iswupper)(t),_iswxdigit=Module._iswxdigit=t=>(_iswxdigit=Module._iswxdigit=wasmExports.iswxdigit)(t),_memchr=Module._memchr=(t,e,r)=>(_memchr=Module._memchr=wasmExports.memchr)(t,e,r),_strlen=Module._strlen=t=>(_strlen=Module._strlen=wasmExports.strlen)(t),_strcmp=Module._strcmp=(t,e)=>(_strcmp=Module._strcmp=wasmExports.strcmp)(t,e),_strncat=Module._strncat=(t,e,r)=>(_strncat=Module._strncat=wasmExports.strncat)(t,e,r),_strncpy=Module._strncpy=(t,e,r)=>(_strncpy=Module._strncpy=wasmExports.strncpy)(t,e,r),_towlower=Module._towlower=t=>(_towlower=Module._towlower=wasmExports.towlower)(t),_towupper=Module._towupper=t=>(_towupper=Module._towupper=wasmExports.towupper)(t),_setThrew=a((t,e)=>(_setThrew=wasmExports.setThrew)(t,e),"_setThrew"),__emscripten_stack_restore=a(t=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(t),"__emscripten_stack_restore"),__emscripten_stack_alloc=a(t=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(t),"__emscripten_stack_alloc"),_emscripten_stack_get_current=a(()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),"_emscripten_stack_get_current"),dynCall_jiji=Module.dynCall_jiji=(t,e,r,n,o)=>(dynCall_jiji=Module.dynCall_jiji=wasmExports.dynCall_jiji)(t,e,r,n,o),_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=t=>(_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=wasmExports.orig$ts_parser_timeout_micros)(t),_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=(t,e)=>(_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=wasmExports.orig$ts_parser_set_timeout_micros)(t,e);Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16;var calledRun;dependenciesFulfilled=a(function t(){calledRun||run(),calledRun||(dependenciesFulfilled=t)},"runCaller");function callMain(t=[]){var e=resolveGlobalSymbol("main").sym;if(e){t.unshift(thisProgram);var r=t.length,n=stackAlloc((r+1)*4),o=n;t.forEach(c=>{LE_HEAP_STORE_U32((o>>2)*4,stringToUTF8OnStack(c)),o+=4}),LE_HEAP_STORE_U32((o>>2)*4,0);try{var s=e(r,n);return exitJS(s,!0),s}catch(c){return handleException(c)}}}a(callMain,"callMain");function run(t=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function e(){calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),Module.onRuntimeInitialized?.(),shouldRunNow&&callMain(t),postRun()))}a(e,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),e()},1)):e()}if(a(run,"run"),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_CURSOR=4*SIZE_OF_INT,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/,VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static{a(this,"ParserImpl")}static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let r;if(!e)r=0,e=null;else if(e.constructor===Language){r=e[0];let n=C._ts_language_version(r);if(ne.slice(u),"currentParseCallback");else if(typeof e=="function")currentParseCallback=e;else throw new Error("Argument must be a string or a function");this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let o=0,s=0;if(n?.includedRanges){o=n.includedRanges.length,s=C._calloc(o,SIZE_OF_RANGE);let u=s;for(let d=0;d0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let n=r;for(let o=0;o0){let n=r;for(let o=0;o0){let f=u;for(let h=0;h0){if(v[0].type!=="string")throw new Error("Predicates must begin with a literal value");let x=v[0].value,P=!0,D=!0,N;switch(x){case"any-not-eq?":case"not-eq?":P=!1;case"any-eq?":case"eq?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 2, got ${v.length-1}`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}"`);if(D=!x.startsWith("any-"),v[2].type==="capture"){let M=v[1].name,O=v[2].name;A[y].push(q=>{let Q=[],U=[];for(let $ of q)$.name===M&&Q.push($.node),$.name===O&&U.push($.node);let z=a(($,W,J)=>J?$.text===W.text:$.text!==W.text,"compare");return D?Q.every($=>U.some(W=>z($,W,P))):Q.some($=>U.some(W=>z($,W,P)))})}else{N=v[1].name;let M=v[2].value,O=a(Q=>Q.text===M,"matches"),q=a(Q=>Q.text!==M,"doesNotMatch");A[y].push(Q=>{let U=[];for(let $ of Q)$.name===N&&U.push($.node);let z=P?O:q;return D?U.every(z):U.some(z)})}break;case"any-not-match?":case"not-match?":P=!1;case"any-match?":case"match?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 2, got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}".`);if(v[2].type!=="string")throw new Error(`Second argument of \`#${x}\` predicate must be a string. Got @${v[2].value}.`);N=v[1].name;let B=new RegExp(v[2].value);D=!x.startsWith("any-"),A[y].push(M=>{let O=[];for(let Q of M)Q.name===N&&O.push(Q.node.text);let q=a((Q,U)=>U?B.test(Q):!B.test(Q),"test");return O.length===0?!P:D?O.every(Q=>q(Q,P)):O.some(Q=>q(Q,P))});break;case"set!":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(M=>M.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');f[y]||(f[y]={}),f[y][v[1].value]=v[2]?v[2].value:null;break;case"is?":case"is-not?":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(M=>M.type!=="string"))throw new Error(`Arguments to \`#${x}\` predicate must be a strings.".`);let L=x==="is?"?h:m;L[y]||(L[y]={}),L[y][v[1].value]=v[2]?v[2].value:null;break;case"not-any-of?":P=!1;case"any-of?":if(v.length<2)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected at least 1. Got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}".`);for(let M=2;MM.value);A[y].push(M=>{let O=[];for(let q of M)q.name===N&&O.push(q.node.text);return O.length===0?!P:O.every(q=>j.includes(q))===P});break;default:g[y].push({operator:x,operands:v.slice(1)})}v.length=0}}Object.freeze(f[y]),Object.freeze(h[y]),Object.freeze(m[y])}return C._free(n),new Query(INTERNAL,o,u,A,g,Object.freeze(f),Object.freeze(h),Object.freeze(m))}static load(e){let r;if(e instanceof Uint8Array)r=Promise.resolve(e);else{let n=e;if(typeof process<"u"&&process.versions&&process.versions.node){let o=require("fs");r=Promise.resolve(o.readFileSync(n))}else r=fetch(n).then(o=>o.arrayBuffer().then(s=>{if(o.ok)return new Uint8Array(s);{let c=new TextDecoder("utf-8").decode(s);throw new Error(`Language.load failed with status ${o.status}. +`)+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;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 rdn=I((qIu,tdn)=>{"use strict";p();var S4o=require("path"),T4o=S4o.join(__dirname,"compiled",process.platform,process.arch,"keytar.node");tdn.exports=require(T4o)});var ydn=I(JM=>{"use strict";p();Object.defineProperty(JM,"__esModule",{value:!0});JM.bytePairEncode=JM.BinaryMap=JM.binaryMapKey=void 0;var L4o=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");JM.binaryMapKey=L4o;var l8t=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,JM.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,JM.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)}}};JM.BinaryMap=l8t;var KM=new Int32Array(128),x_=new Int32Array(128);function F4o(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;KM.length0&&(KM[x_[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(G$e,"__esModule",{value:!0});G$e.makeTextEncoder=void 0;var u8t=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}},d8t=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 d8t:new u8t,"makeTextEncoder");G$e.makeTextEncoder=U4o});var _dn=I($$e=>{"use strict";p();Object.defineProperty($$e,"__esModule",{value:!0});$$e.LRUCache=void 0;var f8t=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 p8t(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}};$$e.LRUCache=f8t;var p8t=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var m8t=I(W$e=>{"use strict";p();Object.defineProperty(W$e,"__esModule",{value:!0});W$e.TikTokenizer=void 0;var V$e=ydn(),Q4o=Edn(),q4o=_dn();function j4o(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(j4o,"loadTikTokenBpe");function H4o(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(H4o,"escapeRegExp");var h8t=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,Q4o.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new q4o.LRUCache(o);let s=typeof e=="string"?j4o(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new V$e.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=>H4o(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,V$e.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,V$e.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,V$e.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))}};W$e.TikTokenizer=h8t});var Pdn=I(Fh=>{"use strict";p();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.createTokenizer=Fh.createByEncoderName=Fh.createByModelName=Fh.getRegexByModel=Fh.getRegexByEncoder=Fh.getSpecialTokensByModel=Fh.getSpecialTokensByEncoder=Fh.MODEL_TO_ENCODING=void 0;var G4o=m8t(),$4o=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);Fh.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 z$e="<|endoftext|>",vdn="<|fim_prefix|>",Cdn="<|fim_middle|>",bdn="<|fim_suffix|>",Sdn="<|endofprompt|>",GTe="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",Tdn="(?:'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+",V4o=[`[^\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+"],Idn=V4o.join("|");function g8t(t){let e="";if(Fh.MODEL_TO_ENCODING.has(t))e=Fh.MODEL_TO_ENCODING.get(t);else for(let[r,n]of $4o)if(t.startsWith(r)){e=n;break}return e}a(g8t,"getEncoderFromModelName");async function W4o(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(W4o,"fetchAndSaveFile");function A8t(t){let e=new Map([[z$e,50256]]);switch(t){case"o200k_base":e=new Map([[z$e,199999],[Sdn,200018]]);break;case"cl100k_base":e=new Map([[z$e,100257],[vdn,100258],[Cdn,100259],[bdn,100260],[Sdn,100276]]);break;case"p50k_edit":e=new Map([[z$e,50256],[vdn,50281],[Cdn,50282],[bdn,50283]]);break;default:break}return e}a(A8t,"getSpecialTokensByEncoder");Fh.getSpecialTokensByEncoder=A8t;function z4o(t){let e=g8t(t);return A8t(e)}a(z4o,"getSpecialTokensByModel");Fh.getSpecialTokensByModel=z4o;function xdn(t){switch(t){case"o200k_base":return Idn;case"cl100k_base":return Tdn;default:break}return GTe}a(xdn,"getRegexByEncoder");Fh.getRegexByEncoder=xdn;function Y4o(t){let e=g8t(t);return xdn(e)}a(Y4o,"getRegexByModel");Fh.getRegexByModel=Y4o;async function K4o(t,e=null){return wdn(g8t(t),e)}a(K4o,"createByModelName");Fh.createByModelName=K4o;async function wdn(t,e=null){let r,n,o=A8t(t);switch(t){case"o200k_base":r=Idn,n="https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken";break;case"cl100k_base":r=Tdn,n="https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken";break;case"p50k_base":r=GTe,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"p50k_edit":r=GTe,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"r50k_base":r=GTe,n="https://openaipublic.blob.core.windows.net/encodings/r50k_base.tiktoken";break;case"gpt2":r=GTe,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 W4o(n,d),console.log(`Saved file to ${d}`)),Rdn(d,o,r)}a(wdn,"createByEncoderName");Fh.createByEncoderName=wdn;function Rdn(t,e,r,n=8192){return new G4o.TikTokenizer(t,e,r,n)}a(Rdn,"createTokenizer");Fh.createTokenizer=Rdn});var y8t=I(Uh=>{"use strict";p();Object.defineProperty(Uh,"__esModule",{value:!0});Uh.createTokenizer=Uh.createByEncoderName=Uh.createByModelName=Uh.getSpecialTokensByModel=Uh.getSpecialTokensByEncoder=Uh.getRegexByModel=Uh.getRegexByEncoder=Uh.MODEL_TO_ENCODING=Uh.TikTokenizer=void 0;var J4o=m8t();Object.defineProperty(Uh,"TikTokenizer",{enumerable:!0,get:a(function(){return J4o.TikTokenizer},"get")});var oQ=Pdn();Object.defineProperty(Uh,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return oQ.MODEL_TO_ENCODING},"get")});Object.defineProperty(Uh,"getRegexByEncoder",{enumerable:!0,get:a(function(){return oQ.getRegexByEncoder},"get")});Object.defineProperty(Uh,"getRegexByModel",{enumerable:!0,get:a(function(){return oQ.getRegexByModel},"get")});Object.defineProperty(Uh,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return oQ.getSpecialTokensByEncoder},"get")});Object.defineProperty(Uh,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return oQ.getSpecialTokensByModel},"get")});Object.defineProperty(Uh,"createByModelName",{enumerable:!0,get:a(function(){return oQ.createByModelName},"get")});Object.defineProperty(Uh,"createByEncoderName",{enumerable:!0,get:a(function(){return oQ.createByEncoderName},"get")});Object.defineProperty(Uh,"createTokenizer",{enumerable:!0,get:a(function(){return oQ.createTokenizer},"get")})});var u3=I(Y$e=>{"use strict";p();Object.defineProperty(Y$e,"__esModule",{value:!0});Y$e.Lazy=void 0;var sQ;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(sQ||(sQ={}));var E8t=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=sQ.Uninitialized}get hasValue(){return this._state===sQ.Completed}get value(){if(this._state===sQ.Uninitialized){this._state=sQ.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=sQ.Completed}}else if(this._state===sQ.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}};Y$e.Lazy=E8t});var Is=I(To=>{"use strict";p();Object.defineProperty(To,"__esModule",{value:!0});To.BugIndicatingError=To.ErrorNoTelemetry=To.ExpectedError=To.NotSupportedError=To.NotImplementedError=To.ReadonlyError=To.PendingMigrationError=To.CancellationError=To.canceledName=To.errorHandler=To.ErrorHandler=void 0;To.setUnexpectedErrorHandler=Z4o;To.isSigPipeError=X4o;To.onBugIndicatingError=eBo;To.onUnexpectedError=tBo;To.onUnexpectedExternalError=rBo;To.transformErrorForSerialization=kdn;To.transformErrorFromSerialization=Ddn;To.isCancellationError=I8t;To.canceled=nBo;To.illegalArgument=iBo;To.illegalState=oBo;To.getErrorMessage=sBo;var K$e=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?IY.isErrorNoTelemetry(e)?new IY(e.message+` +${JSON.stringify(o,null,2)}`);let c=n[s]();return new Language(INTERNAL,c)})}}class LookaheadIterable{static{a(this,"LookaheadIterable")}constructor(e,r,n){assertInternal(e),this[0]=r,this.language=n}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(e){return C._ts_lookahead_iterator_reset_state(this[0],e)}reset(e,r){return C._ts_lookahead_iterator_reset(this[0],e[0],r)?(this.language=e,!0):!1}[Symbol.iterator](){let e=this;return{next(){return C._ts_lookahead_iterator_next(e[0])?{done:!1,value:e.currentType}:{done:!0,value:""}}}}}class Query{static{a(this,"Query")}constructor(e,r,n,o,s,c,l,u){assertInternal(e),this[0]=r,this.captureNames=n,this.textPredicates=o,this.predicates=s,this.setProperties=c,this.assertedProperties=l,this.refutedProperties=u,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_matches_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=new Array(u);this.exceededMatchLimit=!!f;let m=0,g=d;for(let A=0;Av(_))){h[m]={pattern:y,captures:_};let v=this.setProperties[y];v&&(h[m].setProperties=v);let b=this.assertedProperties[y];b&&(h[m].assertedProperties=b);let T=this.refutedProperties[y];T&&(h[m].refutedProperties=T),m++}}return h.length=m,C._free(d),h}captures(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_captures_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=[];this.exceededMatchLimit=!!f;let m=[],g=d;for(let A=0;Av(m))){let v=m[_],b=this.setProperties[y];b&&(v.setProperties=b);let T=this.assertedProperties[y];T&&(v.assertedProperties=T);let w=this.refutedProperties[y];w&&(v.refutedProperties=w),h.push(v)}}return C._free(d),h}predicatesForPattern(e){return this.predicates[e]}disableCapture(e){let r=lengthBytesUTF8(e),n=C._malloc(r+1);stringToUTF8(e,n,r+1),C._ts_query_disable_capture(this[0],n,r),C._free(n)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(t,e,r){let n=r-e,o=t.textCallback(e,null,r);for(e+=o.length;e0)e+=s.length,o+=s;else break}return e>r&&(o=o.slice(0,n)),o}a(getText,"getText");function unmarshalCaptures(t,e,r,n){for(let o=0,s=n.length;o>>0,column:getValue(t+SIZE_OF_INT,"i32")>>>0}}a(unmarshalPoint,"unmarshalPoint");function marshalRange(t,e){marshalPoint(t,e.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,e.endPosition),t+=SIZE_OF_POINT,setValue(t,e.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,e.endIndex,"i32"),t+=SIZE_OF_INT}a(marshalRange,"marshalRange");function unmarshalRange(t){let e={};return e.startPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.endPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.startIndex=getValue(t,"i32")>>>0,t+=SIZE_OF_INT,e.endIndex=getValue(t,"i32")>>>0,e}a(unmarshalRange,"unmarshalRange");function marshalEdit(t){let e=TRANSFER_BUFFER;marshalPoint(e,t.startPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.oldEndPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.newEndPosition),e+=SIZE_OF_POINT,setValue(e,t.startIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.oldEndIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.newEndIndex,"i32"),e+=SIZE_OF_INT}a(marshalEdit,"marshalEdit");for(let t of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,t,{value:ParserImpl.prototype[t],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}}))}}return Parser})();typeof exports=="object"&&(module.exports=TreeSitter)});var 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(` +`)&&(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` + + + `}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+` `+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)}};To.ErrorHandler=K$e;To.errorHandler=new K$e;function Z4o(t){To.errorHandler.setUnexpectedErrorHandler(t)}a(Z4o,"setUnexpectedErrorHandler");function X4o(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(X4o,"isSigPipeError");function eBo(t){To.errorHandler.onUnexpectedError(t)}a(eBo,"onBugIndicatingError");function tBo(t){I8t(t)||To.errorHandler.onUnexpectedError(t)}a(tBo,"onUnexpectedError");function rBo(t){I8t(t)||To.errorHandler.onUnexpectedExternalError(t)}a(rBo,"onUnexpectedExternalError");function kdn(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:IY.isErrorNoTelemetry(t),cause:n?kdn(n):void 0,code:t.code}}return t}a(kdn,"transformErrorForSerialization");function Ddn(t){let e;return t.noTelemetry?e=new IY:(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=Ddn(t.cause)),e}a(Ddn,"transformErrorFromSerialization");To.canceledName="Canceled";function I8t(t){return t instanceof J$e?!0:t instanceof Error&&t.name===To.canceledName&&t.message===To.canceledName}a(I8t,"isCancellationError");var J$e=class extends Error{static{a(this,"CancellationError")}constructor(){super(To.canceledName),this.name=this.message}};To.CancellationError=J$e;var _8t=class t extends Error{static{a(this,"PendingMigrationError")}static{this._name="PendingMigrationError"}static is(e){return e instanceof t||e instanceof Error&&e.name===t._name}constructor(e){super(e),this.name=t._name}};To.PendingMigrationError=_8t;function nBo(){let t=new Error(To.canceledName);return t.name=t.message,t}a(nBo,"canceled");function iBo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a(iBo,"illegalArgument");function oBo(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(oBo,"illegalState");var v8t=class extends TypeError{static{a(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};To.ReadonlyError=v8t;function sBo(t){return t?t.message?t.message:t.stack?t.stack.split(` -`)[0]:String(t):"Error"}a(sBo,"getErrorMessage");var C8t=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};To.NotImplementedError=C8t;var b8t=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};To.NotSupportedError=b8t;var S8t=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};To.ExpectedError=S8t;var IY=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};To.ErrorNoTelemetry=IY;var T8t=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};To.BugIndicatingError=T8t});var aQ=I(X0=>{"use strict";p();Object.defineProperty(X0,"__esModule",{value:!0});X0.MonotonousArray=void 0;X0.findLast=aBo;X0.findLastIdx=Ndn;X0.findFirst=cBo;X0.findFirstIdx=Mdn;X0.findLastMonotonous=lBo;X0.findLastIdxMonotonous=w8t;X0.findFirstMonotonous=uBo;X0.findFirstIdxMonotonousOrArrLen=R8t;X0.findFirstIdxMonotonous=dBo;X0.findFirstMax=Odn;X0.findLastMax=fBo;X0.findFirstMin=pBo;X0.findMaxIdx=hBo;X0.mapFindFirst=mBo;function aBo(t,e,r=t.length-1){let n=Ndn(t,e,r);if(n!==-1)return t[n]}a(aBo,"findLast");function Ndn(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(Ndn,"findLastIdx");function cBo(t,e,r=0){let n=Mdn(t,e,r);if(n!==-1)return t[n]}a(cBo,"findFirst");function Mdn(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(Odn,"findFirstMax");function fBo(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(fBo,"findLastMax");function pBo(t,e){return Odn(t,(r,n)=>-e(r,n))}a(pBo,"findFirstMin");function hBo(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(hBo,"findMaxIdx");function mBo(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(mBo,"mapFindFirst")});var Al=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=yBo;Vn.equals=EBo;Vn.removeFastWithoutKeepingOrder=_Bo;Vn.binarySearch=vBo;Vn.binarySearch2=Bdn;Vn.quickSelect=P8t;Vn.groupBy=CBo;Vn.groupAdjacentBy=bBo;Vn.forEachAdjacent=SBo;Vn.forEachWithNeighbors=TBo;Vn.concatArrays=IBo;Vn.sortedDiff=Ldn;Vn.delta=xBo;Vn.top=wBo;Vn.topAsync=RBo;Vn.coalesce=PBo;Vn.coalesceInPlace=kBo;Vn.move=DBo;Vn.isFalsyOrEmpty=NBo;Vn.isNonEmptyArray=MBo;Vn.distinct=OBo;Vn.uniqueFilter=BBo;Vn.commonPrefixLength=LBo;Vn.range=FBo;Vn.index=UBo;Vn.insert=QBo;Vn.remove=Udn;Vn.arrayInsert=qBo;Vn.shuffle=jBo;Vn.pushToStart=HBo;Vn.pushToEnd=GBo;Vn.pushMany=$Bo;Vn.mapArrayOrNot=VBo;Vn.mapFilter=WBo;Vn.withoutDuplicates=zBo;Vn.asArray=YBo;Vn.getRandomElement=KBo;Vn.insertInto=Qdn;Vn.splice=JBo;Vn.compareBy=ZBo;Vn.tieBreakComparators=XBo;Vn.reverseOrder=rLo;Vn.compareUndefinedSmallest=nLo;Vn.findAsync=iLo;Vn.sum=oLo;Vn.sumBy=sLo;var gBo=aQ(),ABo=Is();function yBo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(yBo,"tail");function EBo(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(vBo,"binarySearch");function Bdn(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(Bdn,"binarySearch2");function P8t(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(Ldn,"sortedDiff");function xBo(t,e,r){let n=Ldn(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(xBo,"delta");function wBo(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return Fdn(t,e,n,r,t.length),n}a(wBo,"top");function RBo(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 ABo.CancellationError;Fdn(t,e,u,d,f)}return u})().then(s,c)})}a(RBo,"topAsync");function Fdn(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a(Fdn,"topStep");function PBo(t){return t.filter(e=>!!e)}a(PBo,"coalesce");function kBo(t){let e=0;for(let r=0;r0}a(MBo,"isNonEmptyArray");function OBo(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(OBo,"distinct");function BBo(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(BBo,"uniqueFilter");function LBo(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(FBo,"range");function UBo(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(UBo,"index");function QBo(t,e){return t.push(e),()=>Udn(t,e)}a(QBo,"insert");function Udn(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a(Udn,"remove");function qBo(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a(qBo,"arrayInsert");function jBo(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(jBo,"shuffle");function HBo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(HBo,"pushToStart");function GBo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(GBo,"pushToEnd");function $Bo(t,e){for(let r of e)t.push(r)}a($Bo,"pushMany");function VBo(t,e){return Array.isArray(t)?t.map(e):e(t)}a(VBo,"mapArrayOrNot");function WBo(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(WBo,"mapFilter");function zBo(t){let e=new Set(t);return Array.from(e)}a(zBo,"withoutDuplicates");function YBo(t){return Array.isArray(t)?t:[t]}a(YBo,"asArray");function KBo(t){return t[Math.floor(Math.random()*t.length)]}a(KBo,"getRandomElement");function Qdn(t,e,r){let n=qdn(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})(cQ||(Vn.CompareResult=cQ={}));function ZBo(t,e){return(r,n)=>e(t(r),t(n))}a(ZBo,"compareBy");function XBo(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!cQ.isNeitherLessOrGreaterThan(o))return o}return cQ.neitherLessOrGreaterThan}}a(XBo,"tieBreakComparators");var eLo=a((t,e)=>t-e,"numberComparator");Vn.numberComparator=eLo;var tLo=a((t,e)=>(0,Vn.numberComparator)(t?1:0,e?1:0),"booleanComparator");Vn.booleanComparator=tLo;function rLo(t){return(e,r)=>-t(e,r)}a(rLo,"reverseOrder");function nLo(t){return(e,r)=>e===void 0?r===void 0?cQ.neitherLessOrGreaterThan:cQ.lessThan:r===void 0?cQ.greaterThan:t(e,r)}a(nLo,"compareUndefinedSmallest");var k8t=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=k8t;var D8t=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||cQ.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};Vn.CallbackIterable=D8t;var N8t=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(iLo,"findAsync");function oLo(t){return t.reduce((e,r)=>e+r,0)}a(oLo,"sum");function sLo(t,e){return t.reduce((r,n)=>r+e(n),0)}a(sLo,"sumBy")});var O8t=I(d3=>{"use strict";p();var jdn;Object.defineProperty(d3,"__esModule",{value:!0});d3.SetWithKey=void 0;d3.groupBy=aLo;d3.groupByMap=cLo;d3.diffSets=lLo;d3.diffMaps=uLo;d3.intersection=dLo;function aLo(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(aLo,"groupBy");function cLo(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(cLo,"groupByMap");function lLo(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(lLo,"diffSets");function uLo(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(uLo,"diffMaps");function dLo(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a(dLo,"intersection");var M8t=class{static{a(this,"SetWithKey")}static{jdn=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[jdn]="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()}};d3.SetWithKey=M8t});var bk=I(Dd=>{"use strict";p();var Hdn,Gdn,$dn;Object.defineProperty(Dd,"__esModule",{value:!0});Dd.NKeyMap=Dd.SetMap=Dd.BidirectionalMap=Dd.CounterSet=Dd.MRUCache=Dd.LRUCache=Dd.LinkedMap=Dd.ResourceSet=Dd.ResourceMap=void 0;Dd.getOrSet=fLo;Dd.mapToString=pLo;Dd.setToString=hLo;Dd.mapsStrictEqualIgnoreOrder=gLo;function fLo(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(fLo,"getOrSet");function pLo(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(pLo,"mapToString");function hLo(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(hLo,"setToString");var B8t=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function mLo(t){return Array.isArray(t)}a(mLo,"isEntries");var $Te=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[Hdn]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(mLo(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 B8t(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]}*[(Hdn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Dd.ResourceMap=$Te;var L8t=class{static{a(this,"ResourceSet")}constructor(e,r){this[Gdn]="ResourceSet",!e||typeof e=="function"?this._map=new $Te(e):(this._map=new $Te(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()}[(Gdn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};Dd.ResourceSet=L8t;var Z$e=class{static{a(this,"LinkedMap")}constructor(){this[$dn]="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}[($dn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Dd.LinkedMap=Z$e;var X$e=class extends Z$e{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))}},F8t=class extends X$e{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};Dd.LRUCache=F8t;var U8t=class extends X$e{static{a(this,"MRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimNew(e)}set(e,r){return this._limit<=this.size&&!this.has(e)&&this.trim(Math.round(this._limit*this._ratio)-1),super.set(e,r),this}};Dd.MRUCache=U8t;var Q8t=class{static{a(this,"CounterSet")}constructor(){this.map=new Map}add(e){return this.map.set(e,(this.map.get(e)||0)+1),this}delete(e){let r=this.map.get(e)||0;return r===0?!1:(r--,r===0?this.map.delete(e):this.map.set(e,r),!0)}has(e){return this.map.has(e)}};Dd.CounterSet=Q8t;var q8t=class{static{a(this,"BidirectionalMap")}constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this._m1.clear(),this._m2.clear()}set(e,r){this._m1.set(e,r),this._m2.set(r,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let r=this._m1.get(e);return r===void 0?!1:(this._m1.delete(e),this._m2.delete(r),!0)}forEach(e,r){this._m1.forEach((n,o)=>{e.call(r,n,o,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}};Dd.BidirectionalMap=q8t;var j8t=class{static{a(this,"SetMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};Dd.SetMap=j8t;function gLo(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(gLo,"mapsStrictEqualIgnoreOrder");var H8t=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)}};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(c,n+1):o+=`${c} -`;return o},"printMap");return e(this._data,0)}};Dd.NKeyMap=H8t});var $8t=I(G8t=>{"use strict";p();Object.defineProperty(G8t,"__esModule",{value:!0});G8t.createSingleCallFunction=ALo;function ALo(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(ALo,"createSingleCallFunction")});var zu=I(f3=>{"use strict";p();Object.defineProperty(f3,"__esModule",{value:!0});f3.ok=yLo;f3.assertNever=ELo;f3.softAssertNever=_Lo;f3.assert=vLo;f3.softAssert=CLo;f3.assertFn=bLo;f3.checkAdjacentItems=SLo;var VTe=Is();function yLo(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(yLo,"ok");function ELo(t,e="Unreachable"){throw new Error(e)}a(ELo,"assertNever");function _Lo(t){}a(_Lo,"softAssertNever");function vLo(t,e="unexpected state"){if(!t)throw typeof e=="string"?new VTe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(vLo,"assert");function CLo(t,e="Soft Assertion Failed"){t||(0,VTe.onUnexpectedError)(new VTe.BugIndicatingError(e))}a(CLo,"softAssert");function bLo(t){if(!t()){debugger;t(),(0,VTe.onUnexpectedError)(new VTe.BugIndicatingError("Assertion Failed"))}}a(bLo,"assertFn");function SLo(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(yl,"__esModule",{value:!0});yl.isOneOf=void 0;yl.isString=V8t;yl.isStringArray=ILo;yl.isArrayOf=Vdn;yl.isObject=Wdn;yl.isTypedArray=xLo;yl.isNumber=wLo;yl.isIterable=RLo;yl.isAsyncIterable=PLo;yl.isBoolean=kLo;yl.isUndefined=zdn;yl.isDefined=DLo;yl.isUndefinedOrNull=eVe;yl.assertType=NLo;yl.assertReturnsDefined=MLo;yl.assertDefined=OLo;yl.assertReturnsAllDefined=BLo;yl.typeCheck=FLo;yl.isEmptyObject=QLo;yl.isFunction=W8t;yl.areFunctions=qLo;yl.validateConstraints=jLo;yl.validateConstraint=Ydn;yl.upcast=HLo;yl.hasKey=GLo;var TLo=zu();function V8t(t){return typeof t=="string"}a(V8t,"isString");function ILo(t){return Vdn(t,V8t)}a(ILo,"isStringArray");function Vdn(t,e){return Array.isArray(t)&&t.every(e)}a(Vdn,"isArrayOf");function Wdn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Wdn,"isObject");function xLo(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(xLo,"isTypedArray");function wLo(t){return typeof t=="number"&&!isNaN(t)}a(wLo,"isNumber");function RLo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(RLo,"isIterable");function PLo(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(PLo,"isAsyncIterable");function kLo(t){return t===!0||t===!1}a(kLo,"isBoolean");function zdn(t){return typeof t>"u"}a(zdn,"isUndefined");function DLo(t){return!eVe(t)}a(DLo,"isDefined");function eVe(t){return zdn(t)||t===null}a(eVe,"isUndefinedOrNull");function NLo(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a(NLo,"assertType");function MLo(t){return(0,TLo.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(MLo,"assertReturnsDefined");function OLo(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(OLo,"assertDefined");function BLo(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");yl.isOneOf=LLo;function FLo(t){}a(FLo,"typeCheck");var ULo=Object.prototype.hasOwnProperty;function QLo(t){if(!Wdn(t))return!1;for(let e in t)if(ULo.call(t,e))return!1;return!0}a(QLo,"isEmptyObject");function W8t(t){return typeof t=="function"}a(W8t,"isFunction");function qLo(...t){return t.length>0&&t.every(W8t)}a(qLo,"areFunctions");function jLo(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(tVe,"__esModule",{value:!0});tVe.Iterable=void 0;var $Lo=SS(),Kdn;(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,$Lo.isIterable)(P)?yield*P:yield P}a(E,"concat"),t.concat=E;function _(x,P,D){let N=D;for(let B of x)N=P(N,B);return N}a(_,"reduce"),t.reduce=_;function v(x){let P=0;for(let D of x)P++;return P}a(v,"length"),t.length=v;function*b(x,P,D=x.length){for(P<-x.length&&(P=0),P<0&&(P+=x.length),D<0?D+=x.length:D>x.length&&(D=x.length);P{"use strict";p();Object.defineProperty(ls,"__esModule",{value:!0});ls.DisposableResourceMap=ls.DisposableSet=ls.DisposableMap=ls.ImmortalReference=ls.AsyncReferenceCollection=ls.ReferenceCollection=ls.RefCountedDisposable=ls.MandatoryMutableDisposable=ls.MutableDisposable=ls.Disposable=ls.DisposableStore=ls.DisposableTracker=ls.GCBasedDisposableTracker=void 0;ls.setDisposableTracker=efn;ls.trackDisposable=wY;ls.markAsDisposed=RY;ls.markAsSingleton=JLo;ls.isDisposable=tfn;ls.dispose=zTe;ls.disposeIfDisposable=ZLo;ls.combinedDisposable=XLo;ls.toDisposable=o6t;ls.disposeOnReturn=e3o;ls.thenIfNotDisposed=t3o;ls.thenRegisterOrDispose=r3o;var Jdn=Al(),VLo=O8t(),Xdn=bk(),WLo=$8t(),zLo=z8t(),Zdn=Is(),YLo=!1,xY=null,Y8t=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)}};ls.GCBasedDisposableTracker=Y8t;var K8t=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 Xdn.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,Jdn.compareBy)(u=>u.idx,Jdn.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(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;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,F$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} ==================== @@ -86,158 +100,129 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};ls.DisposableTracker=K8t;function efn(t){xY=t}a(efn,"setDisposableTracker");if(YLo){let t="__is_disposable_tracked__";efn(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!==ele.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==ele.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function wY(t){return xY?.trackDisposable(t),t}a(wY,"trackDisposable");function RY(t){xY?.markAsDisposed(t)}a(RY,"markAsDisposed");function p3(t,e){xY?.setParent(t,e)}a(p3,"setParentOfDisposable");function KLo(t,e){if(xY)for(let r of t)xY.setParent(r,e)}a(KLo,"setParentOfDisposables");function JLo(t){return xY?.markAsSingleton(t),t}a(JLo,"markAsSingleton");function tfn(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(tfn,"isDisposable");function zTe(t){if(zLo.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(zTe,"dispose");function ZLo(t){for(let e of t)tfn(e)&&e.dispose();return[]}a(ZLo,"disposeIfDisposable");function XLo(...t){let e=o6t(()=>zTe(t));return KLo(t,e),e}a(XLo,"combinedDisposable");var J8t=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,wY(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,RY(this),this._fn()}}};function o6t(t){return new J8t(t)}a(o6t,"toDisposable");var WTe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,wY(this)}dispose(){this._isDisposed||(RY(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{zTe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===ele.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return p3(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)&&p3(e,null)}assertNotDisposed(){this._isDisposed&&(0,Zdn.onUnexpectedError)(new Zdn.BugIndicatingError("Object disposed"))}};ls.DisposableStore=WTe;var ele=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new WTe,wY(this),p3(this._store,this)}dispose(){RY(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};ls.Disposable=ele;var rVe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,wY(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&p3(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,RY(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&p3(e,null),e}};ls.MutableDisposable=rVe;var Z8t=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new rVe,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()}};ls.MandatoryMutableDisposable=Z8t;var X8t=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}};ls.RefCountedDisposable=X8t;var e6t=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,WLo.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};ls.ReferenceCollection=e6t;var t6t=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}}};ls.AsyncReferenceCollection=t6t;var r6t=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};ls.ImmortalReference=r6t;function e3o(t){let e=new WTe;try{t(e)}finally{e.dispose()}}a(e3o,"disposeOnReturn");var nVe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,wY(this)}dispose(){RY(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{zTe(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),p3(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&p3(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};ls.DisposableMap=nVe;var n6t=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,wY(this)}dispose(){RY(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{zTe(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),p3(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return p3(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};ls.DisposableSet=n6t;function t3o(t,e){let r=!1;return t.then(n=>{r||e(n)}),o6t(()=>{r=!0})}a(t3o,"thenIfNotDisposed");function r3o(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(r3o,"thenRegisterOrDispose");var i6t=class extends nVe{static{a(this,"DisposableResourceMap")}constructor(){super(new Xdn.ResourceMap)}};ls.DisposableResourceMap=i6t});var nfn=I(AA=>{"use strict";p();Object.defineProperty(AA,"__esModule",{value:!0});AA.isReadable=i3o;AA.isReadableStream=rfn;AA.isReadableBufferedStream=o3o;AA.newWriteableStream=YTe;AA.consumeReadable=s3o;AA.peekReadable=a3o;AA.consumeStream=c3o;AA.listenStream=oVe;AA.peekStream=l3o;AA.toStream=u3o;AA.emptyStream=d3o;AA.toReadable=f3o;AA.transform=p3o;AA.prefixedReadable=h3o;AA.prefixedStream=m3o;var n3o=Is(),iVe=Io();function i3o(t){let e=t;return e?typeof e.read=="function":!1}a(i3o,"isReadable");function rfn(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(rfn,"isReadableStream");function o3o(t){let e=t;return e?rfn(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a(o3o,"isReadableBufferedStream");function YTe(t,e){return new s6t(t,e)}a(YTe,"newWriteableStream");var s6t=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,n3o.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 s3o(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(s3o,"consumeReadable");function a3o(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(a3o,"peekReadable");function c3o(t,e){return new Promise((r,n)=>{let o=[];oVe(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(c3o,"consumeStream");function oVe(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(oVe,"listenStream");function l3o(t,e){return new Promise((r,n)=>{let o=new iVe.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,iVe.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,iVe.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,iVe.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(l3o,"peekStream");function u3o(t,e){let r=YTe(e);return r.end(t),r}a(u3o,"toStream");function d3o(){let t=YTe(()=>{throw new Error("not supported")});return t.end(),t}a(d3o,"emptyStream");function f3o(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(f3o,"toReadable");function p3o(t,e,r){let n=YTe(r);return oVe(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(p3o,"transform");function h3o(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(h3o,"prefixedReadable");function m3o(t,e,r){let n=!1,o=YTe(r);return oVe(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(m3o,"prefixedStream")});var uQ=I(hc=>{"use strict";p();var g3o=hc&&hc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),A3o=hc&&hc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),y3o=hc&&hc.__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)),a6t,c6t,Wy=class t{static{a(this,"VSBuffer")}static alloc(e){return KTe?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return KTe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&KTe?new t(Buffer.from(e)):(a6t||(a6t=new TextEncoder),new t(a6t.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])}};hc.VSBuffer=Wy;function sfn(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=_3o.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(v3o,"readUInt16LE");function C3o(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(C3o,"writeUInt16LE");function afn(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(afn,"readUInt32BE");function cfn(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(cfn,"writeUInt32BE");function lfn(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(lfn,"readUInt32LE");function ufn(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(ufn,"writeUInt32LE");function dfn(t,e){return t[e]}a(dfn,"readUInt8");function ffn(t,e,r){t[r]=e}a(ffn,"writeUInt8");function b3o(t){return lQ.consumeReadable(t,e=>Wy.concat(e))}a(b3o,"readableToBuffer");function S3o(t){return lQ.toReadable(t)}a(S3o,"bufferToReadable");function pfn(t){return lQ.consumeStream(t,e=>Wy.concat(e))}a(pfn,"streamToBuffer");async function T3o(t){return t.ended?Wy.concat(t.buffer):Wy.concat([...t.buffer,await pfn(t.stream)])}a(T3o,"bufferedStreamToBuffer");function I3o(t){return lQ.toStream(t,e=>Wy.concat(e))}a(I3o,"bufferToStream");function x3o(t){return lQ.transform(t,{data:a(e=>typeof e=="string"?Wy.fromString(e):Wy.wrap(e),"data")},e=>Wy.concat(e))}a(x3o,"streamToBufferReadableStream");function w3o(t){return lQ.newWriteableStream(e=>Wy.concat(e),t)}a(w3o,"newWriteableBufferStream");function R3o(t,e){return lQ.prefixedReadable(t,e,r=>Wy.concat(r))}a(R3o,"prefixedBufferReadable");function P3o(t,e){return lQ.prefixedStream(t,e,r=>Wy.concat(r))}a(P3o,"prefixedBufferStream");function k3o(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 Wy.wrap(o).slice(0,c)}a(k3o,"decodeBase64");var D3o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N3o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function M3o({buffer:t},e=!0,r=!1){let n=r?N3o:D3o,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(M3o,"encodeBase64");var ifn="0123456789abcdef";function O3o({buffer:t}){let e="";for(let r=0;r>>4],e+=ifn[n&15]}return e}a(O3o,"encodeHex");function B3o(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]=ofn(t,r++)<<4|ofn(t,r++);return Wy.wrap(e)}a(B3o,"decodeHex");function ofn(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(ofn,"decodeHexChar")});var hfn=I(sVe=>{"use strict";p();Object.defineProperty(sVe,"__esModule",{value:!0});sVe.readVariableLengthQuantity=F3o;sVe.writeVariableLengthQuantity=U3o;var L3o=uQ();function F3o(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 L3o.VSBuffer.fromByteArray(e)}a(U3o,"writeVariableLengthQuantity")});var l6t=I(aVe=>{"use strict";p();Object.defineProperty(aVe,"__esModule",{value:!0});aVe.parseTikTokenBinary=void 0;var Q3o=require("fs"),q3o=hfn(),j3o=uQ(),H3o=a(t=>{let e=(0,Q3o.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(cVe,"__esModule",{value:!0});cVe.CopilotPromptLoadFailure=void 0;var u6t=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};cVe.CopilotPromptLoadFailure=u6t});var f6t=I(kx=>{"use strict";p();var G3o=kx&&kx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$3o=kx&&kx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),V3o=kx&&kx.__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(Dx,"__esModule",{value:!0});Dx.initializeTokenizers=Dx.ApproximateTokenizer=Dx.TTokenizer=Dx.TokenizerName=void 0;Dx.getTokenizer=eFo;var p6t=y8t(),K3o=l6t(),J3o=d6t(),Z3o=f6t(),kY;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(kY||(Dx.TokenizerName=kY={}));var Afn=new Map;var tle=null;function X3o(t){tle=t}a(X3o,"setExternalTokenizerProvider");Dx.setExternalTokenizerProvider=X3o;function eFo(t=kY.o200k){if(tle)return tle.getTokenizer(t);let e=Afn.get(t);return e!==void 0||(e=Afn.get(kY.o200k),e!==void 0)?e:new lVe}a(eFo,"getTokenizer");var m6t=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,p6t.createTokenizer)((0,K3o.parseTikTokenBinary)((0,Z3o.locateFile)(`${e}.tiktoken`)),(0,p6t.getSpecialTokensByEncoder)(e),(0,p6t.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new J3o.CopilotPromptLoadFailure("Could not load tokenizer",r):r}}tokenize(e){return this._tokenizer.encode(e)}detokenize(e){return this._tokenizer.decode(e)}tokenLength(e){return this.tokenize(e).length}tokenizeStrings(e){return this.tokenize(e).map(n=>this.detokenize([n]))}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.length{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-h6t),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-h6t)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?tFo[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)}};Dx.ApproximateTokenizer=lVe;Dx.initializeTokenizers={then(t,e){return(tle&&typeof tle.ensureLoaded=="function"?tle.ensureLoaded():Promise.resolve()).then(t,e)},catch(t){return this.then(void 0,t)},finally(t){return this.then(e=>(t&&t(),e),e=>{throw t&&t(),e})}}});var yfn=I(A6t=>{"use strict";p();Object.defineProperty(A6t,"__esModule",{value:!0});A6t.assertNever=rFo;function rFo(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(rFo,"assertNever")});var JTe=I(h3=>{"use strict";p();Object.defineProperty(h3,"__esModule",{value:!0});h3.ChatCompletionContentPartOpaque=h3.ChatCompletionContentPartKind=h3.ChatRole=void 0;var nFo=yfn(),uVe;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(uVe||(h3.ChatRole=uVe={}));(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,nFo.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(uVe||(h3.ChatRole=uVe={}));var Efn;(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"})(Efn||(h3.ChatCompletionContentPartKind=Efn={}));var _fn;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})(_fn||(h3.ChatCompletionContentPartOpaque=_fn={}))});var y6t=I(ZM=>{"use strict";p();Object.defineProperty(ZM,"__esModule",{value:!0});ZM.BaseTokensPerName=ZM.BaseTokensPerMessage=ZM.BaseTokensPerCompletion=ZM.ChatRole=void 0;var vfn;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(vfn||(ZM.ChatRole=vfn={}));ZM.BaseTokensPerCompletion=3;ZM.BaseTokensPerMessage=3;ZM.BaseTokensPerName=1});var Tfn=I(fVe=>{"use strict";p();Object.defineProperty(fVe,"__esModule",{value:!0});fVe.toOpenAiChatMessage=Sfn;fVe.toOpenAIChatMessages=oFo;var XM=JTe(),dVe=y6t(),iFo=dQ();function Cfn(t){return t.filter(e=>e.type===XM.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(Cfn,"onlyStringContent");function bfn(t){let e=t.map(r=>{if(r.type===XM.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===XM.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===XM.ChatCompletionContentPartKind.Document)return;if(r.type===XM.ChatCompletionContentPartKind.Opaque&&XM.ChatCompletionContentPartOpaque.usableIn(r,iFo.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(bfn,"stringAndImageContent");function Sfn(t){switch(t.role){case XM.ChatRole.System:return{role:dVe.ChatRole.System,content:Cfn(t.content),name:t.name};case XM.ChatRole.User:return{role:dVe.ChatRole.User,content:bfn(t.content),name:t.name};case XM.ChatRole.Assistant:return{role:dVe.ChatRole.Assistant,content:Cfn(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case XM.ChatRole.Tool:return{role:dVe.ChatRole.Tool,content:bfn(t.content),tool_call_id:t.toolCallId};default:return}}a(Sfn,"toOpenAiChatMessage");function oFo(t){return t.map(Sfn).filter(e=>!!e)}a(oFo,"toOpenAIChatMessages")});var xfn=I(mVe=>{"use strict";p();Object.defineProperty(mVe,"__esModule",{value:!0});mVe.toVsCodeChatMessage=Ifn;mVe.toVsCodeChatMessages=sFo;var hVe=JTe();function pVe(t){return t.filter(e=>e.type===hVe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(pVe,"onlyStringContent");var fQ;function Ifn(t){switch(fQ??=require("vscode"),t.role){case hVe.ChatRole.Assistant:let e=fQ.LanguageModelChatMessage.Assistant(pVe(t.content),t.name);return t.toolCalls&&(e.content=[new fQ.LanguageModelTextPart(pVe(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 fQ.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case hVe.ChatRole.User:return fQ.LanguageModelChatMessage.User(pVe(t.content),t.name);case hVe.ChatRole.Tool:{let r=fQ.LanguageModelChatMessage.User("");return r.content=[new fQ.LanguageModelToolResultPart(t.toolCallId,[new fQ.LanguageModelTextPart(pVe(t.content))])],r}default:return}}a(Ifn,"toVsCodeChatMessage");function sFo(t){return t.map(Ifn).filter(e=>!!e)}a(sFo,"toVsCodeChatMessages")});var dQ=I(Sk=>{"use strict";p();Object.defineProperty(Sk,"__esModule",{value:!0});Sk.OutputMode=Sk.Raw=Sk.OpenAI=void 0;Sk.toMode=E6t;Sk.toVSCode=aFo;Sk.toOpenAI=cFo;var wfn=Tfn(),Rfn=xfn();Sk.OpenAI=y6t();Sk.Raw=JTe();var DY;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(DY||(Sk.OutputMode=DY={}));function E6t(t,e){switch(t){case DY.Raw:return e;case DY.VSCode:return e instanceof Array?(0,Rfn.toVsCodeChatMessages)(e):(0,Rfn.toVsCodeChatMessage)(e);case DY.OpenAI:return e instanceof Array?(0,wfn.toOpenAIChatMessages)(e):(0,wfn.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(E6t,"toMode");function aFo(t){return E6t(DY.VSCode,t)}a(aFo,"toVSCode");function cFo(t){return E6t(DY.OpenAI,t)}a(cFo,"toOpenAI")});var _6t=I(ZTe=>{"use strict";p();Object.defineProperty(ZTe,"__esModule",{value:!0});ZTe.jsonRetainedProps=void 0;ZTe.forEachNode=Pfn;ZTe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function Pfn(t,e){if(e(t),t.type===1)for(let r of t.children)Pfn(r,e)}a(Pfn,"forEachNode")});var kfn=I(v6t=>{"use strict";p();Object.defineProperty(v6t,"__esModule",{value:!0});v6t.once=lFo;function lFo(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(lFo,"once")});var T6t=I(eg=>{"use strict";p();Object.defineProperty(eg,"__esModule",{value:!0});eg.BudgetExceededError=eg.MaterializedChatMessageDocument=eg.MaterializedChatMessageImage=eg.MaterializedChatMessageBreakpoint=eg.MaterializedChatMessageOpaque=eg.MaterializedChatMessage=eg.MaterializedChatMessageTextChunk=eg.GenericMaterializedContainer=void 0;var NY=kfn(),yA=dQ(),m3=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=hQ(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 Qfn(e,this.children,r)}allMetadata(){return Ufn(this)}findById(e){return S6t(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)uFo(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof Ik&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof Ik||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return b6t(this,e),e}};eg.GenericMaterializedContainer=m3;var XTe=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,NY.once)(async e=>await e.tokenLength({type:yA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};eg.MaterializedChatMessageTextChunk=XTe;var Ik=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=Qfn(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return b6t(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return S6t(e,this)}_tokenCount=(0,NY.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,yA.toMode)(e.mode,r))});_upperBound=(0,NY.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,NY.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===yA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===yA.Raw.ChatCompletionContentPartKind.Image||n.type===yA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,yA.toMode)(e.mode,r))});_text=(0,NY.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of Lfn(this)){if(r instanceof MY||r instanceof OY||r instanceof pQ){e.push(r);continue}if(r instanceof Tk){e.at(-1)instanceof Tk?e[e.length-1]=r:e.push(r);continue}if(r.lineBreakBefore===1||r.lineBreakBefore===2&&!n){let o=e[e.length-1];typeof o=="string"&&o&&!o.endsWith(` -`)&&(e[e.length-1]=o+` -`)}typeof e[e.length-1]=="string"?e[e.length-1]+=r.text:e.push(r.text)}return e});toChatMessage(){let e=this.text.map(r=>{if(typeof r=="string")return{type:yA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof MY)return{type:yA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:qfn(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof OY)return{type:yA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof pQ)return{type:yA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof Tk)return r.part;throw new Error("Unexpected element type")});if(this.role===yA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===yA.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===yA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===yA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};eg.MaterializedChatMessage=Ik;var pQ=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&&yA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};eg.MaterializedChatMessageOpaque=pQ;var Tk=class{static{a(this,"MaterializedChatMessageBreakpoint")}parent;part;metadata=[];priority=Number.MAX_SAFE_INTEGER;constructor(e,r){this.parent=e,this.part=r}upperBoundTokenCount(e){return 0}isEmpty=!1};eg.MaterializedChatMessageBreakpoint=Tk;var MY=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,NY.once)(async e=>e.tokenLength({type:yA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:qfn(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};eg.MaterializedChatMessageImage=MY;var OY=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,NY.once)(async e=>e.tokenLength({type:yA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};eg.MaterializedChatMessageDocument=OY;function hQ(t){return t instanceof m3||t instanceof Ik}a(hQ,"isContainerType");function Bfn(t){return t instanceof XTe||t instanceof MY||t instanceof OY||t instanceof pQ||t instanceof Tk}a(Bfn,"isContentType");function uFo(t){if(!hQ(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(uFo,"assertContainerOrChatMessage");function*Lfn(t,e=!1){for(let r of t.children)r instanceof XTe?(yield{content:r,isTextSibling:e},e=!0):r instanceof MY||r instanceof OY||r instanceof pQ||r instanceof Tk?yield{content:r,isTextSibling:!1}:r instanceof pQ?yield{content:r,isTextSibling:!0}:(r&&(yield*Lfn(r,e)),e=!1)}a(Lfn,"contentChunks");function dFo(t,e){let r;function n(o,s){if(Bfn(o))(!r||o.priorityn instanceof Tk):t instanceof m3&&(r=t.children.some(Ffn)),Dfn.set(t,r),r}a(Ffn,"hasCachePoint");function fFo(t){if(t instanceof Ik)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof Ik)return!1;return!0}a(fFo,"shouldLookForCachePointInNode");function b6t(t,e){let r;if(t instanceof m3&&t.has(1)){dFo(t,e);return}let n=fFo(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 Ik?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};eg.BudgetExceededError=gVe;function Nfn(t){if(!hQ(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(Nfn,"getLowestPriorityAmongChildren");function*Ufn(t){yield*t.metadata;for(let e of t.children)hQ(e)?yield*Ufn(e):yield*e.metadata}a(Ufn,"allMetadata");function Qfn(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,hQ(r)&&e.push(...r.children)}}a(Mfn,"forEachNode");function pFo(t){let e=t;for(;e.parent;)e=e.parent;return e}a(pFo,"getRoot");function Ofn(t){return t instanceof m3&&t.keepWithId!==void 0}a(Ofn,"isKeepWith");var C6t=new Set;function hFo(t,e){let r=new Set;for(let n of Mfn(t))Ofn(n)&&!C6t.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)C6t.add(n);try{let n=pFo(t);for(let o of Mfn(n))Ofn(o)&&r.has(o.keepWithId)?eIe(o,e):o instanceof Ik&&o.toolCalls&&(o.toolCalls=mFo(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&&eIe(o,e))}finally{for(let n of r)C6t.delete(n)}}a(hFo,"removeOtherKeepWiths");function S6t(t,e){if(e.id===t)return e;for(let r of e.children)if(hQ(r)){let n=S6t(t,r);if(n)return n}}a(S6t,"findNodeById");function eIe(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),hFo(t,e),r.isEmpty?eIe(r,e):r.onChunksChange())}a(eIe,"removeNode");function qfn(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(qfn,"getEncodedBase64");function mFo(t,e){for(let r=0;r{"use strict";p();function gFo(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(gFo,"_vscpp");function jfn(){throw new Error("This should not be invoked!")}a(jfn,"_vscppf");jfn.isFragment=!0;globalThis.vscpp=gFo;globalThis.vscppf=jfn});var x6t=I(AVe=>{"use strict";p();Object.defineProperty(AVe,"__esModule",{value:!0});AVe.PromptElement=void 0;Hfn();var I6t=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}};AVe.PromptElement=I6t});var F6t=I(Ls=>{"use strict";p();Object.defineProperty(Ls,"__esModule",{value:!0});Ls.LogicalWrapper=Ls.IfEmpty=Ls.AbstractKeepWith=Ls.TokenLimit=Ls.Expandable=Ls.Chunk=Ls.LegacyPrioritization=Ls.ToolResult=Ls.PrioritizedList=Ls.Document=Ls.Image=Ls.TextChunk=Ls.ToolMessage=Ls.AssistantMessage=Ls.UserMessage=Ls.SystemMessage=Ls.BaseChatMessage=void 0;Ls.isChatMessagePromptElement=AFo;Ls.useKeepWith=vFo;var rIe=xo(),TS=x6t();function AFo(t){return t instanceof yVe||t instanceof EVe||t instanceof _Ve}a(AFo,"isChatMessagePromptElement");var BY=class extends TS.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};Ls.BaseChatMessage=BY;var yVe=class extends BY{static{a(this,"SystemMessage")}constructor(e){e.role=rIe.Raw.ChatRole.System,super(e)}};Ls.SystemMessage=yVe;var EVe=class extends BY{static{a(this,"UserMessage")}constructor(e){e.role=rIe.Raw.ChatRole.User,super(e)}};Ls.UserMessage=EVe;var _Ve=class extends BY{static{a(this,"AssistantMessage")}constructor(e){e.role=rIe.Raw.ChatRole.Assistant,super(e)}};Ls.AssistantMessage=_Ve;var yFo=/\s+/g,w6t=class extends BY{static{a(this,"ToolMessage")}constructor(e){e.role=rIe.Raw.ChatRole.Tool,super(e)}};Ls.ToolMessage=w6t;var vVe=class extends TS.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?yFo: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 EFo(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};Ls.TextChunk=vVe;async function EFo(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(EFo,"getTextContentBelowBudget");var R6t=class extends TS.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Ls.Image=R6t;var P6t=class extends TS.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Ls.Document=P6t;var k6t=class extends TS.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(vVe,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};Ls.PrioritizedList=k6t;var D6t=class extends TS.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})}))}};Ls.ToolResult=D6t;var N6t=class extends TS.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};Ls.LegacyPrioritization=N6t;var M6t=class extends TS.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};Ls.Chunk=M6t;var O6t=class extends TS.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};Ls.Expandable=O6t;var B6t=class extends TS.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};Ls.TokenLimit=B6t;var CVe=class extends TS.PromptElement{static{a(this,"AbstractKeepWith")}};Ls.AbstractKeepWith=CVe;var _Fo=0;function vFo(){let t=_Fo++;return class extends CVe{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a(vFo,"useKeepWith");var L6t=class extends TS.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp(tIe,null,this.props.alt),vscpp(tIe,{flexGrow:1},this.props.children))}};Ls.IfEmpty=L6t;var tIe=class extends TS.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};Ls.LogicalWrapper=tIe});var $fn=I(nIe=>{"use strict";p();Object.defineProperty(nIe,"__esModule",{value:!0});nIe.localize=CFo;nIe.localize2=bFo;nIe.getConfiguredDefaultLocale=SFo;function Gfn(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(Gfn,"_format");function CFo(t,e,...r){return Gfn(e,r)}a(CFo,"localize");function bFo(t,e,...r){let n=Gfn(e,r);return{original:n,value:n}}a(bFo,"localize2");function SFo(t){}a(SFo,"getConfiguredDefaultLocale")});var j6t=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=IFo;Sr.isLittleEndian=xFo;Sr.isBigSurOrNewer=wFo;var Vfn=$fn();Sr.LANGUAGE_DEFAULT="en";var sIe=!1,aIe=!1,oIe=!1,Kfn=!1,Jfn=!1,Q6t=!1,Zfn=!1,q6t=!1,Xfn=!1,epn=!1,iIe,bVe=Sr.LANGUAGE_DEFAULT,U6t=Sr.LANGUAGE_DEFAULT,tpn,g3,A3=globalThis,IS;typeof A3.vscode<"u"&&typeof A3.vscode.process<"u"?IS=A3.vscode.process:typeof process<"u"&&(IS=process);var rpn=typeof IS?.versions?.electron=="string",TFo=rpn&&IS?.type==="renderer";if(typeof IS=="object"){sIe=IS.platform==="win32",aIe=IS.platform==="darwin",oIe=IS.platform==="linux",Kfn=oIe&&!!IS.env.SNAP&&!!IS.env.SNAP_REVISION,Zfn=rpn,Xfn=!!IS.env.CI||!!IS.env.BUILD_ARTIFACTSTAGINGDIRECTORY,iIe=Sr.LANGUAGE_DEFAULT,bVe=Sr.LANGUAGE_DEFAULT;let t=IS.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];iIe=e.locale,U6t=e.osLocale,bVe=r||Sr.LANGUAGE_DEFAULT,tpn=e._translationsConfigFile}catch{}Jfn=!0}else typeof navigator=="object"&&!TFo?(g3=navigator.userAgent,sIe=g3.indexOf("Windows")>=0,aIe=g3.indexOf("Macintosh")>=0,q6t=(g3.indexOf("Macintosh")>=0||g3.indexOf("iPad")>=0||g3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,oIe=g3.indexOf("Linux")>=0,epn=g3?.indexOf("Mobi")>=0,Q6t=!0,iIe=Vfn.getConfiguredDefaultLocale(Vfn.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||Sr.LANGUAGE_DEFAULT,bVe=iIe,U6t=navigator.language):console.error("Unable to resolve platform.");function IFo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(IFo,"PlatformToString");var SVe=0;aIe?SVe=1:sIe?SVe=3:oIe&&(SVe=2);Sr.isWindows=sIe;Sr.isMacintosh=aIe;Sr.isLinux=oIe;Sr.isLinuxSnap=Kfn;Sr.isNative=Jfn;Sr.isElectron=Zfn;Sr.isWeb=Q6t;Sr.isWebWorker=Q6t&&typeof A3.importScripts=="function";Sr.webWorkerOrigin=Sr.isWebWorker?A3.origin:void 0;Sr.isIOS=q6t;Sr.isMobile=epn;Sr.isCI=Xfn;Sr.platform=SVe;Sr.userAgent=g3;Sr.language=bVe;var Wfn;(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})(Wfn||(Sr.Language=Wfn={}));Sr.locale=iIe;Sr.platformLocale=U6t;Sr.translationsConfigFile=tpn;Sr.setTimeout0IsFaster=typeof A3.postMessage=="function"&&!A3.importScripts;Sr.setTimeout0=(()=>{if(Sr.setTimeout0IsFaster){let t=[];A3.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}),A3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();Sr.OS=aIe||q6t?2:sIe?1:3;var zfn=!0,Yfn=!1;function xFo(){if(!Yfn){Yfn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,zfn=new Uint16Array(t.buffer)[0]===513}return zfn}a(xFo,"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 wFo(t){return parseFloat(t)>=20}a(wFo,"isBigSurOrNewer")});var ipn=I(eO=>{"use strict";p();Object.defineProperty(eO,"__esModule",{value:!0});eO.arch=eO.platform=eO.env=eO.cwd=void 0;var npn=j6t(),LY,H6t=globalThis.vscode;if(typeof H6t<"u"&&typeof H6t.process<"u"){let t=H6t.process;LY={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?LY={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:LY={get platform(){return npn.isWindows?"win32":npn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};eO.cwd=LY.cwd;eO.env=LY.env;eO.platform=LY.platform;eO.arch=LY.arch});var spn=I(pn=>{"use strict";p();Object.defineProperty(pn,"__esModule",{value:!0});pn.delimiter=pn.sep=pn.toNamespacedPath=pn.parse=pn.format=pn.extname=pn.basename=pn.dirname=pn.relative=pn.resolve=pn.join=pn.isAbsolute=pn.normalize=pn.posix=pn.win32=void 0;var rle=ipn(),RFo=65,PFo=97,kFo=90,DFo=122,AQ=46,tg=47,SC=92,mQ=58,NFo=63,TVe=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 MFo(t,e){if(t===null||typeof t!="object")throw new TVe(e,"Object",t)}a(MFo,"validateObject");function Yf(t,e){if(typeof t!="string")throw new TVe(e,"string",t)}a(Yf,"validateString");var TC=rle.platform==="win32";function Xo(t){return t===tg||t===SC}a(Xo,"isPathSeparator");function G6t(t){return t===tg}a(G6t,"isPosixPathSeparator");function gQ(t){return t>=RFo&&t<=kFo||t>=PFo&&t<=DFo}a(gQ,"isWindowsDeviceRoot");function IVe(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===AQ&&l!==-1?++l:l=-1}return o}a(IVe,"normalizeString");function opn(t,e){MFo(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(opn,"_format");pn.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],Yf(s,"path"),s.length===0)continue}else e.length===0?s=rle.cwd():(s=rle.env[`=${e}`]||rle.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===SC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Xo(f)&&(l=1,d=!0);else if(Xo(f))if(d=!0,Xo(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Xo(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=IVe(r,!n,"\\",Xo),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Yf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return G6t(s)?"\\":t;if(Xo(s))if(o=!0,Xo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Xo(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Xo(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){Yf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Xo(r)||e>2&&gQ(r)&&t.charCodeAt(1)===mQ&&Xo(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&Xo(r.charCodeAt(0))){++o;let s=r.length;s>1&&Xo(r.charCodeAt(1))&&(++o,s>2&&(Xo(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return pn.win32.normalize(e)},relative(t,e){if(Yf(t,"from"),Yf(e,"to"),t===e)return"";let r=pn.win32.resolve(t),n=pn.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===SC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===SC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===SC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===SC?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)===SC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===SC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=pn.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===SC){if(e.charCodeAt(1)===SC){let r=e.charCodeAt(2);if(r!==NFo&&r!==AQ)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(gQ(e.charCodeAt(0))&&e.charCodeAt(1)===mQ&&e.charCodeAt(2)===SC)return`\\\\?\\${e}`;return t},dirname(t){Yf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Xo(o)?t:".";if(Xo(o)){if(r=n=1,Xo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Xo(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Xo(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&Yf(e,"ext"),Yf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&gQ(t.charCodeAt(0))&&t.charCodeAt(1)===mQ&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(Xo(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(Xo(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Yf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===mQ&&gQ(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Xo(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===AQ?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:opn.bind(null,"\\"),parse(t){Yf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return Xo(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Xo(o)){if(n=1,Xo(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),Xo(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===AQ?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 OFo=(()=>{if(TC){let t=/\\/g;return()=>{let e=rle.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>rle.cwd()})();pn.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:OFo();Yf(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===tg)}return e=IVe(e,!r,"/",G6t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Yf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===tg,r=t.charCodeAt(t.length-1)===tg;return t=IVe(t,!e,"/",G6t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Yf(t,"path"),t.length>0&&t.charCodeAt(0)===tg},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":pn.posix.normalize(e)},relative(t,e){if(Yf(t,"from"),Yf(e,"to"),t===e||(t=pn.posix.resolve(t),e=pn.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===tg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===tg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===tg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Yf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===tg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===tg){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&Yf(e,"ext"),Yf(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===tg){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===tg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Yf(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===tg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===AQ?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:opn.bind(null,"/"),parse(t){Yf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===tg,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===tg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===AQ?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};pn.posix.win32=pn.win32.win32=pn.win32;pn.posix.posix=pn.win32.posix=pn.posix;pn.normalize=TC?pn.win32.normalize:pn.posix.normalize;pn.isAbsolute=TC?pn.win32.isAbsolute:pn.posix.isAbsolute;pn.join=TC?pn.win32.join:pn.posix.join;pn.resolve=TC?pn.win32.resolve:pn.posix.resolve;pn.relative=TC?pn.win32.relative:pn.posix.relative;pn.dirname=TC?pn.win32.dirname:pn.posix.dirname;pn.basename=TC?pn.win32.basename:pn.posix.basename;pn.extname=TC?pn.win32.extname:pn.posix.extname;pn.format=TC?pn.win32.format:pn.posix.format;pn.parse=TC?pn.win32.parse:pn.posix.parse;pn.toNamespacedPath=TC?pn.win32.toNamespacedPath:pn.posix.toNamespacedPath;pn.sep=TC?pn.win32.sep:pn.posix.sep;pn.delimiter=TC?pn.win32.delimiter:pn.posix.delimiter});var ppn=I(nle=>{"use strict";p();Object.defineProperty(nle,"__esModule",{value:!0});nle.URI=void 0;nle.isUriComponents=HFo;nle.uriToFsPath=PVe;var apn=spn(),wVe=j6t(),BFo=/^\w[\w\d+.-]*$/,LFo=/^\//,FFo=/^\/\//;function UFo(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&&!BFo.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!LFo.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(FFo.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(UFo,"_validateUri");function QFo(t,e){return!t&&!e?"file":t}a(QFo,"_schemeFix");function qFo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==xk&&(e=xk+e):e=xk;break}return e}a(qFo,"_referenceResolution");var Bl="",xk="/",jFo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,RVe=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||Bl,this.authority=e.authority||Bl,this.path=e.path||Bl,this.query=e.query||Bl,this.fragment=e.fragment||Bl):(this.scheme=QFo(e,c),this.authority=r||Bl,this.path=qFo(this.scheme,n||Bl),this.query=o||Bl,this.fragment=s||Bl,UFo(this,c))}get fsPath(){return PVe(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=Bl),n===void 0?n=this.authority:n===null&&(n=Bl),o===void 0?o=this.path:o===null&&(o=Bl),s===void 0?s=this.query:s===null&&(s=Bl),c===void 0?c=this.fragment:c===null&&(c=Bl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new yQ(r,n,o,s,c)}static parse(e,r=!1){let n=jFo.exec(e);return n?new yQ(n[2]||Bl,xVe(n[4]||Bl),xVe(n[5]||Bl),xVe(n[7]||Bl),xVe(n[9]||Bl),r):new yQ(Bl,Bl,Bl,Bl,Bl)}static file(e){let r=Bl;if(wVe.isWindows&&(e=e.replace(/\\/g,xk)),e[0]===xk&&e[1]===xk){let n=e.indexOf(xk,2);n===-1?(r=e.substring(2),e=xk):(r=e.substring(2,n),e=e.substring(n)||xk)}return new yQ("file",r,e,Bl,Bl)}static from(e,r){return new yQ(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 wVe.isWindows&&e.scheme==="file"?n=t.file(apn.win32.join(PVe(e,!0),...r)).path:n=apn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return $6t(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new yQ(e);return r._formatted=e.external??null,r._fsPath=e._sep===upn?e.fsPath??null:null,r}}else return e}};nle.URI=RVe;function HFo(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(HFo,"isUriComponents");var upn=wVe.isWindows?1:void 0,yQ=class extends RVe{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=PVe(this,!1)),this._fsPath}toString(e=!1){return e?$6t(this,!0):(this._formatted||(this._formatted=$6t(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=upn),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}},dpn={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 cpn(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=dpn[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(cpn,"encodeURIComponentFast");function GFo(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,wVe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(PVe,"uriToFsPath");function $6t(t,e){let r=e?GFo:cpn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=xk,n+=xk),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:cpn(u,!1,!1)),n}a($6t,"_asFormatted");function fpn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+fpn(t.substr(3)):t}}a(fpn,"decodeURIComponentGraceful");var lpn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function xVe(t){return t.match(lpn)?t.replace(lpn,e=>fpn(e)):t}a(xVe,"percentDecode")});var z6t=I(EQ=>{"use strict";p();Object.defineProperty(EQ,"__esModule",{value:!0});EQ.PromptReference=EQ.ChatResponseReferencePartStatusKind=EQ.PromptMetadata=void 0;var cIe=ppn(),V6t=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};EQ.PromptMetadata=V6t;var hpn;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(hpn||(EQ.ChatResponseReferencePartStatusKind=hpn={}));var W6t=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?cIe.URI.from(n):{uri:cIe.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?cIe.URI.from(e.iconPath):"light"in e.iconPath?{light:cIe.URI.from(e.iconPath.light),dark:cIe.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}}};EQ.PromptReference=W6t});var r9t=I(ile=>{"use strict";p();Object.defineProperty(ile,"__esModule",{value:!0});ile.PromptRenderer=ile.MetadataMap=void 0;var $Fo=_6t(),_Q=T6t(),UY=dQ(),Nd=F6t(),t9t=z6t(),DVe;(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")})})(DVe||(ile.MetadataMap=DVe={}));var Y6t=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new OVe(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=ypn(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 Nd.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:UY.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 gpn(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 gpn(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 FY(b.tokenBudget,this._endpoint),_,v,T,n,o);v instanceof Nd.Expandable&&this._growables.push({initialConsume:w,elem:_.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=Apn(o),u=new FY(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await VFo(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 FY(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,UY.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new FY(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 tO))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(BVe),h=o.map(m=>{if(!(m instanceof tO)||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(BVe);return{metadata:DVe.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 _Q.BudgetExceededError&&(m.metadata=DVe.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 Nd.Expandable))throw new Error("unreachable: expected growable");let l=new OVe(null,0,s.elem.id),u=new FY(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:UY.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===Nd.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},NVe(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 tO(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 tO(u));else this._handleIntrinsic(e,l.name,l.props,NVe(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};ile.PromptRenderer=Y6t;async function VFo(t,e,r,n){let o=0;if((0,Nd.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,UY.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:UY.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(VFo,"computeTokensConsumedByLiterals");function Apn(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new Z6t(String(t))):WFo(t)?NVe(t.children,e):zFo(t)?NVe(t,e):typeof t.ctor=="string"?e.push(new K6t(t.ctor,t.props,t.children)):e.push(new J6t(t.ctor,t.props,t.children)),e)}a(Apn,"flattenAndReduce");function NVe(t,e=[]){for(let r of t)Apn(r,e);return e}a(NVe,"flattenAndReduceArr");var K6t=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},J6t=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},Z6t=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},MVe=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 _Q.MaterializedChatMessageOpaque(e,{type:UY.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},FY=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}},OVe=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 tO(t9t.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return lIe.fromJSON(o,c,s);case 3:return MVe.fromJSON(o,c,s);default:}}).filter(BVe),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new Nd.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,Nd.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new Nd.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new Nd.Image(r.props);break;case 4:o._obj=new Nd.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 Nd.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof Nd.Chunk&&(this._objFlags|=2),this._obj instanceof Nd.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 lIe(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new lIe(this,r,` -`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new MVe(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(BVe),props:{},references:this._metadata.filter(r=>r instanceof tO).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=kVe(this._obj.props,$Fo.jsonRetainedProps)),this._obj instanceof Nd.BaseChatMessage)e.ctor=1,Object.assign(e.props,kVe(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof Nd.Image)return{...e,ctor:3,props:{...e.props,...kVe(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof Nd.Document)return{...e,ctor:4,props:{...e.props,...kVe(this._obj.props,["data","mediaType"])}};this._obj instanceof Nd.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 Nd.Image)return new _Q.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 Nd.Document)return new _Q.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 Nd.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new _Q.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof Nd.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof Nd.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 _Q.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 Nd.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof Nd.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new X6t({type:UY.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},X6t=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new _Q.MaterializedChatMessageBreakpoint(e,this.part)}},lIe=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 tO(t9t.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 _Q.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 tO).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function WFo(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a(WFo,"isFragmentCtor");function BVe(t){return t!==void 0}a(BVe,"isDefined");var e9t=class extends t9t.PromptMetadata{static{a(this,"InternalMetadata")}},tO=class extends e9t{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function zFo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(zFo,"isIterable");function kVe(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(kVe,"pickProps");function ypn(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(ypn,"atPath");var mpn=new WeakSet;async function gpn(t,e){try{return await e()}catch(r){throw r instanceof Error&&!mpn.has(r)&&r.constructor.name!=="CancellationError"&&(mpn.add(r),r.message+=` (at tsx element ${ypn(t.path)})`),r}}a(gpn,"annotateError")});var Epn=I(LVe=>{"use strict";p();Object.defineProperty(LVe,"__esModule",{value:!0});LVe.VSCodeTokenizer=void 0;var n9t=dQ(),i9t=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=n9t.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==n9t.OutputMode.VSCode)throw new Error("`mode` must be set to vscode when using vscode.LanguageModelChat as the tokenizer")}async tokenLength(e,r){return e.type===n9t.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};LVe.VSCodeTokenizer=i9t});var _pn=I(ole=>{"use strict";p();Object.defineProperty(ole,"__esModule",{value:!0});ole.tracerCss=ole.tracerSrc=void 0;ole.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';ole.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 Tpn=I(UVe=>{"use strict";p();Object.defineProperty(UVe,"__esModule",{value:!0});UVe.HTMLTracer=void 0;var vpn=_pn(),vQ=T6t(),YFo=dQ(),o9t=class{static{a(this,"HTMLTracer")}traceData;epochs=[];addRenderEpoch(e){this.epochs.push(e)}includeInEpoch(e){this.epochs[this.epochs.length-1].elements.push(e)}didMaterializeTree(e){this.traceData=e}async serveHTML(){return s9t.create({epochs:this.epochs,traceData:bpn(this.traceData)})}serveRouter(e){return new FVe({baseAddress:e,epochs:this.epochs,traceData:bpn(this.traceData)})}};UVe.HTMLTracer=o9t;var FVe=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 Cpn(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)})}},s9t=class t extends FVe{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 Cpn(t,e){return{container:await Spn(t,e.container,!1),removed:e.removed,budget:e.budget}}a(Cpn,"serializeRenderData");async function Spn(t,e,r){let n={metadata:e.metadata.map(JFo),priority:e.priority};if(e instanceof vQ.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof vQ.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof vQ.MaterializedChatMessageOpaque||e instanceof vQ.MaterializedChatMessageBreakpoint||e instanceof vQ.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>Spn(t,s,r||e instanceof vQ.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof vQ.GenericMaterializedContainer)return{...o,type:0};if(e instanceof vQ.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:YFo.Raw.ChatRole.display(e.role),text:s}}}KFo(e)}a(Spn,"serializeMaterialized");function KFo(t){throw new Error("unreachable")}a(KFo,"assertNever");function JFo(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(JFo,"serializeMetadata");var bpn=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var xpn=I(Ipn=>{"use strict";p();Object.defineProperty(Ipn,"__esModule",{value:!0})});var Rpn=I(wpn=>{"use strict";p();Object.defineProperty(wpn,"__esModule",{value:!0})});var kpn=I(Ppn=>{"use strict";p();Object.defineProperty(Ppn,"__esModule",{value:!0})});var xo=I(Yu=>{"use strict";p();var ZFo=Yu&&Yu.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QY=Yu&&Yu.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZFo(e,t,r)};Object.defineProperty(Yu,"__esModule",{value:!0});Yu.contentType=Yu.PromptRenderer=Yu.MetadataMap=Yu.PromptElement=Yu.JSONTree=void 0;Yu.renderPrompt=t8o;Yu.renderElementJSON=r8o;var a9t=dQ(),Dpn=r9t(),XFo=Epn();QY(Tpn(),Yu);Yu.JSONTree=_6t();QY(dQ(),Yu);QY(F6t(),Yu);QY(z6t(),Yu);QY(xpn(),Yu);QY(Rpn(),Yu);QY(kpn(),Yu);var e8o=x6t();Object.defineProperty(Yu,"PromptElement",{enumerable:!0,get:a(function(){return e8o.PromptElement},"get")});var Npn=r9t();Object.defineProperty(Yu,"MetadataMap",{enumerable:!0,get:a(function(){return Npn.MetadataMap},"get")});Object.defineProperty(Yu,"PromptRenderer",{enumerable:!0,get:a(function(){return Npn.PromptRenderer},"get")});async function t8o(t,e,r,n,o,s,c=a9t.OutputMode.VSCode){let l="countTokens"in n?new XFo.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new Dpn.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(t8o,"renderPrompt");Yu.contentType="application/vnd.codechat.prompt+json.1";function r8o(t,e,r,n){return new Dpn.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:a9t.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===a9t.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(r8o,"renderElementJSON")});var l9t=I(sle=>{"use strict";p();Object.defineProperty(sle,"__esModule",{value:!0});sle.DisposablesLRUCache=sle.LRUCache=void 0;var uIe=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},QVe=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 uIe("",null),this._tail=new uIe("",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 uIe(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}};sle.LRUCache=QVe;var c9t=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new QVe(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()}};sle.DisposablesLRUCache=c9t});var d9t=I(rO=>{"use strict";p();Object.defineProperty(rO,"__esModule",{value:!0});rO.getImageDimensions=n8o;rO.getImageDimensionsFromBytes=i8o;rO.getPngDimensions=Mpn;rO.getGifDimensions=Opn;rO.getJpegDimensions=Bpn;rO.getWebPDimensions=Qpn;rO.getMimeType=Hpn;rO.extractImageAttributes=a8o;function n8o(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(Hpn(e)){case"image/png":return Mpn(e);case"image/gif":return Opn(e);case"image/jpeg":case"image/jpg":return Bpn(e);case"image/webp":return Qpn(e);default:throw new Error("Unsupported image format")}}a(n8o,"getImageDimensions");function i8o(t,e){switch(o8o(e)){case"image/png":return Lpn(t);case"image/gif":return Fpn(t);case"image/jpeg":case"image/jpg":return Upn(t);case"image/webp":return qpn(t);default:throw new Error("Unsupported image format")}}a(i8o,"getImageDimensionsFromBytes");function Mpn(t){return Lpn(qVe(t.slice(0,50)))}a(Mpn,"getPngDimensions");function Opn(t){return Fpn(qVe(t.slice(0,50)))}a(Opn,"getGifDimensions");function Bpn(t){return Upn(qVe(t))}a(Bpn,"getJpegDimensions");function Lpn(t){if(!jpn(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(Lpn,"getPngDimensionsFromBytes");function Fpn(t){if(!u9t(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(Fpn,"getGifDimensionsFromBytes");function Upn(t){if(!jpn(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(Upn,"getJpegDimensionsFromBytes");function Qpn(t){return qpn(qVe(t))}a(Qpn,"getWebPDimensions");function qpn(t){if(!u9t(t,0,"RIFF")||!u9t(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=s8o(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(qpn,"getWebPDimensionsFromBytes");function o8o(t){return t?.toLowerCase().split(";")[0].trim()}a(o8o,"normalizeMimeType");function qVe(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(qVe,"base64ToBytes");function jpn(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(CQ,"__esModule",{value:!0});CQ.IInstantiationService=CQ._util=void 0;CQ.createDecorator=Gpn;CQ.refineServiceDecorator=l8o;var y3;(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})(y3||(CQ._util=y3={}));CQ.IInstantiationService=Gpn("instantiationService");function c8o(t,e,r){e[y3.DI_TARGET]===e?e[y3.DI_DEPENDENCIES].push({id:t,index:r}):(e[y3.DI_DEPENDENCIES]=[{id:t,index:r}],e[y3.DI_TARGET]=e)}a(c8o,"storeServiceDependency");function Gpn(t){if(y3.serviceIds.has(t))return y3.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");c8o(e,r,o)},"id");return e.toString=()=>t,y3.serviceIds.set(t,e),e}a(Gpn,"createDecorator");function l8o(t){return t}a(l8o,"refineServiceDecorator")});var ale=I(jVe=>{"use strict";p();Object.defineProperty(jVe,"__esModule",{value:!0});jVe.LinkedList=void 0;var lu=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}},f9t=class{static{a(this,"LinkedList")}constructor(){this._first=lu.Undefined,this._last=lu.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===lu.Undefined}clear(){let e=this._first;for(;e!==lu.Undefined;){let r=e.next;e.prev=lu.Undefined,e.next=lu.Undefined,e=r}this._first=lu.Undefined,this._last=lu.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new lu(e);if(this._first===lu.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!==lu.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==lu.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==lu.Undefined)return this._last.element}_remove(e){if(e.prev!==lu.Undefined&&e.next!==lu.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===lu.Undefined&&e.next===lu.Undefined?(this._first=lu.Undefined,this._last=lu.Undefined):e.next===lu.Undefined?(this._last=this._last.prev,this._last.next=lu.Undefined):e.prev===lu.Undefined&&(this._first=this._first.next,this._first.prev=lu.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==lu.Undefined;)yield e.element,e=e.next}};jVe.LinkedList=f9t});var zpn=I(cle=>{"use strict";p();Object.defineProperty(cle,"__esModule",{value:!0});cle.getNLSMessages=$pn;cle.getNLSLanguage=Vpn;cle.localize=d8o;cle.localize2=f8o;function $pn(){return globalThis._VSCODE_NLS_MESSAGES}a($pn,"getNLSMessages");function Vpn(){return globalThis._VSCODE_NLS_LANGUAGE}a(Vpn,"getNLSLanguage");var u8o=Vpn()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function HVe(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}),u8o&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(HVe,"_format");function d8o(t,e,...r){return HVe(typeof t=="number"?Wpn(t,e):e,r)}a(d8o,"localize");function Wpn(t,e){let r=$pn()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(Wpn,"lookupMessage");function f8o(t,e,...r){let n;typeof t=="number"?n=Wpn(t,e):n=e;let o=HVe(n,r);return{value:o,original:e===n?o:HVe(e,r)}}a(f8o,"localize2")});var bQ=I(pr=>{"use strict";p();var p8o=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]})),h8o=pr&&pr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),m8o=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,hIe=E3.indexOf("Macintosh")>=0,m9t=(E3.indexOf("Macintosh")>=0||E3.indexOf("iPad")>=0||E3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,fIe=E3.indexOf("Linux")>=0,rhn=E3?.indexOf("Mobi")>=0,h9t=!0,GVe=g8o.getNLSLanguage()||pr.LANGUAGE_DEFAULT,dIe=navigator.language.toLowerCase(),p9t=dIe):console.error("Unable to resolve platform.");function y8o(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(y8o,"PlatformToString");var $Ve=0;hIe?$Ve=1:pIe?$Ve=3:fIe&&($Ve=2);pr.isWindows=pIe;pr.isMacintosh=hIe;pr.isLinux=fIe;pr.isLinuxSnap=Zpn;pr.isNative=Xpn;pr.isElectron=ehn;pr.isWeb=h9t;pr.isWebWorker=h9t&&typeof _3.importScripts=="function";pr.webWorkerOrigin=pr.isWebWorker?_3.origin:void 0;pr.isIOS=m9t;pr.isMobile=rhn;pr.isCI=thn;pr.platform=$Ve;pr.userAgent=E3;pr.language=GVe;var Ypn;(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})(Ypn||(pr.Language=Ypn={}));pr.locale=dIe;pr.platformLocale=p9t;pr.translationsConfigFile=nhn;pr.setTimeout0IsFaster=typeof _3.postMessage=="function"&&!_3.importScripts;pr.setTimeout0=(()=>{if(pr.setTimeout0IsFaster){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)})();pr.OS=hIe||m9t?2:pIe?1:3;var Kpn=!0,Jpn=!1;function E8o(){if(!Jpn){Jpn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,Kpn=new Uint16Array(t.buffer)[0]===513}return Kpn}a(E8o,"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 _8o(t){return parseFloat(t)>=25}a(_8o,"isTahoeOrNewer")});var mIe=I(nO=>{"use strict";p();Object.defineProperty(nO,"__esModule",{value:!0});nO.arch=nO.platform=nO.env=nO.cwd=void 0;var ohn=bQ(),qY,g9t=globalThis.vscode;if(typeof g9t<"u"&&typeof g9t.process<"u"){let t=g9t.process;qY={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"?qY={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:qY={get platform(){return ohn.isWindows?"win32":ohn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};nO.cwd=qY.cwd;nO.env=qY.env;nO.platform=qY.platform;nO.arch=qY.arch});var iO=I(VVe=>{"use strict";p();Object.defineProperty(VVe,"__esModule",{value:!0});VVe.StopWatch=void 0;var v8o=globalThis.performance.now.bind(globalThis.performance),A9t=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:v8o,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}};VVe.StopWatch=A9t});var bc=I(ja=>{"use strict";p();Object.defineProperty(ja,"__esModule",{value:!0});ja.ValueWithChangeEvent=ja.Relay=ja.EventBufferer=ja.DynamicListEventMultiplexer=ja.EventMultiplexer=ja.MicrotaskEmitter=ja.DebounceEmitter=ja.PauseableEmitter=ja.AsyncEmitter=ja.createEventDeliveryQueue=ja.Emitter=ja.ListenerRefusalError=ja.ListenerLeakError=ja.EventProfiling=ja.Event=void 0;ja.setGlobalLeakWarningThreshold=w8o;ja.trackSetChanges=D8o;var C8o=O8t(),gIe=Is(),b8o=$8t(),xC=Io(),uhn=ale(),S8o=mIe(),T8o=iO(),shn=!1,I8o=!1,x8o=100,ahn=6e4;function chn(){return!!S8o.env.VSCODE_DEV}a(chn,"_isBufferLeakWarningEnabled");var WVe;(function(t){t.None=()=>xC.Disposable.None;function e(M){if(I8o){let{onDidAddListener:O}=M,q=ule.create(),Q=0;M.onDidAddListener=()=>{++Q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),q.print()),O?.()}}}a(e,"_addLeakageTraceLogic");function r(M,O,q){return g(M,()=>{},0,void 0,O??!0,void 0,q)}a(r,"defer"),t.defer=r;function n(M){return(O,q=null,Q)=>{let U=!1,z;return z=M($=>{if(!U)return z?z.dispose():U=!0,O.call(q,$)},null,Q),U&&z.dispose(),z}}a(n,"once"),t.once=n;function o(M,O){return t.once(t.filter(M,O))}a(o,"onceIf"),t.onceIf=o;function s(M,O,q){return h((Q,U=null,z)=>M($=>Q.call(U,O($)),null,z),q)}a(s,"map"),t.map=s;function c(M,O,q){return h((Q,U=null,z)=>M($=>{O($),Q.call(U,$)},null,z),q)}a(c,"forEach"),t.forEach=c;function l(M,O,q){return h((Q,U=null,z)=>M($=>O($)&&Q.call(U,$),null,z),q)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(O,q=null,Q)=>{let U=(0,xC.combinedDisposable)(...M.map(z=>z($=>O.call(q,$))));return m(U,Q)}}a(d,"any"),t.any=d;function f(M,O,q,Q){let U=q;return s(M,z=>(U=O(U,z),U),Q)}a(f,"reduce"),t.reduce=f;function h(M,O){let q,Q={onWillAddFirstListener(){q=M(U.fire,U)},onDidRemoveLastListener(){q?.dispose()}};O||e(Q);let U=new zy(Q);return O?.add(U),U.event}a(h,"snapshot");function m(M,O){return O instanceof Array?O.push(M):O&&O.add(M),M}a(m,"addAndReturnDisposable");function g(M,O,q=100,Q=!1,U=!1,z,$){let W,J,ne,H=0,re,ae={leakWarningThreshold:z,onWillAddFirstListener(){W=M(ve=>{H++,J=O(J,ve),Q&&!ne&&(Be.fire(J),J=void 0),re=a(()=>{let Ue=J;J=void 0,ne=void 0,(!Q||H>1)&&Be.fire(Ue),H=0},"doFire"),typeof q=="number"?(ne&&clearTimeout(ne),ne=setTimeout(re,q)):ne===void 0&&(ne=null,queueMicrotask(re))})},onWillRemoveListener(){U&&H>0&&re?.()},onDidRemoveLastListener(){re=void 0,W.dispose()}};$||e(ae);let Be=new zy(ae);return $?.add(Be),Be.event}a(g,"debounce"),t.debounce=g;function A(M,O=0,q,Q){return t.debounce(M,(U,z)=>U?(U.push(z),U):[z],O,void 0,q??!0,void 0,Q)}a(A,"accumulate"),t.accumulate=A;function y(M,O,q=100,Q=!0,U=!0,z,$){let W,J,ne,H=0,re={leakWarningThreshold:z,onWillAddFirstListener(){W=M(Be=>{H++,J=O(J,Be),ne===void 0&&(Q&&(ae.fire(J),J=void 0,H=0),typeof q=="number"?ne=setTimeout(()=>{U&&H>0&&ae.fire(J),J=void 0,ne=void 0,H=0},q):(ne=0,queueMicrotask(()=>{U&&H>0&&ae.fire(J),J=void 0,ne=void 0,H=0})))})},onDidRemoveLastListener(){W.dispose()}};$||e(re);let ae=new zy(re);return $?.add(ae),ae.event}a(y,"throttle"),t.throttle=y;function E(M,O=(Q,U)=>Q===U,q){let Q=!0,U;return l(M,z=>{let $=Q||!O(z,U);return Q=!1,U=z,$},q)}a(E,"latch"),t.latch=E;function _(M,O,q){return[t.filter(M,O,q),t.filter(M,Q=>!O(Q),q)]}a(_,"split"),t.split=_;function v(M,O,q=!1,Q=[],U){let z=Q.slice(),$;chn()&&($={stack:ule.create(),timerId:setTimeout(()=>{z&&z.length>0&&$&&!$.warned&&($.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${z.length} events buffered for ${ahn/1e3}s without being consumed. Buffered here:`),$.stack.print())},ahn),warned:!1},U&&U.add((0,xC.toDisposable)(()=>clearTimeout($.timerId))));let W=a(()=>{$&&clearTimeout($.timerId)},"clearLeakWarningTimer"),J=M(re=>{z?(z.push(re),chn()&&$&&!$.warned&&z.length>=x8o&&($.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${z.length} events buffered without being consumed. Buffered here:`),$.stack.print())):H.fire(re)});U&&U.add(J);let ne=a(()=>{z?.forEach(re=>H.fire(re)),z=null,W()},"flush"),H=new zy({onWillAddFirstListener(){J||(J=M(re=>H.fire(re)),U&&U.add(J))},onDidAddFirstListener(){z&&(q?setTimeout(ne):ne())},onDidRemoveLastListener(){J&&J.dispose(),J=null,W()}});return U&&U.add(H),H.event}a(v,"buffer"),t.buffer=v;function b(M,O){return a((Q,U,z)=>{let $=O(new w);return M(function(W){let J=$.evaluate(W);J!==T&&Q.call(U,J)},void 0,z)},"fn")}a(b,"chain"),t.chain=b;let T=Symbol("HaltChainable");class w{static{a(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(q=>(O(q),q)),this}filter(O){return this.steps.push(q=>O(q)?q:T),this}reduce(O,q){let Q=q;return this.steps.push(U=>(Q=O(Q,U),Q)),this}latch(O=(q,Q)=>q===Q){let q=!0,Q;return this.steps.push(U=>{let z=q||!O(U,Q);return q=!1,Q=U,z?U:T}),this}evaluate(O){for(let q of this.steps)if(O=q(O),O===T)break;return O}}function R(M,O,q=Q=>Q){let Q=a((...W)=>$.fire(q(...W)),"fn"),U=a(()=>M.on(O,Q),"onFirstListenerAdd"),z=a(()=>M.removeListener(O,Q),"onLastListenerRemove"),$=new zy({onWillAddFirstListener:U,onDidRemoveLastListener:z});return $.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,O,q=Q=>Q){let Q=a((...W)=>$.fire(q(...W)),"fn"),U=a(()=>M.addEventListener(O,Q),"onFirstListenerAdd"),z=a(()=>M.removeEventListener(O,Q),"onLastListenerRemove"),$=new zy({onWillAddFirstListener:U,onDidRemoveLastListener:z});return $.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function P(M,O){let q,Q,U=new Promise(z=>{Q=n(M)(z),x9t(Q,O),q=a(()=>{lhn(Q,O)},"cancelRef")});return U.cancel=q,O&&U.finally(()=>lhn(Q,O)),U}a(P,"toPromise"),t.toPromise=P;function D(M,O){return M(q=>O.fire(q))}a(D,"forward"),t.forward=D;function N(M,O,q){return O(q),M(Q=>O(Q))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class B{static{a(this,"EmitterObserver")}constructor(O,q){this._observable=O,this._counter=0,this._hasChanged=!1;let Q={onWillAddFirstListener:a(()=>{O.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{O.removeObserver(this)},"onDidRemoveLastListener")};q||e(Q),this.emitter=new zy(Q),q&&q.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,q){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function L(M,O){return new B(M,O).emitter.event}a(L,"fromObservable"),t.fromObservable=L;function j(M){return(O,q,Q)=>{let U=0,z=!1,$={beginUpdate(){U++},endUpdate(){U--,U===0&&(M.reportChanges(),z&&(z=!1,O.call(q)))},handlePossibleChange(){},handleChange(){z=!0}};M.addObserver($),M.reportChanges();let W={dispose(){M.removeObserver($)}};return x9t(W,Q),W}}a(j,"fromObservableLight"),t.fromObservableLight=j})(WVe||(ja.Event=WVe={}));var zVe=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 T8o.StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};ja.EventProfiling=zVe;var AIe=-1;function w8o(t){let e=AIe;return AIe=t,{dispose(){AIe=e}}}a(w8o,"setGlobalLeakWarningThreshold");var y9t=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 yIe(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!==_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{if(t instanceof lle)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new y9t(e?.onListenerError??gIe.onUnexpectedError,this._options?.leakWarningThreshold??AIe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new zVe(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(shn){let e=this._listeners;queueMicrotask(()=>{dhn(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 YVe(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||gIe.onUnexpectedError)(h),xC.Disposable.None}if(this._disposed)return xC.Disposable.None;r&&(e=e.bind(r));let o=new lle(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=ule.create(),s=this._leakageMon.check(o.stack,this._size+1)),shn&&(o.stack=c??ule.create()),this._listeners?this._listeners instanceof lle?(this._deliveryQueue??=new KVe,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,xC.toDisposable)(()=>{s?.(),this._removeListener(o)});return x9t(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*P8o<=r.length){let s=0;for(let c=0;c0}};ja.Emitter=zy;var k8o=a(()=>new KVe,"createEventDeliveryQueue");ja.createEventDeliveryQueue=k8o;var KVe=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}},E9t=class extends zy{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new uhn.LinkedList),dhn(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,gIe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,gIe.onUnexpectedError)(d.reason)})}}};ja.AsyncEmitter=E9t;var JVe=class extends zy{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new uhn.LinkedList,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}};ja.PauseableEmitter=JVe;var _9t=class extends JVe{static{a(this,"DebounceEmitter")}constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}};ja.DebounceEmitter=_9t;var v9t=class extends zy{static{a(this,"MicrotaskEmitter")}constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(r=>super.fire(r)),this._queuedEvents=[]}))}};ja.MicrotaskEmitter=v9t;var ZVe=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new zy({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,xC.toDisposable)((0,b8o.createSingleCallFunction)(n))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(r=>this.emitter.fire(r))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(let e of this.events)e.listener?.dispose();this.events=[]}};ja.EventMultiplexer=ZVe;var C9t=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new xC.DisposableStore;let s=this._store.add(new ZVe),c=this._store.add(new xC.DisposableMap);function l(u){c.set(u,s.add(o(u)))}a(l,"addItem");for(let u of e)l(u);this._store.add(r(u=>{l(u)})),this._store.add(n(u=>{c.deleteAndDispose(u)})),this.event=s.event}dispose(){this._store.dispose()}};ja.DynamicListEventMultiplexer=C9t;var b9t=class{static{a(this,"EventBufferer")}constructor(){this.data=[]}wrapEvent(e,r,n){return(o,s,c)=>e(l=>{let u=this.data[this.data.length-1];if(!r){u?u.buffers.push(()=>o.call(s,l)):o.call(s,l);return}let d=u;if(!d){o.call(s,r(n,l));return}d.items??=[],d.items.push(l),d.buffers.length===0&&u.buffers.push(()=>{d.reducedResult??=n?d.items.reduce(r,n):d.items.reduce(r),o.call(s,d.reducedResult)})},void 0,c)}bufferEvents(e){let r={buffers:new Array};this.data.push(r);let n=e();return this.data.pop(),r.buffers.forEach(o=>o()),n}};ja.EventBufferer=b9t;var S9t=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=WVe.None,this.inputEventListener=xC.Disposable.None,this.emitter=new zy({onDidAddFirstListener:a(()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},"onDidAddFirstListener"),onDidRemoveLastListener:a(()=>{this.listening=!1,this.inputEventListener.dispose()},"onDidRemoveLastListener")}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}};ja.Relay=S9t;var T9t=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new I9t(e)}constructor(e){this._value=e,this._onDidChange=new zy,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};ja.ValueWithChangeEvent=T9t;var I9t=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=WVe.None}};function D8o(t,e,r){let n=new xC.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new xC.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,C8o.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(D8o,"trackSetChanges");function x9t(t,e){e instanceof xC.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(x9t,"addToDisposables");function lhn(t,e){if(e instanceof xC.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a(lhn,"disposeAndRemove")});var wk=I(v3=>{"use strict";p();Object.defineProperty(v3,"__esModule",{value:!0});v3.CancellationTokenPool=v3.CancellationTokenSource=v3.CancellationToken=void 0;v3.cancelOnDispose=M8o;var fhn=bc(),N8o=Io(),phn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),XVe;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof dle?!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:fhn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:phn})})(XVe||(v3.CancellationToken=XVe={}));var dle=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?phn:(this._emitter||(this._emitter=new fhn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},EIe=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 dle),this._token}cancel(){this._token?this._token instanceof dle&&this._token.cancel():this._token=XVe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof dle&&this._token.dispose():this._token=XVe.None}};v3.CancellationTokenSource=EIe;function M8o(t){let e=new EIe;return t.add({dispose(){e.cancel()}}),e.token}a(M8o,"cancelOnDispose");var w9t=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new EIe,this._listeners=new N8o.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()}};v3.CancellationTokenPool=w9t});var EA=I(Kr=>{"use strict";p();var O8o=Kr&&Kr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B8o=Kr&&Kr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),L8o=Kr&&Kr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=F8o&&t<=Q8o||t>=U8o&&t<=q8o}a(b3,"isWindowsDeviceRoot");function tWe(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===jY&&l!==-1?++l:l=-1}return o}a(tWe,"normalizeString");function G8o(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(G8o,"formatExt");function hhn(t,e){H8o(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${G8o(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(hhn,"_format");Kr.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],Kf(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=fle.cwd():(s=fle.env[`=${e}`]||fle.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===wC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Vo(f)&&(l=1,d=!0);else if(Vo(f))if(d=!0,Vo(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Vo(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=tWe(r,!n,"\\",Vo),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Kf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return R9t(s)?"\\":t;if(Vo(s))if(o=!0,Vo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Vo(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Vo(t.charCodeAt(e-1))&&(c+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&b3(c.charCodeAt(0))&&c.charCodeAt(1)===C3)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||Vo(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){Kf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Vo(r)||e>2&&b3(r)&&t.charCodeAt(1)===C3&&Vo(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"&&Vo(r.charCodeAt(0))){++o;let s=r.length;s>1&&Vo(r.charCodeAt(1))&&(++o,s>2&&(Vo(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Kr.win32.normalize(e)},relative(t,e){if(Kf(t,"from"),Kf(e,"to"),t===e)return"";let r=Kr.win32.resolve(t),n=Kr.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";if(r.length!==t.length||n.length!==e.length){let A=r.split("\\"),y=n.split("\\");A[A.length-1]===""&&A.pop(),y[y.length-1]===""&&y.pop();let E=A.length,_=y.length,v=E<_?E:_,b;for(b=0;bv?y.slice(b).join("\\"):E>v?"..\\".repeat(E-1-b)+"..":"":"..\\".repeat(E-b)+y.slice(b).join("\\")}let o=0;for(;oo&&t.charCodeAt(s-1)===wC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===wC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===wC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===wC?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)===wC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===wC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Kr.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===wC){if(e.charCodeAt(1)===wC){let r=e.charCodeAt(2);if(r!==j8o&&r!==jY)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(b3(e.charCodeAt(0))&&e.charCodeAt(1)===C3&&e.charCodeAt(2)===wC)return`\\\\?\\${e}`;return e},dirname(t){Kf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Vo(o)?t:".";if(Vo(o)){if(r=n=1,Vo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Vo(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Vo(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&&Kf(e,"suffix"),Kf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&b3(t.charCodeAt(0))&&t.charCodeAt(1)===C3&&(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(Vo(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(Vo(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){Kf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===C3&&b3(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Vo(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===jY?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:hhn.bind(null,"\\"),parse(t){Kf(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 Vo(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Vo(o)){if(n=1,Vo(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),Vo(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===jY?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 $8o=(()=>{if(RC){let t=/\\/g;return()=>{let e=fle.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>fle.cwd()})();Kr.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];Kf(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===rg)}if(!r){let n=$8o();e=`${n}/${e}`,r=n.charCodeAt(0)===rg}return e=tWe(e,!r,"/",R9t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Kf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===rg,r=t.charCodeAt(t.length-1)===rg;return t=tWe(t,!e,"/",R9t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Kf(t,"path"),t.length>0&&t.charCodeAt(0)===rg},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":Kr.posix.normalize(e.join("/"))},relative(t,e){if(Kf(t,"from"),Kf(e,"to"),t===e||(t=Kr.posix.resolve(t),e=Kr.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===rg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===rg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===rg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Kf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===rg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===rg){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&&Kf(e,"suffix"),Kf(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===rg){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)===rg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Kf(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:hhn.bind(null,"/"),parse(t){Kf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===rg,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===rg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===jY?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Kr.posix.win32=Kr.win32.win32=Kr.win32;Kr.posix.posix=Kr.win32.posix=Kr.posix;Kr.normalize=RC?Kr.win32.normalize:Kr.posix.normalize;Kr.isAbsolute=RC?Kr.win32.isAbsolute:Kr.posix.isAbsolute;Kr.join=RC?Kr.win32.join:Kr.posix.join;Kr.resolve=RC?Kr.win32.resolve:Kr.posix.resolve;Kr.relative=RC?Kr.win32.relative:Kr.posix.relative;Kr.dirname=RC?Kr.win32.dirname:Kr.posix.dirname;Kr.basename=RC?Kr.win32.basename:Kr.posix.basename;Kr.extname=RC?Kr.win32.extname:Kr.posix.extname;Kr.format=RC?Kr.win32.format:Kr.posix.format;Kr.parse=RC?Kr.win32.parse:Kr.posix.parse;Kr.toNamespacedPath=RC?Kr.win32.toNamespacedPath:Kr.posix.toNamespacedPath;Kr.sep=RC?Kr.win32.sep:Kr.posix.sep;Kr.delimiter=RC?Kr.win32.delimiter:Kr.posix.delimiter});var nWe=I(Rk=>{"use strict";p();Object.defineProperty(Rk,"__esModule",{value:!0});Rk.WeakCachedFunction=Rk.CachedFunction=Rk.LRUCachedFunction=Rk.Cache=void 0;Rk.identity=rWe;var V8o=wk(),P9t=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new V8o.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};Rk.Cache=P9t;function rWe(t){return t}a(rWe,"identity");var k9t=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=rWe):(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}};Rk.LRUCachedFunction=k9t;var D9t=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=rWe):(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}};Rk.CachedFunction=D9t;var N9t=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=rWe):(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}};Rk.WeakCachedFunction=N9t});var Qh=I(Rr=>{"use strict";p();Object.defineProperty(Rr,"__esModule",{value:!0});Rr.Ellipsis=Rr.InvisibleCharacters=Rr.AmbiguousCharacters=Rr.noBreakWhitespace=Rr.UTF8_BOM_CHARACTER=Rr.UNUSUAL_LINE_TERMINATORS=Rr.GraphemeIterator=Rr.CodePointIterator=void 0;Rr.isFalsyOrWhitespace=z8o;Rr.format=K8o;Rr.format2=Z8o;Rr.htmlAttributeEncodeValue=X8o;Rr.escape=e6o;Rr.escapeRegExpCharacters=Ahn;Rr.count=t6o;Rr.truncate=r6o;Rr.truncateMiddle=n6o;Rr.trim=i6o;Rr.ltrim=yhn;Rr.rtrim=Ehn;Rr.convertSimple2RegExpPattern=o6o;Rr.createRegExp=s6o;Rr.regExpLeadsToEndlessLoop=a6o;Rr.joinStrings=c6o;Rr.splitLines=l6o;Rr.splitLinesIncludeSeparators=u6o;Rr.indexOfPattern=d6o;Rr.firstNonWhitespaceIndex=_hn;Rr.getLeadingWhitespace=f6o;Rr.lastNonWhitespaceIndex=p6o;Rr.getIndentationLength=h6o;Rr.replaceAsync=m6o;Rr.compare=g6o;Rr.compareSubstring=vhn;Rr.compareIgnoreCase=A6o;Rr.compareSubstringIgnoreCase=vIe;Rr.isAsciiDigit=y6o;Rr.isLowerAsciiLetter=O9t;Rr.isUpperAsciiLetter=E6o;Rr.equalsIgnoreCase=Chn;Rr.equals=_6o;Rr.startsWithIgnoreCase=v6o;Rr.endsWithIgnoreCase=C6o;Rr.commonPrefixLength=b6o;Rr.commonSuffixLength=S6o;Rr.isHighSurrogate=F9t;Rr.isLowSurrogate=iWe;Rr.computeCodePoint=U9t;Rr.getNextCodePoint=bhn;Rr.nextCharLength=Shn;Rr.prevCharLength=Thn;Rr.getCharContainingOffset=I6o;Rr.charCount=x6o;Rr.containsRTL=R6o;Rr.isBasicASCII=k6o;Rr.containsUnusualLineTerminators=D6o;Rr.isFullWidthCharacter=N6o;Rr.isEmojiImprecise=Ihn;Rr.lcut=M6o;Rr.rcut=O6o;Rr.forAnsiStringParts=U6o;Rr.removeAnsiEscapeCodes=whn;Rr.removeAnsiEscapeCodesFromPrompt=q6o;Rr.startsWithUTF8BOM=Rhn;Rr.stripUTF8BOM=j6o;Rr.fuzzyContains=H6o;Rr.containsUppercaseCharacter=G6o;Rr.uppercaseFirstLetter=$6o;Rr.getNLines=V6o;Rr.singleLetterHash=W6o;Rr.getGraphemeBreakType=z6o;Rr.getLeftDeleteOffset=K6o;Rr.multibyteAwareBtoa=e9o;var W8o=nWe(),mhn=u3();function z8o(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(z8o,"isFalsyOrWhitespace");var Y8o=/{(\d+)}/g;function K8o(t,...e){return e.length===0?t:t.replace(Y8o,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(K8o,"format");var J8o=/{([^}]+)}/g;function Z8o(t,e){return Object.keys(e).length===0?t:t.replace(J8o,(r,n)=>e[n]??r)}a(Z8o,"format2");function X8o(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(X8o,"htmlAttributeEncodeValue");function e6o(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(e6o,"escape");function Ahn(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(Ahn,"escapeRegExpCharacters");function t6o(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a(t6o,"count");function r6o(t,e,r=Rr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a(r6o,"truncate");function n6o(t,e,r=Rr.Ellipsis){if(t.length<=e)return t;let n=Math.ceil(e/2)-r.length/2,o=Math.floor(e/2)-r.length/2;return`${t.substr(0,n)}${r}${t.substr(t.length-o)}`}a(n6o,"truncateMiddle");function i6o(t,e=" "){let r=yhn(t,e);return Ehn(r,e)}a(i6o,"trim");function yhn(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(Ehn,"rtrim");function o6o(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(o6o,"convertSimple2RegExpPattern");function s6o(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=Ahn(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(s6o,"createRegExp");function a6o(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(a6o,"regExpLeadsToEndlessLoop");function c6o(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(c6o,"joinStrings");function l6o(t){return t.split(/\r\n|\r|\n/)}a(l6o,"splitLines");function u6o(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(p6o,"lastNonWhitespaceIndex");function h6o(t){let e=_hn(t);return e===-1?t.length:e}a(h6o,"getIndentationLength");function m6o(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(m6o,"replaceAsync");function g6o(t,e){return te?1:0}a(g6o,"compare");function vhn(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(vhn,"compareSubstring");function A6o(t,e){return vIe(t,e,0,t.length,0,e.length)}a(A6o,"compareIgnoreCase");function vIe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return vhn(t.toLowerCase(),e.toLowerCase(),r,n,o,s);O9t(u)&&(u-=32),O9t(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(vIe,"compareSubstringIgnoreCase");function y6o(t){return t>=48&&t<=57}a(y6o,"isAsciiDigit");function O9t(t){return t>=97&&t<=122}a(O9t,"isLowerAsciiLetter");function E6o(t){return t>=65&&t<=90}a(E6o,"isUpperAsciiLetter");function Chn(t,e){return t.length===e.length&&vIe(t,e)===0}a(Chn,"equalsIgnoreCase");function _6o(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&Chn(t,e)}a(_6o,"equals");function v6o(t,e){let r=e.length;return r<=t.length&&vIe(t,e,0,r)===0}a(v6o,"startsWithIgnoreCase");function C6o(t,e){let r=t.length,n=r-e.length;return n>=0&&vIe(t,e,n,r)===0}a(C6o,"endsWithIgnoreCase");function b6o(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(F9t(n))return U9t(n,r)}return r}a(T6o,"getPrevCodePoint");var ple=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=T6o(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=bhn(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};Rr.CodePointIterator=ple;var hle=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new ple(e,r)}nextGraphemeLength(){let e=_Ie.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.nextCodePoint());for(;!r.eol();){let s=r.offset,c=e.getGraphemeBreakType(r.nextCodePoint());if(ghn(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=_Ie.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.prevCodePoint());for(;r.offset>0;){let s=r.offset,c=e.getGraphemeBreakType(r.prevCodePoint());if(ghn(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};Rr.GraphemeIterator=hle;function Shn(t,e){return new hle(t,e).nextGraphemeLength()}a(Shn,"nextCharLength");function Thn(t,e){return new hle(t,e).prevGraphemeLength()}a(Thn,"prevCharLength");function I6o(t,e){e>0&&iWe(t.charCodeAt(e))&&e--;let r=e+Shn(t,e);return[r-Thn(t,r),r]}a(I6o,"getCharContainingOffset");function x6o(t){let e=new hle(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(x6o,"charCount");var M9t;function w6o(){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(w6o,"makeContainsRtl");function R6o(t){return M9t||(M9t=w6o()),M9t.test(t)}a(R6o,"containsRTL");var P6o=/^[\t\n\r\x20-\x7E]*$/;function k6o(t){return P6o.test(t)}a(k6o,"isBasicASCII");Rr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function D6o(t){return Rr.UNUSUAL_LINE_TERMINATORS.test(t)}a(D6o,"containsUnusualLineTerminators");function N6o(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(N6o,"isFullWidthCharacter");function Ihn(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(Ihn,"isEmojiImprecise");function M6o(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@^`{}|~]/,L6o=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,F6o=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,xhn=new RegExp("(?:"+[B6o.source,L6o.source,F6o.source].join("|")+")","g");function*U6o(t){let e=0;for(let r of t.matchAll(xhn))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(U6o,"forAnsiStringParts");function whn(t){return t&&(t=t.replace(xhn,"")),t}a(whn,"removeAnsiEscapeCodes");var Q6o=/\\\[.*?\\\]/g;function q6o(t){return whn(t).replace(Q6o,"")}a(q6o,"removeAnsiEscapeCodesFromPrompt");Rr.UTF8_BOM_CHARACTER="\uFEFF";function Rhn(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(Rhn,"startsWithUTF8BOM");function j6o(t){return Rhn(t)?t.substr(1):t}a(j6o,"stripUTF8BOM");function H6o(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a(V6o,"getNLines");function W6o(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(W6o,"singleLetterHash");function z6o(t){return _Ie.getInstance().getGraphemeBreakType(t)}a(z6o,"getGraphemeBreakType");function ghn(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(ghn,"breakBetweenGraphemeBreakType");var _Ie=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=Y6o()}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 Y6o(){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(Y6o,"getGraphemeBreakRawData");function K6o(t,e){if(t===0)return 0;let r=J6o(t,e);if(r!==void 0)return r;let n=new ple(e,t);return n.prevCodePoint(),n.offset}a(K6o,"getLeftDeleteOffset");function J6o(t,e){let r=new ple(e,t),n=r.prevCodePoint();for(;Z6o(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!Ihn(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(J6o,"getOffsetBeforeLastEmojiComponent");function Z6o(t){return 127995<=t&&t<=127999}a(Z6o,"isEmojiModifier");Rr.noBreakWhitespace="\xA0";var B9t=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new mhn.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 W8o.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 mhn.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(Xm,"__esModule",{value:!0});Xm.isPathSeparator=S3;Xm.toSlashes=Phn;Xm.toPosixPath=r9o;Xm.getRoot=n9o;Xm.isUNC=i9o;Xm.isValidBasename=c9o;Xm.isEqual=l9o;Xm.isEqualOrParent=u9o;Xm.isWindowsDriveLetter=Q9t;Xm.sanitizeFilePath=d9o;Xm.removeTrailingPathSeparator=khn;Xm.isRootOrDriveLetter=f9o;Xm.hasDriveLetter=q9t;Xm.getDriveLetter=p9o;Xm.indexOfPath=h9o;Xm.parseLineAndColumnAware=m9o;Xm.randomPath=y9o;var PC=EA(),SQ=bQ(),oWe=Qh(),t9o=SS();function S3(t){return t===47||t===92}a(S3,"isPathSeparator");function Phn(t){return t.replace(/[\\/]/g,PC.posix.sep)}a(Phn,"toSlashes");function r9o(t){return t.indexOf("/")===-1&&(t=Phn(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a(r9o,"toPosixPath");function n9o(t,e=PC.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(S3(n)){if(S3(t.charCodeAt(1))&&!S3(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,s9o=/[/]/g,a9o=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function c9o(t,e=SQ.isWindows){let r=e?o9o:s9o;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&a9o.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(c9o,"isValidBasename");function l9o(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,oWe.equalsIgnoreCase)(t,e)}a(l9o,"isEqual");function u9o(t,e,r,n=PC.sep){if(t===e)return!0;if(!t||!e||e.length>t.length)return!1;if(r){if(!(0,oWe.startsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;let s=e.length;return e.charAt(e.length-1)===n&&s--,t.charAt(s)===n}return e.charAt(e.length-1)!==n&&(e+=n),t.indexOf(e)===0}a(u9o,"isEqualOrParent");function Q9t(t){return t>=65&&t<=90||t>=97&&t<=122}a(Q9t,"isWindowsDriveLetter");function d9o(t,e){return SQ.isWindows&&t.endsWith(":")&&(t+=PC.sep),(0,PC.isAbsolute)(t)||(t=(0,PC.join)(e,t)),t=(0,PC.normalize)(t),khn(t)}a(d9o,"sanitizeFilePath");function khn(t){return SQ.isWindows?(t=(0,oWe.rtrim)(t,PC.sep),t.endsWith(":")&&(t+=PC.sep)):(t=(0,oWe.rtrim)(t,PC.sep),t||(t=PC.sep)),t}a(khn,"removeTrailingPathSeparator");function f9o(t){let e=(0,PC.normalize)(t);return SQ.isWindows?t.length>3?!1:q9t(e)&&(t.length===2||e.charCodeAt(2)===92):e===PC.posix.sep}a(f9o,"isRootOrDriveLetter");function q9t(t,e=SQ.isWindows){return e?Q9t(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(q9t,"hasDriveLetter");function p9o(t,e=SQ.isWindows){return q9t(t,e)?t[0]:void 0}a(p9o,"getDriveLetter");function h9o(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(h9o,"indexOfPath");function m9o(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,t9o.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(m9o,"parseLineAndColumnAware");var g9o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",A9o="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function y9o(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var E9o=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]})),_9o=Nx&&Nx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),v9o=Nx&&Nx.__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(!b9o.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(S9o.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(T9o,"_validateUri");function I9o(t,e){return!t&&!e?"file":t}a(I9o,"_schemeFix");function x9o(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==Pk&&(e=Pk+e):e=Pk;break}return e}a(x9o,"_referenceResolution");var Ll="",Pk="/",w9o=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,cWe=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||Ll,this.authority=e.authority||Ll,this.path=e.path||Ll,this.query=e.query||Ll,this.fragment=e.fragment||Ll):(this.scheme=I9o(e,c),this.authority=r||Ll,this.path=x9o(this.scheme,n||Ll),this.query=o||Ll,this.fragment=s||Ll,T9o(this,c))}get fsPath(){return lWe(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=Ll),n===void 0?n=this.authority:n===null&&(n=Ll),o===void 0?o=this.path:o===null&&(o=Ll),s===void 0?s=this.query:s===null&&(s=Ll),c===void 0?c=this.fragment:c===null&&(c=Ll),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new TQ(r,n,o,s,c)}static parse(e,r=!1){let n=w9o.exec(e);return n?new TQ(n[2]||Ll,sWe(n[4]||Ll),sWe(n[5]||Ll),sWe(n[7]||Ll),sWe(n[9]||Ll),r):new TQ(Ll,Ll,Ll,Ll,Ll)}static file(e){let r=Ll;if(aWe.isWindows&&(e=e.replace(/\\/g,Pk)),e[0]===Pk&&e[1]===Pk){let n=e.indexOf(Pk,2);n===-1?(r=e.substring(2),e=Pk):(r=e.substring(2,n),e=e.substring(n)||Pk)}return new TQ("file",r,e,Ll,Ll)}static from(e,r){return new TQ(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 aWe.isWindows&&e.scheme==="file"?n=t.file(Dhn.win32.join(lWe(e,!0),...r)).path:n=Dhn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return H9t(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new TQ(e);return r._formatted=e.external??null,r._fsPath=e._sep===Ohn?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};Nx.URI=cWe;function R9o(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(R9o,"isUriComponents");var Ohn=aWe.isWindows?1:void 0,TQ=class extends cWe{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=lWe(this,!1)),this._fsPath}toString(e=!1){return e?H9t(this,!0):(this._formatted||(this._formatted=H9t(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=Ohn),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}},Bhn={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 Nhn(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=Bhn[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(Nhn,"encodeURIComponentFast");function P9o(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,aWe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(lWe,"uriToFsPath");function H9t(t,e){let r=e?P9o:Nhn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=Pk,n+=Pk),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:Nhn(u,!1,!1)),n}a(H9t,"_asFormatted");function Lhn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+Lhn(t.substr(3)):t}}a(Lhn,"decodeURIComponentGraceful");var Mhn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function sWe(t){return t.match(Mhn)?t.replace(Mhn,e=>Lhn(e)):t}a(sWe,"percentDecode")});var GY=I(us=>{"use strict";p();var k9o=us&&us.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D9o=us&&us.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),z9t=us&&us.__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;oQhn(t,r))}a(M9o,"matchesSomeScheme");us.connectionTokenCookieName="vscode-tkn";us.connectionTokenQueryName="tkn";var V9t=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=$9t.posix.join(r??"/",qhn(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return $9t.posix.join(this._serverRootPath,oO.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 N9o.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+=`&${us.connectionTokenQueryName}=${encodeURIComponent(s)}`),HY.URI.from({scheme:G9t.isWeb?this._preferredWebSchema:oO.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};us.RemoteAuthorities=new V9t;function qhn(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(qhn,"getServerProductSegment");us.builtinExtensionsPath="vs/../../extensions";us.nodeModulesPath="vs/../../node_modules";us.nodeModulesAsarPath="vs/../../node_modules.asar";us.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";us.VSCODE_AUTHORITY="vscode-app";var W9t=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=us.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===oO.vscodeRemote?us.RemoteAuthorities.rewrite(e):e.scheme===oO.file&&(G9t.isNative||G9t.webWorkerOrigin===`${oO.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:oO.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===oO.vscodeFileResource?e.with({scheme:oO.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(HY.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return HY.URI.joinPath(HY.URI.parse(r,!0),e);let n=$9t.join(r,e);return HY.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};us.FileAccess=new W9t;us.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});us.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var Uhn;(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:HY.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})(Uhn||(us.COI=Uhn={}))});var kk=I(Ar=>{"use strict";p();var O9o=Ar&&Ar.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B9o=Ar&&Ar.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Ghn=Ar&&Ar.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;omle.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=w_.sep){return(0,Ar.hasTrailingPathSeparator)(e,r)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,r=w_.sep){let n=!1;if(e.scheme===IQ.Schemas.file){let o=sO(e);n=o!==void 0&&o.length===mle.getRoot(o).length&&o[o.length-1]===r}else{r="/";let o=e.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!(0,Ar.hasTrailingPathSeparator)(e,r)?e.with({path:e.path+"/"}):e}};Ar.ExtUri=gle;Ar.extUri=new gle(()=>!1);Ar.extUriBiasedIgnorePathCase=new gle(t=>t.scheme===IQ.Schemas.file?!$hn.isLinux:!0);Ar.extUriIgnorePathCase=new gle(t=>!0);Ar.isEqual=Ar.extUri.isEqual.bind(Ar.extUri);Ar.isEqualOrParent=Ar.extUri.isEqualOrParent.bind(Ar.extUri);Ar.getComparisonKey=Ar.extUri.getComparisonKey.bind(Ar.extUri);Ar.basenameOrAuthority=Ar.extUri.basenameOrAuthority.bind(Ar.extUri);Ar.basename=Ar.extUri.basename.bind(Ar.extUri);Ar.extname=Ar.extUri.extname.bind(Ar.extUri);Ar.dirname=Ar.extUri.dirname.bind(Ar.extUri);Ar.joinPath=Ar.extUri.joinPath.bind(Ar.extUri);Ar.normalizePath=Ar.extUri.normalizePath.bind(Ar.extUri);Ar.relativePath=Ar.extUri.relativePath.bind(Ar.extUri);Ar.resolvePath=Ar.extUri.resolvePath.bind(Ar.extUri);Ar.isAbsolutePath=Ar.extUri.isAbsolutePath.bind(Ar.extUri);Ar.isEqualAuthority=Ar.extUri.isEqualAuthority.bind(Ar.extUri);Ar.hasTrailingPathSeparator=Ar.extUri.hasTrailingPathSeparator.bind(Ar.extUri);Ar.removeTrailingPathSeparator=Ar.extUri.removeTrailingPathSeparator.bind(Ar.extUri);Ar.addTrailingPathSeparator=Ar.extUri.addTrailingPathSeparator.bind(Ar.extUri);function L9o(t,e){let r=[];for(let n=0;nc===n?!1:(0,Ar.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(L9o,"distinctParents");var Hhn;(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})(Hhn||(Ar.DataUri=Hhn={}));function F9o(t,e,r){if(e){let n=t.path;return n&&n[0]!==w_.posix.sep&&(n=w_.posix.sep+n),t.with({scheme:r,authority:e,path:n})}return t.with({scheme:r})}a(F9o,"toLocalResource")});var Vhn=I(uWe=>{"use strict";p();Object.defineProperty(uWe,"__esModule",{value:!0});uWe.MicrotaskDelay=void 0;uWe.MicrotaskDelay=Symbol("MicrotaskDelay")});var Yc=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=Yhn;Kt.createCancelablePromise=Khn;Kt.raceCancellation=Jhn;Kt.raceCancellationError=j9o;Kt.rejectIfNotCanceled=H9o;Kt.notCancellablePromise=G9o;Kt.raceCancellablePromises=$9o;Kt.raceTimeout=Zhn;Kt.asPromise=V9o;Kt.promiseWithResolvers=Xhn;Kt.timeout=hUt;Kt.disposableTimeout=Y9o;Kt.sequence=K9o;Kt.first=J9o;Kt.firstParallel=Z9o;Kt.installFakeRunWhenIdle=X9o;Kt.retry=eUo;Kt.createCancelableAsyncIterableProducer=tUo;Kt.cancellableIterable=rUo;Kt.createTimeout=nUo;var pUt=wk(),R_=Is(),bIe=bc(),xQ=Io(),Whn=kk(),U9o=bQ(),Q9o=Vhn(),q9o=u3();function Yhn(t){return!!t&&typeof t.then=="function"}a(Yhn,"isThenable");function Khn(t){let e=new pUt.CancellationTokenSource,r=t(e.token),n=!1,o=new Promise((s,c)=>{let l=e.token.onCancellationRequested(()=>{n=!0,l.dispose(),c(new R_.CancellationError)});Promise.resolve(r).then(u=>{l.dispose(),e.dispose(),n?(0,xQ.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(Khn,"createCancelablePromise");function Jhn(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(Jhn,"raceCancellation");function j9o(t,e){return new Promise((r,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new R_.CancellationError)});t.then(r,n).finally(()=>o.dispose())})}a(j9o,"raceCancellationError");function H9o(t){if(!(0,R_.isCancellationError)(t))return Promise.reject(t)}a(H9o,"rejectIfNotCanceled");function G9o(t){return new Promise((e,r)=>{t.then(e,r)})}a(G9o,"notCancellablePromise");function $9o(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($9o,"raceCancellablePromises");function Zhn(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(Zhn,"raceTimeout");function V9o(t){return new Promise((e,r)=>{let n=t();Yhn(n)?n.then(e,r):e(n)})}a(V9o,"asPromise");function Xhn(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(Xhn,"promiseWithResolvers");var dWe=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new pUt.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=dWe;var Y9t=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Kt.Sequencer=Y9t;var K9t=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=K9t;var W9o=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"),z9o=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),fWe=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===Q9o.MicrotaskDelay?z9o(n):W9o(r,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new R_.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};Kt.Delayer=fWe;var J9t=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new fWe(e),this.throttler=new dWe}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=J9t;var pWe=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=pWe;var Z9t=class extends pWe{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Kt.AutoOpenBarrier=Z9t;function hUt(t,e){return e?new Promise((r,n)=>{let o=setTimeout(()=>{s.dispose(),r()},t),s=e.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new R_.CancellationError)})}):Khn(r=>hUt(t,r))}a(hUt,"timeout");function Y9o(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,xQ.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(Y9o,"disposableTimeout");function K9o(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(J9o,"first");function Z9o(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(Z9o,"firstParallel");var hWe=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new bIe.Emitter}whenIdle(){return this.size>0?bIe.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=hWe;var mWe=class extends hWe{static{a(this,"Queue")}constructor(){super(1)}};Kt.Queue=mWe;var X9t=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new AWe,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=X9t;var eUt=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 T3;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=Whn.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=Whn.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new mWe;let c=this.drainListenerCount++,l=bIe.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 xQ.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=eUt;var tUt=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new T3;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new T3;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 R_.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 R_.CancellationError)}};Kt.TaskQueue=tUt;var rUt=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 R_.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 R_.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},r))}};Kt.TimeoutTimer=rUt;var nUt=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 R_.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},r);this.disposable=(0,xQ.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Kt.IntervalTimer=nUt;var SIe=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=SIe;var iUt=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=iUt;var oUt=class extends SIe{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=oUt;var sUt=class extends xQ.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new xQ.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 SIe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Kt.ThrottledWorker=sUt;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Kt._runWhenIdle=(e,r,n)=>{(0,U9o.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 X9o(t){let e=Kt._runWhenIdle,r=Kt.runWhenGlobalIdle;return Kt._runWhenIdle=t,Kt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,xQ.toDisposable)(()=>{Kt._runWhenIdle=e,Kt.runWhenGlobalIdle=r})}a(X9o,"installFakeRunWhenIdle");var gWe=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=gWe;var aUt=class extends gWe{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Kt.GlobalIdleValue=aUt;async function eUo(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}=Xhn();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=AWe;var cUt=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=cUt;var T3=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 R_.CancellationError)}};Kt.DeferredPromise=T3;var zhn;(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})(zhn||(Kt.Promises=zhn={}));var yWe=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 R_.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};Kt.StatefulPromise=yWe;var lUt=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new q9o.Lazy(()=>new yWe(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Kt.LazyStatefulPromise=lUt;var EWe=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 bIe.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=EWe;function tUo(t){let e=new pUt.CancellationTokenSource,r=t(e.token);return new vWe(e,async n=>{let o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),n.reject(new R_.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(tUo,"createCancelableAsyncIterableProducer");var uUt=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new T3,this._asyncIterable=new EWe(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=uUt;function rUo(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await Jhn(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a(rUo,"cancellableIterable");var dUt=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 R_.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 T3;return this._unsatisfiedConsumers.push(e),e.p}}},_We=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new dUt,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 T3,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=_We;var vWe=class extends _We{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Kt.CancelableAsyncIterableProducer=vWe;Kt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var fUt=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 R_.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await Zhn(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=fUt;function nUo(t,e){let r=setTimeout(e,t);return(0,xQ.toDisposable)(()=>clearTimeout(r))}a(nUo,"createTimeout")});var bWe=I(CWe=>{"use strict";p();Object.defineProperty(CWe,"__esModule",{value:!0});CWe.SyncDescriptor=void 0;var mUt=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};CWe.SyncDescriptor=mUt});var emn=I(Ale=>{"use strict";p();Object.defineProperty(Ale,"__esModule",{value:!0});Ale.Graph=Ale.Node=void 0;var SWe=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};Ale.Node=SWe;var gUt=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 SWe(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)}}};Ale.Graph=gUt});var yUt=I(TWe=>{"use strict";p();Object.defineProperty(TWe,"__esModule",{value:!0});TWe.ServiceCollection=void 0;var AUt=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)}};TWe.ServiceCollection=AUt});var rmn=I(_le=>{"use strict";p();Object.defineProperty(_le,"__esModule",{value:!0});_le.Trace=_le.InstantiationService=void 0;var iUo=Yc(),oUo=Is(),EUt=Io(),yle=bWe(),tmn=emn(),_Ut=Fs(),sUo=yUt(),aUo=ale(),cUo=!1,IWe=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()}`}},vUt=class t{static{a(this,"InstantiationService")}constructor(e=new sUo.ServiceCollection,r=!1,n,o=cUo){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(_Ut.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new tmn.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,EUt.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,EUt.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=Ele.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,oUo.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 yle.SyncDescriptor?(n=Ele.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=Ele.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=_Ut._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 yle.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 yle.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 tmn.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 IWe(o);for(let d of _Ut._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 yle.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 IWe(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof yle.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 yle.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 iUo.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 aUo.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,EUt.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)}};_le.InstantiationService=vUt;var Ele=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(` -`))}};_le.Trace=Ele});var rn=I(vle=>{"use strict";p();Object.defineProperty(vle,"__esModule",{value:!0});vle.InstantiationServiceBuilder=vle.createServiceIdentifier=void 0;var lUo=Fs();Object.defineProperty(vle,"createServiceIdentifier",{enumerable:!0,get:a(function(){return lUo.createDecorator},"get")});var uUo=rmn(),nmn=yUt(),CUt=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new nmn.ServiceCollection(...e):e??new nmn.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 uUo.InstantiationService(this._collection,!0)}};vle.InstantiationServiceBuilder=CUt});var Cle=I(xWe=>{"use strict";p();Object.defineProperty(xWe,"__esModule",{value:!0});xWe.TokenizerType=void 0;var imn;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(imn||(xWe.TokenizerType=imn={}))});var SUt=I($Y=>{"use strict";p();Object.defineProperty($Y,"__esModule",{value:!0});$Y.WorkerWithRpcProxy=$Y.RcpResponseHandler=void 0;$Y.createRpcProxy=omn;var dUo=require("worker_threads"),wWe=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()}};$Y.RcpResponseHandler=wWe;function omn(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(omn,"createRpcProxy");var bUt=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new wWe,this.worker=new dUo.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=omn((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)}};$Y.WorkerWithRpcProxy=bUt});var wQ=I(ble=>{"use strict";p();Object.defineProperty(ble,"__esModule",{value:!0});ble.CopilotTokenStore=ble.ICopilotTokenStore=void 0;var fUo=rn(),pUo=bc(),hUo=Io();ble.ICopilotTokenStore=(0,fUo.createServiceIdentifier)("ICopilotTokenStore");var TUt=class extends hUo.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new pUo.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()}};ble.CopilotTokenStore=TUt});var qh=I(_A=>{"use strict";p();var mUo=_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},gUo=_A&&_A.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(_A,"__esModule",{value:!0});_A.TelemetryTrustedValue=_A.ITelemetryService=_A.TelemetryUserConfigImpl=_A.ITelemetryUserConfig=void 0;_A.createTrackingIdGetter=yUo;_A.multiplexProperties=_Uo;var smn=rn(),AUo=wQ();_A.ITelemetryUserConfig=(0,smn.createServiceIdentifier)("ITelemetryUserConfig");var IUt=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)}};_A.TelemetryUserConfigImpl=IUt;_A.TelemetryUserConfigImpl=IUt=mUo([gUo(2,AUo.ICopilotTokenStore)],IUt);function yUo(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(yUo,"createTrackingIdGetter");_A.ITelemetryService=(0,smn.createServiceIdentifier)("ITelemetryService");var xUt=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};_A.TelemetryTrustedValue=xUt;var TIe=8192,EUo=50;function _Uo(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>TIe){let s=0,c=0;for(;o>0&&c1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+TIe;o{"use strict";p();Object.defineProperty(Mx,"__esModule",{value:!0});Mx.SlidingWindowAverage=Mx.MovingAverage=Mx.Counter=void 0;Mx.clamp=CUo;Mx.rot=bUo;Mx.isPointWithinTriangle=SUo;Mx.randomChance=TUo;var vUo=zu();function CUo(t,e,r){return Math.min(Math.max(t,e),r)}a(CUo,"clamp");function bUo(t,e){return(e+t%e)%e}a(bUo,"rot");var wUt=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};Mx.Counter=wUt;var RUt=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}};Mx.MovingAverage=RUt;var PUt=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(SUo,"isPointWithinTriangle");function TUo(t){return(0,vUo.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(PWe,"__esModule",{value:!0});PWe.TikTokenImpl=void 0;var kUt=y8t(),RWe=amn(),IUo=iO(),xUo=l6t(),DUt=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new RWe.MovingAverage,textLength:new RWe.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?xUo.parseTikTokenBinary:c=>c;return this._values.push((0,kUt.createTokenizer)(s(e),(0,kUt.getSpecialTokensByEncoder)(r),(0,kUt.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=IUo.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 RWe.MovingAverage,this._stats.textLength=new RWe.MovingAverage,this._stats.callCount=0,r}};PWe.TikTokenImpl=DUt});var PQ=I(mf=>{p();var kWe=null;function wUo(t){kWe=t}a(wUo,"setExternalNativeTokenizerProvider");mf.setExternalNativeTokenizerProvider=wUo;var dmn=mf&&mf.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},fmn=mf&&mf.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(mf,"__esModule",{value:!0});mf.TokenizerProvider=mf.BaseTokensPerName=mf.BaseTokensPerMessage=mf.BaseTokensPerCompletion=mf.ITokenizerProvider=void 0;mf.calculateImageTokenCost=BUt;mf.estimateDocumentTokenCost=hmn;var RQ=xo(),RUo=l9t(),PUo=d9t(),kUo=rn(),lmn=Cle(),DUo=SUt(),NUo=zu(),umn=u3(),NUt=Io(),DWe=EA(),pmn=qh(),MUt=cmn();mf.ITokenizerProvider=(0,kUo.createServiceIdentifier)("ITokenizerProvider");mf.BaseTokensPerCompletion=3;mf.BaseTokensPerMessage=3;mf.BaseTokensPerName=1;var OUt=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new umn.Lazy(()=>new NWe(e,(0,DWe.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new umn.Lazy(()=>new NWe(e,(0,DWe.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case lmn.TokenizerType.CL100K:return this._cl100kTokenizer.value;case lmn.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};mf.TokenizerProvider=OUt;mf.TokenizerProvider=OUt=dmn([fmn(1,pmn.ITelemetryService)],OUt);var NWe=class extends NUt.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 RUo.LRUCache(5e3),this.baseTokensPerMessage=mf.BaseTokensPerMessage,this.baseTokensPerName=mf.BaseTokensPerName,this.mode=RQ.OutputMode.Raw}async countMessagesTokens(e){let r=mf.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 RQ.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case RQ.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case RQ.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return BUt(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case RQ.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case RQ.Raw.ChatCompletionContentPartKind.Document:return hmn(e.documentData.data);default:(0,NUo.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,RQ.toMode)(RQ.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+=BUt(s.image_url.url,s.image_url.detail)}catch{r+=await this.tokenLength(s.image_url.url)}else r+=await this.tokenLength(s.image_url.url);else{let c=await this.countMessageObjectTokens(o);n==="tool_calls"&&(c=Math.floor(c*1.5)),r+=c}}n==="name"&&o!==void 0&&(r+=this.baseTokensPerName)}return r}async countObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))o&&(r+=await this.tokenLength(n),typeof o=="string"?r+=await this.tokenLength(o):o&&(r+=await this.countMessageObjectTokens(o)));return r}ensureTokenizer(){return this._tokenizer??=this.doInitTokenizer(),this._tokenizer}async doInitTokenizer(){if(kWe)try{await kWe.ensureLoaded(this._encoderName);let r=kWe.getEncoder(this._encoderName);if(r)return{encode:a(async(n,o)=>r.encode(n,o),"encode")};console.error("[chat-lib-tokenizer] host provider returned no encoder for "+this._encoderName+", falling back to own BPE load")}catch(r){console.error("[chat-lib-tokenizer] host delegate failed: "+r+", falling back to own BPE load")}let e=(0,DWe.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,DWe.join)(__dirname,"tikTokenizerWorker.js"),n=new DUo.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,NUt.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=MUt.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,NUt.toDisposable)(()=>{MUt.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>MUt.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};NWe=dmn([fmn(3,pmn.ITelemetryService)],NWe);function BUt(t,e){let{width:r,height:n}=(0,PUo.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(BUt,"calculateImageTokenCost");function hmn(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(hmn,"estimateDocumentTokenCost")});var m0n={};Ri(m0n,{TextDocument:()=>w3});function p7t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);p7t(n,e),p7t(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 tQo(t){let e=h0n(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Pze,w3,h7t=_e(()=>{"use strict";p();Pze=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=h0n(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=f0n(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&&p0n(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 Pze(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof Pze)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=p7t(s.map(tQo),(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})(w3||(w3={}));a(p7t,"mergeSort");a(f0n,"computeLineOffsets");a(p0n,"isEOL");a(h0n,"getWellformedRange");a(tQo,"getWellformedEdit")});var Qze=I($h=>{"use strict";p();Object.defineProperty($h,"__esModule",{value:!0});$h.thenable=$h.typedArray=$h.stringArray=$h.array=$h.func=$h.error=$h.number=$h.string=$h.boolean=void 0;function sQo(t){return t===!0||t===!1}a(sQo,"boolean");$h.boolean=sQo;function Tgn(t){return typeof t=="string"||t instanceof String}a(Tgn,"string");$h.string=Tgn;function aQo(t){return typeof t=="number"||t instanceof Number}a(aQo,"number");$h.number=aQo;function cQo(t){return t instanceof Error}a(cQo,"error");$h.error=cQo;function Ign(t){return typeof t=="function"}a(Ign,"func");$h.func=Ign;function xgn(t){return Array.isArray(t)}a(xgn,"array");$h.array=xgn;function lQo(t){return xgn(t)&&t.every(e=>Tgn(e))}a(lQo,"stringArray");$h.stringArray=lQo;function uQo(t,e){return Array.isArray(t)&&t.every(e)}a(uQo,"typedArray");$h.typedArray=uQo;function dQo(t){return t&&Ign(t.then)}a(dQo,"thenable");$h.thenable=dQo});var D7t=I(Bx=>{"use strict";p();Object.defineProperty(Bx,"__esModule",{value:!0});Bx.generateUuid=Bx.parse=Bx.isUUID=Bx.v4=Bx.empty=void 0;var jIe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},HIe=class t extends jIe{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(""))}};HIe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];HIe._timeHighBits=["8","9","a","b"];Bx.empty=new jIe("00000000-0000-0000-0000-000000000000");function wgn(){return new HIe}a(wgn,"v4");Bx.v4=wgn;var fQo=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Rgn(t){return fQo.test(t)}a(Rgn,"isUUID");Bx.isUUID=Rgn;function pQo(t){if(!Rgn(t))throw new Error("invalid uuid");return new jIe(t)}a(pQo,"parse");Bx.parse=pQo;function hQo(){return wgn().asHex()}a(hQo,"generateUuid");Bx.generateUuid=hQo});var Pgn=I(HQ=>{"use strict";p();Object.defineProperty(HQ,"__esModule",{value:!0});HQ.attachPartialResult=HQ.ProgressFeature=HQ.attachWorkDone=void 0;var jQ=ri(),mQo=D7t(),eK=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(jQ.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(jQ.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(jQ.WorkDoneProgress.type,this._token,{kind:"end"})}};eK.Instances=new Map;var qze=class extends eK{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new jQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},GIe=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},jze=class extends GIe{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new jQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function gQo(t,e){if(e===void 0||e.workDoneToken===void 0)return new GIe;let r=e.workDoneToken;return delete e.workDoneToken,new eK(t,r)}a(gQo,"attachWorkDone");HQ.attachWorkDone=gQo;var AQo=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(jQ.WorkDoneProgressCancelNotification.type,r=>{let n=eK.Instances.get(r.token);(n instanceof qze||n instanceof jze)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new GIe:new eK(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,mQo.generateUuid)();return this.connection.sendRequest(jQ.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new qze(this.connection,e))}else return Promise.resolve(new jze)}},"ProgressFeature");HQ.ProgressFeature=AQo;var N7t;(function(t){t.type=new jQ.ProgressType})(N7t||(N7t={}));var M7t=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(N7t.type,this._token,e)}};function yQo(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new M7t(t,r)}a(yQo,"attachPartialResult");HQ.attachPartialResult=yQo});var kgn=I(Hze=>{"use strict";p();Object.defineProperty(Hze,"__esModule",{value:!0});Hze.ConfigurationFeature=void 0;var EQo=ri(),_Qo=Qze(),vQo=a(t=>class extends t{getConfiguration(e){return e?_Qo.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(EQo.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");Hze.ConfigurationFeature=vQo});var Dgn=I($ze=>{"use strict";p();Object.defineProperty($ze,"__esModule",{value:!0});$ze.WorkspaceFoldersFeature=void 0;var Gze=ri(),CQo=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 Gze.Emitter,this.connection.onNotification(Gze.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(Gze.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(Gze.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");$ze.WorkspaceFoldersFeature=CQo});var Ngn=I(Vze=>{"use strict";p();Object.defineProperty(Vze,"__esModule",{value:!0});Vze.CallHierarchyFeature=void 0;var O7t=ri(),bQo=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(O7t.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=O7t.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=O7t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");Vze.CallHierarchyFeature=bQo});var L7t=I(GQ=>{"use strict";p();Object.defineProperty(GQ,"__esModule",{value:!0});GQ.SemanticTokensBuilder=GQ.SemanticTokensDiff=GQ.SemanticTokensFeature=void 0;var Wze=ri(),SQo=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(Wze.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=Wze.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=Wze.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=Wze.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");GQ.SemanticTokensFeature=SQo;var zze=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 zze(this._prevData,this._data).computeDiff()}:this.build()}};GQ.SemanticTokensBuilder=B7t});var Mgn=I(Yze=>{"use strict";p();Object.defineProperty(Yze,"__esModule",{value:!0});Yze.ShowDocumentFeature=void 0;var TQo=ri(),IQo=a(t=>class extends t{showDocument(e){return this.connection.sendRequest(TQo.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");Yze.ShowDocumentFeature=IQo});var Ogn=I(Kze=>{"use strict";p();Object.defineProperty(Kze,"__esModule",{value:!0});Kze.FileOperationsFeature=void 0;var Nle=ri(),xQo=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Nle.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Nle.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Nle.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Nle.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Nle.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Nle.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");Kze.FileOperationsFeature=xQo});var Bgn=I(Jze=>{"use strict";p();Object.defineProperty(Jze,"__esModule",{value:!0});Jze.LinkedEditingRangeFeature=void 0;var wQo=ri(),RQo=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(wQo.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");Jze.LinkedEditingRangeFeature=RQo});var Lgn=I(Zze=>{"use strict";p();Object.defineProperty(Zze,"__esModule",{value:!0});Zze.TypeHierarchyFeature=void 0;var F7t=ri(),PQo=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(F7t.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=F7t.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=F7t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");Zze.TypeHierarchyFeature=PQo});var Ugn=I(Xze=>{"use strict";p();Object.defineProperty(Xze,"__esModule",{value:!0});Xze.InlineValueFeature=void 0;var Fgn=ri(),kQo=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(Fgn.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(Fgn.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");Xze.InlineValueFeature=kQo});var qgn=I(eYe=>{"use strict";p();Object.defineProperty(eYe,"__esModule",{value:!0});eYe.FoldingRangeFeature=void 0;var Qgn=ri(),DQo=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(Qgn.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=Qgn.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");eYe.FoldingRangeFeature=DQo});var jgn=I(tYe=>{"use strict";p();Object.defineProperty(tYe,"__esModule",{value:!0});tYe.InlayHintFeature=void 0;var U7t=ri(),NQo=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest(U7t.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(U7t.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest(U7t.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");tYe.InlayHintFeature=NQo});var Hgn=I(rYe=>{"use strict";p();Object.defineProperty(rYe,"__esModule",{value:!0});rYe.DiagnosticFeature=void 0;var $Ie=ri(),MQo=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest($Ie.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest($Ie.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress($Ie.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest($Ie.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress($Ie.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");rYe.DiagnosticFeature=MQo});var q7t=I(nYe=>{"use strict";p();Object.defineProperty(nYe,"__esModule",{value:!0});nYe.TextDocuments=void 0;var tK=ri(),Q7t=class{static{a(this,"TextDocuments")}constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new tK.Emitter,this._onDidOpen=new tK.Emitter,this._onDidClose=new tK.Emitter,this._onDidSave=new tK.Emitter,this._onWillSave=new tK.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=tK.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}))})),tK.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};nYe.TextDocuments=Q7t});var H7t=I(Mle=>{"use strict";p();Object.defineProperty(Mle,"__esModule",{value:!0});Mle.NotebookDocuments=Mle.NotebookSyncFeature=void 0;var Lx=ri(),Ggn=q7t(),OQo=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(Lx.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(Lx.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(Lx.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(Lx.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");Mle.NotebookSyncFeature=OQo;var iYe=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,Lx.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Lx.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Lx.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}};iYe.NULL_DISPOSE=Object.freeze({dispose:a(()=>{},"dispose")});var j7t=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof Ggn.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Ggn.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Lx.Emitter,this._onDidChange=new Lx.Emitter,this._onDidSave=new Lx.Emitter,this._onDidClose=new Lx.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 iYe,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)}})),Lx.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Mle.NotebookDocuments=j7t});var $gn=I(oYe=>{"use strict";p();Object.defineProperty(oYe,"__esModule",{value:!0});oYe.MonikerFeature=void 0;var BQo=ri(),LQo=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=BQo.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");oYe.MonikerFeature=LQo});var Y7t=I(mc=>{"use strict";p();Object.defineProperty(mc,"__esModule",{value:!0});mc.createConnection=mc.combineFeatures=mc.combineNotebooksFeatures=mc.combineLanguagesFeatures=mc.combineWorkspaceFeatures=mc.combineWindowFeatures=mc.combineClientFeatures=mc.combineTracerFeatures=mc.combineTelemetryFeatures=mc.combineConsoleFeatures=mc._NotebooksImpl=mc._LanguagesImpl=mc.BulkUnregistration=mc.BulkRegistration=mc.ErrorMessageTracker=void 0;var Jr=ri(),Fx=Qze(),$7t=D7t(),wo=Pgn(),FQo=kgn(),UQo=Dgn(),QQo=Ngn(),qQo=L7t(),jQo=Mgn(),HQo=Ogn(),GQo=Bgn(),$Qo=Lgn(),VQo=Ugn(),WQo=qgn(),zQo=jgn(),YQo=Hgn(),KQo=H7t(),JQo=$gn();function G7t(t){if(t!==null)return t}a(G7t,"null2Undefined");var V7t=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)})}};mc.ErrorMessageTracker=V7t;var sYe=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(Jr.MessageType.Error,e)}warn(e){this.send(Jr.MessageType.Warning,e)}info(e){this.send(Jr.MessageType.Info,e)}log(e){this.send(Jr.MessageType.Log,e)}debug(e){this.send(Jr.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Jr.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Jr.RAL)().console.error("Sending log message failed")})}},W7t=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:Jr.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Jr.ShowMessageRequest.type,n).then(G7t)}showWarningMessage(e,...r){let n={type:Jr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Jr.ShowMessageRequest.type,n).then(G7t)}showInformationMessage(e,...r){let n={type:Jr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Jr.ShowMessageRequest.type,n).then(G7t)}},Vgn=(0,jQo.ShowDocumentFeature)((0,wo.ProgressFeature)(W7t)),Wgn;(function(t){function e(){return new aYe}a(e,"create"),t.create=e})(Wgn||(mc.BulkRegistration=Wgn={}));var aYe=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=Fx.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=$7t.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},zgn;(function(t){function e(){return new VIe(void 0,[])}a(e,"create"),t.create=e})(zgn||(mc.BulkUnregistration=zgn={}));var VIe=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(Jr.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=Fx.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let o={unregisterations:[n]};return this._connection.sendRequest(Jr.UnregistrationRequest.type,o).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},cYe=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 aYe?this.registerMany(e):e instanceof VIe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=Fx.string(r)?r:r.method,s=$7t.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Jr.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=Fx.string(e)?e:e.method,o=$7t.generateUuid(),s={registrations:[{id:o,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Jr.RegistrationRequest.type,s).then(c=>Jr.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(Jr.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(Jr.RegistrationRequest.type,r).then(()=>new VIe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},z7t=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(Jr.ApplyWorkspaceEditRequest.type,n)}},Ygn=(0,HQo.FileOperationsFeature)((0,UQo.WorkspaceFoldersFeature)((0,FQo.ConfigurationFeature)(z7t))),lYe=class{static{a(this,"TracerImpl")}constructor(){this._trace=Jr.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!==Jr.Trace.Off&&this.connection.sendNotification(Jr.LogTraceNotification.type,{message:e,verbose:this._trace===Jr.Trace.Verbose?r:void 0}).catch(()=>{})}},uYe=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(Jr.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},dYe=class{static{a(this,"_LanguagesImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,wo.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,wo.attachPartialResult)(this.connection,r)}};mc._LanguagesImpl=dYe;var Kgn=(0,WQo.FoldingRangeFeature)((0,JQo.MonikerFeature)((0,YQo.DiagnosticFeature)((0,zQo.InlayHintFeature)((0,VQo.InlineValueFeature)((0,$Qo.TypeHierarchyFeature)((0,GQo.LinkedEditingRangeFeature)((0,qQo.SemanticTokensFeature)((0,QQo.CallHierarchyFeature)(dYe))))))))),fYe=class{static{a(this,"_NotebooksImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,wo.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,wo.attachPartialResult)(this.connection,r)}};mc._NotebooksImpl=fYe;var Jgn=(0,KQo.NotebookSyncFeature)(fYe);function Zgn(t,e){return function(r){return e(t(r))}}a(Zgn,"combineConsoleFeatures");mc.combineConsoleFeatures=Zgn;function Xgn(t,e){return function(r){return e(t(r))}}a(Xgn,"combineTelemetryFeatures");mc.combineTelemetryFeatures=Xgn;function eAn(t,e){return function(r){return e(t(r))}}a(eAn,"combineTracerFeatures");mc.combineTracerFeatures=eAn;function tAn(t,e){return function(r){return e(t(r))}}a(tAn,"combineClientFeatures");mc.combineClientFeatures=tAn;function rAn(t,e){return function(r){return e(t(r))}}a(rAn,"combineWindowFeatures");mc.combineWindowFeatures=rAn;function nAn(t,e){return function(r){return e(t(r))}}a(nAn,"combineWorkspaceFeatures");mc.combineWorkspaceFeatures=nAn;function iAn(t,e){return function(r){return e(t(r))}}a(iAn,"combineLanguagesFeatures");mc.combineLanguagesFeatures=iAn;function oAn(t,e){return function(r){return e(t(r))}}a(oAn,"combineNotebooksFeatures");mc.combineNotebooksFeatures=oAn;function ZQo(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,Zgn),tracer:r(t.tracer,e.tracer,eAn),telemetry:r(t.telemetry,e.telemetry,Xgn),client:r(t.client,e.client,tAn),window:r(t.window,e.window,rAn),workspace:r(t.workspace,e.workspace,nAn),languages:r(t.languages,e.languages,iAn),notebooks:r(t.notebooks,e.notebooks,oAn)}}a(ZQo,"combineFeatures");mc.combineFeatures=ZQo;function XQo(t,e,r){let n=r&&r.console?new(r.console(sYe)):new sYe,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(lYe)):new lYe,c=r&&r.telemetry?new(r.telemetry(uYe)):new uYe,l=r&&r.client?new(r.client(cYe)):new cYe,u=r&&r.window?new(r.window(Vgn)):new Vgn,d=r&&r.workspace?new(r.workspace(Ygn)):new Ygn,f=r&&r.languages?new(r.languages(Kgn)):new Kgn,h=r&&r.notebooks?new(r.notebooks(Jgn)):new Jgn,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:Fx.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(Fx.string(v)?v:v.method,...b),"sendRequest"),onRequest:a((v,b)=>o.onRequest(v,b),"onRequest"),sendNotification:a((v,b)=>{let T=Fx.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(Jr.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(Jr.DidChangeConfigurationNotification.type,v),"onDidChangeConfiguration"),onDidChangeWatchedFiles:a(v=>o.onNotification(Jr.DidChangeWatchedFilesNotification.type,v),"onDidChangeWatchedFiles"),__textDocumentSync:void 0,onDidOpenTextDocument:a(v=>o.onNotification(Jr.DidOpenTextDocumentNotification.type,v),"onDidOpenTextDocument"),onDidChangeTextDocument:a(v=>o.onNotification(Jr.DidChangeTextDocumentNotification.type,v),"onDidChangeTextDocument"),onDidCloseTextDocument:a(v=>o.onNotification(Jr.DidCloseTextDocumentNotification.type,v),"onDidCloseTextDocument"),onWillSaveTextDocument:a(v=>o.onNotification(Jr.WillSaveTextDocumentNotification.type,v),"onWillSaveTextDocument"),onWillSaveTextDocumentWaitUntil:a(v=>o.onRequest(Jr.WillSaveTextDocumentWaitUntilRequest.type,v),"onWillSaveTextDocumentWaitUntil"),onDidSaveTextDocument:a(v=>o.onNotification(Jr.DidSaveTextDocumentNotification.type,v),"onDidSaveTextDocument"),sendDiagnostics:a(v=>o.sendNotification(Jr.PublishDiagnosticsNotification.type,v),"sendDiagnostics"),onHover:a(v=>o.onRequest(Jr.HoverRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Jr.CompletionRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onCompletion"),onCompletionResolve:a(v=>o.onRequest(Jr.CompletionResolveRequest.type,v),"onCompletionResolve"),onSignatureHelp:a(v=>o.onRequest(Jr.SignatureHelpRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Jr.DeclarationRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Jr.DefinitionRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Jr.TypeDefinitionRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Jr.ImplementationRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onImplementation"),onReferences:a(v=>o.onRequest(Jr.ReferencesRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Jr.DocumentHighlightRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Jr.DocumentSymbolRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Jr.WorkspaceSymbolRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onWorkspaceSymbol"),onWorkspaceSymbolResolve:a(v=>o.onRequest(Jr.WorkspaceSymbolResolveRequest.type,v),"onWorkspaceSymbolResolve"),onCodeAction:a(v=>o.onRequest(Jr.CodeActionRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onCodeAction"),onCodeActionResolve:a(v=>o.onRequest(Jr.CodeActionResolveRequest.type,(b,T)=>v(b,T)),"onCodeActionResolve"),onCodeLens:a(v=>o.onRequest(Jr.CodeLensRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onCodeLens"),onCodeLensResolve:a(v=>o.onRequest(Jr.CodeLensResolveRequest.type,(b,T)=>v(b,T)),"onCodeLensResolve"),onDocumentFormatting:a(v=>o.onRequest(Jr.DocumentFormattingRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Jr.DocumentRangeFormattingRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),void 0)),"onDocumentRangeFormatting"),onDocumentOnTypeFormatting:a(v=>o.onRequest(Jr.DocumentOnTypeFormattingRequest.type,(b,T)=>v(b,T)),"onDocumentOnTypeFormatting"),onRenameRequest:a(v=>o.onRequest(Jr.RenameRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),void 0)),"onRenameRequest"),onPrepareRename:a(v=>o.onRequest(Jr.PrepareRenameRequest.type,(b,T)=>v(b,T)),"onPrepareRename"),onDocumentLinks:a(v=>o.onRequest(Jr.DocumentLinkRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onDocumentLinks"),onDocumentLinkResolve:a(v=>o.onRequest(Jr.DocumentLinkResolveRequest.type,(b,T)=>v(b,T)),"onDocumentLinkResolve"),onDocumentColor:a(v=>o.onRequest(Jr.DocumentColorRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Jr.ColorPresentationRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Jr.FoldingRangeRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Jr.SelectionRangeRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Jr.ExecuteCommandRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),void 0)),"onExecuteCommand"),dispose:a(()=>o.dispose(),"dispose")};for(let v of m)v.attach(_);return o.onRequest(Jr.InitializeRequest.type,v=>{e.initialize(v),Fx.string(v.trace)&&(s.trace=Jr.Trace.fromString(v.trace));for(let b of m)b.initialize(v.capabilities);if(y){let b=y(v,new Jr.CancellationTokenSource().token,(0,wo.attachWorkDone)(o,v),void 0);return g(b).then(T=>{if(T instanceof Jr.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=Fx.number(_.__textDocumentSync)?_.__textDocumentSync:Jr.TextDocumentSyncKind.None:!Fx.number(R.textDocumentSync)&&!Fx.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=Fx.number(_.__textDocumentSync)?_.__textDocumentSync:Jr.TextDocumentSyncKind.None);for(let x of m)x.fillServerCapabilities(R);return w})}else{let b={capabilities:{textDocumentSync:Jr.TextDocumentSyncKind.None}};for(let T of m)T.fillServerCapabilities(b.capabilities);return b}}),o.onRequest(Jr.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new Jr.CancellationTokenSource().token)}),o.onNotification(Jr.ExitNotification.type,()=>{try{E&&E()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),o.onNotification(Jr.SetTraceNotification.type,v=>{s.trace=Jr.Trace.fromString(v.value)}),_}a(XQo,"createConnection");mc.createConnection=XQo});var sAn=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 eqo=require("url"),Ok=require("path"),K7t=require("fs"),eQt=require("child_process");function tqo(t){let e=eqo.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 Ok.normalize(r.join("/"))}a(tqo,"uriToFilePath");NC.uriToFilePath=tqo;function J7t(){return process.platform==="win32"}a(J7t,"isWindows");function pYe(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&&K7t.existsSync(e)&&(d[o]?d[o]=e+Ok.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,eQt.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(pYe,"resolve");NC.resolve=pYe;function Z7t(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};J7t()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,eQt.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?J7t()?Ok.join(c,"node_modules"):Ok.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(Z7t,"resolveGlobalNodePath");NC.resolveGlobalNodePath=Z7t;function rqo(t){let e="yarn",r={encoding:"utf8"};J7t()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,eQt.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 Ok.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(rqo,"resolveGlobalYarnPath");NC.resolveGlobalYarnPath=rqo;var X7t;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!K7t.existsSync(__filename.toUpperCase())||!K7t.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?Ok.normalize(s).indexOf(Ok.normalize(o))===0:Ok.normalize(s).toLowerCase().indexOf(Ok.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(X7t||(NC.FileSystem=X7t={}));function nqo(t,e,r,n){return r?(Ok.isAbsolute(r)||(r=Ok.join(t,r)),pYe(e,r,r,n).then(o=>X7t.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>pYe(e,Z7t(n),t,n))):pYe(e,Z7t(n),t,n)}a(nqo,"resolveModulePath");NC.resolveModulePath=nqo});var tQt=I((_3u,aAn)=>{"use strict";p();aAn.exports=ri()});var cAn=I(hYe=>{"use strict";p();Object.defineProperty(hYe,"__esModule",{value:!0});hYe.InlineCompletionFeature=void 0;var iqo=ri(),oqo=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(iqo.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");hYe.InlineCompletionFeature=oqo});var dAn=I(Zy=>{"use strict";p();var sqo=Zy&&Zy.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uAn=Zy&&Zy.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sqo(e,t,r)};Object.defineProperty(Zy,"__esModule",{value:!0});Zy.ProposedFeatures=Zy.NotebookDocuments=Zy.TextDocuments=Zy.SemanticTokensBuilder=void 0;var aqo=L7t();Object.defineProperty(Zy,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return aqo.SemanticTokensBuilder},"get")});var cqo=cAn();uAn(ri(),Zy);var lqo=q7t();Object.defineProperty(Zy,"TextDocuments",{enumerable:!0,get:a(function(){return lqo.TextDocuments},"get")});var uqo=H7t();Object.defineProperty(Zy,"NotebookDocuments",{enumerable:!0,get:a(function(){return uqo.NotebookDocuments},"get")});uAn(Y7t(),Zy);var lAn;(function(t){t.all={__brand:"features",languages:cqo.InlineCompletionFeature}})(lAn||(Zy.ProposedFeatures=lAn={}))});var Kc=I(Ux=>{"use strict";p();var dqo=Ux&&Ux.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mAn=Ux&&Ux.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dqo(e,t,r)};Object.defineProperty(Ux,"__esModule",{value:!0});Ux.createConnection=Ux.Files=void 0;var fAn=require("node:util"),rQt=Qze(),fqo=Y7t(),WIe=sAn(),rK=tQt();mAn(tQt(),Ux);mAn(dAn(),Ux);var pAn;(function(t){t.uriToFilePath=WIe.uriToFilePath,t.resolveGlobalNodePath=WIe.resolveGlobalNodePath,t.resolveGlobalYarnPath=WIe.resolveGlobalYarnPath,t.resolve=WIe.resolve,t.resolveModulePath=WIe.resolveModulePath})(pAn||(Ux.Files=pAn={}));var hAn;function mYe(){if(hAn!==void 0)try{hAn.end()}catch{}}a(mYe,"endProtocolConnection");var Ole=!1,gAn;function pqo(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(gAn=setInterval(()=>{try{process.kill(n,0)}catch{mYe(),process.exit(Ole?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;rQt.number(e)&&gAn===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Ole?0:1)}},3e3)},"initialize"),get shutdownReceived(){return Ole},set shutdownReceived(t){Ole=t},exit:a(t=>{mYe(),process.exit(t)},"exit")};function mqo(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),rK.ConnectionStrategy.is(t)||rK.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),gqo(s,c,l,o)}a(mqo,"createConnection");Ux.createConnection=mqo;function gqo(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{mYe(),process.exit(Ole?0:1)}),u.on("close",()=>{mYe(),process.exit(Ole?0:1)})}let l=a(u=>{let d=(0,rK.createProtocolConnection)(t,e,u,r);return o&&Aqo(u),d},"connectionFactory");return(0,fqo.createConnection)(l,hqo,n)}a(gqo,"_createConnection");function Aqo(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,fAn.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,fAn.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(Aqo,"patchConsole")});var Bk=I((D3u,AAn)=>{"use strict";p();AAn.exports=Kc()});var YAn=I((b8u,zAn)=>{"use strict";p();zAn.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 Wyn=I(t0=>{"use strict";p();var FQt=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),yjo=FQt(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")}),Ejo=FQt(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")}),_jo=FQt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),jyn=t0&&t0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vjo=t0&&t0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Hyn=t0&&t0.__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:Sjo,sync:Tjo}=Wyn(),{join:Ijo,delimiter:xjo,sep:zyn,posix:Yyn}=require("path"),Kyn=process.platform==="win32",Jyn=new RegExp(`[${Yyn.sep}${zyn===Yyn.sep?"":zyn}]`.replace(/(\\)/g,"\\$1")),wjo=new RegExp(`^\\.${Jyn.source}`),Zyn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),Xyn=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=xjo})=>{let o=t.match(Jyn)?[""]:[...Kyn?[process.cwd()]:[],...(e||"").split(n)];if(Kyn){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"),eEn=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&wjo.test(e)?e.slice(0,2):"")+Ijo(r,e)},"getPathPart"),tEn=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=Xyn(t,e),s=[];for(let c of r){let l=eEn(c,t);for(let u of n){let d=l+u;if(await Sjo(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 Zyn(t)},"which"),Rjo=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=Xyn(t,e),s=[];for(let c of r){let l=eEn(c,t);for(let u of n){let d=l+u;if(Tjo(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 Zyn(t)},"whichSync");rEn.exports=tEn;tEn.sync=Rjo});var uxe=I((oju,A_n)=>{"use strict";p();var p_n="[^\\\\/]",fGo="(?=.)",h_n="[^/]",nqt="(?:\\/|$)",m_n="(?:^|\\/)",iqt=`\\.{1,2}${nqt}`,pGo="(?!\\.)",hGo=`(?!${m_n}${iqt})`,mGo=`(?!\\.{0,1}${nqt})`,gGo=`(?!${iqt})`,AGo="[^.\\/]",yGo=`${h_n}*?`,EGo="/",g_n={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:fGo,QMARK:h_n,END_ANCHOR:nqt,DOTS_SLASH:iqt,NO_DOT:pGo,NO_DOTS:hGo,NO_DOT_SLASH:mGo,NO_DOTS_SLASH:gGo,QMARK_NO_DOT:AGo,STAR:yGo,START_ANCHOR:m_n,SEP:EGo},_Go={...g_n,SLASH_LITERAL:"[\\\\/]",QMARK:p_n,STAR:`${p_n}*?`,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:"\\"},vGo={__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"};A_n.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:vGo,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?_Go:g_n}}});var dxe=I(LC=>{"use strict";p();var{REGEX_BACKSLASH:CGo,REGEX_REMOVE_BACKSLASH:bGo,REGEX_SPECIAL_CHARS:SGo,REGEX_SPECIAL_CHARS_GLOBAL:TGo}=uxe();LC.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);LC.hasRegexChars=t=>SGo.test(t);LC.isRegexChar=t=>t.length===1&&LC.hasRegexChars(t);LC.escapeRegex=t=>t.replace(TGo,"\\$1");LC.toPosixSlashes=t=>t.replace(CGo,"/");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(bGo,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 T_n=I((lju,S_n)=>{"use strict";p();var y_n=dxe(),{CHAR_ASTERISK:oqt,CHAR_AT:IGo,CHAR_BACKWARD_SLASH:fxe,CHAR_COMMA:xGo,CHAR_DOT:sqt,CHAR_EXCLAMATION_MARK:aqt,CHAR_FORWARD_SLASH:b_n,CHAR_LEFT_CURLY_BRACE:cqt,CHAR_LEFT_PARENTHESES:lqt,CHAR_LEFT_SQUARE_BRACKET:wGo,CHAR_PLUS:RGo,CHAR_QUESTION_MARK:E_n,CHAR_RIGHT_CURLY_BRACE:PGo,CHAR_RIGHT_PARENTHESES:__n,CHAR_RIGHT_SQUARE_BRACKET:kGo}=uxe(),v_n=a(t=>t===b_n||t===fxe,"isPathSeparator"),C_n=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),DGo=a((t,e)=>{let r=e||{},n=t.length-1,o=r.parts===!0||r.scanToEnd===!0,s=[],c=[],l=[],u=t,d=-1,f=0,h=0,m=!1,g=!1,A=!1,y=!1,E=!1,_=!1,v=!1,b=!1,T=!1,w=!1,R=0,x,P,D={value:"",depth:0,isGlob:!1},N=a(()=>d>=n,"eos"),B=a(()=>u.charCodeAt(d+1),"peek"),L=a(()=>(x=P,u.charCodeAt(++d)),"advance");for(;d0&&(M=u.slice(0,f),u=u.slice(f),h-=f),j&&A===!0&&h>0?(j=u.slice(0,h),O=u.slice(h)):A===!0?(j="",O=u):j=u,j&&j!==""&&j!=="/"&&j!==u&&v_n(j.charCodeAt(j.length-1))&&(j=j.slice(0,-1)),r.unescape===!0&&(O&&(O=y_n.removeBackslashes(O)),j&&v===!0&&(j=y_n.removeBackslashes(j)));let q={prefix:M,input:t,start:f,base:j,glob:O,isBrace:m,isBracket:g,isGlob:A,isExtglob:y,isGlobstar:E,negated:b,negatedExtglob:T};if(r.tokens===!0&&(q.maxDepth=0,v_n(P)||c.push(D),q.tokens=c),r.parts===!0||r.tokens===!0){let Q;for(let U=0;U{"use strict";p();var pxe=uxe(),BS=dxe(),{MAX_LENGTH:oKe,POSIX_REGEX_SOURCE:NGo,REGEX_NON_SPECIAL_CHARS:MGo,REGEX_SPECIAL_CHARS_BACKREF:OGo,REPLACEMENTS:I_n}=pxe,BGo=a((t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(o=>BS.escapeRegex(o)).join("..")}return r},"expandRange"),zle=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),x_n=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"),LGo=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"),w_n=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(LGo(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),FGo=a(t=>{let e=t.map(w_n).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"),UGo=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=w_n(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?BS.escapeRegex(r[0]):`[${r.map(o=>BS.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),QGo=a(t=>{let e=0,r=t.trim(),n=uqt(r);for(;n;)e++,r=n.body.trim(),n=uqt(r);return e},"repeatedExtglobRecursion"),qGo=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:pxe.DEFAULT_MAX_EXTGLOB_RECURSION,n=x_n(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||FGo(n)))return{risky:!0};for(let o of n){let s=UGo(o);if(s)return{risky:!0,safeOutput:s};if(QGo(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),dqt=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=I_n[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(oKe,r.maxLength):oKe,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=pxe.globChars(r.windows),d=pxe.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:m,ONE_CHAR:g,DOTS_SLASH:A,NO_DOT:y,NO_DOT_SLASH:E,NO_DOTS_SLASH:_,QMARK:v,QMARK_NO_DOT:b,STAR:T,START_ANCHOR:w}=u,R=a(ve=>`(${l}(?:(?!${w}${ve.dot?A:f}).)*?)`,"globstar"),x=r.dot?"":y,P=r.dot?v:b,D=r.bash===!0?R(r):T;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let N={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:c};t=BS.removePrefix(t,N),o=t.length;let B=[],L=[],j=[],M=s,O,q=a(()=>N.index===o-1,"eos"),Q=N.peek=(ve=1)=>t[N.index+ve],U=N.advance=()=>t[++N.index]||"",z=a(()=>t.slice(N.index+1),"remaining"),$=a((ve="",Ue=0)=>{N.consumed+=ve,N.index+=Ue},"consume"),W=a(ve=>{N.output+=ve.output!=null?ve.output:ve.value,$(ve.value)},"append"),J=a(()=>{let ve=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)U(),N.start++,ve++;return ve%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),ne=a(ve=>{N[ve]++,j.push(ve)},"increment"),H=a(ve=>{N[ve]--,j.pop()},"decrement"),re=a(ve=>{if(M.type==="globstar"){let Ue=N.braces>0&&(ve.type==="comma"||ve.type==="brace"),Pe=ve.extglob===!0||B.length&&(ve.type==="pipe"||ve.type==="paren");ve.type!=="slash"&&ve.type!=="paren"&&!Ue&&!Pe&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(B.length&&ve.type!=="paren"&&(B[B.length-1].inner+=ve.value),(ve.value||ve.output)&&W(ve),M&&M.type==="text"&&ve.type==="text"){M.output=(M.output||M.value)+ve.value,M.value+=ve.value;return}ve.prev=M,c.push(ve),M=ve},"push"),ae=a((ve,Ue)=>{let Pe={...d[Ue],conditions:1,inner:""};Pe.prev=M,Pe.parens=N.parens,Pe.output=N.output,Pe.startIndex=N.index,Pe.tokensIndex=c.length;let Z=(r.capture?"(":"")+Pe.open;ne("parens"),re({type:ve,value:Ue,output:N.output?"":g}),re({type:"paren",extglob:!0,value:U(),output:Z}),B.push(Pe)},"extglobOpen"),Be=a(ve=>{let Ue=t.slice(ve.startIndex,N.index+1),Pe=t.slice(ve.startIndex+2,N.index),Z=qGo(Pe,r);if((ve.type==="plus"||ve.type==="star")&&Z.risky){let he=Z.safeOutput?(ve.output?"":g)+(r.capture?`(${Z.safeOutput})`:Z.safeOutput):void 0,X=c[ve.tokensIndex];X.type="text",X.value=Ue,X.output=he||BS.escapeRegex(Ue);for(let ue=ve.tokensIndex+1;ue1&&ve.inner.includes("/")&&(he=R(r)),(he!==D||q()||/^\)+$/.test(z()))&&(ee=ve.close=`)$))${he}`),ve.inner.includes("*")&&(K=z())&&/^\.[^\\/.]+$/.test(K)){let X=dqt(K,{...e,fastpaths:!1}).output;ee=ve.close=`)${X})${he})`}ve.prev.type==="bos"&&(N.negatedExtglob=!0)}re({type:"paren",extglob:!0,value:O,output:ee}),H("parens")},"extglobClose");if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let ve=!1,Ue=t.replace(OGo,(Pe,Z,ee,K,he,X)=>K==="\\"?(ve=!0,Pe):K==="?"?Z?Z+K+(he?v.repeat(he.length):""):X===0?P+(he?v.repeat(he.length):""):v.repeat(ee.length):K==="."?f.repeat(ee.length):K==="*"?Z?Z+K+(he?D:""):D:Z?Pe:`\\${Pe}`);return ve===!0&&(r.unescape===!0?Ue=Ue.replace(/\\/g,""):Ue=Ue.replace(/\\+/g,Pe=>Pe.length%2===0?"\\\\":Pe?"\\":"")),Ue===t&&r.contains===!0?(N.output=t,N):(N.output=BS.wrapOutput(Ue,N,e),N)}for(;!q();){if(O=U(),O==="\0")continue;if(O==="\\"){let Pe=Q();if(Pe==="/"&&r.bash!==!0||Pe==="."||Pe===";")continue;if(!Pe){O+="\\",re({type:"text",value:O});continue}let Z=/^\\+/.exec(z()),ee=0;if(Z&&Z[0].length>2&&(ee=Z[0].length,N.index+=ee,ee%2!==0&&(O+="\\")),r.unescape===!0?O=U():O+=U(),N.brackets===0){re({type:"text",value:O});continue}}if(N.brackets>0&&(O!=="]"||M.value==="["||M.value==="[^")){if(r.posix!==!1&&O===":"){let Pe=M.value.slice(1);if(Pe.includes("[")&&(M.posix=!0,Pe.includes(":"))){let Z=M.value.lastIndexOf("["),ee=M.value.slice(0,Z),K=M.value.slice(Z+2),he=NGo[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,W({value:O});continue}if(N.quotes===1&&O!=='"'){O=BS.escapeRegex(O),M.value+=O,W({value:O});continue}if(O==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&re({type:"text",value:O});continue}if(O==="("){ne("parens"),re({type:"paren",value:O});continue}if(O===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(zle("opening","("));let Pe=B[B.length-1];if(Pe&&N.parens===Pe.parens+1){Be(B.pop());continue}re({type:"paren",value:O,output:N.parens?")":"\\)"}),H("parens");continue}if(O==="["){if(r.nobracket===!0||!z().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(zle("closing","]"));O=`\\${O}`}else ne("brackets");re({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||M&&M.type==="bracket"&&M.value.length===1){re({type:"text",value:O,output:`\\${O}`});continue}if(N.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(zle("opening","["));re({type:"text",value:O,output:`\\${O}`});continue}H("brackets");let Pe=M.value.slice(1);if(M.posix!==!0&&Pe[0]==="^"&&!Pe.includes("/")&&(O=`/${O}`),M.value+=O,W({value:O}),r.literalBrackets===!1||BS.hasRegexChars(Pe))continue;let Z=BS.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=Z,M.value=Z;continue}M.value=`(${l}${Z}|${M.value})`,N.output+=M.value;continue}if(O==="{"&&r.nobrace!==!0){ne("braces");let Pe={type:"brace",value:O,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};L.push(Pe),re(Pe);continue}if(O==="}"){let Pe=L[L.length-1];if(r.nobrace===!0||!Pe){re({type:"text",value:O,output:O});continue}let Z=")";if(Pe.dots===!0){let ee=c.slice(),K=[];for(let he=ee.length-1;he>=0&&(c.pop(),ee[he].type!=="brace");he--)ee[he].type!=="dots"&&K.unshift(ee[he].value);Z=BGo(K,r),N.backtrack=!0}if(Pe.comma!==!0&&Pe.dots!==!0){let ee=N.output.slice(0,Pe.outputIndex),K=N.tokens.slice(Pe.tokensIndex);Pe.value=Pe.output="\\{",O=Z="\\}",N.output=ee;for(let he of K)N.output+=he.output||he.value}re({type:"brace",value:O,output:Z}),H("braces"),L.pop();continue}if(O==="|"){B.length>0&&B[B.length-1].conditions++,re({type:"text",value:O});continue}if(O===","){let Pe=O,Z=L[L.length-1];Z&&j[j.length-1]==="braces"&&(Z.comma=!0,Pe="|"),re({type:"comma",value:O,output:Pe});continue}if(O==="/"){if(M.type==="dot"&&N.index===N.start+1){N.start=N.index+1,N.consumed="",N.output="",c.pop(),M=s;continue}re({type:"slash",value:O,output:m});continue}if(O==="."){if(N.braces>0&&M.type==="dot"){M.value==="."&&(M.output=f);let Pe=L[L.length-1];M.type="dots",M.output+=O,M.value+=O,Pe.dots=!0;continue}if(N.braces+N.parens===0&&M.type!=="bos"&&M.type!=="slash"){re({type:"text",value:O,output:f});continue}re({type:"dot",value:O,output:f});continue}if(O==="?"){if(!(M&&M.value==="(")&&r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ae("qmark",O);continue}if(M&&M.type==="paren"){let Z=Q(),ee=O;(M.value==="("&&!/[!=<:]/.test(Z)||Z==="<"&&!/<([!=]|\w+>)/.test(z()))&&(ee=`\\${O}`),re({type:"text",value:O,output:ee});continue}if(r.dot!==!0&&(M.type==="slash"||M.type==="bos")){re({type:"qmark",value:O,output:b});continue}re({type:"qmark",value:O,output:v});continue}if(O==="!"){if(r.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){ae("negate",O);continue}if(r.nonegate!==!0&&N.index===0){J();continue}}if(O==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ae("plus",O);continue}if(M&&M.value==="("||r.regex===!1){re({type:"plus",value:O,output:h});continue}if(M&&(M.type==="bracket"||M.type==="paren"||M.type==="brace")||N.parens>0){re({type:"plus",value:O});continue}re({type:"plus",value:h});continue}if(O==="@"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){re({type:"at",extglob:!0,value:O,output:""});continue}re({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let Pe=MGo.exec(z());Pe&&(O+=Pe[0],N.index+=Pe[0].length),re({type:"text",value:O});continue}if(M&&(M.type==="globstar"||M.star===!0)){M.type="star",M.star=!0,M.value+=O,M.output=D,N.backtrack=!0,N.globstar=!0,$(O);continue}let ve=z();if(r.noextglob!==!0&&/^\([^?]/.test(ve)){ae("star",O);continue}if(M.type==="star"){if(r.noglobstar===!0){$(O);continue}let Pe=M.prev,Z=Pe.prev,ee=Pe.type==="slash"||Pe.type==="bos",K=Z&&(Z.type==="star"||Z.type==="globstar");if(r.bash===!0&&(!ee||ve[0]&&ve[0]!=="/")){re({type:"star",value:O,output:""});continue}let he=N.braces>0&&(Pe.type==="comma"||Pe.type==="brace"),X=B.length&&(Pe.type==="pipe"||Pe.type==="paren");if(!ee&&Pe.type!=="paren"&&!he&&!X){re({type:"star",value:O,output:""});continue}for(;ve.slice(0,3)==="/**";){let ue=t[N.index+4];if(ue&&ue!=="/")break;ve=ve.slice(3),$("/**",3)}if(Pe.type==="bos"&&q()){M.type="globstar",M.value+=O,M.output=R(r),N.output=M.output,N.globstar=!0,$(O);continue}if(Pe.type==="slash"&&Pe.prev.type!=="bos"&&!K&&q()){N.output=N.output.slice(0,-(Pe.output+M.output).length),Pe.output=`(?:${Pe.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=O,N.globstar=!0,N.output+=Pe.output+M.output,$(O);continue}if(Pe.type==="slash"&&Pe.prev.type!=="bos"&&ve[0]==="/"){let ue=ve[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(Pe.output+M.output).length),Pe.output=`(?:${Pe.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${ue})`,M.value+=O,N.output+=Pe.output+M.output,N.globstar=!0,$(O+U()),re({type:"slash",value:"/",output:""});continue}if(Pe.type==="bos"&&ve[0]==="/"){M.type="globstar",M.value+=O,M.output=`(?:^|${m}|${R(r)}${m})`,N.output=M.output,N.globstar=!0,$(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,$(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(zle("closing","]"));N.output=BS.escapeLast(N.output,"["),H("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(zle("closing",")"));N.output=BS.escapeLast(N.output,"("),H("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(zle("closing","}"));N.output=BS.escapeLast(N.output,"{"),H("braces")}if(r.strictSlashes!==!0&&(M.type==="star"||M.type==="bracket")&&re({type:"maybe_slash",value:"",output:`${m}?`}),N.backtrack===!0){N.output="";for(let ve of N.tokens)N.output+=ve.output!=null?ve.output:ve.value,ve.suffix&&(N.output+=ve.suffix)}return N},"parse");dqt.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(oKe,r.maxLength):oKe,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=I_n[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}=pxe.globChars(r.windows),A=r.dot?f:d,y=r.dot?h:d,E=r.capture?"":"?:",_={negated:!1,prefix:""},v=r.bash===!0?".*?":m;r.capture&&(v=`(${v})`);let b=a(x=>x.noglobstar===!0?v:`(${E}(?:(?!${g}${x.dot?u:s}).)*?)`,"globstar"),T=a(x=>{switch(x){case"*":return`${A}${l}${v}`;case".*":return`${s}${l}${v}`;case"*.*":return`${A}${v}${s}${l}${v}`;case"*/*":return`${A}${v}${c}${l}${y}${v}`;case"**":return A+b(r);case"**/*":return`(?:${A}${b(r)}${c})?${y}${l}${v}`;case"**/*.*":return`(?:${A}${b(r)}${c})?${y}${v}${s}${l}${v}`;case"**/.*":return`(?:${A}${b(r)}${c})?${s}${l}${v}`;default:{let P=/^(.*?)\.(\w+)$/.exec(x);if(!P)return;let D=T(P[1]);return D?D+s+P[2]:void 0}}},"create"),w=BS.removePrefix(t,_),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};R_n.exports=dqt});var N_n=I((mju,D_n)=>{"use strict";p();var jGo=T_n(),fqt=P_n(),k_n=dxe(),HGo=uxe(),GGo=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),Wp=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>Wp(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=GGo(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?Wp.compileRe(t,e):Wp.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=Wp(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=Wp.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");Wp.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?k_n.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=Wp.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};Wp.matchBase=(t,e,r)=>(e instanceof RegExp?e:Wp.makeRe(e,r)).test(k_n.basename(t));Wp.isMatch=(t,e,r)=>Wp(e,r)(t);Wp.parse=(t,e)=>Array.isArray(t)?t.map(r=>Wp.parse(r,e)):fqt(t,{...e,fastpaths:!1});Wp.scan=(t,e)=>jGo(t,e);Wp.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=Wp.toRegex(l,e);return n===!0&&(u.state=t),u};Wp.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=fqt.fastpaths(t,e)),o.output||(o=fqt(t,e)),Wp.compileRe(o,e,r,n)};Wp.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/$^/}};Wp.constants=HGo;D_n.exports=Wp});var L_n=I((yju,B_n)=>{"use strict";p();var M_n=N_n(),$Go=dxe();function O_n(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:$Go.isWindows()}),M_n(t,e,r)}a(O_n,"picomatch");Object.assign(O_n,M_n);B_n.exports=O_n});var U_n=I((vju,F_n)=>{p();F_n.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 j_n=I((Sju,q_n)=>{p();var VGo=U_n(),Q_n={"{":"}","(":")","[":"]"},WGo=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=Q_n[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),zGo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var IK=require("path"),YGo=L_n(),KGo=j_n();function sKe(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(KGo(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=YGo.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(IK.resolve(t,o))}return e}a(sKe,"normalizeOptions");H_n.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(IK.resolve(e),IK.resolve(r),sKe(e,n))},getEventsSince(e,r,n){return t.getEventsSince(IK.resolve(e),IK.resolve(r),sKe(e,n))},async subscribe(e,r,n){return e=IK.resolve(e),n=sKe(e,n),await t.subscribe(e,r,n),{unsubscribe(){return t.unsubscribe(e,r,n)}}},unsubscribe(e,r,n){return t.unsubscribe(IK.resolve(e),r,sKe(e,n))}})});var $_n=I(hxe=>{"use strict";p();var JGo=require("path"),{createWrapper:ZGo}=G_n();function XGo(){return JGo.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(XGo,"resolveBindingPath");var e$o=require(XGo()),aKe=ZGo(e$o);hxe.writeSnapshot=aKe.writeSnapshot;hxe.getEventsSince=aKe.getEventsSince;hxe.subscribe=aKe.subscribe;hxe.unsubscribe=aKe.unsubscribe});var O_=I(pKe=>{"use strict";p();Object.defineProperty(pKe,"__esModule",{value:!0});pKe.Position=void 0;var gqt=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(hKe,"__esModule",{value:!0});hKe.Range=void 0;var tvn=O_(),Aqt=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 tvn.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new tvn.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}};hKe.Range=Aqt});var u1n=I((fad,Vxe)=>{"use strict";p();var ZJe=a(function(){},"NullObject");ZJe.prototype=Object.create(null);var KJe=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,JJe=/\\([\v\u0020-\u00ff])/gu,a1n=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,HK={type:"",parameters:new ZJe};Object.freeze(HK.parameters);Object.freeze(HK);function c1n(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(a1n.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new ZJe};if(e===-1)return n;let o,s,c;for(KJe.lastIndex=e;s=KJe.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),JJe.test(c)&&(c=c.replace(JJe,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(c1n,"parse");function l1n(t){if(typeof t!="string")return HK;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(a1n.test(r)===!1)return HK;let n={type:r.toLowerCase(),parameters:new ZJe};if(e===-1)return n;let o,s,c;for(KJe.lastIndex=e;s=KJe.exec(t);){if(s.index!==e)return HK;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),JJe.test(c)&&(c=c.replace(JJe,"$1"))),n.parameters[o]=c}return e!==t.length?HK:n}a(l1n,"safeParse");Vxe.exports.default={parse:c1n,safeParse:l1n};Vxe.exports.parse=c1n;Vxe.exports.safeParse=l1n;Vxe.exports.defaultContentType=HK});var dSn=I(GS=>{"use strict";p();var FYo=GS&&GS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(GS,"__esModule",{value:!0});var UYo=require("fs"),QYo=FYo(hk()),Sue=QYo.default("@kwsites/file-exists");function qYo(t,e,r){Sue("checking %s",t);try{let n=UYo.statSync(t);return n.isFile()&&e?(Sue("[OK] path represents a file"),!0):n.isDirectory()&&r?(Sue("[OK] path represents a directory"),!0):(Sue("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Sue("[FAIL] path is not accessible: %o",n),!1;throw Sue("[FATAL] %o",n),n}}a(qYo,"check");function jYo(t,e=GS.READABLE){return qYo(t,(e&GS.FILE)>0,(e&GS.FOLDER)>0)}a(jYo,"exists");GS.exists=jYo;GS.FILE=1;GS.FOLDER=2;GS.READABLE=GS.FILE+GS.FOLDER});var fSn=I(xZe=>{"use strict";p();function HYo(t){for(var e in t)xZe.hasOwnProperty(e)||(xZe[e]=t[e])}a(HYo,"__export");Object.defineProperty(xZe,"__esModule",{value:!0});HYo(dSn())});var hSn=I((Zmd,pSn)=>{p();var xue=1e3,wue=xue*60,Rue=wue*60,WK=Rue*24,GYo=WK*7,$Yo=WK*365.25;pSn.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return VYo(t);if(r==="number"&&isFinite(t))return e.long?zYo(t):WYo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function VYo(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*$Yo;case"weeks":case"week":case"w":return r*GYo;case"days":case"day":case"d":return r*WK;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Rue;case"minutes":case"minute":case"mins":case"min":case"m":return r*wue;case"seconds":case"second":case"secs":case"sec":case"s":return r*xue;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(VYo,"parse");function WYo(t){var e=Math.abs(t);return e>=WK?Math.round(t/WK)+"d":e>=Rue?Math.round(t/Rue)+"h":e>=wue?Math.round(t/wue)+"m":e>=xue?Math.round(t/xue)+"s":t+"ms"}a(WYo,"fmtShort");function zYo(t){var e=Math.abs(t);return e>=WK?wZe(t,e,WK,"day"):e>=Rue?wZe(t,e,Rue,"hour"):e>=wue?wZe(t,e,wue,"minute"):e>=xue?wZe(t,e,xue,"second"):t+" ms"}a(zYo,"fmtLong");function wZe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(wZe,"plural")});var jHt=I((t0d,mSn)=>{p();function YYo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=hSn(),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");mSn.exports=YYo});var gSn=I(($S,RZe)=>{p();$S.formatArgs=JYo;$S.save=ZYo;$S.load=XYo;$S.useColors=KYo;$S.storage=eKo();$S.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`."))}})();$S.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 KYo(){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(KYo,"useColors");function JYo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+RZe.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(JYo,"formatArgs");$S.log=console.debug||console.log||(()=>{});function ZYo(t){try{t?$S.storage.setItem("debug",t):$S.storage.removeItem("debug")}catch{}}a(ZYo,"save");function XYo(){let t;try{t=$S.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(XYo,"load");function eKo(){try{return localStorage}catch{}}a(eKo,"localstorage");RZe.exports=jHt()($S);var{formatters:tKo}=RZe.exports;tKo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ySn=I((dg,kZe)=>{p();var rKo=require("tty"),PZe=require("util");dg.init=lKo;dg.log=sKo;dg.formatArgs=iKo;dg.save=aKo;dg.load=cKo;dg.useColors=nKo;dg.destroy=PZe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");dg.colors=[6,2,3,4,5,1];try{let t=EGe();t&&(t.stderr||t).level>=2&&(dg.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{}dg.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 nKo(){return"colors"in dg.inspectOpts?!!dg.inspectOpts.colors:rKo.isatty(process.stderr.fd)}a(nKo,"useColors");function iKo(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(` +`))}},cwe=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"}};Ga.ListenerLeakError=cwe;var UJe=class extends cwe{static{a(this,"ListenerRefusalError")}constructor(e,r,n,o,s){super(e,r,n,o,s),this.name="ListenerRefusalError"}};Ga.ListenerRefusalError=UJe;var hVo=0,bue=class{static{a(this,"UniqueContainer")}constructor(e){this.value=e,this.id=hVo++}},mVo=2,Wbn=a((t,e)=>{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(` `).join(` -`+s),t.push(o+"m+"+kZe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=oKo()+e+" "+t[0]}a(iKo,"formatArgs");function oKo(){return dg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(oKo,"getDate");function sKo(...t){return process.stderr.write(PZe.formatWithOptions(dg.inspectOpts,...t)+` -`)}a(sKo,"log");function aKo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(aKo,"save");function cKo(){return process.env.DEBUG}a(cKo,"load");function lKo(t){t.inspectOpts={};let e=Object.keys(dg.inspectOpts);for(let r=0;re.trim()).join(" ")};ASn.O=function(t){return this.inspectOpts.colors=this.useColors,PZe.inspect(t,this.inspectOpts)}});var ESn=I((c0d,HHt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?HHt.exports=gSn():HHt.exports=ySn()});var $Ht=I(zK=>{"use strict";p();Object.defineProperty(zK,"__esModule",{value:!0});zK.createDeferred=zK.deferred=void 0;function GHt(){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(GHt,"deferred");zK.deferred=GHt;zK.createDeferred=GHt;zK.default=GHt});var nXe=I(WS=>{"use strict";p();Object.defineProperty(WS,"__esModule",{value:!0});WS.deepClone=vxn;WS.deepFreeze=zXo;WS.cloneAndChange=YXo;WS.mixin=bxn;WS.equals=gwe;WS.safeStringify=KXo;WS.stableStringify=JXo;WS.distinct=ZXo;WS.getCaseInsensitive=XXo;WS.filter=ees;WS.mapValues=tes;var Mq=SS();function vxn(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"?vxn(n):n}),e}a(vxn,"deepClone");function zXo(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(Cxn.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,Mq.isTypedArray)(o)&&e.push(o)}}return t}a(zXo,"deepFreeze");var Cxn=Object.prototype.hasOwnProperty;function YXo(t,e){return VGt(t,e,new Set)}a(YXo,"cloneAndChange");function VGt(t,e,r){if((0,Mq.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(VGt(s,e,r));return o}if((0,Mq.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)Cxn.call(t,s)&&(o[s]=VGt(t[s],e,r));return r.delete(t),o}return t}a(VGt,"_cloneAndChange");function bxn(t,e,r=!0){return(0,Mq.isObject)(t)?((0,Mq.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,Mq.isObject)(t[n])&&(0,Mq.isObject)(e[n])?bxn(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(bxn,"mixin");function gwe(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,Mq.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(KXo,"safeStringify");function JXo(t){if(t===void 0)return"undefined";try{return WGt(t,new WeakSet)}catch{return""}}a(JXo,"stableStringify");function WGt(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=>WGt(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)+":"+WGt(s,e))}return"{"+n.join(",")+"}"}a(WGt,"_stableStringify");function ZXo(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];gwe(s,c)||(r[o]=c)}),r}a(ZXo,"distinct");function XXo(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(XXo,"getCaseInsensitive");function ees(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(ees,"filter");function tes(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(tes,"mapValues")});var $_=I(iXe=>{"use strict";p();Object.defineProperty(iXe,"__esModule",{value:!0});iXe.ErrorUtils=void 0;var res=nXe(),Sxn;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,res.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(Sxn||(iXe.ErrorUtils=Sxn={}))});var cw=I(oXe=>{"use strict";p();Object.defineProperty(oXe,"__esModule",{value:!0});oXe.Result=void 0;var zGt=$_(),Txn;(function(t){function e(c){return new YGt(c)}a(e,"ok"),t.ok=e;function r(c){return new KGt(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(zGt.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(zGt.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(Txn||(oXe.Result=Txn={}));var YGt=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}},KGt=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:zGt.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var Fd=I((_Jd,D2n)=>{p();D2n.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 yc=I((CJd,nDn)=>{"use strict";p();var N2n=Symbol.for("undici.error.UND_ERR"),Ud=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[N2n]===!0}[N2n]=!0},M2n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),GZt=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[M2n]===!0}[M2n]=!0},O2n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),$Zt=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[O2n]===!0}[O2n]=!0},B2n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),VZt=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[B2n]===!0}[B2n]=!0},L2n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),WZt=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[L2n]===!0}[L2n]=!0},F2n=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),zZt=class extends Ud{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[F2n]===!0}[F2n]=!0},U2n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),YZt=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[U2n]===!0}[U2n]=!0},Q2n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),KZt=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[Q2n]===!0}[Q2n]=!0},q2n=Symbol.for("undici.error.UND_ERR_ABORT"),Hrt=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[q2n]===!0}[q2n]=!0},j2n=Symbol.for("undici.error.UND_ERR_ABORTED"),JZt=class extends Hrt{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[j2n]===!0}[j2n]=!0},H2n=Symbol.for("undici.error.UND_ERR_INFO"),ZZt=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[H2n]===!0}[H2n]=!0},G2n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),XZt=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[G2n]===!0}[G2n]=!0},$2n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),eXt=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[$2n]===!0}[$2n]=!0},V2n=Symbol.for("undici.error.UND_ERR_DESTROYED"),tXt=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[V2n]===!0}[V2n]=!0},W2n=Symbol.for("undici.error.UND_ERR_CLOSED"),rXt=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[W2n]===!0}[W2n]=!0},z2n=Symbol.for("undici.error.UND_ERR_SOCKET"),nXt=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[z2n]===!0}[z2n]=!0},Y2n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),iXt=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[Y2n]===!0}[Y2n]=!0},K2n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),oXt=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[K2n]===!0}[K2n]=!0},J2n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),sXt=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[J2n]===!0}[J2n]=!0},Z2n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),aXt=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[Z2n]===!0}[Z2n]=!0},X2n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),cXt=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[X2n]===!0}[X2n]=!0},eDn=Symbol.for("undici.error.UND_ERR_RESPONSE"),lXt=class extends Ud{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[eDn]===!0}[eDn]=!0},tDn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),uXt=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[tDn]===!0}[tDn]=!0},rDn=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),dXt=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[rDn]===!0}get[rDn](){return!0}};nDn.exports={AbortError:Hrt,HTTPParserError:sXt,UndiciError:Ud,HeadersTimeoutError:$Zt,HeadersOverflowError:VZt,BodyTimeoutError:WZt,RequestContentLengthMismatchError:XZt,ConnectTimeoutError:GZt,ResponseStatusCodeError:zZt,InvalidArgumentError:YZt,InvalidReturnValueError:KZt,RequestAbortedError:JZt,ClientDestroyedError:tXt,ClientClosedError:rXt,InformationalError:ZZt,SocketError:nXt,NotSupportedError:iXt,ResponseContentLengthMismatchError:eXt,BalancedPoolMissingUpstreamError:oXt,ResponseExceededMaxSizeError:aXt,RequestRetryError:cXt,ResponseError:lXt,SecureProxyConnectionError:uXt,MessageSizeExceededError:dXt}});var $rt=I((TJd,iDn)=>{"use strict";p();var Grt={},fXt=["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:oDn,headerNameLowerCasedRecord:bus}=$rt(),pXt=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 LRe=require("node:assert"),{kDestroyed:uDn,kBodyUsed:Bde,kListeners:hXt,kBody:lDn}=Fd(),{IncomingMessage:Sus}=require("node:http"),Yrt=require("node:stream"),Tus=require("node:net"),{Blob:Ius}=require("node:buffer"),xus=require("node:util"),{stringify:wus}=require("node:querystring"),{EventEmitter:Rus}=require("node:events"),{InvalidArgumentError:Ag}=yc(),{headerNameLowerCasedRecord:Pus}=$rt(),{tree:dDn}=cDn(),[kus,Dus]=process.versions.node.split(".").map(t=>Number(t)),zrt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[lDn]=e,this[Bde]=!1}async*[Symbol.asyncIterator](){LRe(!this[Bde],"disturbed"),this[Bde]=!0,yield*this[lDn]}};function Nus(t){return Krt(t)?(gDn(t)===0&&t.on("data",function(){LRe(!1)}),typeof t.readableDidRead!="boolean"&&(t[Bde]=!1,Rus.prototype.on.call(t,"data",function(){this[Bde]=!0})),t):t&&typeof t.pipeTo=="function"?new zrt(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&mDn(t)?new zrt(t):t}a(Nus,"wrapRequestBody");function Mus(){}a(Mus,"nop");function Krt(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Krt,"isStream");function fDn(t){if(t===null)return!1;if(t instanceof Ius)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(fDn,"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=wus(e);return r&&(t+="?"+r),t}a(Ous,"buildURL");function pDn(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(pDn,"isValidPort");function Wrt(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(Wrt,"isHttpOrHttpsPrefixed");function hDn(t){if(typeof t=="string"){if(t=new URL(t),!Wrt(t.origin||t.protocol))throw new Ag("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new Ag("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&pDn(t.port)===!1)throw new Ag("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new Ag("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new Ag("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new Ag("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new Ag("Invalid URL origin: the origin must be a string or null/undefined.");if(!Wrt(t.origin||t.protocol))throw new Ag("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!Wrt(t.origin||t.protocol))throw new Ag("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(hDn,"parseURL");function Bus(t){if(t=hDn(t),t.pathname!=="/"||t.search||t.hash)throw new Ag("invalid url");return t}a(Bus,"parseOrigin");function Lus(t){if(t[0]==="["){let r=t.indexOf("]");return LRe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(Lus,"getHostname");function Fus(t){if(!t)return null;LRe(typeof t=="string");let e=Lus(t);return Tus.isIP(e)?"":e}a(Fus,"getServerName");function Uus(t){return JSON.parse(JSON.stringify(t))}a(Uus,"deepClone");function Qus(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(Qus,"isAsyncIterable");function mDn(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(mDn,"isIterable");function gDn(t){if(t==null)return 0;if(Krt(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(fDn(t))return t.size!=null?t.size:null;if(EDn(t))return t.byteLength}return null}a(gDn,"bodyLength");function ADn(t){return t&&!!(t.destroyed||t[uDn]||Yrt.isDestroyed?.(t))}a(ADn,"isDestroyed");function qus(t,e){t==null||!Krt(t)||ADn(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===Sus&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[uDn]=!0))}a(qus,"destroy");var jus=/timeout=(\d+)/;function Hus(t){let e=t.toString().match(jus);return e?parseInt(e[1],10)*1e3:null}a(Hus,"parseKeepAliveTimeout");function yDn(t){return typeof t=="string"?Pus[t]??t.toLowerCase():dDn.lookup(t)??t.toString("latin1").toLowerCase()}a(yDn,"headerNameToString");function Gus(t){return dDn.lookup(t)??t.toString("latin1").toLowerCase()}a(Gus,"bufferToLowerCasedHeaderName");function $us(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($us,"parseHeaders");function Vus(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(Zus,"ReadableStreamFrom");function Xus(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(Xus,"isFormDataLike");function eds(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(eds,"addAbortListener");var tds=typeof String.prototype.toWellFormed=="function",rds=typeof String.prototype.isWellFormed=="function";function _Dn(t){return tds?`${t}`.toWellFormed():xus.toUSVString(t)}a(_Dn,"toUSVString");function nds(t){return rds?`${t}`.isWellFormed():_Dn(t)===`${t}`}a(nds,"isUSVString");function vDn(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(vDn,"isTokenCharCode");function ids(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Bc=require("node:diagnostics_channel"),AXt=require("node:util"),Jrt=AXt.debuglog("undici"),gXt=AXt.debuglog("fetch"),PJ=AXt.debuglog("websocket"),TDn=!1,dds={beforeConnect:Bc.channel("undici:client:beforeConnect"),connected:Bc.channel("undici:client:connected"),connectError:Bc.channel("undici:client:connectError"),sendHeaders:Bc.channel("undici:client:sendHeaders"),create:Bc.channel("undici:request:create"),bodySent:Bc.channel("undici:request:bodySent"),headers:Bc.channel("undici:request:headers"),trailers:Bc.channel("undici:request:trailers"),error:Bc.channel("undici:request:error"),open:Bc.channel("undici:websocket:open"),close:Bc.channel("undici:websocket:close"),socketError:Bc.channel("undici:websocket:socket_error"),ping:Bc.channel("undici:websocket:ping"),pong:Bc.channel("undici:websocket:pong")};if(Jrt.enabled||gXt.enabled){let t=gXt.enabled?gXt:Jrt;Bc.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)}),Bc.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)}),Bc.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)}),Bc.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)}),Bc.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)}),Bc.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)}),Bc.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)}),TDn=!0}if(PJ.enabled){if(!TDn){let t=Jrt.enabled?Jrt:PJ;Bc.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)}),Bc.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)}),Bc.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)}),Bc.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)})}Bc.channel("undici:websocket:open").subscribe(t=>{let{address:{address:e,port:r}}=t;PJ("connection opened %s%s",e,r?`:${r}`:"")}),Bc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;PJ("closed connection to %s - %s %s",e.url,r,n)}),Bc.channel("undici:websocket:socket_error").subscribe(t=>{PJ("connection errored - %s",t.message)}),Bc.channel("undici:websocket:ping").subscribe(t=>{PJ("ping received")}),Bc.channel("undici:websocket:pong").subscribe(t=>{PJ("pong received")})}IDn.exports={channels:dds}});var PDn=I((OJd,RDn)=>{"use strict";p();var{InvalidArgumentError:_u,NotSupportedError:fds}=yc(),pF=require("node:assert"),{isValidHTTPToken:wDn,isValidHeaderValue:yXt,isStream:pds,destroy:hds,isBuffer:mds,isFormDataLike:gds,isIterable:Ads,isBlobLike:yds,buildURL:Eds,validateHandler:_ds,getServerName:vds,normalizedMethodRecords:Cds}=Us(),{channels:ZO}=Lde(),{headerNameLowerCasedRecord:xDn}=$rt(),bds=/[^\u0021-\u00ff]/,yw=Symbol("handler"),EXt=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 _u("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new _u("path must be an absolute URL or start with a slash");if(bds.test(r))throw new _u("invalid request path");if(typeof n!="string")throw new _u("method must be a string");if(Cds[n]===void 0&&!wDn(n))throw new _u("invalid request method");if(d&&typeof d!="string")throw new _u("upgrade must be a string");if(d&&!yXt(d))throw new _u("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new _u("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new _u("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new _u("invalid reset");if(A!=null&&typeof A!="boolean")throw new _u("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(pds(o)){this.body=o;let _=this.body._readableState;(!_||!_.autoDestroy)&&(this.endHandler=a(function(){hds(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(mds(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(gds(o)||Ads(o)||yds(o))this.body=o;else throw new _u("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?Eds(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 _u("headers array must be even");for(let _=0;_{"use strict";p();var Sds=require("node:events"),Xrt=class extends Sds{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 _Xt(this,n)}},_Xt=class extends Xrt{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)}};kDn.exports=Xrt});var qde=I((qJd,DDn)=>{"use strict";p();var Tds=FRe(),{ClientDestroyedError:vXt,ClientClosedError:Ids,InvalidArgumentError:Fde}=yc(),{kDestroy:xds,kClose:wds,kClosed:URe,kDestroyed:Ude,kDispatch:CXt,kInterceptors:kJ}=Fd(),hF=Symbol("onDestroyed"),Qde=Symbol("onClosed"),ent=Symbol("Intercepted Dispatch"),bXt=class extends Tds{static{a(this,"DispatcherBase")}constructor(){super(),this[Ude]=!1,this[hF]=null,this[URe]=!1,this[Qde]=[]}get destroyed(){return this[Ude]}get closed(){return this[URe]}get interceptors(){return this[kJ]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[kJ][r]!="function")throw new Fde("interceptor must be an function")}this[kJ]=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 Fde("invalid callback");if(this[Ude]){queueMicrotask(()=>e(new vXt,null));return}if(this[URe]){this[Qde]?this[Qde].push(e):queueMicrotask(()=>e(null,null));return}this[URe]=!0,this[Qde].push(e);let r=a(()=>{let n=this[Qde];this[Qde]=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 Fde("invalid callback");if(this[Ude]){this[hF]?this[hF].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new vXt),this[Ude]=!0,this[hF]=this[hF]||[],this[hF].push(r);let n=a(()=>{let o=this[hF];this[hF]=null;for(let s=0;s{queueMicrotask(n)})}[ent](e,r){if(!this[kJ]||this[kJ].length===0)return this[ent]=this[CXt],this[CXt](e,r);let n=this[CXt].bind(this);for(let o=this[kJ].length-1;o>=0;o--)n=this[kJ][o](n);return this[ent]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new Fde("handler must be an object");try{if(!e||typeof e!="object")throw new Fde("opts must be an object.");if(this[Ude]||this[hF])throw new vXt;if(this[URe])throw new Ids;return this[ent](e,r)}catch(n){if(typeof r.onError!="function")throw new Fde("invalid onError method");return r.onError(n),!1}}};DDn.exports=bXt});var PXt=I((GJd,BDn)=>{"use strict";p();var jde=0,SXt=1e3,TXt=(SXt>>1)-1,mF,IXt=Symbol("kFastTimer"),gF=[],xXt=-2,wXt=-1,MDn=0,NDn=1;function RXt(){jde+=TXt;let t=0,e=gF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=wXt,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===wXt?(r._state=xXt,--e!==0&&(gF[t]=gF[e])):++t}gF.length=e,gF.length!==0&&ODn()}a(RXt,"onTick");function ODn(){mF?mF.refresh():(clearTimeout(mF),mF=setTimeout(RXt,TXt),mF.unref&&mF.unref())}a(ODn,"refreshTimeout");var tnt=class{static{a(this,"FastTimer")}[IXt]=!0;_state=xXt;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===xXt&&gF.push(this),(!mF||gF.length===1)&&ODn(),this._state=MDn}clear(){this._state=wXt,this._idleStart=-1}};BDn.exports={setTimeout(t,e,r){return e<=SXt?setTimeout(t,e,r):new tnt(t,e,r)},clearTimeout(t){t[IXt]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new tnt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return jde},tick(t=0){jde+=t-SXt+1,RXt(),RXt()},reset(){jde=0,gF.length=0,clearTimeout(mF),mF=null},kFastTimer:IXt}});var QRe=I((YJd,qDn)=>{"use strict";p();var Rds=require("node:net"),LDn=require("node:assert"),QDn=Us(),{InvalidArgumentError:Pds,ConnectTimeoutError:kds}=yc(),rnt=PXt();function FDn(){}a(FDn,"noop");var kXt,DXt;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?DXt=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 Dds({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new Pds("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new DXt(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:"){kXt||(kXt=require("node:tls")),g=g||c.servername||QDn.getServerName(f)||null;let b=g||d;LDn(b);let T=o||l.get(b)||null;m=m||443,_=kXt.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 LDn(!y,"httpSocket can only be sent on TLS update"),m=m||80,_=Rds.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(Dds,"buildConnector");var Nds=process.platform==="win32"?(t,e)=>{if(!e.timeout)return FDn;let r=null,n=null,o=rnt.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>UDn(t.deref(),e))})},e.timeout);return()=>{rnt.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return FDn;let r=null,n=rnt.setFastTimeout(()=>{r=setImmediate(()=>{UDn(t.deref(),e)})},e.timeout);return()=>{rnt.clearFastTimeout(n),clearImmediate(r)}};function UDn(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)`,QDn.destroy(t,new kds(r))}a(UDn,"onConnectTimeout");qDn.exports=Dds});var jDn=I(nnt=>{"use strict";p();Object.defineProperty(nnt,"__esModule",{value:!0});nnt.enumToMap=void 0;function Mds(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(Mds,"enumToMap");nnt.enumToMap=Mds});var HDn=I(kr=>{"use strict";p();Object.defineProperty(kr,"__esModule",{value:!0});kr.SPECIAL_HEADERS=kr.HEADER_STATE=kr.MINOR=kr.MAJOR=kr.CONNECTION_TOKEN_CHARS=kr.HEADER_CHARS=kr.TOKEN=kr.STRICT_TOKEN=kr.HEX=kr.URL_CHAR=kr.STRICT_URL_CHAR=kr.USERINFO_CHARS=kr.MARK=kr.ALPHANUM=kr.NUM=kr.HEX_MAP=kr.NUM_MAP=kr.ALPHA=kr.FINISH=kr.H_METHOD_MAP=kr.METHOD_MAP=kr.METHODS_RTSP=kr.METHODS_ICE=kr.METHODS_HTTP=kr.METHODS=kr.LENIENT_FLAGS=kr.FLAGS=kr.TYPE=kr.ERROR=void 0;var Ods=jDn(),Bds;(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"})(Bds=kr.ERROR||(kr.ERROR={}));var Lds;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(Lds=kr.TYPE||(kr.TYPE={}));var Fds;(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"})(Fds=kr.FLAGS||(kr.FLAGS={}));var Uds;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(Uds=kr.LENIENT_FLAGS||(kr.LENIENT_FLAGS={}));var Ni;(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"})(Ni=kr.METHODS||(kr.METHODS={}));kr.METHODS_HTTP=[Ni.DELETE,Ni.GET,Ni.HEAD,Ni.POST,Ni.PUT,Ni.CONNECT,Ni.OPTIONS,Ni.TRACE,Ni.COPY,Ni.LOCK,Ni.MKCOL,Ni.MOVE,Ni.PROPFIND,Ni.PROPPATCH,Ni.SEARCH,Ni.UNLOCK,Ni.BIND,Ni.REBIND,Ni.UNBIND,Ni.ACL,Ni.REPORT,Ni.MKACTIVITY,Ni.CHECKOUT,Ni.MERGE,Ni["M-SEARCH"],Ni.NOTIFY,Ni.SUBSCRIBE,Ni.UNSUBSCRIBE,Ni.PATCH,Ni.PURGE,Ni.MKCALENDAR,Ni.LINK,Ni.UNLINK,Ni.PRI,Ni.SOURCE];kr.METHODS_ICE=[Ni.SOURCE];kr.METHODS_RTSP=[Ni.OPTIONS,Ni.DESCRIBE,Ni.ANNOUNCE,Ni.SETUP,Ni.PLAY,Ni.PAUSE,Ni.TEARDOWN,Ni.GET_PARAMETER,Ni.SET_PARAMETER,Ni.REDIRECT,Ni.RECORD,Ni.FLUSH,Ni.GET,Ni.POST];kr.METHOD_MAP=Ods.enumToMap(Ni);kr.H_METHOD_MAP={};Object.keys(kr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(kr.H_METHOD_MAP[t]=kr.METHOD_MAP[t])});var Qds;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(Qds=kr.FINISH||(kr.FINISH={}));kr.ALPHA=[];for(let t=65;t<=90;t++)kr.ALPHA.push(String.fromCharCode(t)),kr.ALPHA.push(String.fromCharCode(t+32));kr.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};kr.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};kr.NUM=["0","1","2","3","4","5","6","7","8","9"];kr.ALPHANUM=kr.ALPHA.concat(kr.NUM);kr.MARK=["-","_",".","!","~","*","'","(",")"];kr.USERINFO_CHARS=kr.ALPHANUM.concat(kr.MARK).concat(["%",";",":","&","=","+","$",","]);kr.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(kr.ALPHANUM);kr.URL_CHAR=kr.STRICT_URL_CHAR.concat([" ","\f"]);for(let t=128;t<=255;t++)kr.URL_CHAR.push(t);kr.HEX=kr.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);kr.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(kr.ALPHANUM);kr.TOKEN=kr.STRICT_TOKEN.concat([" "]);kr.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&kr.HEADER_CHARS.push(t);kr.CONNECTION_TOKEN_CHARS=kr.HEADER_CHARS.filter(t=>t!==44);kr.MAJOR=kr.NUM_MAP;kr.MINOR=kr.MAJOR;var Hde;(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"})(Hde=kr.HEADER_STATE||(kr.HEADER_STATE={}));kr.SPECIAL_HEADERS={connection:Hde.CONNECTION,"content-length":Hde.CONTENT_LENGTH,"proxy-connection":Hde.CONNECTION,"transfer-encoding":Hde.TRANSFER_ENCODING,upgrade:Hde.UPGRADE}});var NXt=I((nZd,GDn)=>{"use strict";p();var{Buffer:qds}=require("node:buffer");GDn.exports=qds.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 VDn=I((oZd,$Dn)=>{"use strict";p();var{Buffer:jds}=require("node:buffer");$Dn.exports=jds.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 qRe=I((aZd,eNn)=>{"use strict";p();var WDn=["GET","HEAD","POST"],Hds=new Set(WDn),Gds=[101,204,205,304],zDn=[301,302,303,307,308],$ds=new Set(zDn),YDn=["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"],Vds=new Set(YDn),KDn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],Wds=new Set(KDn),zds=["follow","manual","error"],JDn=["GET","HEAD","OPTIONS","TRACE"],Yds=new Set(JDn),Kds=["navigate","same-origin","no-cors","cors"],Jds=["omit","same-origin","include"],Zds=["default","no-store","reload","no-cache","force-cache","only-if-cached"],Xds=["content-encoding","content-language","content-location","content-type","content-length"],efs=["half"],ZDn=["CONNECT","TRACE","TRACK"],tfs=new Set(ZDn),XDn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],rfs=new Set(XDn);eNn.exports={subresource:XDn,forbiddenMethods:ZDn,requestBodyHeader:Xds,referrerPolicy:KDn,requestRedirect:zds,requestMode:Kds,requestCredentials:Jds,requestCache:Zds,redirectStatus:zDn,corsSafeListedMethods:WDn,nullBodyStatus:Gds,safeMethods:JDn,badPorts:YDn,requestDuplex:efs,subresourceSet:rfs,badPortsSet:Vds,redirectStatusSet:$ds,corsSafeListedMethodsSet:Hds,safeMethodsSet:Yds,forbiddenMethodsSet:tfs,referrerPolicySet:Wds}});var OXt=I((lZd,tNn)=>{"use strict";p();var MXt=Symbol.for("undici.globalOrigin.1");function nfs(){return globalThis[MXt]}a(nfs,"getGlobalOrigin");function ifs(t){if(t===void 0){Object.defineProperty(globalThis,MXt,{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,MXt,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(ifs,"setGlobalOrigin");tNn.exports={getGlobalOrigin:nfs,setGlobalOrigin:ifs}});var JC=I((fZd,cNn)=>{"use strict";p();var ont=require("node:assert"),ofs=new TextEncoder,jRe=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,sfs=/[\u000A\u000D\u0009\u0020]/,afs=/[\u0009\u000A\u000C\u000D\u0020]/g,cfs=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function lfs(t){ont(t.protocol==="data:");let e=iNn(t,!0);e=e.slice(5);let r={position:0},n=Gde(",",e,r),o=n.length;if(n=mfs(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=oNn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=aNn(c);if(c=dfs(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=BXt(n);return l==="failure"&&(l=BXt("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(lfs,"dataURLProcessor");function iNn(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(iNn,"URLSerializer");function snt(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(rNn,"isHexCharByte");function nNn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(nNn,"hexByteToNumber");function ufs(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=Gde(";",t,e);if(n=int(n,!1,!0),n.length===0||!jRe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionsfs.test(d),t,e);let l=snt(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=sNn(t,e,!0),Gde(";",t,e);else if(u=Gde(";",t,e),u=int(u,!1,!0),u.length===0)continue;l.length!==0&&jRe.test(l)&&(u.length===0||cfs.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(BXt,"parseMIMEType");function dfs(t){t=t.replace(afs,"");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(dfs,"forgivingBase64");function sNn(t,e,r){let n=e.position,o="";for(ont(t[e.position]==='"'),e.position++;o+=snt(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{ont(s==='"');break}}return r?o:t.slice(n,e.position)}a(sNn,"collectAnHTTPQuotedString");function ffs(t){ont(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",jRe.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(ffs,"serializeAMimeType");function pfs(t){return t===13||t===10||t===9||t===32}a(pfs,"isHTTPWhiteSpace");function int(t,e=!0,r=!0){return LXt(t,e,r,pfs)}a(int,"removeHTTPWhitespace");function hfs(t){return t===13||t===10||t===9||t===12||t===32}a(hfs,"isASCIIWhitespace");function mfs(t,e=!0,r=!0){return LXt(t,e,r,hfs)}a(mfs,"removeASCIIWhitespace");function LXt(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(LXt,"removeChars");function aNn(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(aNn,"isomorphicDecode");function gfs(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(gfs,"minimizeSupportedMimeType");cNn.exports={dataURLProcessor:lfs,URLSerializer:iNn,collectASequenceOfCodePoints:snt,collectASequenceOfCodePointsFast:Gde,stringPercentDecode:oNn,parseMIMEType:BXt,collectAnHTTPQuotedString:sNn,serializeAMimeType:ffs,removeChars:LXt,removeHTTPWhitespace:int,minimizeSupportedMimeType:gfs,HTTP_TOKEN_CODEPOINTS:jRe,isomorphicDecode:aNn}});var MA=I((mZd,lNn)=>{"use strict";p();var{types:XO,inspect:Afs}=require("node:util"),{markAsUncloneable:yfs}=require("node:worker_threads"),{toUSVString:Efs}=Us(),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 Afs(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(!XO.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=Efs;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"||!XO.isAnyArrayBuffer(t))throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&XO.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"||!XO.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&&XO.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"||!XO.isDataView(t))throw Er.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&XO.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(XO.isAnyArrayBuffer(t))return Er.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if(XO.isTypedArray(t))return Er.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if(XO.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);lNn.exports={webidl:Er}});var XS=I((AZd,bNn)=>{"use strict";p();var{Transform:_fs}=require("node:stream"),uNn=require("node:zlib"),{redirectStatusSet:vfs,referrerPolicySet:Cfs,badPortsSet:bfs}=qRe(),{getGlobalOrigin:dNn}=OXt(),{collectASequenceOfCodePoints:DJ,collectAnHTTPQuotedString:Sfs,removeChars:Tfs,parseMIMEType:Ifs}=JC(),{performance:xfs}=require("node:perf_hooks"),{isBlobLike:wfs,ReadableStreamFrom:Rfs,isValidHTTPToken:fNn,normalizedMethodRecordsBase:Pfs}=Us(),NJ=require("node:assert"),{isUint8Array:kfs}=require("node:util/types"),{webidl:HRe}=MA(),pNn=[],cnt;try{cnt=require("node:crypto");let t=["sha256","sha384","sha512"];pNn=cnt.getHashes().filter(e=>t.includes(e))}catch{}function hNn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(hNn,"responseURL");function Dfs(t,e){if(!vfs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&gNn(r)&&(mNn(r)||(r=Nfs(r)),r=new URL(r,hNn(t))),r&&!r.hash&&(r.hash=e),r}a(Dfs,"responseLocationURL");function mNn(t){for(let e=0;e126||r<32)return!1}return!0}a(mNn,"isValidEncodedURL");function Nfs(t){return Buffer.from(t,"binary").toString("utf8")}a(Nfs,"normalizeBinaryStringToUtf8");function $Re(t){return t.urlList[t.urlList.length-1]}a($Re,"requestCurrentURL");function Mfs(t){let e=$Re(t);return vNn(e)&&bfs.has(e.port)?"blocked":"allowed"}a(Mfs,"requestBadPort");function Ofs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(Ofs,"isErrorLike");function Bfs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(Bfs,"isValidReasonPhrase");var Lfs=fNn;function gNn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(gNn,"isValidHeaderValue");function Ffs(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(Cfs.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(Ffs,"setRequestReferrerPolicyOnRedirect");function Ufs(){return"allowed"}a(Ufs,"crossOriginResourcePolicyCheck");function Qfs(){return"success"}a(Qfs,"corsCheck");function qfs(){return"success"}a(qfs,"TAOCheck");function jfs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(jfs,"appendFetchMetadata");function Hfs(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&&UXt(t.origin)&&!UXt($Re(t))&&(e=null);break;case"same-origin":lnt(t,$Re(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(Hfs,"appendRequestOriginHeader");function $de(t,e){return t}a($de,"coarsenTime");function Gfs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=lnt(t,n),c=GRe(n)&&!GRe(t.url);switch(e){case"origin":return o??FXt(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=$Re(t);return lnt(n,l)?n:GRe(n)&&!GRe(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(zfs,"determineRequestsReferrer");function FXt(t,e){return NJ(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(FXt,"stripURLForReferrer");function GRe(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(GRe,"isURLPotentiallyTrustworthy");function Yfs(t,e){if(cnt===void 0)return!0;let r=yNn(e);if(r==="no metadata"||r.length===0)return!0;let n=Jfs(r),o=Zfs(r,n);for(let s of o){let c=s.algo,l=s.hash,u=cnt.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)),Xfs(u,l))return!0}return!1}a(Yfs,"bytesMatch");var Kfs=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function yNn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=Kfs.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();pNn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(yNn,"parseMetadata");function Jfs(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(tps,"createDeferredPromise");function rps(t){return t.controller.state==="aborted"}a(rps,"isAborted");function nps(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(nps,"isCancelled");function ips(t){return Pfs[t.toLowerCase()]??t}a(ips,"normalizeMethod");function ops(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return NJ(typeof e=="string"),e}a(ops,"serializeJavascriptValueToJSONString");var sps=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function ENn(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,sps),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(ENn,"createIterator");function aps(t,e,r,n=0,o=1){let s=ENn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return HRe.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return HRe.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return HRe.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(HRe.brandCheck(this,e),HRe.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(aps,"iteratorMixin");async function cps(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await _Nn(s))}catch(c){o(c)}}a(cps,"fullyReadBody");function lps(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(lps,"isReadableStreamLike");function ups(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(ups,"readableStreamClose");var dps=/[^\x00-\xFF]/;function ant(t){return NJ(!dps.test(t)),t}a(ant,"isomorphicEncode");async function _Nn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!kfs(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(_Nn,"readAllBytes");function fps(t){NJ("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(fps,"urlIsLocal");function UXt(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(UXt,"urlHasHttpsScheme");function vNn(t){NJ("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(vNn,"urlIsHttpHttpsScheme");function pps(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&DJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&DJ(u=>u===" "||u===" ",r,n);let o=DJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&DJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&DJ(u=>u===" "||u===" ",r,n);let c=DJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(pps,"simpleRangeHeaderValue");function hps(t,e,r){let n="bytes ";return n+=ant(`${t}`),n+="-",n+=ant(`${e}`),n+="/",n+=ant(`${r}`),n}a(hps,"buildContentRange");var QXt=class extends _fs{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?uNn.createInflate(this.#e):uNn.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 mps(t){return new QXt(t)}a(mps,"createInflate");function gps(t){let e=null,r=null,n=null,o=CNn("content-type",t);if(o===null)return"failure";for(let s of o){let c=Ifs(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(gps,"extractMimeType");function Aps(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(Aps,"gettingDecodingSplitting");function CNn(t,e){let r=e.get(t,!0);return r===null?null:Aps(r)}a(CNn,"getDecodeSplit");var yps=new TextDecoder;function Eps(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),yps.decode(t))}a(Eps,"utf8DecodeBytes");var qXt=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return dNn()}get origin(){return this.baseUrl?.origin}policyContainer=ANn()},jXt=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new qXt},_ps=new jXt;bNn.exports={isAborted:rps,isCancelled:nps,isValidEncodedURL:mNn,createDeferredPromise:tps,ReadableStreamFrom:Rfs,tryUpgradeRequestToAPotentiallyTrustworthyURL:eps,clampAndCoarsenConnectionTimingInfo:Gfs,coarsenedSharedCurrentTime:$fs,determineRequestsReferrer:zfs,makePolicyContainer:ANn,clonePolicyContainer:Wfs,appendFetchMetadata:jfs,appendRequestOriginHeader:Hfs,TAOCheck:qfs,corsCheck:Qfs,crossOriginResourcePolicyCheck:Ufs,createOpaqueTimingInfo:Vfs,setRequestReferrerPolicyOnRedirect:Ffs,isValidHTTPToken:fNn,requestBadPort:Mfs,requestCurrentURL:$Re,responseURL:hNn,responseLocationURL:Dfs,isBlobLike:wfs,isURLPotentiallyTrustworthy:GRe,isValidReasonPhrase:Bfs,sameOrigin:lnt,normalizeMethod:ips,serializeJavascriptValueToJSONString:ops,iteratorMixin:aps,createIterator:ENn,isValidHeaderName:Lfs,isValidHeaderValue:gNn,isErrorLike:Ofs,fullyReadBody:cps,bytesMatch:Yfs,isReadableStreamLike:lps,readableStreamClose:ups,isomorphicEncode:ant,urlIsLocal:fps,urlHasHttpsScheme:UXt,urlIsHttpHttpsScheme:vNn,readAllBytes:_Nn,simpleRangeHeaderValue:pps,buildContentRange:hps,parseMetadata:yNn,createInflate:mps,extractMimeType:gps,getDecodeSplit:CNn,utf8DecodeBytes:Eps,environmentSettingsObject:_ps}});var tj=I((_Zd,SNn)=>{"use strict";p();SNn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var GXt=I((CZd,TNn)=>{"use strict";p();var{Blob:vps,File:Cps}=require("node:buffer"),{kState:AF}=tj(),{webidl:e5}=MA(),HXt=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[AF]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return e5.brandCheck(this,t),this[AF].blobLike.stream(...e)}arrayBuffer(...e){return e5.brandCheck(this,t),this[AF].blobLike.arrayBuffer(...e)}slice(...e){return e5.brandCheck(this,t),this[AF].blobLike.slice(...e)}text(...e){return e5.brandCheck(this,t),this[AF].blobLike.text(...e)}get size(){return e5.brandCheck(this,t),this[AF].blobLike.size}get type(){return e5.brandCheck(this,t),this[AF].blobLike.type}get name(){return e5.brandCheck(this,t),this[AF].name}get lastModified(){return e5.brandCheck(this,t),this[AF].lastModified}get[Symbol.toStringTag](){return"File"}};e5.converters.Blob=e5.interfaceConverter(vps);function bps(t){return t instanceof Cps||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(bps,"isFileLike");TNn.exports={FileLike:HXt,isFileLike:bps}});var WRe=I((TZd,PNn)=>{"use strict";p();var{isBlobLike:unt,iteratorMixin:Sps}=XS(),{kState:Y_}=tj(),{kEnumerableProperty:Vde}=Us(),{FileLike:INn,isFileLike:Tps}=GXt(),{webidl:vu}=MA(),{File:RNn}=require("node:buffer"),xNn=require("node:util"),wNn=globalThis.File??RNn,VRe=class t{static{a(this,"FormData")}constructor(e){if(vu.util.markAsUncloneable(this),e!==void 0)throw vu.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[Y_]=[]}append(e,r,n=void 0){vu.brandCheck(this,t);let o="FormData.append";if(vu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!unt(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=vu.converters.USVString(e,o,"name"),r=unt(r)?vu.converters.Blob(r,o,"value",{strict:!1}):vu.converters.USVString(r,o,"value"),n=arguments.length===3?vu.converters.USVString(n,o,"filename"):void 0;let s=$Xt(e,r,n);this[Y_].push(s)}delete(e){vu.brandCheck(this,t);let r="FormData.delete";vu.argumentLengthCheck(arguments,1,r),e=vu.converters.USVString(e,r,"name"),this[Y_]=this[Y_].filter(n=>n.name!==e)}get(e){vu.brandCheck(this,t);let r="FormData.get";vu.argumentLengthCheck(arguments,1,r),e=vu.converters.USVString(e,r,"name");let n=this[Y_].findIndex(o=>o.name===e);return n===-1?null:this[Y_][n].value}getAll(e){vu.brandCheck(this,t);let r="FormData.getAll";return vu.argumentLengthCheck(arguments,1,r),e=vu.converters.USVString(e,r,"name"),this[Y_].filter(n=>n.name===e).map(n=>n.value)}has(e){vu.brandCheck(this,t);let r="FormData.has";return vu.argumentLengthCheck(arguments,1,r),e=vu.converters.USVString(e,r,"name"),this[Y_].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){vu.brandCheck(this,t);let o="FormData.set";if(vu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!unt(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=vu.converters.USVString(e,o,"name"),r=unt(r)?vu.converters.Blob(r,o,"name",{strict:!1}):vu.converters.USVString(r,o,"name"),n=arguments.length===3?vu.converters.USVString(n,o,"name"):void 0;let s=$Xt(e,r,n),c=this[Y_].findIndex(l=>l.name===e);c!==-1?this[Y_]=[...this[Y_].slice(0,c),s,...this[Y_].slice(c+1).filter(l=>l.name!==e)]:this[Y_].push(s)}[xNn.inspect.custom](e,r){let n=this[Y_].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=xNn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};Sps("FormData",VRe,Y_,"name","value");Object.defineProperties(VRe.prototype,{append:Vde,delete:Vde,get:Vde,getAll:Vde,has:Vde,set:Vde,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function $Xt(t,e,r){if(typeof e!="string"){if(Tps(e)||(e=e instanceof Blob?new wNn([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 RNn?new wNn([e],r,n):new INn(e,r,n)}}return{name:t,value:e}}a($Xt,"makeEntry");PNn.exports={FormData:VRe,makeEntry:$Xt}});var BNn=I((wZd,ONn)=>{"use strict";p();var{isUSVString:kNn,bufferToLowerCasedHeaderName:Ips}=Us(),{utf8DecodeBytes:xps}=XS(),{HTTP_TOKEN_CODEPOINTS:wps,isomorphicDecode:DNn}=JC(),{isFileLike:Rps}=GXt(),{makeEntry:Pps}=WRe(),dnt=require("node:assert"),{File:kps}=require("node:buffer"),Dps=globalThis.File??kps,Nps=Buffer.from('form-data; name="'),NNn=Buffer.from("; filename"),Mps=Buffer.from("--"),Ops=Buffer.from(`--\r -`);function Bps(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(Lps,"validateBoundary");function Fps(t,e){dnt(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&&fnt(t,Mps,s)||s.position===t.length-4&&fnt(t,Ops,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=Ups(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",Bps(f)||(f=""),g=new Dps([m],d,{type:f})):g=xps(Buffer.from(m)),dnt(kNn(u)),dnt(typeof g=="string"&&kNn(g)||Rps(g)),o.push(Pps(u,g,d))}}a(Fps,"multipartFormDataParser");function Ups(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=Wde(l=>l!==10&&l!==13&&l!==58,t,e);if(c=VXt(c,!0,!0,l=>l===9||l===32),!wps.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,Wde(l=>l===32||l===9,t,e),Ips(c)){case"content-disposition":{if(r=n=null,!fnt(t,Nps,e)||(e.position+=17,r=MNn(t,e),r===null))return"failure";if(fnt(t,NNn,e)){let l=e.position+NNn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=MNn(t,e),n===null))return"failure"}break}case"content-type":{let l=Wde(u=>u!==10&&u!==13,t,e);l=VXt(l,!1,!0,u=>u===9||u===32),o=DNn(l);break}case"content-transfer-encoding":{let l=Wde(u=>u!==10&&u!==13,t,e);l=VXt(l,!1,!0,u=>u===9||u===32),s=DNn(l);break}default:Wde(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a(Ups,"parseMultipartFormDataHeaders");function MNn(t,e){dnt(t[e.position-1]===34);let r=Wde(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(MNn,"parseMultipartFormDataName");function Wde(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(VXt,"removeChars");function fnt(t,e,r){if(t.length{"use strict";p();var zRe=Us(),{ReadableStreamFrom:Qps,isBlobLike:LNn,isReadableStreamLike:qps,readableStreamClose:jps,createDeferredPromise:Hps,fullyReadBody:Gps,extractMimeType:$ps,utf8DecodeBytes:QNn}=XS(),{FormData:FNn}=WRe(),{kState:Yde}=tj(),{webidl:Vps}=MA(),{Blob:Wps}=require("node:buffer"),WXt=require("node:assert"),{isErrored:qNn,isDisturbed:zps}=require("node:stream"),{isArrayBuffer:Yps}=require("node:util/types"),{serializeAMimeType:Kps}=JC(),{multipartFormDataParser:Jps}=BNn(),zXt;try{let t=require("node:crypto");zXt=a(e=>t.randomInt(0,e),"random")}catch{zXt=a(t=>Math.floor(Math.random(t)),"random")}var pnt=new TextEncoder;function Zps(){}a(Zps,"noop");var jNn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,HNn;jNn&&(HNn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!zps(e)&&!qNn(e)&&e.cancel("Response object has been garbage collected").catch(Zps)}));function GNn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:LNn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?pnt.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>jps(u))},start(){},type:"bytes"}),WXt(qps(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(Yps(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(zRe.isFormDataLike(t)){let u=`----formdata-undici-0${`${zXt(1e11)}`.padStart(11,"0")}`,d=`--${u}\r +`+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 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=pnt.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=snt.encode(d+`; name="${f(h(E))}"\r \r ${h(_)}\r -`);m.push(v),s+=v.byteLength}else{let v=pnt.encode(`${d}; name="${f(h(E))}"`+(_.name?`; filename="${f(_.name)}"`:"")+`\r +`);m.push(v),s+=v.byteLength}else{let v=snt.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=pnt.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(LNn(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(zRe.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:Qps(t)}if((typeof o=="string"||zRe.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(!qNn(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(GNn,"extractBody");function Xps(t,e=!1){return t instanceof ReadableStream&&(WXt(!zRe.isDisturbed(t),"The body has already been consumed."),WXt(!t.locked,"The stream is locked.")),GNn(t,e)}a(Xps,"safelyExtractBody");function ehs(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(ehs,"cloneBody");function ths(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(ths,"throwIfAborted");function rhs(t){return{blob(){return zde(this,r=>{let n=UNn(this);return n===null?n="":n&&(n=Kps(n)),new Wps([r],{type:n})},t)},arrayBuffer(){return zde(this,r=>new Uint8Array(r).buffer,t)},text(){return zde(this,QNn,t)},json(){return zde(this,ihs,t)},formData(){return zde(this,r=>{let n=UNn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=Jps(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new FNn;return s[Yde]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new FNn;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 zde(this,r=>new Uint8Array(r),t)}}}a(rhs,"bodyMixinMethods");function nhs(t){Object.assign(t.prototype,rhs(t))}a(nhs,"mixinBody");async function zde(t,e,r){if(Vps.brandCheck(t,r),$Nn(t))throw new TypeError("Body is unusable: Body has already been read");ths(t[Yde]);let n=Hps(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[Yde].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await Gps(t[Yde].body,s,o),n.promise)}a(zde,"consumeBody");function $Nn(t){let e=t[Yde].body;return e!=null&&(e.stream.locked||zRe.isDisturbed(e.stream))}a($Nn,"bodyUnusable");function ihs(t){return JSON.parse(QNn(t))}a(ihs,"parseJSONFromBytes");function UNn(t){let e=t[Yde].headersList,r=$ps(e);return r==="failure"?null:r}a(UNn,"bodyMimeType");VNn.exports={extractBody:GNn,safelyExtractBody:Xps,cloneBody:ehs,mixinBody:nhs,streamRegistry:HNn,hasFinalizationRegistry:jNn,bodyUnusable:$Nn}});var nMn=I((MZd,rMn)=>{"use strict";p();var Gi=require("node:assert"),Ao=Us(),{channels:WNn}=Lde(),YXt=PXt(),{RequestContentLengthMismatchError:MJ,ResponseContentLengthMismatchError:ohs,RequestAbortedError:XNn,HeadersTimeoutError:shs,HeadersOverflowError:ahs,SocketError:Ent,InformationalError:Jde,BodyTimeoutError:chs,HTTPParserError:lhs,ResponseExceededMaxSizeError:uhs}=yc(),{kUrl:eMn,kReset:ZC,kClient:XXt,kParser:ap,kBlocking:JRe,kRunning:dE,kPending:dhs,kSize:zNn,kWriting:nj,kQueue:s2,kNoRef:YRe,kKeepAliveDefaultTimeout:fhs,kHostHeader:phs,kPendingIdx:hhs,kRunningIdx:Ew,kError:_w,kPipelining:Ant,kSocket:Zde,kKeepAliveTimeoutValue:_nt,kMaxHeadersSize:KXt,kKeepAliveMaxTimeout:mhs,kKeepAliveTimeoutThreshold:ghs,kHeadersTimeout:Ahs,kBodyTimeout:yhs,kStrictContentLength:eer,kMaxRequests:YNn,kCounter:Ehs,kMaxResponseSize:_hs,kOnError:vhs,kResume:rj,kHTTPContext:tMn}=Fd(),t5=HDn(),Chs=Buffer.alloc(0),hnt=Buffer[Symbol.species],mnt=Ao.addListener,bhs=Ao.removeAllListeners,JXt;async function Shs(){let t=process.env.JEST_WORKER_ID?NXt():void 0,e;try{e=await WebAssembly.compile(VDn())}catch{e=await WebAssembly.compile(t||NXt())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:a((r,n,o)=>0,"wasm_on_url"),wasm_on_status:a((r,n,o)=>{Gi(u0.ptr===r);let s=n-n5+r5.byteOffset;return u0.onStatus(new hnt(r5.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(Gi(u0.ptr===r),u0.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{Gi(u0.ptr===r);let s=n-n5+r5.byteOffset;return u0.onHeaderField(new hnt(r5.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{Gi(u0.ptr===r);let s=n-n5+r5.byteOffset;return u0.onHeaderValue(new hnt(r5.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(Gi(u0.ptr===r),u0.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{Gi(u0.ptr===r);let s=n-n5+r5.byteOffset;return u0.onBody(new hnt(r5.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(Gi(u0.ptr===r),u0.onMessageComplete()||0),"wasm_on_message_complete")}})}a(Shs,"lazyllhttp");var ZXt=null,ter=Shs();ter.catch();var u0=null,r5=null,gnt=0,n5=null,Ths=0,KRe=1,Xde=2|KRe,ynt=4|KRe,rer=8|Ths,ner=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){Gi(Number.isFinite(e[KXt])&&e[KXt]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(t5.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[KXt],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[_hs]}setTimeout(e,r){e!==this.timeoutValue||r&KRe^this.timeoutType&KRe?(this.timeout&&(YXt.clearTimeout(this.timeout),this.timeout=null),e&&(r&KRe?this.timeout=YXt.setFastTimeout(KNn,e,new WeakRef(this)):(this.timeout=setTimeout(KNn,e,new WeakRef(this)),this.timeout.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(Gi(this.ptr!=null),Gi(u0==null),this.llhttp.llhttp_resume(this.ptr),Gi(this.timeoutType===ynt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Chs),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Gi(this.ptr!=null),Gi(u0==null),Gi(!this.paused);let{socket:r,llhttp:n}=this;e.length>gnt&&(n5&&n.free(n5),gnt=Math.ceil(e.length/4096)*4096,n5=n.malloc(gnt)),new Uint8Array(n.memory.buffer,n5,gnt).set(e);try{let o;try{r5=e,u0=this,o=n.llhttp_execute(this.ptr,n5,e.length)}catch(c){throw c}finally{u0=null,r5=null}let s=n.llhttp_get_error_pos(this.ptr)-n5;if(o===t5.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===t5.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==t5.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 lhs(l,t5.ERROR[o],e.slice(s))}}catch(o){Ao.destroy(r,o)}}destroy(){Gi(this.ptr!=null),Gi(u0==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&YXt.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[s2][r[Ew]];if(!n)return-1;n.onResponseStarted()}onHeaderField(e){let r=this.headers.length;(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length)}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=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 ahs)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Gi(r),Gi(n[Zde]===o),Gi(!o.destroyed),Gi(!this.paused),Gi((s.length&1)===0);let l=n[s2][n[Ew]];Gi(l),Gi(l.upgrade||l.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,o.unshift(e),o[ap].destroy(),o[ap]=null,o[XXt]=null,o[_w]=null,bhs(o),n[Zde]=null,n[tMn]=null,n[s2][n[Ew]++]=null,n.emit("disconnect",n[eMn],[n],new Jde("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ao.destroy(o,u)}n[rj]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[s2][o[Ew]];if(!u)return-1;if(Gi(!this.upgrade),Gi(this.statusCode<200),e===100)return Ao.destroy(s,new Ent("bad response",Ao.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ao.destroy(s,new Ent("bad upgrade",Ao.getSocketInfo(s))),-1;if(Gi(this.timeoutType===Xde),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[ZC]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[yhs];this.setTimeout(f,ynt)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Gi(o[dE]===1),this.upgrade=!0,2;if(r)return Gi(o[dE]===1),this.upgrade=!0,2;if(Gi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Ant]){let f=this.keepAlive?Ao.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[ghs],o[mhs]);h<=0?s[ZC]=!0:o[_nt]=h}else o[_nt]=o[fhs]}else s[ZC]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[JRe]&&(s[JRe]=!1,o[rj]()),d?t5.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[Ew]];if(Gi(c),Gi(this.timeoutType===ynt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Gi(o>=200),s>-1&&this.bytesRead+e.length>s)return Ao.destroy(n,new uhs),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return t5.ERROR.PAUSED}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return;Gi(n>=100),Gi((this.headers.length&1)===0);let d=e[s2][e[Ew]];if(Gi(d),this.statusCode=null,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,!(n<200)){if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return Ao.destroy(r,new ohs),-1;if(d.onComplete(s),e[s2][e[Ew]++]=null,r[nj])return Gi(e[dE]===0),Ao.destroy(r,new Jde("reset")),t5.ERROR.PAUSED;if(u){if(r[ZC]&&e[dE]===0)return Ao.destroy(r,new Jde("reset")),t5.ERROR.PAUSED;e[Ant]==null||e[Ant]===1?setImmediate(()=>e[rj]()):e[rj]()}else return Ao.destroy(r,new Jde("reset")),t5.ERROR.PAUSED}}};function KNn(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===Xde?(!e[nj]||e.writableNeedDrain||n[dE]>1)&&(Gi(!o,"cannot be paused while waiting for headers"),Ao.destroy(e,new shs)):r===ynt?o||Ao.destroy(e,new chs):r===rer&&(Gi(n[dE]===0&&n[_nt]),Ao.destroy(e,new Jde("socket idle timeout")))}a(KNn,"onParserTimeout");async function Ihs(t,e){t[Zde]=e,ZXt||(ZXt=await ter,ter=null),e[YRe]=!1,e[nj]=!1,e[ZC]=!1,e[JRe]=!1,e[ap]=new ner(t,e,ZXt),mnt(e,"error",function(n){Gi(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[ap];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[_w]=n,this[XXt][vhs](n)}),mnt(e,"readable",function(){let n=this[ap];n&&n.readMore()}),mnt(e,"end",function(){let n=this[ap];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}Ao.destroy(this,new Ent("other side closed",Ao.getSocketInfo(this)))}),mnt(e,"close",function(){let n=this[XXt],o=this[ap];o&&(!this[_w]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[ap].destroy(),this[ap]=null);let s=this[_w]||new Ent("closed",Ao.getSocketInfo(this));if(n[Zde]=null,n[tMn]=null,n.destroyed){Gi(n[dhs]===0);let c=n[s2].splice(n[Ew]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[s2][n[Ew]];n[s2][n[Ew]++]=null,Ao.errorRequest(n,c,s)}n[hhs]=n[Ew],Gi(n[dE]===0),n.emit("disconnect",n[eMn],[n],s),n[rj]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return Rhs(t,...n)},resume(){xhs(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[nj]||e[ZC]||e[JRe]||n&&(t[dE]>0&&!n.idempotent||t[dE]>0&&(n.upgrade||n.method==="CONNECT")||t[dE]>0&&Ao.bodyLength(n.body)!==0&&(Ao.isStream(n.body)||Ao.isAsyncIterable(n.body)||Ao.isFormDataLike(n.body))))}}}a(Ihs,"connectH1");function xhs(t){let e=t[Zde];if(e&&!e.destroyed){if(t[zNn]===0?!e[YRe]&&e.unref&&(e.unref(),e[YRe]=!0):e[YRe]&&e.ref&&(e.ref(),e[YRe]=!1),t[zNn]===0)e[ap].timeoutType!==rer&&e[ap].setTimeout(t[_nt],rer);else if(t[dE]>0&&e[ap].statusCode<200&&e[ap].timeoutType!==Xde){let r=t[s2][t[Ew]],n=r.headersTimeout!=null?r.headersTimeout:t[Ahs];e[ap].setTimeout(n,Xde)}}}a(xhs,"resumeH1");function whs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(whs,"shouldSendContentLength");function Rhs(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)){JXt||(JXt=Kde().extractBody);let[E,_]=JXt(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),whs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[eer])return Ao.errorRequest(t,e,new MJ),!1;process.emitWarning(new MJ)}let g=t[Zde],A=a(E=>{e.aborted||e.completed||(Ao.errorRequest(t,e,E||new XNn),Ao.destroy(u),Ao.destroy(g,new Jde("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ao.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[ZC]=!0),(s||r==="CONNECT")&&(g[ZC]=!0),l!=null&&(g[ZC]=l),t[YNn]&&g[Ehs]++>=t[YNn]&&(g[ZC]=!0),c&&(g[JRe]=!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=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 `;if(typeof o=="string"?y+=`host: ${o}\r -`:y+=t[phs],s?y+=`connection: upgrade\r +`:y+=t[Cps],s?y+=`connection: upgrade\r upgrade: ${s}\r -`:t[Ant]&&!g[ZC]?y+=`connection: keep-alive\r +`:t[unt]&&!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 XNn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Gi(o.destroyed||o[nj]&&r[dE]<=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(Phs,"writeStream");function JNn(t,e,r,n,o,s,c,l){try{e?Ao.isBuffer(e)&&(Gi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return TNn.sendHeaders.hasSubscribers&&TNn.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?RNn(A,null,t,e,g,f,y,h):Ao.isBuffer(u)?RNn(A,u,t,e,g,f,y,h):Ao.isBlobLike(u)?typeof u.stream=="function"?kNn(A,u.stream(),t,e,g,f,y,h):Qps(A,u,t,e,g,f,y,h):Ao.isStream(u)?Ups(A,u,t,e,g,f,y,h):Ao.isIterable(u)?kNn(A,u,t,e,g,f,y,h):Hi(!1),!0}a(Fps,"writeH1");function Ups(t,e,r,n,o,s,c,l){Hi(s!==0||r[yE]===0,"stream body cannot be pipelined");let u=!1,d=new hnt({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c}),f=a(function(A){if(!u)try{!d.write(A)&&this.pause&&this.pause()}catch(y){Ao.destroy(this,y)}},"onData"),h=a(function(){u||e.resume&&e.resume()},"onDrain"),m=a(function(){if(queueMicrotask(()=>{e.removeListener("error",g)}),!u){let A=new 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 \r -`,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[ZC]=!0)):s===0?o.write(`${c}content-length: 0\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"):(Gi(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[rj]()}catch(u){t(u)}}a(JNn,"writeBuffer");async function khs(t,e,r,n,o,s,c,l){Gi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new MJ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\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 \r -`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[ZC]=!0),r[rj]()}catch(u){t(u)}}a(khs,"writeBlob");async function ZNn(t,e,r,n,o,s,c,l){Gi(s!==0||r[dE]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{Gi(u===null),o[_w]?g(o[_w]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new vnt({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[_w])throw o[_w];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(ZNn,"writeIterable");var vnt=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[nj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[_w])throw r[_w];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[eer])throw new MJ;process.emitWarning(new MJ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[ZC]=!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[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"):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[ap].timeout&&r[ap].timeoutType===Xde&&r[ap].timeout.refresh&&r[ap].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[nj]=!1,e[_w])throw e[_w];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r +`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[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 \r `,"latin1"):e.write(`${c}\r `,"latin1"):r===null&&e.write(`\r 0\r \r -`,"latin1"),r!==null&&o!==r){if(n[eer])throw new MJ;process.emitWarning(new MJ)}e[ap].timeout&&e[ap].timeoutType===Xde&&e[ap].timeout.refresh&&e[ap].timeout.refresh(),n[rj]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[nj]=!1,e&&(Gi(n[dE]<=1,"pipeline should only contain this request"),o(e))}};rMn.exports=Ihs});var dMn=I((LZd,uMn)=>{"use strict";p();var vw=require("node:assert"),{pipeline:Dhs}=require("node:stream"),la=Us(),{RequestContentLengthMismatchError:ier,RequestAbortedError:iMn,SocketError:ZRe,InformationalError:oer}=yc(),{kUrl:Cnt,kReset:Snt,kClient:efe,kRunning:Tnt,kPending:Nhs,kQueue:ij,kPendingIdx:ser,kRunningIdx:a2,kError:l2,kSocket:yg,kStrictContentLength:Mhs,kOnError:aer,kMaxConcurrentStreams:lMn,kHTTP2Session:c2,kResume:oj,kSize:Ohs,kHTTPContext:Bhs}=Fd(),yF=Symbol("open streams"),oMn,sMn=!1,bnt;try{bnt=require("node:http2")}catch{bnt={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:Lhs,HTTP2_HEADER_METHOD:Fhs,HTTP2_HEADER_PATH:Uhs,HTTP2_HEADER_SCHEME:Qhs,HTTP2_HEADER_CONTENT_LENGTH:qhs,HTTP2_HEADER_EXPECT:jhs,HTTP2_HEADER_STATUS:Hhs}}=bnt;function Ghs(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(Ghs,"parseH2Headers");async function $hs(t,e){t[yg]=e,sMn||(sMn=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=bnt.connect(t[Cnt],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[lMn]});r[yF]=0,r[efe]=t,r[yg]=e,la.addListener(r,"error",Whs),la.addListener(r,"frameError",zhs),la.addListener(r,"end",Yhs),la.addListener(r,"goaway",Khs),la.addListener(r,"close",function(){let{[efe]:o}=this,{[yg]:s}=o,c=this[yg][l2]||this[l2]||new ZRe("closed",la.getSocketInfo(s));if(o[c2]=null,o.destroyed){vw(o[Nhs]===0);let l=o[ij].splice(o[a2]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return Zhs(t,...o)},resume(){Vhs(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a($hs,"connectH2");function Vhs(t){let e=t[yg];e?.destroyed===!1&&(t[Ohs]===0&&t[lMn]===0?(e.unref(),t[c2].unref()):(e.ref(),t[c2].ref()))}a(Vhs,"resumeH2");function Whs(t){vw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[yg][l2]=t,this[efe][aer](t)}a(Whs,"onHttp2SessionError");function zhs(t,e,r){if(r===0){let n=new oer(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[yg][l2]=n,this[efe][aer](n)}}a(zhs,"onHttp2FrameError");function Yhs(){let t=new ZRe("other side closed",la.getSocketInfo(this[yg]));this.destroy(t),la.destroy(this[yg],t)}a(Yhs,"onHttp2SessionEnd");function Khs(t){let e=this[l2]||new ZRe(`HTTP/2: "GOAWAY" frame received with code ${t}`,la.getSocketInfo(this)),r=this[efe];if(r[yg]=null,r[Bhs]=null,this[c2]!=null&&(this[c2].destroy(e),this[c2]=null),la.destroy(this[yg],e),r[a2]{e.aborted||e.completed||(T=T||new iMn,la.errorRequest(t,e,T),m!=null&&la.destroy(m,T),la.destroy(f,T),t[ij][t[a2]++]=null,t[oj]())},"abort");try{e.onConnect(y)}catch(T){la.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[yF],t[ij][t[a2]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[yF],t[ij][t[a2]++]=null}),m.once("close",()=>{r[yF]-=1,r[yF]===0&&r.unref()}),!0;h[Uhs]=o,h[Qhs]="https";let E=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let _=la.bodyLength(f);if(la.isFormDataLike(f)){oMn??=Kde().extractBody;let[T,w]=oMn(f);h["content-type"]=w,f=T.stream,_=T.length}if(_==null&&(_=e.contentLength),(_===0||!E)&&(_=null),Jhs(n)&&_>0&&e.contentLength!=null&&e.contentLength!==_){if(t[Mhs])return la.errorRequest(t,e,new ier),!1;process.emitWarning(new ier)}_!=null&&(vw(f,"no body must not have content length"),h[qhs]=`${_}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[jhs]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",b)):(m=r.request(h,{endStream:v,signal:u}),b()),++r[yF],m.once("response",T=>{let{[Hhs]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new iMn;la.errorRequest(t,e,x),la.destroy(m,x);return}e.onHeaders(Number(w),Ghs(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[yF]===0&&r.unref(),y(new oer("HTTP/2: stream half-closed (remote)")),t[ij][t[a2]++]=null,t[ser]=t[a2],t[oj]()}),m.once("close",()=>{r[yF]-=1,r[yF]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new oer(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function b(){!f||_===0?aMn(y,m,null,t,e,t[yg],_,E):la.isBuffer(f)?aMn(y,m,f,t,e,t[yg],_,E):la.isBlobLike(f)?typeof f.stream=="function"?cMn(y,m,f.stream(),t,e,t[yg],_,E):ems(y,m,f,t,e,t[yg],_,E):la.isStream(f)?Xhs(y,t[yg],E,m,f,t,e,_):la.isIterable(f)?cMn(y,m,f,t,e,t[yg],_,E):vw(!1)}a(b,"writeBodyH2")}a(Zhs,"writeH2");function aMn(t,e,r,n,o,s,c,l){try{r!=null&&la.isBuffer(r)&&(vw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Snt]=!0),o.onRequestSent(),n[oj]()}catch(u){t(u)}}a(aMn,"writeBuffer");function Xhs(t,e,r,n,o,s,c,l){vw(l!==0||s[Tnt]===0,"stream body cannot be pipelined");let u=Dhs(o,n,f=>{f?(la.destroy(u,f),t(f)):(la.removeAllListeners(u),c.onRequestSent(),r||(e[Snt]=!0),s[oj]())});la.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(Xhs,"writeStream");async function ems(t,e,r,n,o,s,c,l){vw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new ier;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Snt]=!0),n[oj]()}catch(u){t(u)}}a(ems,"writeBlob");async function cMn(t,e,r,n,o,s,c,l){vw(c!==0||n[Tnt]===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)=>{vw(u===null),s[l2]?m(s[l2]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[l2])throw s[l2];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Snt]=!0),n[oj]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(cMn,"writeIterable");uMn.exports=$hs});var xnt=I((QZd,hMn)=>{"use strict";p();var i5=Us(),{kBodyUsed:XRe}=Fd(),ler=require("node:assert"),{InvalidArgumentError:tms}=yc(),rms=require("node:events"),nms=[300,301,302,303,307,308],fMn=Symbol("body"),Int=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[fMn]=e,this[XRe]=!1}async*[Symbol.asyncIterator](){ler(!this[XRe],"disturbed"),this[XRe]=!0,yield*this[fMn]}},cer=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new tms("maxRedirections must be a positive number");i5.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,i5.isStream(this.opts.body)?(i5.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){ler(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[XRe]=!1,rms.prototype.on.call(this.opts.body,"data",function(){this[XRe]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Int(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&i5.isIterable(this.opts.body)&&(this.opts.body=new Int(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||i5.isDisturbed(this.opts.body)?null:ims(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}=i5.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=oms(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 ims(t,e){if(nms.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var sms=xnt();function ams({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new sms(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(ams,"createRedirectInterceptor");mMn.exports=ams});var nfe=I((VZd,TMn)=>{"use strict";p();var EF=require("node:assert"),vMn=require("node:net"),cms=require("node:http"),OJ=Us(),{channels:tfe}=Lde(),lms=PDn(),ums=qde(),{InvalidArgumentError:th,InformationalError:dms,ClientDestroyedError:fms}=yc(),pms=QRe(),{kUrl:s5,kServerName:sj,kClient:hms,kBusy:uer,kConnect:mms,kResuming:BJ,kRunning:iPe,kPending:oPe,kSize:nPe,kQueue:u2,kConnected:gms,kConnecting:rfe,kNeedDrain:cj,kKeepAliveDefaultTimeout:gMn,kHostHeader:Ams,kPendingIdx:d2,kRunningIdx:_F,kError:yms,kPipelining:Rnt,kKeepAliveTimeoutValue:Ems,kMaxHeadersSize:_ms,kKeepAliveMaxTimeout:vms,kKeepAliveTimeoutThreshold:Cms,kHeadersTimeout:bms,kBodyTimeout:Sms,kStrictContentLength:Tms,kConnector:ePe,kMaxRedirections:Ims,kMaxRequests:der,kCounter:xms,kClose:wms,kDestroy:Rms,kDispatch:Pms,kInterceptors:AMn,kLocalAddress:tPe,kMaxResponseSize:kms,kOnError:Dms,kHTTPContext:rh,kMaxConcurrentStreams:Nms,kResume:rPe}=Fd(),Mms=nMn(),Oms=dMn(),yMn=!1,aj=Symbol("kClosedResolve"),EMn=a(()=>{},"noop");function CMn(t){return t[Rnt]??t[rh]?.defaultPipelining??1}a(CMn,"getPipelining");var fer=class extends ums{static{a(this,"Client")}constructor(e,{interceptors:r,maxHeaderSize:n,headersTimeout:o,socketTimeout:s,requestTimeout:c,connectTimeout:l,bodyTimeout:u,idleTimeout:d,keepAlive:f,keepAliveTimeout:h,maxKeepAliveTimeout:m,keepAliveMaxTimeout:g,keepAliveTimeoutThreshold:A,socketPath:y,pipelining:E,tls:_,strictContentLength:v,maxCachedSessions:b,maxRedirections:T,connect:w,maxRequestsPerClient:R,localAddress:x,maxResponseSize:P,autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N,maxConcurrentStreams:B,allowH2:L}={}){if(super(),f!==void 0)throw new th("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new th("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new th("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new th("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new th("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new th("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new th("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new th("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new th("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new th("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new th("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new th("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new th("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new th("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new th("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new th("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||vMn.isIP(x)===0))throw new th("localAddress must be valid string IP address");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new th("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new th("autoSelectFamilyAttemptTimeout must be a positive number");if(L!=null&&typeof L!="boolean")throw new th("allowH2 must be a valid boolean value");if(B!=null&&(typeof B!="number"||B<1))throw new th("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=pms({..._,maxCachedSessions:b,allowH2:L,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[AMn]=r.Client,yMn||(yMn=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[AMn]=[Bms({maxRedirections:T})],this[s5]=OJ.parseOrigin(e),this[ePe]=w,this[Rnt]=E??1,this[_ms]=n||cms.maxHeaderSize,this[gMn]=h??4e3,this[vms]=g??6e5,this[Cms]=A??2e3,this[Ems]=this[gMn],this[sj]=null,this[tPe]=x??null,this[BJ]=0,this[cj]=0,this[Ams]=`host: ${this[s5].hostname}${this[s5].port?`:${this[s5].port}`:""}\r -`,this[Sms]=u??3e5,this[bms]=o??3e5,this[Tms]=v??!0,this[Ims]=T,this[der]=R,this[aj]=null,this[kms]=P>-1?P:-1,this[Nms]=B??100,this[rh]=null,this[u2]=[],this[_F]=0,this[d2]=0,this[rPe]=j=>per(this,j),this[Dms]=j=>bMn(this,j)}get pipelining(){return this[Rnt]}set pipelining(e){this[Rnt]=e,this[rPe](!0)}get[oPe](){return this[u2].length-this[d2]}get[iPe](){return this[d2]-this[_F]}get[nPe](){return this[u2].length-this[_F]}get[gms](){return!!this[rh]&&!this[rfe]&&!this[rh].destroyed}get[uer](){return!!(this[rh]?.busy(null)||this[nPe]>=(CMn(this)||1)||this[oPe]>0)}[mms](e){SMn(this),this.once("connect",e)}[Pms](e,r){let n=e.origin||this[s5].origin,o=new lms(n,e,r);return this[u2].push(o),this[BJ]||(OJ.bodyLength(o.body)==null&&OJ.isIterable(o.body)?(this[BJ]=1,queueMicrotask(()=>per(this))):this[rPe](!0)),this[BJ]&&this[cj]!==2&&this[uer]&&(this[cj]=2),this[cj]<2}async[wms](){return new Promise(e=>{this[nPe]?this[aj]=e:e(null)})}async[Rms](e){return new Promise(r=>{let n=this[u2].splice(this[d2]);for(let s=0;s{this[aj]&&(this[aj](),this[aj]=null),r(null)},"callback");this[rh]?(this[rh].destroy(e,o),this[rh]=null):queueMicrotask(o),this[rPe]()})}},Bms=wnt();function bMn(t,e){if(t[iPe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){EF(t[d2]===t[_F]);let r=t[u2].splice(t[_F]);for(let n=0;n{t[ePe]({host:e,hostname:r,protocol:n,port:o,servername:t[sj],localAddress:t[tPe]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){OJ.destroy(s.on("error",EMn),new fms);return}EF(s);try{t[rh]=s.alpnProtocol==="h2"?await Oms(t,s):await Mms(t,s)}catch(c){throw s.destroy().on("error",EMn),c}t[rfe]=!1,s[xms]=0,s[der]=t[der],s[hms]=t,s[yms]=null,tfe.connected.hasSubscribers&&tfe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[rh]?.version,servername:t[sj],localAddress:t[tPe]},connector:t[ePe],socket:s}),t.emit("connect",t[s5],[t])}catch(s){if(t.destroyed)return;if(t[rfe]=!1,tfe.connectError.hasSubscribers&&tfe.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[rh]?.version,servername:t[sj],localAddress:t[tPe]},connector:t[ePe],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(EF(t[iPe]===0);t[oPe]>0&&t[u2][t[d2]].servername===t[sj];){let c=t[u2][t[d2]++];OJ.errorRequest(t,c,s)}else bMn(t,s);t.emit("connectionError",t[s5],[t],s)}t[rPe]()}a(SMn,"connect");function _Mn(t){t[cj]=0,t.emit("drain",t[s5],[t])}a(_Mn,"emitDrain");function per(t,e){t[BJ]!==2&&(t[BJ]=2,Lms(t,e),t[BJ]=0,t[_F]>256&&(t[u2].splice(0,t[_F]),t[d2]-=t[_F],t[_F]=0))}a(per,"resume");function Lms(t,e){for(;;){if(t.destroyed){EF(t[oPe]===0);return}if(t[aj]&&!t[nPe]){t[aj](),t[aj]=null;return}if(t[rh]&&t[rh].resume(),t[uer])t[cj]=2;else if(t[cj]===2){e?(t[cj]=1,queueMicrotask(()=>_Mn(t))):_Mn(t);continue}if(t[oPe]===0||t[iPe]>=(CMn(t)||1))return;let r=t[u2][t[d2]];if(t[s5].protocol==="https:"&&t[sj]!==r.servername){if(t[iPe]>0)return;t[sj]=r.servername,t[rh]?.destroy(new dms("servername changed"),()=>{t[rh]=null,per(t)})}if(t[rfe])return;if(!t[rh]){SMn(t);return}if(t[rh].destroyed||t[rh].busy(r))return;!r.aborted&&t[rh].write(r)?t[d2]++:t[u2].splice(t[d2],1)}}a(Lms,"_resume");TMn.exports=fer});var her=I((KZd,IMn)=>{"use strict";p();var Pnt=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 Pnt}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Pnt),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var wMn=I((XZd,xMn)=>{p();var{kFree:Fms,kConnected:Ums,kPending:Qms,kQueued:qms,kRunning:jms,kSize:Hms}=Fd(),LJ=Symbol("pool"),mer=class{static{a(this,"PoolStats")}constructor(e){this[LJ]=e}get connected(){return this[LJ][Ums]}get free(){return this[LJ][Fms]}get pending(){return this[LJ][Qms]}get queued(){return this[LJ][qms]}get running(){return this[LJ][jms]}get size(){return this[LJ][Hms]}};xMn.exports=mer});var ver=I((rXd,FMn)=>{"use strict";p();var Gms=qde(),$ms=her(),{kConnected:ger,kSize:RMn,kRunning:PMn,kPending:kMn,kQueued:sPe,kBusy:Vms,kFree:Wms,kUrl:zms,kClose:Yms,kDestroy:Kms,kDispatch:Jms}=Fd(),Zms=wMn(),XC=Symbol("clients"),K_=Symbol("needDrain"),aPe=Symbol("queue"),Aer=Symbol("closed resolve"),yer=Symbol("onDrain"),DMn=Symbol("onConnect"),NMn=Symbol("onDisconnect"),MMn=Symbol("onConnectionError"),Eer=Symbol("get dispatcher"),BMn=Symbol("add client"),LMn=Symbol("remove client"),OMn=Symbol("stats"),_er=class extends Gms{static{a(this,"PoolBase")}constructor(){super(),this[aPe]=new $ms,this[XC]=[],this[sPe]=0;let e=this;this[yer]=a(function(n,o){let s=e[aPe],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[sPe]--,c=!this.dispatch(l.opts,l.handler)}this[K_]=c,!this[K_]&&e[K_]&&(e[K_]=!1,e.emit("drain",n,[e,...o])),e[Aer]&&s.isEmpty()&&Promise.all(e[XC].map(l=>l.close())).then(e[Aer])},"onDrain"),this[DMn]=(r,n)=>{e.emit("connect",r,[e,...n])},this[NMn]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[MMn]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[OMn]=new Zms(this)}get[Vms](){return this[K_]}get[ger](){return this[XC].filter(e=>e[ger]).length}get[Wms](){return this[XC].filter(e=>e[ger]&&!e[K_]).length}get[kMn](){let e=this[sPe];for(let{[kMn]:r}of this[XC])e+=r;return e}get[PMn](){let e=0;for(let{[PMn]:r}of this[XC])e+=r;return e}get[RMn](){let e=this[sPe];for(let{[RMn]:r}of this[XC])e+=r;return e}get stats(){return this[OMn]}async[Yms](){this[aPe].isEmpty()?await Promise.all(this[XC].map(e=>e.close())):await new Promise(e=>{this[Aer]=e})}async[Kms](e){for(;;){let r=this[aPe].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[XC].map(r=>r.destroy(e)))}[Jms](e,r){let n=this[Eer]();return n?n.dispatch(e,r)||(n[K_]=!0,this[K_]=!this[Eer]()):(this[K_]=!0,this[aPe].push({opts:e,handler:r}),this[sPe]++),!this[K_]}[BMn](e){return e.on("drain",this[yer]).on("connect",this[DMn]).on("disconnect",this[NMn]).on("connectionError",this[MMn]),this[XC].push(e),this[K_]&&queueMicrotask(()=>{this[K_]&&this[yer](e[zms],[this,e])}),this}[LMn](e){e.close(()=>{let r=this[XC].indexOf(e);r!==-1&&this[XC].splice(r,1)}),this[K_]=this[XC].some(r=>!r[K_]&&r.closed!==!0&&r.destroyed!==!0)}};FMn.exports={PoolBase:_er,kClients:XC,kNeedDrain:K_,kAddClient:BMn,kRemoveClient:LMn,kGetDispatcher:Eer}});var ife=I((oXd,jMn)=>{"use strict";p();var{PoolBase:Xms,kClients:knt,kNeedDrain:e0s,kAddClient:t0s,kGetDispatcher:r0s}=ver(),n0s=nfe(),{InvalidArgumentError:Cer}=yc(),UMn=Us(),{kUrl:QMn,kInterceptors:i0s}=Fd(),o0s=QRe(),ber=Symbol("options"),Ser=Symbol("connections"),qMn=Symbol("factory");function s0s(t,e){return new n0s(t,e)}a(s0s,"defaultFactory");var Ter=class extends Xms{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=s0s,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 Cer("invalid connections");if(typeof n!="function")throw new Cer("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new Cer("connect must be a function or an object");typeof o!="function"&&(o=o0s({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[i0s]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[Ser]=r||null,this[QMn]=UMn.parseOrigin(e),this[ber]={...UMn.deepClone(m),connect:o,allowH2:h},this[ber].interceptors=m.interceptors?{...m.interceptors}:void 0,this[qMn]=n,this.on("connectionError",(g,A,y)=>{for(let E of A){let _=this[knt].indexOf(E);_!==-1&&this[knt].splice(_,1)}})}[r0s](){for(let e of this[knt])if(!e[e0s])return e;if(!this[Ser]||this[knt].length{"use strict";p();var{BalancedPoolMissingUpstreamError:a0s,InvalidArgumentError:c0s}=yc(),{PoolBase:l0s,kClients:fE,kNeedDrain:cPe,kAddClient:u0s,kRemoveClient:d0s,kGetDispatcher:f0s}=ver(),p0s=ife(),{kUrl:Ier,kInterceptors:h0s}=Fd(),{parseOrigin:HMn}=Us(),GMn=Symbol("factory"),Dnt=Symbol("options"),$Mn=Symbol("kGreatestCommonDivisor"),FJ=Symbol("kCurrentWeight"),UJ=Symbol("kIndex"),Cw=Symbol("kWeight"),Nnt=Symbol("kMaxWeightPerServer"),Mnt=Symbol("kErrorPenalty");function m0s(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(m0s,"getGreatestCommonDivisor");function g0s(t,e){return new p0s(t,e)}a(g0s,"defaultFactory");var xer=class extends l0s{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=g0s,...n}={}){if(super(),this[Dnt]=n,this[UJ]=-1,this[FJ]=0,this[Nnt]=this[Dnt].maxWeightPerServer||100,this[Mnt]=this[Dnt].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new c0s("factory must be a function.");this[h0s]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[GMn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=HMn(e).origin;if(this[fE].find(o=>o[Ier].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[GMn](r,Object.assign({},this[Dnt]));this[u0s](n),n.on("connect",()=>{n[Cw]=Math.min(this[Nnt],n[Cw]+this[Mnt])}),n.on("connectionError",()=>{n[Cw]=Math.max(1,n[Cw]-this[Mnt]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Cw]=Math.max(1,n[Cw]-this[Mnt]),this._updateBalancedPoolStats())});for(let o of this[fE])o[Cw]=this[Nnt];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Ier].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[d0s](n),this}get upstreams(){return this[fE].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Ier].origin)}[f0s](){if(this[fE].length===0)throw new a0s;if(!this[fE].find(s=>!s[cPe]&&s.closed!==!0&&s.destroyed!==!0)||this[fE].map(s=>s[cPe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[fE].findIndex(s=>!s[cPe]);for(;n++this[fE][o][Cw]&&!s[cPe]&&(o=this[UJ]),this[UJ]===0&&(this[FJ]=this[FJ]-this[$Mn],this[FJ]<=0&&(this[FJ]=this[Nnt])),s[Cw]>=this[FJ]&&!s[cPe])return s}return this[FJ]=this[fE][o][Cw],this[UJ]=o,this[fE][o]}};VMn.exports=xer});var ofe=I((dXd,eOn)=>{"use strict";p();var{InvalidArgumentError:Ont}=yc(),{kClients:lj,kRunning:zMn,kClose:A0s,kDestroy:y0s,kDispatch:E0s,kInterceptors:_0s}=Fd(),v0s=qde(),C0s=ife(),b0s=nfe(),S0s=Us(),T0s=wnt(),YMn=Symbol("onConnect"),KMn=Symbol("onDisconnect"),JMn=Symbol("onConnectionError"),I0s=Symbol("maxRedirections"),ZMn=Symbol("onDrain"),XMn=Symbol("factory"),wer=Symbol("options");function x0s(t,e){return e&&e.connections===1?new b0s(t,e):new C0s(t,e)}a(x0s,"defaultFactory");var Rer=class extends v0s{static{a(this,"Agent")}constructor({factory:e=x0s,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new Ont("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new Ont("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new Ont("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[_0s]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[T0s({maxRedirections:r})],this[wer]={...S0s.deepClone(o),connect:n},this[wer].interceptors=o.interceptors?{...o.interceptors}:void 0,this[I0s]=r,this[XMn]=e,this[lj]=new Map,this[ZMn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[YMn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[KMn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[JMn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[zMn](){let e=0;for(let r of this[lj].values())e+=r[zMn];return e}[E0s](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new Ont("opts.origin must be a non-empty string or URL.");let o=this[lj].get(n);return o||(o=this[XMn](e.origin,this[wer]).on("drain",this[ZMn]).on("connect",this[YMn]).on("disconnect",this[KMn]).on("connectionError",this[JMn]),this[lj].set(n,o)),o.dispatch(e,r)}async[A0s](){let e=[];for(let r of this[lj].values())e.push(r.close());this[lj].clear(),await Promise.all(e)}async[y0s](e){let r=[];for(let n of this[lj].values())r.push(n.destroy(e));this[lj].clear(),await Promise.all(r)}};eOn.exports=Rer});var Mer=I((hXd,dOn)=>{"use strict";p();var{kProxy:Per,kClose:sOn,kDestroy:aOn,kDispatch:tOn,kInterceptors:w0s}=Fd(),{URL:QJ}=require("node:url"),R0s=ofe(),cOn=ife(),lOn=qde(),{InvalidArgumentError:sfe,RequestAbortedError:P0s,SecureProxyConnectionError:k0s}=yc(),rOn=QRe(),uOn=nfe(),Bnt=Symbol("proxy agent"),Lnt=Symbol("proxy client"),uj=Symbol("proxy headers"),ker=Symbol("request tls settings"),nOn=Symbol("proxy tls settings"),iOn=Symbol("connect endpoint function"),oOn=Symbol("tunnel proxy");function D0s(t){return t==="https:"?443:80}a(D0s,"defaultProtocolPort");function N0s(t,e){return new cOn(t,e)}a(N0s,"defaultFactory");var M0s=a(()=>{},"noop");function O0s(t,e){return e.connections===1?new uOn(t,e):new cOn(t,e)}a(O0s,"defaultAgentFactory");var Der=class extends lOn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new sfe("Proxy URL is mandatory");this[uj]=r,o?this.#e=o(e,{connect:n}):this.#e=new uOn(e,{connect:n})}[tOn](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new sfe("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 QJ(o);c.host=l}return e.headers={...this[uj],...c},this.#e[tOn](e,r)}async[sOn](){return this.#e.close()}async[aOn](e){return this.#e.destroy(e)}},Ner=class extends lOn{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof QJ)&&!e.uri)throw new sfe("Proxy uri is mandatory");let{clientFactory:r=N0s}=e;if(typeof r!="function")throw new sfe("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[Per]={uri:s,protocol:u},this[w0s]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[ker]=e.requestTls,this[nOn]=e.proxyTls,this[uj]=e.headers||{},this[oOn]=n,e.auth&&e.token)throw new sfe("opts.auth cannot be used in combination with opts.token");e.auth?this[uj]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[uj]["proxy-authorization"]=e.token:d&&f&&(this[uj]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=rOn({...e.proxyTls});this[iOn]=rOn({...e.requestTls});let g=e.factory||O0s,A=a((y,E)=>{let{protocol:_}=new QJ(y);return!this[oOn]&&_==="http:"&&this[Per].protocol==="http:"?new Der(this[Per].uri,{headers:this[uj],connect:m,factory:g}):g(y,E)},"factory");this[Lnt]=r(o,{connect:m}),this[Bnt]=new R0s({...e,factory:A,connect:a(async(y,E)=>{let _=y.host;y.port||(_+=`:${D0s(y.protocol)}`);try{let{socket:v,statusCode:b}=await this[Lnt].connect({origin:c,port:l,path:_,signal:y.signal,headers:{...this[uj],host:y.host},servername:this[nOn]?.servername||h});if(b!==200&&(v.on("error",M0s).destroy(),E(new P0s(`Proxy response (${b}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){E(null,v);return}let T;this[ker]?T=this[ker].servername:T=y.servername,this[iOn]({...y,servername:T,httpSocket:v},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new k0s(v)):E(v)}},"connect")})}dispatch(e,r){let n=B0s(e.headers);if(L0s(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new QJ(e.origin);n.host=o}return this[Bnt].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new QJ(e):e instanceof QJ?e:new QJ(e.uri)}async[sOn](){await this[Bnt].close(),await this[Lnt].close()}async[aOn](){await this[Bnt].destroy(),await this[Lnt].destroy()}};function B0s(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new sfe("Proxy-Authorization should be sent in ProxyAgent constructor")}a(L0s,"throwIfProxyAuthIsSent");dOn.exports=Ner});var AOn=I((AXd,gOn)=>{"use strict";p();var F0s=qde(),{kClose:U0s,kDestroy:Q0s,kClosed:fOn,kDestroyed:pOn,kDispatch:q0s,kNoProxyAgent:lPe,kHttpProxyAgent:dj,kHttpsProxyAgent:qJ}=Fd(),hOn=Mer(),j0s=ofe(),H0s={"http:":80,"https:":443},mOn=!1,Oer=class extends F0s{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,mOn||(mOn=!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[lPe]=new j0s(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[dj]=new hOn({...s,uri:c}):this[dj]=this[lPe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[qJ]=new hOn({...s,uri:l}):this[qJ]=this[dj],this.#o()}[q0s](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[U0s](){await this[lPe].close(),this[dj][fOn]||await this[dj].close(),this[qJ][fOn]||await this[qJ].close()}async[Q0s](e){await this[lPe].destroy(e),this[dj][pOn]||await this[dj].destroy(e),this[qJ][pOn]||await this[qJ].destroy(e)}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||H0s[r]||0,this.#i(n,o)?r==="https:"?this[qJ]:this[dj]:this[lPe]}#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 afe=require("node:assert"),{kRetryHandlerDefaultRetry:yOn}=Fd(),{RequestRetryError:uPe}=yc(),{isDisturbed:EOn,parseHeaders:G0s,parseRangeHeader:_On,wrapRequestBody:$0s}=Us();function V0s(t){let e=Date.now();return new Date(t).getTime()-e}a(V0s,"calculateRetryAfterHeader");var Ber=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:$0s(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[yOn],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[yOn](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)?V0s(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=G0s(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new uPe("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 uPe("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=_On(s["content-range"]);if(!l)return this.abort(new uPe("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new uPe("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return afe(this.start===u,"content-range mismatch"),afe(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=_On(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;afe(u!=null&&Number.isFinite(u),"content-range mismatch"),afe(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 afe(Number.isFinite(this.start)),afe(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 uPe("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||EOn(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||EOn(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")}};vOn.exports=Ber});var bOn=I((bXd,COn)=>{"use strict";p();var W0s=FRe(),z0s=Fnt(),Ler=class extends W0s{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 z0s({...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()}};COn.exports=Ler});var Her=I((IXd,DOn)=>{"use strict";p();var wOn=require("node:assert"),{Readable:Y0s}=require("node:stream"),{RequestAbortedError:ROn,NotSupportedError:K0s,InvalidArgumentError:J0s,AbortError:Fer}=yc(),POn=Us(),{ReadableStreamFrom:Z0s}=Us(),eT=Symbol("kConsume"),dPe=Symbol("kReading"),fj=Symbol("kBody"),SOn=Symbol("kAbort"),kOn=Symbol("kContentType"),TOn=Symbol("kContentLength"),X0s=a(()=>{},"noop"),Uer=class extends Y0s{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[SOn]=r,this[eT]=null,this[fj]=null,this[kOn]=n,this[TOn]=o,this[dPe]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new ROn),e&&this[SOn](),super.destroy(e)}_destroy(e,r){this[dPe]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[dPe]=!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[dPe]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[eT]&&e!==null?(qer(this[eT],e),this[dPe]?super.push(e):!0):super.push(e)}async text(){return fPe(this,"text")}async json(){return fPe(this,"json")}async blob(){return fPe(this,"blob")}async bytes(){return fPe(this,"bytes")}async arrayBuffer(){return fPe(this,"arrayBuffer")}async formData(){throw new K0s}get bodyUsed(){return POn.isDisturbed(this)}get body(){return this[fj]||(this[fj]=Z0s(this),this[eT]&&(this[fj].getReader(),wOn(this[fj].locked))),this[fj]}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 J0s("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[TOn]>r&&this.destroy(new Fer);let c=a(()=>{this.destroy(n.reason??new Fer)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new Fer):o(null)}).on("error",X0s).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function egs(t){return t[fj]&&t[fj].locked===!0||t[eT]}a(egs,"isLocked");function tgs(t){return POn.isDisturbed(t)||egs(t)}a(tgs,"isUnusable");async function fPe(t,e){return wOn(!t[eT]),new Promise((r,n)=>{if(tgs(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[eT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){jer(this[eT],o)}).on("close",function(){this[eT].body!==null&&jer(this[eT],new ROn)}),rgs(t[eT])})})}a(fPe,"consume");function rgs(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(Qer,"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 ngs=require("node:assert"),{ResponseStatusCodeError:NOn}=yc(),{chunksDecode:MOn}=Her(),igs=128*1024;async function ogs({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){ngs(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>igs){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new NOn(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{OOn(r)?f=JSON.parse(MOn(c,l)):BOn(r)&&(f=MOn(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new NOn(u,n,s,f)))}a(ogs,"getResolveErrorBodyCallback");var OOn=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"),BOn=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");LOn.exports={getResolveErrorBodyCallback:ogs,isContentTypeApplicationJson:OOn,isContentTypeText:BOn}});var QOn=I((DXd,$er)=>{"use strict";p();var sgs=require("node:assert"),{Readable:ags}=Her(),{InvalidArgumentError:cfe,RequestAbortedError:FOn}=yc(),tT=Us(),{getResolveErrorBodyCallback:cgs}=Ger(),{AsyncResource:lgs}=require("node:async_hooks"),Unt=class extends lgs{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new cfe("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 cfe("invalid callback");if(f&&(typeof f!="number"||f<0))throw new cfe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new cfe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new cfe("invalid method");if(l&&typeof l!="function")throw new cfe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw tT.isStream(c)&&tT.destroy(c.on("error",tT.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,tT.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new FOn:this.removeAbortListener=tT.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new FOn,this.res?tT.destroy(this.res.on("error",tT.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}sgs(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"?tT.parseRawHeaders(r):tT.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?tT.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new ags({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(cgs,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){tT.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(()=>{tT.destroy(r,e)})),o&&(this.body=null,tT.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function UOn(t,e){if(e===void 0)return new Promise((r,n)=>{UOn.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new Unt(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(UOn,"request");$er.exports=UOn;$er.exports.RequestHandler=Unt});var pPe=I((OXd,HOn)=>{p();var{addAbortListener:ugs}=Us(),{RequestAbortedError:dgs}=yc(),lfe=Symbol("kListener"),c5=Symbol("kSignal");function qOn(t){t.abort?t.abort(t[c5]?.reason):t.reason=t[c5]?.reason??new dgs,jOn(t)}a(qOn,"abort");function fgs(t,e){if(t.reason=null,t[c5]=null,t[lfe]=null,!!e){if(e.aborted){qOn(t);return}t[c5]=e,t[lfe]=()=>{qOn(t)},ugs(t[c5],t[lfe])}}a(fgs,"addSignal");function jOn(t){t[c5]&&("removeEventListener"in t[c5]?t[c5].removeEventListener("abort",t[lfe]):t[c5].removeListener("abort",t[lfe]),t[c5]=null,t[lfe]=null)}a(jOn,"removeSignal");HOn.exports={addSignal:fgs,removeSignal:jOn}});var WOn=I((FXd,VOn)=>{"use strict";p();var pgs=require("node:assert"),{finished:hgs,PassThrough:mgs}=require("node:stream"),{InvalidArgumentError:ufe,InvalidReturnValueError:ggs}=yc(),f2=Us(),{getResolveErrorBodyCallback:Ags}=Ger(),{AsyncResource:ygs}=require("node:async_hooks"),{addSignal:Egs,removeSignal:GOn}=pPe(),Ver=class extends ygs{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new ufe("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 ufe("invalid callback");if(typeof r!="function")throw new ufe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new ufe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new ufe("invalid method");if(u&&typeof u!="function")throw new ufe("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw f2.isStream(l)&&f2.destroy(l.on("error",f2.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,f2.isStream(l)&&l.on("error",h=>{this.onError(h)}),Egs(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}pgs(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"?f2.parseRawHeaders(r):f2.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"?f2.parseHeaders(r):f)["content-type"];h=new mgs,this.callback=null,this.runInAsyncScope(Ags,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 ggs("expected Writable");hgs(h,{readable:!1},g=>{let{callback:A,res:y,opaque:E,trailers:_,abort:v}=this;this.res=null,(g||!y.readable)&&f2.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;GOn(this),r&&(this.trailers=f2.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;GOn(this),this.factory=null,r?(this.res=null,f2.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,f2.destroy(s,e))}};function $On(t,e,r){if(r===void 0)return new Promise((n,o)=>{$On.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new Ver(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a($On,"stream");VOn.exports=$On});var JOn=I((qXd,KOn)=>{"use strict";p();var{Readable:YOn,Duplex:_gs,PassThrough:vgs}=require("node:stream"),{InvalidArgumentError:hPe,InvalidReturnValueError:Cgs,RequestAbortedError:Wer}=yc(),bw=Us(),{AsyncResource:bgs}=require("node:async_hooks"),{addSignal:Sgs,removeSignal:Tgs}=pPe(),zOn=require("node:assert"),dfe=Symbol("resume"),zer=class extends YOn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[dfe]=null}_read(){let{[dfe]:e}=this;e&&(this[dfe]=null,e())}_destroy(e,r){this._read(),r(e)}},Yer=class extends YOn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[dfe]=e}_read(){this[dfe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new Wer),r(e)}},Ker=class extends bgs{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new hPe("invalid opts");if(typeof r!="function")throw new hPe("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 hPe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new hPe("invalid method");if(c&&typeof c!="function")throw new hPe("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 zer().on("error",bw.nop),this.ret=new _gs({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[dfe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new Wer),A&&u&&A(),bw.destroy(f,u),bw.destroy(h,u),bw.destroy(m,u),Tgs(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,Sgs(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}zOn(!o,"pipeline cannot be retried"),zOn(!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"?bw.parseRawHeaders(r):bw.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Yer(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?bw.parseRawHeaders(r):bw.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",bw.nop),u}if(!l||typeof l.on!="function")throw new Cgs("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;bw.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||bw.destroy(u,new Wer)}),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,bw.destroy(r,e)}};function Igs(t,e){try{let r=new Ker(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new vgs().destroy(r)}}a(Igs,"pipeline");KOn.exports=Igs});var n5n=I((GXd,r5n)=>{"use strict";p();var{InvalidArgumentError:Jer,SocketError:xgs}=yc(),{AsyncResource:wgs}=require("node:async_hooks"),ZOn=Us(),{addSignal:Rgs,removeSignal:XOn}=pPe(),e5n=require("node:assert"),Zer=class extends wgs{static{a(this,"UpgradeHandler")}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_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,Rgs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}e5n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new xgs("bad upgrade",null)}onUpgrade(e,r,n){e5n(e===101);let{callback:o,opaque:s,context:c}=this;XOn(this),this.callback=null;let l=this.responseHeaders==="raw"?ZOn.parseRawHeaders(r):ZOn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;XOn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function t5n(t,e){if(e===void 0)return new Promise((r,n)=>{t5n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Zer(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(t5n,"upgrade");r5n.exports=t5n});var c5n=I((WXd,a5n)=>{"use strict";p();var Pgs=require("node:assert"),{AsyncResource:kgs}=require("node:async_hooks"),{InvalidArgumentError:Xer,SocketError:Dgs}=yc(),i5n=Us(),{addSignal:Ngs,removeSignal:o5n}=pPe(),etr=class extends kgs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Xer("invalid opts");if(typeof r!="function")throw new Xer("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Xer("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}Pgs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new Dgs("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;o5n(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?i5n.parseRawHeaders(r):i5n.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;o5n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function s5n(t,e){if(e===void 0)return new Promise((r,n)=>{s5n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new etr(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(s5n,"connect");a5n.exports=s5n});var l5n=I((KXd,ffe)=>{"use strict";p();ffe.exports.request=QOn();ffe.exports.stream=WOn();ffe.exports.pipeline=JOn();ffe.exports.upgrade=n5n();ffe.exports.connect=c5n()});var rtr=I((ZXd,d5n)=>{"use strict";p();var{UndiciError:Mgs}=yc(),u5n=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),ttr=class t extends Mgs{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[u5n]===!0}[u5n]=!0};d5n.exports={MockNotMatchedError:ttr}});var pfe=I((tef,f5n)=>{"use strict";p();f5n.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 mPe=I((nef,b5n)=>{"use strict";p();var{MockNotMatchedError:jJ}=rtr(),{kDispatches:Qnt,kMockAgent:Ogs,kOriginalDispatch:Bgs,kOrigin:Lgs,kGetNetConnect:Fgs}=pfe(),{buildURL:Ugs}=Us(),{STATUS_CODES:Qgs}=require("node:http"),{types:{isPromise:qgs}}=require("node:util");function vF(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(vF,"matchValue");function h5n(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(h5n,"lowerCaseEntries");function m5n(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=m5n(e,r);if(!vF(n,o))return!1}return!0}a(g5n,"matchHeaders");function p5n(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(p5n,"safeUrl");function jgs(t,{path:e,method:r,body:n,headers:o}){let s=vF(t.path,e),c=vF(t.method,r),l=typeof t.body<"u"?vF(t.body,n):!0,u=g5n(t,o);return s&&c&&l&&u}a(jgs,"matchKey");function A5n(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(A5n,"getResponseData");function y5n(t,e){let r=e.query?Ugs(e.path,e.query):e.path,n=typeof r=="string"?p5n(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>vF(p5n(s),n));if(o.length===0)throw new jJ(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>vF(s,e.method)),o.length===0)throw new jJ(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?vF(s,e.body):!0),o.length===0)throw new jJ(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>g5n(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new jJ(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(y5n,"getMockDispatch");function Hgs(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(Hgs,"addMockDispatch");function ntr(t,e){let r=t.findIndex(n=>n.consumed?jgs(n,e):!1);r!==-1&&t.splice(r,1)}a(ntr,"deleteMockDispatch");function E5n(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(E5n,"buildKey");function itr(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[Qnt])},d):g(this[Qnt]);function g(y,E=s){let _=Array.isArray(t.headers)?otr(t.headers):t.headers,v=typeof E=="function"?E({...t,headers:_}):E;if(qgs(v)){v.then(R=>g(y,R));return}let b=A5n(v),T=itr(c),w=itr(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,_5n(o)),e.onData?.(Buffer.from(b)),e.onComplete?.(w),ntr(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(v5n,"mockDispatch");function $gs(){let t=this[Ogs],e=this[Lgs],r=this[Bgs];return a(function(o,s){if(t.isMockActive)try{v5n.call(this,o,s)}catch(c){if(c instanceof jJ){let l=t[Fgs]();if(l===!1)throw new jJ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(C5n(l,e))r.call(this,o,s);else throw new jJ(`${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($gs,"buildMockDispatch");function C5n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>vF(n,r.host)))}a(C5n,"checkNetConnect");function Vgs(t){if(t){let{agent:e,...r}=t;return r}}a(Vgs,"buildMockOptions");b5n.exports={getResponseData:A5n,getMockDispatch:y5n,addMockDispatch:Hgs,deleteMockDispatch:ntr,buildKey:E5n,generateKeyValues:itr,matchValue:vF,getResponse:Ggs,getStatusText:_5n,mockDispatch:v5n,buildMockDispatch:$gs,checkNetConnect:C5n,buildMockOptions:Vgs,getHeaderByName:m5n,buildHeadersFromArray:otr}});var ftr=I((sef,dtr)=>{"use strict";p();var{getResponseData:Wgs,buildKey:zgs,addMockDispatch:str}=mPe(),{kDispatches:qnt,kDispatchKey:jnt,kDefaultHeaders:atr,kDefaultTrailers:ctr,kContentLength:ltr,kMockDispatch:Hnt}=pfe(),{InvalidArgumentError:l5}=yc(),{buildURL:Ygs}=Us(),hfe=class{static{a(this,"MockScope")}constructor(e){this[Hnt]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new l5("waitInMs must be a valid integer > 0");return this[Hnt].delay=e,this}persist(){return this[Hnt].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new l5("repeatTimes must be a valid integer > 0");return this[Hnt].times=e,this}},utr=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new l5("opts must be an object");if(typeof e.path>"u")throw new l5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=Ygs(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[jnt]=zgs(e),this[qnt]=r,this[atr]={},this[ctr]={},this[ltr]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=Wgs(r),s=this[ltr]?{"content-length":o.length}:{},c={...this[atr],...s,...n.headers},l={...this[ctr],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new l5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new l5("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new l5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=str(this[qnt],this[jnt],s);return new hfe(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=str(this[qnt],this[jnt],n);return new hfe(o)}replyWithError(e){if(typeof e>"u")throw new l5("error must be defined");let r=str(this[qnt],this[jnt],{error:e});return new hfe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new l5("headers must be defined");return this[atr]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new l5("trailers must be defined");return this[ctr]=e,this}replyContentLength(){return this[ltr]=!0,this}};dtr.exports.MockInterceptor=utr;dtr.exports.MockScope=hfe});var mtr=I((lef,P5n)=>{"use strict";p();var{promisify:Kgs}=require("node:util"),Jgs=nfe(),{buildMockDispatch:Zgs}=mPe(),{kDispatches:S5n,kMockAgent:T5n,kClose:I5n,kOriginalClose:x5n,kOrigin:w5n,kOriginalDispatch:Xgs,kConnected:ptr}=pfe(),{MockInterceptor:eAs}=ftr(),R5n=Fd(),{InvalidArgumentError:tAs}=yc(),htr=class extends Jgs{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new tAs("Argument opts.agent must implement Agent");this[T5n]=r.agent,this[w5n]=e,this[S5n]=[],this[ptr]=1,this[Xgs]=this.dispatch,this[x5n]=this.close.bind(this),this.dispatch=Zgs.call(this),this.close=this[I5n]}get[R5n.kConnected](){return this[ptr]}intercept(e){return new eAs(e,this[S5n])}async[I5n](){await Kgs(this[x5n])(),this[ptr]=0,this[T5n][R5n.kClients].delete(this[w5n])}};P5n.exports=htr});var ytr=I((fef,L5n)=>{"use strict";p();var{promisify:rAs}=require("node:util"),nAs=ife(),{buildMockDispatch:iAs}=mPe(),{kDispatches:k5n,kMockAgent:D5n,kClose:N5n,kOriginalClose:M5n,kOrigin:O5n,kOriginalDispatch:oAs,kConnected:gtr}=pfe(),{MockInterceptor:sAs}=ftr(),B5n=Fd(),{InvalidArgumentError:aAs}=yc(),Atr=class extends nAs{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new aAs("Argument opts.agent must implement Agent");this[D5n]=r.agent,this[O5n]=e,this[k5n]=[],this[gtr]=1,this[oAs]=this.dispatch,this[M5n]=this.close.bind(this),this.dispatch=iAs.call(this),this.close=this[N5n]}get[B5n.kConnected](){return this[gtr]}intercept(e){return new sAs(e,this[k5n])}async[N5n](){await rAs(this[M5n])(),this[gtr]=0,this[D5n][B5n.kClients].delete(this[O5n])}};L5n.exports=Atr});var U5n=I((gef,F5n)=>{"use strict";p();var cAs={pronoun:"it",is:"is",was:"was",this:"this"},lAs={pronoun:"they",is:"are",was:"were",this:"these"};F5n.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?cAs:lAs,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var q5n=I((_ef,Q5n)=>{"use strict";p();var{Transform:uAs}=require("node:stream"),{Console:dAs}=require("node:console"),fAs=process.versions.icu?"\u2705":"Y ",pAs=process.versions.icu?"\u274C":"N ";Q5n.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new uAs({transform(r,n,o){o(null,r)}}),this.logger=new dAs({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?fAs:pAs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var $5n=I((bef,G5n)=>{"use strict";p();var{kClients:HJ}=Fd(),hAs=ofe(),{kAgent:Etr,kMockAgentSet:Gnt,kMockAgentGet:j5n,kDispatches:_tr,kIsMockActive:$nt,kNetConnect:GJ,kGetNetConnect:mAs,kOptions:Vnt,kFactory:Wnt}=pfe(),gAs=mtr(),AAs=ytr(),{matchValue:yAs,buildMockOptions:EAs}=mPe(),{InvalidArgumentError:H5n,UndiciError:_As}=yc(),vAs=FRe(),CAs=U5n(),bAs=q5n(),vtr=class extends vAs{static{a(this,"MockAgent")}constructor(e){if(super(e),this[GJ]=!0,this[$nt]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new H5n("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new hAs(e);this[Etr]=r,this[HJ]=r[HJ],this[Vnt]=EAs(e)}get(e){let r=this[j5n](e);return r||(r=this[Wnt](e),this[Gnt](e,r)),r}dispatch(e,r){return this.get(e.origin),this[Etr].dispatch(e,r)}async close(){await this[Etr].close(),this[HJ].clear()}deactivate(){this[$nt]=!1}activate(){this[$nt]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[GJ])?this[GJ].push(e):this[GJ]=[e];else if(typeof e>"u")this[GJ]=!0;else throw new H5n("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[GJ]=!1}get isMockActive(){return this[$nt]}[Gnt](e,r){this[HJ].set(e,r)}[Wnt](e){let r=Object.assign({agent:this},this[Vnt]);return this[Vnt]&&this[Vnt].connections===1?new gAs(e,r):new AAs(e,r)}[j5n](e){let r=this[HJ].get(e);if(r)return r;if(typeof e!="string"){let n=this[Wnt]("http://localhost:9999");return this[Gnt](e,n),n}for(let[n,o]of Array.from(this[HJ]))if(o&&typeof n!="string"&&yAs(n,e)){let s=this[Wnt](e);return this[Gnt](e,s),s[_tr]=o[_tr],s}}[mAs](){return this[GJ]}pendingInterceptors(){let e=this[HJ];return Array.from(e.entries()).flatMap(([r,n])=>n[_tr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new bAs}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new CAs("interceptor","interceptors").pluralize(r.length);throw new _As(` +`,"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(` ${n.count} ${n.noun} ${n.is} pending: ${e.format(r)} -`.trim())}};G5n.exports=vtr});var znt=I((Ief,Y5n)=>{"use strict";p();var V5n=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:SAs}=yc(),TAs=ofe();z5n()===void 0&&W5n(new TAs);function W5n(t){if(!t||typeof t.dispatch!="function")throw new SAs("Argument agent must implement Agent");Object.defineProperty(globalThis,V5n,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(W5n,"setGlobalDispatcher");function z5n(){return globalThis[V5n]}a(z5n,"getGlobalDispatcher");Y5n.exports={setGlobalDispatcher:W5n,getGlobalDispatcher:z5n}});var Ynt=I((Pef,K5n)=>{"use strict";p();K5n.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 Z5n=I((Nef,J5n)=>{"use strict";p();var IAs=xnt();J5n.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 IAs(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var e4n=I((Bef,X5n)=>{"use strict";p();var xAs=Fnt();X5n.exports=t=>e=>a(function(n,o){return e(n,new xAs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var r4n=I((Uef,t4n)=>{"use strict";p();var wAs=Us(),{InvalidArgumentError:RAs,RequestAbortedError:PAs}=yc(),kAs=Ynt(),Ctr=class extends kAs{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 RAs("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=wAs.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new PAs(`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 DAs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new Ctr({maxSize:s},o);return e(n,c)},"Intercept")}a(DAs,"createDumpInterceptor");t4n.exports=DAs});var o4n=I((jef,i4n)=>{"use strict";p();var{isIP:NAs}=require("node:net"),{lookup:MAs}=require("node:dns"),OAs=Ynt(),{InvalidArgumentError:mfe,InformationalError:BAs}=yc(),n4n=Math.pow(2,31)-1,btr=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 BAs("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){MAs(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===n4n?(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===n4n?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 Str(this,e,r)}},Str=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}}};i4n.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new mfe("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new mfe("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new mfe("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new mfe("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new mfe("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new mfe("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 btr(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 $J=I(($ef,f4n)=>{"use strict";p();var{kConstruct:LAs}=Fd(),{kEnumerableProperty:gfe}=Us(),{iteratorMixin:FAs,isValidHeaderName:gPe,isValidHeaderValue:a4n}=XS(),{webidl:Ha}=MA(),Ttr=require("node:assert"),Knt=require("node:util"),nm=Symbol("headers map"),rT=Symbol("headers map sorted");function s4n(t){return t===10||t===13||t===9||t===32}a(s4n,"isHTTPWhiteSpaceCharCode");function c4n(t){let e=0,r=t.length;for(;r>e&&s4n(t.charCodeAt(r-1));)--r;for(;r>e&&s4n(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(c4n,"headerValueNormalize");function l4n(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(l4n,"fill");function Itr(t,e,r){if(r=c4n(r),gPe(e)){if(!a4n(r))throw Ha.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw Ha.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(d4n(t)==="immutable")throw new TypeError("immutable");return xtr(t).append(e,r,!1)}a(Itr,"appendHeader");function u4n(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[nm])r[n++]=[o,s],Ttr(s!==null);return r.sort(u4n)}}},p2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){Ha.util.markAsUncloneable(this),e!==LAs&&(this.#t=new Jnt,this.#e="none",e!==void 0&&(e=Ha.converters.HeadersInit(e,"Headers contructor","init"),l4n(this,e)))}append(e,r){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=Ha.converters.ByteString(e,n,"name"),r=Ha.converters.ByteString(r,n,"value"),Itr(this,e,r)}delete(e){if(Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"Headers.delete"),e=Ha.converters.ByteString(e,"Headers.delete","name"),!gPe(e))throw Ha.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=Ha.converters.ByteString(e,r,"name"),!gPe(e))throw Ha.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=Ha.converters.ByteString(e,r,"name"),!gPe(e))throw Ha.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=Ha.converters.ByteString(e,n,"name"),r=Ha.converters.ByteString(r,n,"value"),r=c4n(r),gPe(e)){if(!a4n(r))throw Ha.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw Ha.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){Ha.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[rT](){if(this.#t[rT])return this.#t[rT];let e=[],r=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[rT]=r;for(let o=0;o>"](t,e,r,n.bind(t)):Ha.converters["record"](t,e,r)}throw Ha.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};f4n.exports={fill:l4n,compareHeaderName:u4n,Headers:p2,HeadersList:Jnt,getHeadersGuard:d4n,setHeadersGuard:UAs,setHeadersList:QAs,getHeadersList:xtr}});var yPe=I((zef,S4n)=>{"use strict";p();var{Headers:y4n,HeadersList:p4n,fill:qAs,getHeadersGuard:jAs,setHeadersGuard:E4n,setHeadersList:_4n}=$J(),{extractBody:h4n,cloneBody:HAs,mixinBody:GAs,hasFinalizationRegistry:v4n,streamRegistry:C4n,bodyUnusable:$As}=Kde(),wtr=Us(),m4n=require("node:util"),{kEnumerableProperty:nT}=wtr,{isValidReasonPhrase:VAs,isCancelled:WAs,isAborted:zAs,isBlobLike:YAs,serializeJavascriptValueToJSONString:KAs,isErrorLike:JAs,isomorphicEncode:ZAs,environmentSettingsObject:XAs}=XS(),{redirectStatusSet:eys,nullBodyStatus:tys}=qRe(),{kState:Qd,kHeaders:CF}=tj(),{webidl:rs}=MA(),{FormData:rys}=WRe(),{URLSerializer:g4n}=JC(),{kConstruct:Xnt}=Fd(),Rtr=require("node:assert"),{types:nys}=require("node:util"),iys=new TextEncoder("utf-8"),VJ=class t{static{a(this,"Response")}static error(){return APe(eit(),"immutable")}static json(e,r={}){rs.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=rs.converters.ResponseInit(r));let n=iys.encode(KAs(e)),o=h4n(n),s=APe(Afe({}),"response");return A4n(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){rs.argumentLengthCheck(arguments,1,"Response.redirect"),e=rs.converters.USVString(e),r=rs.converters["unsigned short"](r);let n;try{n=new URL(e,XAs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!eys.has(r))throw new RangeError(`Invalid status code ${r}`);let o=APe(Afe({}),"immutable");o[Qd].status=r;let s=ZAs(g4n(n));return o[Qd].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(rs.util.markAsUncloneable(this),e===Xnt)return;e!==null&&(e=rs.converters.BodyInit(e)),r=rs.converters.ResponseInit(r),this[Qd]=Afe({}),this[CF]=new y4n(Xnt),E4n(this[CF],"response"),_4n(this[CF],this[Qd].headersList);let n=null;if(e!=null){let[o,s]=h4n(e);n={body:o,type:s}}A4n(this,r,n)}get type(){return rs.brandCheck(this,t),this[Qd].type}get url(){rs.brandCheck(this,t);let e=this[Qd].urlList,r=e[e.length-1]??null;return r===null?"":g4n(r,!0)}get redirected(){return rs.brandCheck(this,t),this[Qd].urlList.length>1}get status(){return rs.brandCheck(this,t),this[Qd].status}get ok(){return rs.brandCheck(this,t),this[Qd].status>=200&&this[Qd].status<=299}get statusText(){return rs.brandCheck(this,t),this[Qd].statusText}get headers(){return rs.brandCheck(this,t),this[CF]}get body(){return rs.brandCheck(this,t),this[Qd].body?this[Qd].body.stream:null}get bodyUsed(){return rs.brandCheck(this,t),!!this[Qd].body&&wtr.isDisturbed(this[Qd].body.stream)}clone(){if(rs.brandCheck(this,t),$As(this))throw rs.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=Ptr(this[Qd]);return v4n&&this[Qd].body?.stream&&C4n.register(this,new WeakRef(this[Qd].body.stream)),APe(e,jAs(this[CF]))}[m4n.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 ${m4n.formatWithOptions(r,n)}`}};GAs(VJ);Object.defineProperties(VJ.prototype,{type:nT,url:nT,status:nT,ok:nT,redirected:nT,statusText:nT,headers:nT,clone:nT,body:nT,bodyUsed:nT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(VJ,{json:nT,redirect:nT,error:nT});function Ptr(t){if(t.internalResponse)return b4n(Ptr(t.internalResponse),t.type);let e=Afe({...t,body:null});return t.body!=null&&(e.body=HAs(e,t.body)),e}a(Ptr,"cloneResponse");function Afe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new p4n(t?.headersList):new p4n,urlList:t?.urlList?[...t.urlList]:[]}}a(Afe,"makeResponse");function eit(t){let e=JAs(t);return Afe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(eit,"makeNetworkError");function oys(t){return t.type==="error"&&t.status===0}a(oys,"isNetworkError");function Znt(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 Rtr(!(n in e)),r[n]=o,!0}})}a(Znt,"makeFilteredResponse");function b4n(t,e){if(e==="basic")return Znt(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Znt(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Znt(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return Znt(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});Rtr(!1)}a(b4n,"filterResponse");function sys(t,e=null){return Rtr(WAs(t)),zAs(t)?eit(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):eit(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(sys,"makeAppropriateNetworkError");function A4n(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&&!VAs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[Qd].status=e.status),"statusText"in e&&e.statusText!=null&&(t[Qd].statusText=e.statusText),"headers"in e&&e.headers!=null&&qAs(t[CF],e.headers),r){if(tys.includes(t.status))throw rs.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[Qd].body=r.body,r.type!=null&&!t[Qd].headersList.contains("content-type",!0)&&t[Qd].headersList.append("content-type",r.type,!0)}}a(A4n,"initializeResponse");function APe(t,e){let r=new VJ(Xnt);return r[Qd]=t,r[CF]=new y4n(Xnt),_4n(r[CF],t.headersList),E4n(r[CF],e),v4n&&t.body?.stream&&C4n.register(r,new WeakRef(t.body.stream)),r}a(APe,"fromInnerResponse");rs.converters.ReadableStream=rs.interfaceConverter(ReadableStream);rs.converters.FormData=rs.interfaceConverter(rys);rs.converters.URLSearchParams=rs.interfaceConverter(URLSearchParams);rs.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?rs.converters.USVString(t,e,r):YAs(t)?rs.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||nys.isArrayBuffer(t)?rs.converters.BufferSource(t,e,r):wtr.isFormDataLike(t)?rs.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?rs.converters.URLSearchParams(t,e,r):rs.converters.DOMString(t,e,r)};rs.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?rs.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:rs.converters.XMLHttpRequestBodyInit(t,e,r)};rs.converters.ResponseInit=rs.dictionaryConverter([{key:"status",converter:rs.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:rs.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:rs.converters.HeadersInit}]);S4n.exports={isNetworkError:oys,makeNetworkError:eit,makeResponse:Afe,makeAppropriateNetworkError:sys,filterResponse:b4n,Response:VJ,cloneResponse:Ptr,fromInnerResponse:APe}});var w4n=I((Jef,x4n)=>{"use strict";p();var{kConnected:T4n,kSize:I4n}=Fd(),ktr=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[T4n]===0&&this.value[I4n]===0?void 0:this.value}},Dtr=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[T4n]===0&&e[I4n]===0&&this.finalizer(r)})}unregister(e){}};x4n.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:ktr,FinalizationRegistry:Dtr}):{WeakRef,FinalizationRegistry}}});var yfe=I((etf,H4n)=>{"use strict";p();var{extractBody:ays,mixinBody:cys,cloneBody:lys,bodyUnusable:R4n}=Kde(),{Headers:F4n,fill:uys,HeadersList:iit,setHeadersGuard:Mtr,getHeadersGuard:dys,setHeadersList:U4n,getHeadersList:P4n}=$J(),{FinalizationRegistry:fys}=w4n()(),rit=Us(),k4n=require("node:util"),{isValidHTTPToken:pys,sameOrigin:D4n,environmentSettingsObject:tit}=XS(),{forbiddenMethodsSet:hys,corsSafeListedMethodsSet:mys,referrerPolicy:gys,requestRedirect:Ays,requestMode:yys,requestCredentials:Eys,requestCache:_ys,requestDuplex:vys}=qRe(),{kEnumerableProperty:im,normalizedMethodRecordsBase:Cys,normalizedMethodRecords:bys}=rit,{kHeaders:iT,kSignal:nit,kState:nd,kDispatcher:Ntr}=tj(),{webidl:$i}=MA(),{URLSerializer:Sys}=JC(),{kConstruct:oit}=Fd(),Tys=require("node:assert"),{getMaxListeners:N4n,setMaxListeners:M4n,getEventListeners:Iys,defaultMaxListeners:O4n}=require("node:events"),xys=Symbol("abortController"),Q4n=new fys(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),sit=new WeakMap;function B4n(t){return e;function e(){let r=t.deref();if(r!==void 0){Q4n.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=sit.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()}sit.delete(r.signal)}}}}a(B4n,"buildAbort");var L4n=!1,pj=class t{static{a(this,"Request")}constructor(e,r={}){if($i.util.markAsUncloneable(this),e===oit)return;let n="Request constructor";$i.argumentLengthCheck(arguments,1,n),e=$i.converters.RequestInfo(e,n,"input"),r=$i.converters.RequestInit(r,n,"init");let o=null,s=null,c=tit.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[Ntr]=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=ait({urlList:[_]}),s="cors"}else this[Ntr]=r.dispatcher||e[Ntr],Tys(e instanceof t),o=e[nd],l=e[nit];let u=tit.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&D4n(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=ait({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:tit.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&&!D4n(v,tit.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw $i.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let _=r.method,v=bys[_];if(v!==void 0)o.method=v;else{if(!pys(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(hys.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=Cys[b]??_,o.method=_}!L4n&&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"}),L4n=!0)}r.signal!==void 0&&(l=r.signal),this[nd]=o;let m=new AbortController;if(this[nit]=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[xys]=m;let _=new WeakRef(m),v=B4n(_);try{(typeof N4n=="function"&&N4n(l)===O4n||Iys(l,"abort").length>=O4n)&&M4n(1500,l)}catch{}rit.addAbortListener(l,v),Q4n.register(m,{signal:l,abort:v},v)}}if(this[iT]=new F4n(oit),U4n(this[iT],o.headersList),Mtr(this[iT],"request"),h==="no-cors"){if(!mys.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);Mtr(this[iT],"request-no-cors")}if(f){let _=P4n(this[iT]),v=r.headers!==void 0?r.headers:new iit(_);if(_.clear(),v instanceof iit){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else uys(this[iT],v)}let g=e instanceof t?e[nd].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]=ays(r.body,o.keepalive);A=_,v&&!P4n(this[iT]).contains("content-type",!0)&&this[iT].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(R4n(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[nd].body=E}get method(){return $i.brandCheck(this,t),this[nd].method}get url(){return $i.brandCheck(this,t),Sys(this[nd].url)}get headers(){return $i.brandCheck(this,t),this[iT]}get destination(){return $i.brandCheck(this,t),this[nd].destination}get referrer(){return $i.brandCheck(this,t),this[nd].referrer==="no-referrer"?"":this[nd].referrer==="client"?"about:client":this[nd].referrer.toString()}get referrerPolicy(){return $i.brandCheck(this,t),this[nd].referrerPolicy}get mode(){return $i.brandCheck(this,t),this[nd].mode}get credentials(){return this[nd].credentials}get cache(){return $i.brandCheck(this,t),this[nd].cache}get redirect(){return $i.brandCheck(this,t),this[nd].redirect}get integrity(){return $i.brandCheck(this,t),this[nd].integrity}get keepalive(){return $i.brandCheck(this,t),this[nd].keepalive}get isReloadNavigation(){return $i.brandCheck(this,t),this[nd].reloadNavigation}get isHistoryNavigation(){return $i.brandCheck(this,t),this[nd].historyNavigation}get signal(){return $i.brandCheck(this,t),this[nit]}get body(){return $i.brandCheck(this,t),this[nd].body?this[nd].body.stream:null}get bodyUsed(){return $i.brandCheck(this,t),!!this[nd].body&&rit.isDisturbed(this[nd].body.stream)}get duplex(){return $i.brandCheck(this,t),"half"}clone(){if($i.brandCheck(this,t),R4n(this))throw new TypeError("unusable");let e=q4n(this[nd]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=sit.get(this.signal);n===void 0&&(n=new Set,sit.set(this.signal,n));let o=new WeakRef(r);n.add(o),rit.addAbortListener(r.signal,B4n(o))}return j4n(e,r.signal,dys(this[iT]))}[k4n.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 ${k4n.formatWithOptions(r,n)}`}};cys(pj);function ait(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 iit(t.headersList):new iit}}a(ait,"makeRequest");function q4n(t){let e=ait({...t,body:null});return t.body!=null&&(e.body=lys(e,t.body)),e}a(q4n,"cloneRequest");function j4n(t,e,r){let n=new pj(oit);return n[nd]=t,n[nit]=e,n[iT]=new F4n(oit),U4n(n[iT],t.headersList),Mtr(n[iT],r),n}a(j4n,"fromInnerRequest");Object.defineProperties(pj.prototype,{method:im,url:im,headers:im,redirect:im,clone:im,signal:im,duplex:im,destination:im,body:im,bodyUsed:im,isHistoryNavigation:im,isReloadNavigation:im,keepalive:im,integrity:im,cache:im,credentials:im,attribute:im,referrerPolicy:im,referrer:im,mode:im,[Symbol.toStringTag]:{value:"Request",configurable:!0}});$i.converters.Request=$i.interfaceConverter(pj);$i.converters.RequestInfo=function(t,e,r){return typeof t=="string"?$i.converters.USVString(t,e,r):t instanceof pj?$i.converters.Request(t,e,r):$i.converters.USVString(t,e,r)};$i.converters.AbortSignal=$i.interfaceConverter(AbortSignal);$i.converters.RequestInit=$i.dictionaryConverter([{key:"method",converter:$i.converters.ByteString},{key:"headers",converter:$i.converters.HeadersInit},{key:"body",converter:$i.nullableConverter($i.converters.BodyInit)},{key:"referrer",converter:$i.converters.USVString},{key:"referrerPolicy",converter:$i.converters.DOMString,allowedValues:gys},{key:"mode",converter:$i.converters.DOMString,allowedValues:yys},{key:"credentials",converter:$i.converters.DOMString,allowedValues:Eys},{key:"cache",converter:$i.converters.DOMString,allowedValues:_ys},{key:"redirect",converter:$i.converters.DOMString,allowedValues:Ays},{key:"integrity",converter:$i.converters.DOMString},{key:"keepalive",converter:$i.converters.boolean},{key:"signal",converter:$i.nullableConverter(t=>$i.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:$i.converters.any},{key:"duplex",converter:$i.converters.DOMString,allowedValues:vys},{key:"dispatcher",converter:$i.converters.any}]);H4n.exports={Request:pj,makeRequest:ait,fromInnerRequest:j4n,cloneRequest:q4n}});var _Pe=I((ntf,iBn)=>{"use strict";p();var{makeNetworkError:rl,makeAppropriateNetworkError:cit,filterResponse:Otr,makeResponse:lit,fromInnerResponse:wys}=yPe(),{HeadersList:G4n}=$J(),{Request:Rys,cloneRequest:Pys}=yfe(),hj=require("node:zlib"),{bytesMatch:kys,makePolicyContainer:Dys,clonePolicyContainer:Nys,requestBadPort:Mys,TAOCheck:Oys,appendRequestOriginHeader:Bys,responseLocationURL:Lys,requestCurrentURL:u5,setRequestReferrerPolicyOnRedirect:Fys,tryUpgradeRequestToAPotentiallyTrustworthyURL:Uys,createOpaqueTimingInfo:Qtr,appendFetchMetadata:Qys,corsCheck:qys,crossOriginResourcePolicyCheck:jys,determineRequestsReferrer:Hys,coarsenedSharedCurrentTime:EPe,createDeferredPromise:Gys,isBlobLike:$ys,sameOrigin:Utr,isCancelled:WJ,isAborted:$4n,isErrorLike:Vys,fullyReadBody:Wys,readableStreamClose:zys,isomorphicEncode:uit,urlIsLocal:Yys,urlIsHttpHttpsScheme:qtr,urlHasHttpsScheme:Kys,clampAndCoarsenConnectionTimingInfo:Jys,simpleRangeHeaderValue:Zys,buildContentRange:Xys,createInflate:eEs,extractMimeType:tEs}=XS(),{kState:Y4n,kDispatcher:rEs}=tj(),zJ=require("node:assert"),{safelyExtractBody:jtr,extractBody:V4n}=Kde(),{redirectStatusSet:K4n,nullBodyStatus:J4n,safeMethodsSet:nEs,requestBodyHeader:iEs,subresourceSet:oEs}=qRe(),sEs=require("node:events"),{Readable:aEs,pipeline:cEs,finished:lEs}=require("node:stream"),{addAbortListener:uEs,isErrored:dEs,isReadable:dit,bufferToLowerCasedHeaderName:W4n}=Us(),{dataURLProcessor:fEs,serializeAMimeType:pEs,minimizeSupportedMimeType:hEs}=JC(),{getGlobalDispatcher:mEs}=znt(),{webidl:gEs}=MA(),{STATUS_CODES:AEs}=require("node:http"),yEs=["GET","HEAD"],EEs=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",Btr,fit=class extends sEs{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 _Es(t){Z4n(t,"fetch")}a(_Es,"handleFetchDone");function vEs(t,e=void 0){gEs.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=Gys(),n;try{n=new Rys(t,e)}catch(f){return r.reject(f),r.promise}let o=n[Y4n];if(n.signal.aborted)return Ltr(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 uEs(n.signal,()=>{l=!0,zJ(u!=null),u.abort(n.signal.reason);let f=c?.deref();Ltr(r,o,f,n.signal.reason)}),u=eBn({request:o,processResponseEndOfBody:_Es,processResponse:a(f=>{if(!l){if(f.aborted){Ltr(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(wys(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[rEs]}),r.promise}a(vEs,"fetch");function Z4n(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;qtr(r)&&n!==null&&(t.timingAllowPassed||(n=Qtr({startTime:n.startTime}),o=""),n.endTime=EPe(),t.timingInfo=n,X4n(n,r.href,e,globalThis,o))}a(Z4n,"finalizeAndReportTiming");var X4n=performance.markResourceTiming;function Ltr(t,e,r,n){if(t&&t.reject(n),e.body!=null&&dit(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[Y4n];o.body!=null&&dit(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(Ltr,"abortFetch");function eBn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=mEs()}){zJ(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=EPe(d),h=Qtr({startTime:f}),m={controller:new fit(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return zJ(!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=Dys()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,oEs.has(t.destination),tBn(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(eBn,"fetching");async function tBn(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!Yys(u5(r))&&(n=rl("local URLs only")),Uys(r),Mys(r)==="blocked"&&(n=rl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=Hys(r)),n===null&&(n=await(async()=>{let s=u5(r);return Utr(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await z4n(t)):r.mode==="same-origin"?rl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?rl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await z4n(t)):qtr(u5(r))?(r.responseTainting="cors",await rBn(t)):rl("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=Otr(n,"basic"):r.responseTainting==="cors"?n=Otr(n,"cors"):r.responseTainting==="opaque"?n=Otr(n,"opaque"):zJ(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=rl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||J4n.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>Ftr(t,rl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!kys(l,r.integrity)){s("integrity mismatch");return}n.body=jtr(l)[0],Ftr(t,n)},"processBody");await Wys(n.body,c,s)}else Ftr(t,n)}a(tBn,"mainFetch");function z4n(t){if(WJ(t)&&t.request.redirectCount===0)return Promise.resolve(cit(t));let{request:e}=t,{protocol:r}=u5(e);switch(r){case"about:":return Promise.resolve(rl("about scheme is not supported"));case"blob:":{Btr||(Btr=require("node:buffer").resolveObjectURL);let n=u5(e);if(n.search.length!==0)return Promise.resolve(rl("NetworkError when attempting to fetch resource."));let o=Btr(n.toString());if(e.method!=="GET"||!$ys(o))return Promise.resolve(rl("invalid method"));let s=lit(),c=o.size,l=uit(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=Zys(d,!0);if(f==="failure")return Promise.resolve(rl("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(rl("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=V4n(g);s.body=A[0];let y=uit(`${g.size}`),E=Xys(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=V4n(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=u5(e),o=fEs(n);if(o==="failure")return Promise.resolve(rl("failed to fetch the data URL"));let s=pEs(o.mimeType);return Promise.resolve(lit({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:jtr(o.body)[0]}))}case"file:":return Promise.resolve(rl("not implemented... yet..."));case"http:":case"https:":return rBn(t).catch(n=>rl(n));default:return Promise.resolve(rl("unknown scheme"))}}a(z4n,"schemeFetch");function CEs(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(CEs,"finalizeResponse");function Ftr(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=Qtr(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=tEs(e.headersList);f!=="failure"&&(u.contentType=hEs(f))}t.request.initiatorType!=null&&X4n(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():lEs(o.body.stream,()=>{n()})}a(Ftr,"fetchFinale");async function rBn(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 nBn(t),e.responseTainting==="cors"&&qys(e,r)==="failure")return rl("cors failure");Oys(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&jys(e.origin,e.client,e.destination,n)==="blocked"?rl("blocked"):(K4n.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=rl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await bEs(t,r):zJ(!1)),r.timingInfo=o,r)}a(rBn,"httpFetch");function bEs(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=Lys(n,u5(r).hash),o==null)return e}catch(c){return Promise.resolve(rl(c))}if(!qtr(o))return Promise.resolve(rl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(rl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!Utr(r,o))return Promise.resolve(rl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(rl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(rl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!yEs.includes(r.method)){r.method="GET",r.body=null;for(let c of iEs)r.headersList.delete(c)}Utr(u5(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&&(zJ(r.body.source!=null),r.body=jtr(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=EPe(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),Fys(r,n),tBn(t,!0)}a(bEs,"httpRedirectFetch");async function nBn(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=Pys(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=uit(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",uit(s.referrer.href),!0),Bys(s),Qys(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",EEs),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)||(Kys(u5(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return rl("only if cached");let m=await SEs(o,d,r);!nEs.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===407)return n.window==="no-window"?rl():WJ(t)?cit(t):rl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(WJ(t))return cit(t);t.controller.connection.destroy(),c=await nBn(t,e,!0)}return c}a(nBn,"httpNetworkOrCacheFetch");async function SEs(t,e=!1,r=!1){zJ(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(_){WJ(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{WJ(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{WJ(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=lit({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=lit({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),cit(t,A)):rl(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{WJ(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($4n(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){zys(t.controller.controller),CEs(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),dEs(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){$4n(t)?(o.aborted=!0,dit(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):dit(h)&&t.controller.controller.error(new TypeError("terminated",{cause:Vys(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=u5(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=Jys(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=EPe(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=EPe(t.crossOriginIsolatedCapability)},onHeaders(b,T,w,R){if(b<200)return;let x="",P=new G4n;for(let L=0;LM)return v(new Error(`too many content-encodings in response: ${j.length}, maximum allowed is ${M}`)),!0;for(let O=j.length-1;O>=0;--O){let q=j[O].trim();if(q==="x-gzip"||q==="gzip")D.push(hj.createGunzip({flush:hj.constants.Z_SYNC_FLUSH,finishFlush:hj.constants.Z_SYNC_FLUSH}));else if(q==="deflate")D.push(eEs({flush:hj.constants.Z_SYNC_FLUSH,finishFlush:hj.constants.Z_SYNC_FLUSH}));else if(q==="br")D.push(hj.createBrotliDecompress({flush:hj.constants.BROTLI_OPERATION_FLUSH,finishFlush:hj.constants.BROTLI_OPERATION_FLUSH}));else{D.length=0;break}}}let B=this.onError.bind(this);return _({status:b,statusText:R,headersList:P,body:D.length?cEs(this.body,...D,L=>{L&&this.onError(L)}).on("error",B):this.body.on("error",B)}),!0},onData(b){if(t.controller.dump)return;let T=b;return s.encodedBodySize+=T.byteLength,this.body.push(T)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.onAborted&&t.controller.off("terminated",t.controller.onAborted),t.controller.ended=!0,this.body.push(null)},onError(b){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(b),t.controller.terminate(b),v(b)},onUpgrade(b,T,w){if(b!==101)return;let R=new G4n;for(let x=0;x{"use strict";p();oBn.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 aBn=I((ctf,sBn)=>{"use strict";p();var{webidl:oT}=MA(),pit=Symbol("ProgressEvent state"),Gtr=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=oT.converters.DOMString(e,"ProgressEvent constructor","type"),r=oT.converters.ProgressEventInit(r??{}),super(e,r),this[pit]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return oT.brandCheck(this,t),this[pit].lengthComputable}get loaded(){return oT.brandCheck(this,t),this[pit].loaded}get total(){return oT.brandCheck(this,t),this[pit].total}};oT.converters.ProgressEventInit=oT.dictionaryConverter([{key:"lengthComputable",converter:oT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:oT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:oT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:oT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:oT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:oT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);sBn.exports={ProgressEvent:Gtr}});var lBn=I((dtf,cBn)=>{"use strict";p();function TEs(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(TEs,"getEncoding");cBn.exports={getEncoding:TEs}});var ABn=I((htf,gBn)=>{"use strict";p();var{kState:Efe,kError:$tr,kResult:uBn,kAborted:vPe,kLastProgressEventFired:Vtr}=Htr(),{ProgressEvent:IEs}=aBn(),{getEncoding:dBn}=lBn(),{serializeAMimeType:xEs,parseMIMEType:fBn}=JC(),{types:wEs}=require("node:util"),{StringDecoder:pBn}=require("string_decoder"),{btoa:hBn}=require("node:buffer"),REs={enumerable:!0,writable:!1,configurable:!1};function PEs(t,e,r,n){if(t[Efe]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[Efe]="loading",t[uBn]=null,t[$tr]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[vPe];)try{let{done:d,value:f}=await l;if(u&&!t[vPe]&&queueMicrotask(()=>{mj("loadstart",t)}),u=!1,!d&&wEs.isUint8Array(f))c.push(f),(t[Vtr]===void 0||Date.now()-t[Vtr]>=50)&&!t[vPe]&&(t[Vtr]=Date.now(),queueMicrotask(()=>{mj("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[Efe]="done";try{let h=kEs(c,r,e.type,n);if(t[vPe])return;t[uBn]=h,mj("load",t)}catch(h){t[$tr]=h,mj("error",t)}t[Efe]!=="loading"&&mj("loadend",t)});break}}catch(d){if(t[vPe])return;queueMicrotask(()=>{t[Efe]="done",t[$tr]=d,mj("error",t),t[Efe]!=="loading"&&mj("loadend",t)});break}})()}a(PEs,"readOperation");function mj(t,e){let r=new IEs(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(mj,"fireAProgressEvent");function kEs(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=fBn(r||"application/octet-stream");s!=="failure"&&(o+=xEs(s)),o+=";base64,";let c=new pBn("latin1");for(let l of t)o+=hBn(c.write(l));return o+=hBn(c.end()),o}case"Text":{let o="failure";if(n&&(o=dBn(n)),o==="failure"&&r){let s=fBn(r);s!=="failure"&&(o=dBn(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),DEs(t,o)}case"ArrayBuffer":return mBn(t).buffer;case"BinaryString":{let o="",s=new pBn("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a(kEs,"packageData");function DEs(t,e){let r=mBn(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(DEs,"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 mBn(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(mBn,"combineByteSequences");gBn.exports={staticPropertyDescriptors:REs,readOperation:PEs,fireAProgressEvent:mj}});var vBn=I((Atf,_Bn)=>{"use strict";p();var{staticPropertyDescriptors:_fe,readOperation:hit,fireAProgressEvent:yBn}=ABn(),{kState:YJ,kError:EBn,kResult:mit,kEvents:Ic,kAborted:MEs}=Htr(),{webidl:Cl}=MA(),{kEnumerableProperty:eb}=Us(),h2=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[YJ]="empty",this[mit]=null,this[EBn]=null,this[Ic]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){Cl.brandCheck(this,t),Cl.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=Cl.converters.Blob(e,{strict:!1}),hit(this,e,"ArrayBuffer")}readAsBinaryString(e){Cl.brandCheck(this,t),Cl.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=Cl.converters.Blob(e,{strict:!1}),hit(this,e,"BinaryString")}readAsText(e,r=void 0){Cl.brandCheck(this,t),Cl.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=Cl.converters.Blob(e,{strict:!1}),r!==void 0&&(r=Cl.converters.DOMString(r,"FileReader.readAsText","encoding")),hit(this,e,"Text",r)}readAsDataURL(e){Cl.brandCheck(this,t),Cl.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=Cl.converters.Blob(e,{strict:!1}),hit(this,e,"DataURL")}abort(){if(this[YJ]==="empty"||this[YJ]==="done"){this[mit]=null;return}this[YJ]==="loading"&&(this[YJ]="done",this[mit]=null),this[MEs]=!0,yBn("abort",this),this[YJ]!=="loading"&&yBn("loadend",this)}get readyState(){switch(Cl.brandCheck(this,t),this[YJ]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return Cl.brandCheck(this,t),this[mit]}get error(){return Cl.brandCheck(this,t),this[EBn]}get onloadend(){return Cl.brandCheck(this,t),this[Ic].loadend}set onloadend(e){Cl.brandCheck(this,t),this[Ic].loadend&&this.removeEventListener("loadend",this[Ic].loadend),typeof e=="function"?(this[Ic].loadend=e,this.addEventListener("loadend",e)):this[Ic].loadend=null}get onerror(){return Cl.brandCheck(this,t),this[Ic].error}set onerror(e){Cl.brandCheck(this,t),this[Ic].error&&this.removeEventListener("error",this[Ic].error),typeof e=="function"?(this[Ic].error=e,this.addEventListener("error",e)):this[Ic].error=null}get onloadstart(){return Cl.brandCheck(this,t),this[Ic].loadstart}set onloadstart(e){Cl.brandCheck(this,t),this[Ic].loadstart&&this.removeEventListener("loadstart",this[Ic].loadstart),typeof e=="function"?(this[Ic].loadstart=e,this.addEventListener("loadstart",e)):this[Ic].loadstart=null}get onprogress(){return Cl.brandCheck(this,t),this[Ic].progress}set onprogress(e){Cl.brandCheck(this,t),this[Ic].progress&&this.removeEventListener("progress",this[Ic].progress),typeof e=="function"?(this[Ic].progress=e,this.addEventListener("progress",e)):this[Ic].progress=null}get onload(){return Cl.brandCheck(this,t),this[Ic].load}set onload(e){Cl.brandCheck(this,t),this[Ic].load&&this.removeEventListener("load",this[Ic].load),typeof e=="function"?(this[Ic].load=e,this.addEventListener("load",e)):this[Ic].load=null}get onabort(){return Cl.brandCheck(this,t),this[Ic].abort}set onabort(e){Cl.brandCheck(this,t),this[Ic].abort&&this.removeEventListener("abort",this[Ic].abort),typeof e=="function"?(this[Ic].abort=e,this.addEventListener("abort",e)):this[Ic].abort=null}};h2.EMPTY=h2.prototype.EMPTY=0;h2.LOADING=h2.prototype.LOADING=1;h2.DONE=h2.prototype.DONE=2;Object.defineProperties(h2.prototype,{EMPTY:_fe,LOADING:_fe,DONE:_fe,readAsArrayBuffer:eb,readAsBinaryString:eb,readAsText:eb,readAsDataURL:eb,abort:eb,readyState:eb,result:eb,error:eb,onloadstart:eb,onprogress:eb,onload:eb,onabort:eb,onerror:eb,onloadend:eb,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(h2,{EMPTY:_fe,LOADING:_fe,DONE:_fe});_Bn.exports={FileReader:h2}});var git=I((_tf,CBn)=>{"use strict";p();CBn.exports={kConstruct:Fd().kConstruct}});var TBn=I((Ctf,SBn)=>{"use strict";p();var OEs=require("node:assert"),{URLSerializer:bBn}=JC(),{isValidHeaderName:BEs}=XS();function LEs(t,e,r=!1){let n=bBn(t,r),o=bBn(e,r);return n===o}a(LEs,"urlEquals");function FEs(t){OEs(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),BEs(r)&&e.push(r);return e}a(FEs,"getFieldValues");SBn.exports={urlEquals:LEs,getFieldValues:FEs}});var wBn=I((Ttf,xBn)=>{"use strict";p();var{kConstruct:UEs}=git(),{urlEquals:QEs,getFieldValues:Wtr}=TBn(),{kEnumerableProperty:KJ,isDisturbed:qEs}=Us(),{webidl:_i}=MA(),{Response:jEs,cloneResponse:HEs,fromInnerResponse:GEs}=yPe(),{Request:bF,fromInnerRequest:$Es}=yfe(),{kState:m2}=tj(),{fetching:VEs}=_Pe(),{urlIsHttpHttpsScheme:Ait,createDeferredPromise:vfe,readAllBytes:WEs}=XS(),ztr=require("node:assert"),yit=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==UEs&&_i.illegalConstructor(),_i.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){_i.brandCheck(this,t);let n="Cache.match";_i.argumentLengthCheck(arguments,1,n),e=_i.converters.RequestInfo(e,n,"request"),r=_i.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={}){_i.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=_i.converters.RequestInfo(e,n,"request")),r=_i.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){_i.brandCheck(this,t);let r="Cache.add";_i.argumentLengthCheck(arguments,1,r),e=_i.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){_i.brandCheck(this,t);let r="Cache.addAll";_i.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw _i.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=_i.converters.RequestInfo(m),typeof m=="string")continue;let g=m[m2];if(!Ait(g.url)||g.method!=="GET")throw _i.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)[m2];if(!Ait(g.url))throw _i.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=vfe();s.push(VEs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(_i.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=Wtr(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(_i.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=vfe(),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){_i.brandCheck(this,t);let n="Cache.put";_i.argumentLengthCheck(arguments,2,n),e=_i.converters.RequestInfo(e,n,"request"),r=_i.converters.Response(r,n,"response");let o=null;if(e instanceof bF?o=e[m2]:o=new bF(e)[m2],!Ait(o.url)||o.method!=="GET")throw _i.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[m2];if(s.status===206)throw _i.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=Wtr(s.headersList.get("vary"));for(let A of g)if(A==="*")throw _i.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(qEs(s.body.stream)||s.body.stream.locked))throw _i.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=HEs(s),l=vfe();if(s.body!=null){let A=s.body.stream.getReader();WEs(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=vfe(),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={}){_i.brandCheck(this,t);let n="Cache.delete";_i.argumentLengthCheck(arguments,1,n),e=_i.converters.RequestInfo(e,n,"request"),r=_i.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof bF){if(o=e[m2],o.method!=="GET"&&!r.ignoreMethod)return!1}else ztr(typeof e=="string"),o=new bF(e)[m2];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=vfe(),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={}){_i.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=_i.converters.RequestInfo(e,n,"request")),r=_i.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof bF){if(o=e[m2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new bF(e)[m2]);let s=vfe(),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=$Es(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 _i.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw _i.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);ztr(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw _i.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!Ait(u.url))throw _i.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw _i.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw _i.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);ztr(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=""),!QEs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Wtr(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[m2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new bF(e)[m2]);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=GEs(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(yit.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:KJ,matchAll:KJ,add:KJ,addAll:KJ,put:KJ,delete:KJ,keys:KJ});var IBn=[{key:"ignoreSearch",converter:_i.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:_i.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:_i.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];_i.converters.CacheQueryOptions=_i.dictionaryConverter(IBn);_i.converters.MultiCacheQueryOptions=_i.dictionaryConverter([...IBn,{key:"cacheName",converter:_i.converters.DOMString}]);_i.converters.Response=_i.interfaceConverter(jEs);_i.converters["sequence"]=_i.sequenceConverter(_i.converters.RequestInfo);xBn.exports={Cache:yit}});var PBn=I((wtf,RBn)=>{"use strict";p();var{kConstruct:CPe}=git(),{Cache:Eit}=wBn(),{webidl:pE}=MA(),{kEnumerableProperty:bPe}=Us(),_it=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==CPe&&pE.illegalConstructor(),pE.util.markAsUncloneable(this)}async match(e,r={}){if(pE.brandCheck(this,t),pE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=pE.converters.RequestInfo(e),r=pE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Eit(CPe,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Eit(CPe,n).match(e,r);if(s!==void 0)return s}}async has(e){pE.brandCheck(this,t);let r="CacheStorage.has";return pE.argumentLengthCheck(arguments,1,r),e=pE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){pE.brandCheck(this,t);let r="CacheStorage.open";if(pE.argumentLengthCheck(arguments,1,r),e=pE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Eit(CPe,o)}let n=[];return this.#e.set(e,n),new Eit(CPe,n)}async delete(e){pE.brandCheck(this,t);let r="CacheStorage.delete";return pE.argumentLengthCheck(arguments,1,r),e=pE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return pE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(_it.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:bPe,has:bPe,open:bPe,delete:bPe,keys:bPe});RBn.exports={CacheStorage:_it}});var DBn=I((ktf,kBn)=>{"use strict";p();kBn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Ytr=I((Ntf,LBn)=>{"use strict";p();function zEs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(zEs,"isCTLExcludingHtab");function NBn(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(NBn,"validateCookieName");function MBn(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(MBn,"validateCookieValue");function OBn(t){for(let e=0;ee.toString().padStart(2,"0"));function BBn(t){return typeof t=="number"&&(t=new Date(t)),`${KEs[t.getUTCDay()]}, ${vit[t.getUTCDate()]} ${JEs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${vit[t.getUTCHours()]}:${vit[t.getUTCMinutes()]}:${vit[t.getUTCSeconds()]} GMT`}a(BBn,"toIMFDate");function ZEs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(ZEs,"validateCookieMaxAge");function XEs(t){if(t.name.length===0)return null;NBn(t.name),MBn(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"&&(ZEs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(YEs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(OBn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${BBn(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(XEs,"stringify");LBn.exports={isCTLExcludingHtab:zEs,validateCookieName:NBn,validateCookiePath:OBn,validateCookieValue:MBn,toIMFDate:BBn,stringify:XEs}});var UBn=I((Btf,FBn)=>{"use strict";p();var{maxNameValuePairSize:e_s,maxAttributeValueSize:t_s}=DBn(),{isCTLExcludingHtab:r_s}=Ytr(),{collectASequenceOfCodePointsFast:Cit}=JC(),n_s=require("node:assert");function i_s(t){if(r_s(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=Cit(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=Cit("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>e_s?null:{name:n,value:o,...Cfe(r)}}a(i_s,"parseSetCookie");function Cfe(t,e={}){if(t.length===0)return e;n_s(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=Cit(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=Cit("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>t_s)return Cfe(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 Cfe(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 Cfe(t,e)}a(Cfe,"parseUnparsedAttributes");FBn.exports={parseSetCookie:i_s,parseUnparsedAttributes:Cfe}});var jBn=I((Utf,qBn)=>{"use strict";p();var{parseSetCookie:o_s}=UBn(),{stringify:s_s}=Ytr(),{webidl:ua}=MA(),{Headers:bit}=$J();function a_s(t){ua.argumentLengthCheck(arguments,1,"getCookies"),ua.brandCheck(t,bit,{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(a_s,"getCookies");function c_s(t,e,r){ua.brandCheck(t,bit,{strict:!1});let n="deleteCookie";ua.argumentLengthCheck(arguments,2,n),e=ua.converters.DOMString(e,n,"name"),r=ua.converters.DeleteCookieAttributes(r),QBn(t,{name:e,value:"",expires:new Date(0),...r})}a(c_s,"deleteCookie");function l_s(t){ua.argumentLengthCheck(arguments,1,"getSetCookies"),ua.brandCheck(t,bit,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>o_s(r)):[]}a(l_s,"getSetCookies");function QBn(t,e){ua.argumentLengthCheck(arguments,2,"setCookie"),ua.brandCheck(t,bit,{strict:!1}),e=ua.converters.Cookie(e);let r=s_s(e);r&&t.append("Set-Cookie",r)}a(QBn,"setCookie");ua.converters.DeleteCookieAttributes=ua.dictionaryConverter([{converter:ua.nullableConverter(ua.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:ua.nullableConverter(ua.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);ua.converters.Cookie=ua.dictionaryConverter([{converter:ua.converters.DOMString,key:"name"},{converter:ua.converters.DOMString,key:"value"},{converter:ua.nullableConverter(t=>typeof t=="number"?ua.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:ua.nullableConverter(ua.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:ua.nullableConverter(ua.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:ua.nullableConverter(ua.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:ua.nullableConverter(ua.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:ua.nullableConverter(ua.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:ua.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:ua.sequenceConverter(ua.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);qBn.exports={getCookies:a_s,deleteCookie:c_s,getSetCookies:l_s,setCookie:QBn}});var Sfe=I((jtf,GBn)=>{"use strict";p();var{webidl:pi}=MA(),{kEnumerableProperty:tb}=Us(),{kConstruct:HBn}=Fd(),{MessagePort:u_s}=require("node:worker_threads"),bfe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===HBn){super(arguments[1],arguments[2]),pi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";pi.argumentLengthCheck(arguments,1,n),e=pi.converters.DOMString(e,n,"type"),r=pi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,pi.util.markAsUncloneable(this)}get data(){return pi.brandCheck(this,t),this.#e.data}get origin(){return pi.brandCheck(this,t),this.#e.origin}get lastEventId(){return pi.brandCheck(this,t),this.#e.lastEventId}get source(){return pi.brandCheck(this,t),this.#e.source}get ports(){return pi.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 pi.brandCheck(this,t),pi.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(HBn,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:d_s}=bfe;delete bfe.createFastMessageEvent;var Sit=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";pi.argumentLengthCheck(arguments,1,n),e=pi.converters.DOMString(e,n,"type"),r=pi.converters.CloseEventInit(r),super(e,r),this.#e=r,pi.util.markAsUncloneable(this)}get wasClean(){return pi.brandCheck(this,t),this.#e.wasClean}get code(){return pi.brandCheck(this,t),this.#e.code}get reason(){return pi.brandCheck(this,t),this.#e.reason}},Tit=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";pi.argumentLengthCheck(arguments,1,n),super(e,r),pi.util.markAsUncloneable(this),e=pi.converters.DOMString(e,n,"type"),r=pi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return pi.brandCheck(this,t),this.#e.message}get filename(){return pi.brandCheck(this,t),this.#e.filename}get lineno(){return pi.brandCheck(this,t),this.#e.lineno}get colno(){return pi.brandCheck(this,t),this.#e.colno}get error(){return pi.brandCheck(this,t),this.#e.error}};Object.defineProperties(bfe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:tb,origin:tb,lastEventId:tb,source:tb,ports:tb,initMessageEvent:tb});Object.defineProperties(Sit.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:tb,code:tb,wasClean:tb});Object.defineProperties(Tit.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:tb,filename:tb,lineno:tb,colno:tb,error:tb});pi.converters.MessagePort=pi.interfaceConverter(u_s);pi.converters["sequence"]=pi.sequenceConverter(pi.converters.MessagePort);var Ktr=[{key:"bubbles",converter:pi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:pi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:pi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];pi.converters.MessageEventInit=pi.dictionaryConverter([...Ktr,{key:"data",converter:pi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:pi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:pi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:pi.nullableConverter(pi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:pi.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);pi.converters.CloseEventInit=pi.dictionaryConverter([...Ktr,{key:"wasClean",converter:pi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:pi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:pi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);pi.converters.ErrorEventInit=pi.dictionaryConverter([...Ktr,{key:"message",converter:pi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:pi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:pi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:pi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:pi.converters.any}]);GBn.exports={MessageEvent:bfe,CloseEvent:Sit,ErrorEvent:Tit,createFastMessageEvent:d_s}});var JJ=I(($tf,$Bn)=>{"use strict";p();var f_s="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",p_s={enumerable:!0,writable:!1,configurable:!1},h_s={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},m_s={NOT_SENT:0,PROCESSING:1,SENT:2},g_s={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},A_s=2**16-1,y_s={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},E_s=Buffer.allocUnsafe(0),__s={string:1,typedArray:2,arrayBuffer:3,blob:4};$Bn.exports={uid:f_s,sentCloseFrameState:m_s,staticPropertyDescriptors:p_s,states:h_s,opcodes:g_s,maxUnsigned16Bit:A_s,parserStates:y_s,emptyBuffer:E_s,sendHints:__s}});var SPe=I((Wtf,VBn)=>{"use strict";p();VBn.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 xPe=I((Ytf,tLn)=>{"use strict";p();var{kReadyState:TPe,kController:v_s,kResponse:C_s,kBinaryType:b_s,kWebSocketURL:S_s}=SPe(),{states:IPe,opcodes:gj}=JJ(),{ErrorEvent:T_s,createFastMessageEvent:I_s}=Sfe(),{isUtf8:x_s}=require("node:buffer"),{collectASequenceOfCodePointsFast:w_s,removeHTTPWhitespace:WBn}=JC();function R_s(t){return t[TPe]===IPe.CONNECTING}a(R_s,"isConnecting");function P_s(t){return t[TPe]===IPe.OPEN}a(P_s,"isEstablished");function k_s(t){return t[TPe]===IPe.CLOSING}a(k_s,"isClosing");function D_s(t){return t[TPe]===IPe.CLOSED}a(D_s,"isClosed");function Jtr(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(Jtr,"fireEvent");function N_s(t,e,r){if(t[TPe]!==IPe.OPEN)return;let n;if(e===gj.TEXT)try{n=eLn(r)}catch{YBn(t,"Received invalid UTF-8 in text frame.");return}else e===gj.BINARY&&(t[b_s]==="blob"?n=new Blob([r]):n=M_s(r));Jtr("message",t,I_s,{origin:t[S_s].origin,data:n})}a(N_s,"websocketMessageReceived");function M_s(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(M_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 B_s(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(B_s,"isValidStatusCode");function YBn(t,e){let{[v_s]:r,[C_s]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&Jtr("error",t,(o,s)=>new T_s(o,s),{error:new Error(e),message:e})}a(YBn,"failWebsocketConnection");function KBn(t){return t===gj.CLOSE||t===gj.PING||t===gj.PONG}a(KBn,"isControlFrame");function JBn(t){return t===gj.CONTINUATION}a(JBn,"isContinuationFrame");function ZBn(t){return t===gj.TEXT||t===gj.BINARY}a(ZBn,"isTextBinaryFrame");function L_s(t){return ZBn(t)||JBn(t)||KBn(t)}a(L_s,"isValidOpcode");function F_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(U_s,"isValidClientWindowBits");var XBn=typeof process.versions.icu=="string",zBn=XBn?new TextDecoder("utf-8",{fatal:!0}):void 0,eLn=XBn?zBn.decode.bind(zBn):function(t){if(x_s(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};tLn.exports={isConnecting:R_s,isEstablished:P_s,isClosing:k_s,isClosed:D_s,fireEvent:Jtr,isValidSubprotocol:O_s,isValidStatusCode:B_s,failWebsocketConnection:YBn,websocketMessageReceived:N_s,utf8Decode:eLn,isControlFrame:KBn,isContinuationFrame:JBn,isTextBinaryFrame:ZBn,isValidOpcode:L_s,parseExtensions:F_s,isValidClientWindowBits:U_s}});var xit=I((Ztf,rLn)=>{"use strict";p();var{maxUnsigned16Bit:Q_s}=JJ(),Iit=16386,Ztr,wPe=null,Tfe=Iit;try{Ztr=require("node:crypto")}catch{Ztr={randomFillSync:a(function(e,r,n){for(let o=0;oQ_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:j_s,states:RPe,sentCloseFrameState:wit,emptyBuffer:H_s,opcodes:G_s}=JJ(),{kReadyState:PPe,kSentClose:Rit,kByteParser:iLn,kReceivedClose:nLn,kResponse:oLn}=SPe(),{fireEvent:$_s,failWebsocketConnection:Aj,isClosing:V_s,isClosed:W_s,isEstablished:z_s,parseExtensions:Y_s}=xPe(),{channels:Ife}=Lde(),{CloseEvent:K_s}=Sfe(),{makeRequest:J_s}=yfe(),{fetching:Z_s}=_Pe(),{Headers:X_s,getHeadersList:evs}=$J(),{getDecodeSplit:tvs}=XS(),{WebsocketFrameSend:rvs}=xit(),trr;try{trr=require("node:crypto")}catch{}function nvs(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=J_s({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=evs(new X_s(s.headers));l.headersList=h}let u=trr.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"),Z_s({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){Aj(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){Aj(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Aj(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Aj(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=trr.createHash("sha1").update(u+j_s).digest("base64");if(m!==g){Aj(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=Y_s(A),!y.has("permessage-deflate"))){Aj(n,"Sec-WebSocket-Extensions header does not match.");return}let E=h.headersList.get("Sec-WebSocket-Protocol");if(E!==null&&!tvs("sec-websocket-protocol",l.headersList).includes(E)){Aj(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",sLn),h.socket.on("close",aLn),h.socket.on("error",cLn),Ife.open.hasSubscribers&&Ife.open.publish({address:h.socket.address(),protocol:E,extensions:A}),o(h,y)}})}a(nvs,"establishWebSocketConnection");function ivs(t,e,r,n){if(!(V_s(t)||W_s(t)))if(!z_s(t))Aj(t,"Connection was closed before it was established."),t[PPe]=RPe.CLOSING;else if(t[Rit]===wit.NOT_SENT){t[Rit]=wit.PROCESSING;let o=new rvs;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=H_s,t[oLn].socket.write(o.createFrame(G_s.CLOSE)),t[Rit]=wit.SENT,t[PPe]=RPe.CLOSING}else t[PPe]=RPe.CLOSING}a(ivs,"closeWebSocketConnection");function sLn(t){this.ws[iLn].write(t)||this.pause()}a(sLn,"onSocketData");function aLn(){let{ws:t}=this,{[oLn]:e}=t;e.socket.off("data",sLn),e.socket.off("close",aLn),e.socket.off("error",cLn);let r=t[Rit]===wit.SENT&&t[nLn],n=1005,o="",s=t[iLn].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[nLn]||(n=1006),t[PPe]=RPe.CLOSED,$_s("close",t,(c,l)=>new K_s(c,l),{wasClean:r,code:n,reason:o}),Ife.close.hasSubscribers&&Ife.close.publish({websocket:t,code:n,reason:o})}a(aLn,"onSocketClose");function cLn(t){let{ws:e}=this;e[PPe]=RPe.CLOSING,Ife.socketError.hasSubscribers&&Ife.socketError.publish(t),this.destroy()}a(cLn,"onSocketError");lLn.exports={establishWebSocketConnection:nvs,closeWebSocketConnection:ivs}});var fLn=I((irf,dLn)=>{"use strict";p();var{createInflateRaw:ovs,Z_DEFAULT_WINDOWBITS:svs}=require("node:zlib"),{isValidClientWindowBits:avs}=xPe(),{MessageSizeExceededError:uLn}=yc(),cvs=Buffer.from([0,0,255,255]),Pit=Symbol("kBuffer"),kPe=Symbol("kLength"),lvs=4*1024*1024,nrr=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 uLn);return}if(!this.#e){let o=svs;if(this.#t.serverMaxWindowBits){if(!avs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=ovs({windowBits:o})}catch(s){n(s);return}this.#e[Pit]=[],this.#e[kPe]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[kPe]+=s.length,this.#e[kPe]>lvs){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new uLn)}return}this.#e[Pit].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(cvs),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[Pit],this.#e[kPe]);this.#e[Pit].length=0,this.#e[kPe]=0,this.#n=null,n(null,o)})}};dLn.exports={PerMessageDeflate:nrr}});var CLn=I((arf,vLn)=>{"use strict";p();var{Writable:uvs}=require("node:stream"),dvs=require("node:assert"),{parserStates:rb,opcodes:xfe,states:fvs,emptyBuffer:pLn,sentCloseFrameState:hLn}=JJ(),{kReadyState:pvs,kSentClose:mLn,kResponse:gLn,kReceivedClose:ALn}=SPe(),{channels:kit}=Lde(),{isValidStatusCode:hvs,isValidOpcode:mvs,failWebsocketConnection:sT,websocketMessageReceived:yLn,utf8Decode:gvs,isControlFrame:ELn,isTextBinaryFrame:irr,isContinuationFrame:Avs}=xPe(),{WebsocketFrameSend:_Ln}=xit(),{closeWebSocketConnection:yvs}=rrr(),{PerMessageDeflate:Evs}=fLn(),orr=class extends uvs{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=rb.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 Evs(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===rb.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!==xfe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!mvs(o))return sT(this.ws,"Invalid opcode received"),e();if(s)return sT(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){sT(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){sT(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!irr(o)){sT(this.ws,"Invalid frame type was fragmented.");return}if(irr(o)&&this.#o.length>0){sT(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){sT(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&ELn(o)){sT(this.ws,"Control frame either too large or fragmented");return}if(Avs(o)&&this.#o.length===0&&!this.#i.compressed){sT(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=rb.READ_DATA):l===126?this.#n=rb.PAYLOADLENGTH_16:l===127&&(this.#n=rb.PAYLOADLENGTH_64),irr(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===rb.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=rb.READ_DATA}else if(this.#n===rb.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){sT(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=rb.READ_DATA}else if(this.#n===rb.READ_DATA){if(this.#t{if(n){sT(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=rb.INFO,this.#r=!0,this.run(e);return}yLn(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=rb.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);yLn(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=rb.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return pLn;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){dvs(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!hvs(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=gvs(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===xfe.CLOSE){if(n===1)return sT(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 yvs(this.ws,o,s,s.length),sT(this.ws,s),!1}if(this.ws[mLn]!==hLn.SENT){let o=pLn;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new _Ln(o);this.ws[gLn].socket.write(s.createFrame(xfe.CLOSE),c=>{c||(this.ws[mLn]=hLn.SENT)})}return this.ws[pvs]=fvs.CLOSING,this.ws[ALn]=!0,!1}else if(r===xfe.PING){if(!this.ws[ALn]){let o=new _Ln(e);this.ws[gLn].socket.write(o.createFrame(xfe.PONG)),kit.ping.hasSubscribers&&kit.ping.publish({payload:e})}}else r===xfe.PONG&&kit.pong.hasSubscribers&&kit.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};vLn.exports={ByteParser:orr}});var xLn=I((urf,ILn)=>{"use strict";p();var{WebsocketFrameSend:_vs}=xit(),{opcodes:bLn,sendHints:wfe}=JJ(),vvs=her(),SLn=Buffer[Symbol.species],srr=class{static{a(this,"SendQueue")}#e=new vvs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==wfe.blob){let s=TLn(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=TLn(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 TLn(t,e){return new _vs(Cvs(t,e)).createFrame(e===wfe.string?bLn.TEXT:bLn.BINARY)}a(TLn,"createFrame");function Cvs(t,e){switch(e){case wfe.string:return Buffer.from(t);case wfe.arrayBuffer:case wfe.blob:return new SLn(t);case wfe.typedArray:return new SLn(t.buffer,t.byteOffset,t.byteLength)}}a(Cvs,"toBuffer");ILn.exports={SendQueue:srr}});var BLn=I((prf,OLn)=>{"use strict";p();var{webidl:ao}=MA(),{URLSerializer:bvs}=JC(),{environmentSettingsObject:wLn}=XS(),{staticPropertyDescriptors:yj,states:DPe,sentCloseFrameState:Svs,sendHints:Dit}=JJ(),{kWebSocketURL:RLn,kReadyState:arr,kController:Tvs,kBinaryType:Nit,kResponse:PLn,kSentClose:Ivs,kByteParser:xvs}=SPe(),{isConnecting:wvs,isEstablished:Rvs,isClosing:Pvs,isValidSubprotocol:kvs,fireEvent:kLn}=xPe(),{establishWebSocketConnection:Dvs,closeWebSocketConnection:DLn}=rrr(),{ByteParser:Nvs}=CLn(),{kEnumerableProperty:Sw,isBlobLike:NLn}=Us(),{getGlobalDispatcher:Mvs}=znt(),{types:MLn}=require("node:util"),{ErrorEvent:Ovs,CloseEvent:Bvs}=Sfe(),{SendQueue:Lvs}=xLn(),aT=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(),ao.util.markAsUncloneable(this);let n="WebSocket constructor";ao.argumentLengthCheck(arguments,1,n);let o=ao.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=ao.converters.USVString(e,n,"url"),r=o.protocols;let s=wLn.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=>kvs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[RLn]=new URL(c.href);let l=wLn.settingsObject;this[Tvs]=Dvs(c,r,l,this,(u,d)=>this.#o(u,d),o),this[arr]=t.CONNECTING,this[Ivs]=Svs.NOT_SENT,this[Nit]="blob"}close(e=void 0,r=void 0){ao.brandCheck(this,t);let n="WebSocket.close";if(e!==void 0&&(e=ao.converters["unsigned short"](e,n,"code",{clamp:!0})),r!==void 0&&(r=ao.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");DLn(this,e,r,o)}send(e){ao.brandCheck(this,t);let r="WebSocket.send";if(ao.argumentLengthCheck(arguments,1,r),e=ao.converters.WebSocketSendData(e,r,"data"),wvs(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!Rvs(this)||Pvs(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},Dit.string)}else MLn.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Dit.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Dit.typedArray)):NLn(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Dit.blob))}get readyState(){return ao.brandCheck(this,t),this[arr]}get bufferedAmount(){return ao.brandCheck(this,t),this.#t}get url(){return ao.brandCheck(this,t),bvs(this[RLn])}get extensions(){return ao.brandCheck(this,t),this.#n}get protocol(){return ao.brandCheck(this,t),this.#r}get onopen(){return ao.brandCheck(this,t),this.#e.open}set onopen(e){ao.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 ao.brandCheck(this,t),this.#e.error}set onerror(e){ao.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 ao.brandCheck(this,t),this.#e.close}set onclose(e){ao.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 ao.brandCheck(this,t),this.#e.message}set onmessage(e){ao.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 ao.brandCheck(this,t),this[Nit]}set binaryType(e){ao.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[Nit]="blob":this[Nit]=e}#o(e,r){this[PLn]=e;let n=new Nvs(this,r);n.on("drain",Fvs),n.on("error",Uvs.bind(this)),e.socket.ws=this,this[xvs]=n,this.#i=new Lvs(e.socket),this[arr]=DPe.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),kLn("open",this)}};aT.CONNECTING=aT.prototype.CONNECTING=DPe.CONNECTING;aT.OPEN=aT.prototype.OPEN=DPe.OPEN;aT.CLOSING=aT.prototype.CLOSING=DPe.CLOSING;aT.CLOSED=aT.prototype.CLOSED=DPe.CLOSED;Object.defineProperties(aT.prototype,{CONNECTING:yj,OPEN:yj,CLOSING:yj,CLOSED:yj,url:Sw,readyState:Sw,bufferedAmount:Sw,onopen:Sw,onerror:Sw,onclose:Sw,close:Sw,onmessage:Sw,binaryType:Sw,send:Sw,extensions:Sw,protocol:Sw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(aT,{CONNECTING:yj,OPEN:yj,CLOSING:yj,CLOSED:yj});ao.converters["sequence"]=ao.sequenceConverter(ao.converters.DOMString);ao.converters["DOMString or sequence"]=function(t,e,r){return ao.util.Type(t)==="Object"&&Symbol.iterator in t?ao.converters["sequence"](t):ao.converters.DOMString(t,e,r)};ao.converters.WebSocketInit=ao.dictionaryConverter([{key:"protocols",converter:ao.converters["DOMString or sequence"],defaultValue:a(()=>new Array(0),"defaultValue")},{key:"dispatcher",converter:ao.converters.any,defaultValue:a(()=>Mvs(),"defaultValue")},{key:"headers",converter:ao.nullableConverter(ao.converters.HeadersInit)}]);ao.converters["DOMString or sequence or WebSocketInit"]=function(t){return ao.util.Type(t)==="Object"&&!(Symbol.iterator in t)?ao.converters.WebSocketInit(t):{protocols:ao.converters["DOMString or sequence"](t)}};ao.converters.WebSocketSendData=function(t){if(ao.util.Type(t)==="Object"){if(NLn(t))return ao.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||MLn.isArrayBuffer(t))return ao.converters.BufferSource(t)}return ao.converters.USVString(t)};function Fvs(){this.ws[PLn].socket.resume()}a(Fvs,"onParserDrain");function Uvs(t){let e,r;t instanceof Bvs?(e=t.reason,r=t.code):e=t.message,kLn("error",this,()=>new Ovs("error",{error:t,message:e})),DLn(this,r)}a(Uvs,"onParserError");OLn.exports={WebSocket:aT}});var crr=I((grf,LLn)=>{"use strict";p();function Qvs(t){return t.indexOf("\0")===-1}a(Qvs,"isValidLastEventId");function qvs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(qvs,"isASCIINumber");function jvs(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(jvs,"delay");LLn.exports={isValidLastEventId:Qvs,isASCIINumber:qvs,delay:jvs}});var qLn=I((Erf,QLn)=>{"use strict";p();var{Transform:Hvs}=require("node:stream"),{isASCIINumber:FLn,isValidLastEventId:ULn}=crr(),SF=[239,187,191],lrr=10,Mit=13,Gvs=58,$vs=32,urr=class extends Hvs{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]===SF[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===SF[0]&&this.buffer[1]===SF[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===SF[0]&&this.buffer[1]===SF[1]&&this.buffer[2]===SF[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===SF[0]&&this.buffer[1]===SF[1]&&this.buffer[2]===SF[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&FLn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&ULn(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}}};QLn.exports={EventSourceStream:urr}});var YLn=I((Crf,zLn)=>{"use strict";p();var{pipeline:Vvs}=require("node:stream"),{fetching:Wvs}=_Pe(),{makeRequest:zvs}=yfe(),{webidl:TF}=MA(),{EventSourceStream:Yvs}=qLn(),{parseMIMEType:Kvs}=JC(),{createFastMessageEvent:Jvs}=Sfe(),{isNetworkError:jLn}=yPe(),{delay:Zvs}=crr(),{kEnumerableProperty:ZJ}=Us(),{environmentSettingsObject:HLn}=XS(),GLn=!1,$Ln=3e3,NPe=0,VLn=1,MPe=2,Xvs="anonymous",eCs="use-credentials",Rfe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=NPe;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),TF.util.markAsUncloneable(this);let n="EventSource constructor";TF.argumentLengthCheck(arguments,1,n),GLn||(GLn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=TF.converters.USVString(e,n,"url"),r=TF.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:$Ln};let o=HLn,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=Xvs;r.withCredentials&&(c=eCs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=HLn.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=zvs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===MPe)return;this.#n=NPe;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{jLn(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(jLn(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?Kvs(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=VLn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new Yvs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(Jvs(u.type,u.options))},"push")});Vvs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=Wvs(e)}async#u(){this.#n!==MPe&&(this.#n=NPe,this.dispatchEvent(new Event("error")),await Zvs(this.#a.reconnectionTime),this.#n===NPe&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){TF.brandCheck(this,t),this.#n!==MPe&&(this.#n=MPe,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}},WLn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:NPe,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:VLn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:MPe,writable:!1}};Object.defineProperties(Rfe,WLn);Object.defineProperties(Rfe.prototype,WLn);Object.defineProperties(Rfe.prototype,{close:ZJ,onerror:ZJ,onmessage:ZJ,onopen:ZJ,readyState:ZJ,url:ZJ,withCredentials:ZJ});TF.converters.EventSourceInitDict=TF.dictionaryConverter([{key:"withCredentials",converter:TF.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:TF.converters.any}]);zLn.exports={EventSource:Rfe,defaultReconnectionTime:$Ln}});var XLn=I((Trf,Ki)=>{"use strict";p();var tCs=nfe(),KLn=FRe(),rCs=ife(),nCs=WMn(),iCs=ofe(),oCs=Mer(),sCs=AOn(),aCs=bOn(),JLn=yc(),Bit=Us(),{InvalidArgumentError:Oit}=JLn,Pfe=l5n(),cCs=QRe(),lCs=mtr(),uCs=$5n(),dCs=ytr(),fCs=rtr(),pCs=Fnt(),{getGlobalDispatcher:ZLn,setGlobalDispatcher:hCs}=znt(),mCs=Ynt(),gCs=xnt(),ACs=wnt();Object.assign(KLn.prototype,Pfe);Ki.exports.Dispatcher=KLn;Ki.exports.Client=tCs;Ki.exports.Pool=rCs;Ki.exports.BalancedPool=nCs;Ki.exports.Agent=iCs;Ki.exports.ProxyAgent=oCs;Ki.exports.EnvHttpProxyAgent=sCs;Ki.exports.RetryAgent=aCs;Ki.exports.RetryHandler=pCs;Ki.exports.DecoratorHandler=mCs;Ki.exports.RedirectHandler=gCs;Ki.exports.createRedirectInterceptor=ACs;Ki.exports.interceptors={redirect:Z5n(),retry:e4n(),dump:r4n(),dns:o4n()};Ki.exports.buildConnector=cCs;Ki.exports.errors=JLn;Ki.exports.util={parseHeaders:Bit.parseHeaders,headerNameToString:Bit.headerNameToString};function OPe(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 Oit("invalid url");if(r!=null&&typeof r!="object")throw new Oit("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new Oit("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Bit.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Bit.parseURL(e);let{agent:o,dispatcher:s=ZLn()}=r;if(o)throw new Oit("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(OPe,"makeDispatcher");Ki.exports.setGlobalDispatcher=hCs;Ki.exports.getGlobalDispatcher=ZLn;var yCs=_Pe().fetch;Ki.exports.fetch=a(async function(e,r=void 0){try{return await yCs(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");Ki.exports.Headers=$J().Headers;Ki.exports.Response=yPe().Response;Ki.exports.Request=yfe().Request;Ki.exports.FormData=WRe().FormData;Ki.exports.File=globalThis.File??require("node:buffer").File;Ki.exports.FileReader=vBn().FileReader;var{setGlobalOrigin:ECs,getGlobalOrigin:_Cs}=OXt();Ki.exports.setGlobalOrigin=ECs;Ki.exports.getGlobalOrigin=_Cs;var{CacheStorage:vCs}=PBn(),{kConstruct:CCs}=git();Ki.exports.caches=new vCs(CCs);var{deleteCookie:bCs,getCookies:SCs,getSetCookies:TCs,setCookie:ICs}=jBn();Ki.exports.deleteCookie=bCs;Ki.exports.getCookies=SCs;Ki.exports.getSetCookies=TCs;Ki.exports.setCookie=ICs;var{parseMIMEType:xCs,serializeAMimeType:wCs}=JC();Ki.exports.parseMIMEType=xCs;Ki.exports.serializeAMimeType=wCs;var{CloseEvent:RCs,ErrorEvent:PCs,MessageEvent:kCs}=Sfe();Ki.exports.WebSocket=BLn().WebSocket;Ki.exports.CloseEvent=RCs;Ki.exports.ErrorEvent=PCs;Ki.exports.MessageEvent=kCs;Ki.exports.request=OPe(Pfe.request);Ki.exports.stream=OPe(Pfe.stream);Ki.exports.pipeline=OPe(Pfe.pipeline);Ki.exports.connect=OPe(Pfe.connect);Ki.exports.upgrade=OPe(Pfe.upgrade);Ki.exports.MockClient=lCs;Ki.exports.MockPool=dCs;Ki.exports.MockAgent=uCs;Ki.exports.mockErrors=fCs;var{EventSource:DCs}=YLn();Ki.exports.EventSource=DCs});var ps=I((wrf,e3n)=>{p();e3n.exports={options:{usePureJavaScript:!1}}});var n3n=I((Prf,r3n)=>{p();var drr={};r3n.exports=drr;var t3n={};drr.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};drr.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=t3n[e];if(!r){r=t3n[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 oc=I((Nrf,a3n)=>{p();var i3n=ps(),o3n=n3n(),nt=a3n.exports=i3n.util=i3n.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 BPe(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(BPe,"_checkBitsParam");nt.ByteBuffer=frr;function frr(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;rMCs&&(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){BPe(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){BPe(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 BPe(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 Ej="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_j=[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],s3n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";nt.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=Ej.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=Ej.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":Ej.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:o3n.encode,decode:o3n.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+=Ej.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=Ej.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":Ej.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,s3n,e)};nt.binary.base58.decode=function(t,e){return nt.binary.baseN.decode(t,s3n,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(BCs,arguments,o)};nt.getItem=function(t,e,r,n){return Lit(LCs,arguments,n)};nt.removeItem=function(t,e,r,n){Lit(FCs,arguments,n)};nt.clearItems=function(t,e,r){Lit(UCs,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 Eg=ps();oc();c3n.exports=Eg.cipher=Eg.cipher||{};Eg.cipher.algorithms=Eg.cipher.algorithms||{};Eg.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Eg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Eg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Eg.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Eg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Eg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Eg.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Eg.cipher.algorithms[t]=e};Eg.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Eg.cipher.algorithms?Eg.cipher.algorithms[t]:null};var mrr=Eg.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)};mrr.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=Eg.util.createBuffer(),this.output=t.output||Eg.util.createBuffer(),this.mode.start(e)};mrr.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()};mrr.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 Arr=I((Frf,l3n)=>{p();var _g=ps();oc();_g.cipher=_g.cipher||{};var Ys=l3n.exports=_g.cipher.modes=_g.cipher.modes||{};Ys.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Ys.ecb.prototype.start=function(t){};Ys.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};Ys.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Ys.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=Uit(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Ys.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};Ys.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=_g.util.createBuffer(),this._partialBytes=0};Ys.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Uit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Ys.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Ys.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Ys.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=_g.util.createBuffer(),this._partialBytes=0};Ys.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Uit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Ys.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Ys.ofb.prototype.decrypt=Ys.ofb.prototype.encrypt;Ys.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=_g.util.createBuffer(),this._partialBytes=0};Ys.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Uit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Ys.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}Qit(this._inBlock)};Ys.ctr.prototype.decrypt=Ys.ctr.prototype.encrypt;Ys.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=_g.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Ys.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=_g.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=_g.util.createBuffer(t.additionalData):r=_g.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=_g.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(grr(n*8)))}this._inBlock=this._j0.slice(0),Qit(this._inBlock),this._partialBytes=0,r=_g.util.createBuffer(r),this._aDataLength=grr(r.length()*8);var o=r.length()%this.blockSize;for(o&&r.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};Ys.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Qit(this._inBlock)};Ys.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Qit(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var o=0;o0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};Ys.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,o=t[n]>>>(7-r%8)*4&15,s=this._m[r][o];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};Ys.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};Ys.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,o=16*r,s=new Array(o),c=0;c>>1,o=new Array(r);o[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(o[2*s],o[s]=[]),s>>=1;for(s=2;s4){var r=t;t=_g.util.createBuffer();for(var n=0;n{p();var Cu=ps();Fit();Arr();oc();p3n.exports=Cu.aes=Cu.aes||{};Cu.aes.startEncrypting=function(t,e,r,n){var o=qit({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};Cu.aes.createEncryptionCipher=function(t,e){return qit({key:t,output:null,decrypt:!1,mode:e})};Cu.aes.startDecrypting=function(t,e,r,n){var o=qit({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};Cu.aes.createDecryptionCipher=function(t,e){return qit({key:t,output:null,decrypt:!0,mode:e})};Cu.aes.Algorithm=function(t,e){_rr||d3n();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return Err(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return Err(r._w,n,o,!0)},"decrypt")}}),r._init=!1};Cu.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=Cu.util.createBuffer(e);else if(Cu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Cu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,J_[r]=l,yrr[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)XJ[h][r]=d,g2[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(d3n,"initialize");function f3n(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=kfe*c,u=s;u>>16&255]<<24^J_[n>>>8&255]<<16^J_[n&255]<<8^J_[n>>>24]^u3n[o]<<24,o++):s>6&&u%s===4&&(n=J_[n>>>24]<<24^J_[n>>>16&255]<<16^J_[n>>>8&255]<<8^J_[n&255]),r[u]=r[u-s]^n;if(e){var d,f=g2[0],h=g2[1],m=g2[2],g=g2[3],A=r.slice(0);l=r.length;for(var u=0,y=l-kfe;u>>24]]^h[J_[d>>>16&255]]^m[J_[d>>>8&255]]^g[J_[d&255]];r=A}return r}a(f3n,"_expandKey");function Err(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=g2[0],c=g2[1],l=g2[2],u=g2[3],d=yrr):(s=XJ[0],c=XJ[1],l=XJ[2],u=XJ[3],d=J_);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(Err,"_updateBlock");function qit(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Cu.cipher.createDecipher(r,t.key):n=Cu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Cu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(qit,"_createCipher")});var Cj=I((Grf,h3n)=>{p();var LPe=ps();LPe.pki=LPe.pki||{};var vrr=h3n.exports=LPe.pki.oids=LPe.oids=LPe.oids||{};function ir(t,e){vrr[t]=e,vrr[e]=t}a(ir,"_IN");function Lc(t,e){vrr[t]=e}a(Lc,"_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");Lc("2.5.29.1","authorityKeyIdentifier");Lc("2.5.29.2","keyAttributes");Lc("2.5.29.3","certificatePolicies");Lc("2.5.29.4","keyUsageRestriction");Lc("2.5.29.5","policyMapping");Lc("2.5.29.6","subtreesConstraint");Lc("2.5.29.7","subjectAltName");Lc("2.5.29.8","issuerAltName");Lc("2.5.29.9","subjectDirectoryAttributes");Lc("2.5.29.10","basicConstraints");Lc("2.5.29.11","nameConstraints");Lc("2.5.29.12","policyConstraints");Lc("2.5.29.13","basicConstraints");ir("2.5.29.14","subjectKeyIdentifier");ir("2.5.29.15","keyUsage");Lc("2.5.29.16","privateKeyUsagePeriod");ir("2.5.29.17","subjectAltName");ir("2.5.29.18","issuerAltName");ir("2.5.29.19","basicConstraints");Lc("2.5.29.20","cRLNumber");Lc("2.5.29.21","cRLReason");Lc("2.5.29.22","expirationDate");Lc("2.5.29.23","instructionCode");Lc("2.5.29.24","invalidityDate");Lc("2.5.29.25","cRLDistributionPoints");Lc("2.5.29.26","issuingDistributionPoint");Lc("2.5.29.27","deltaCRLIndicator");Lc("2.5.29.28","issuingDistributionPoint");Lc("2.5.29.29","certificateIssuer");Lc("2.5.29.30","nameConstraints");ir("2.5.29.31","cRLDistributionPoints");ir("2.5.29.32","certificatePolicies");Lc("2.5.29.33","policyMappings");Lc("2.5.29.34","policyConstraints");ir("2.5.29.35","authorityKeyIdentifier");Lc("2.5.29.36","policyConstraints");ir("2.5.29.37","extKeyUsage");Lc("2.5.29.46","freshestCRL");Lc("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 A2=I((Wrf,g3n)=>{p();var id=ps();oc();Cj();var nn=g3n.exports=id.asn1=id.asn1||{};nn.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};nn.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};nn.maxDepth=256;nn.create=function(t,e,r,n,o){if(id.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(FPe,"_checkBufferLength");var QCs=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;FPe(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");nn.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=nn.maxDepth),typeof t=="string"&&(t=id.util.createBuffer(t));var r=t.length(),n=jit(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 jit(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;FPe(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=QCs(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(FPe(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(jit(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(jit(t,u,r+1,n)),e-=o-t.length(),u-=o-t.length();if(f===void 0&&c===nn.Class.UNIVERSAL&&l===nn.Type.BITSTRING&&(h=t.bytes(u)),f===void 0&&n.decodeBitStrings&&c===nn.Class.UNIVERSAL&&l===nn.Type.BITSTRING&&u>1){var g=t.read,A=e,y=0;if(l===nn.Type.BITSTRING&&(FPe(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var E={strict:!0,decodeBitStrings:!0},_=jit(t,e,r+1,E),v=o-t.length();e-=v,l==nn.Type.BITSTRING&&v++;var b=_.tagClass;v===u&&(b===nn.Class.UNIVERSAL||b===nn.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===nn.Type.BMPSTRING)for(f="";u>0;u-=2)FPe(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 nn.create(c,l,m,f,T)}a(jit,"_fromDer");nn.toDer=function(t){var e=id.util.createBuffer(),r=t.tagClass|t.type,n=id.util.createBuffer(),o=!1;if("bitStringContents"in t&&(o=!0,t.original&&(o=nn.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};nn.oidToDer=function(t){var e=t.split("."),r=id.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};nn.derToOid=function(t){var e;typeof t=="string"&&(t=id.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};nn.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};nn.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};nn.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};nn.derToInteger=function(t){typeof t=="string"&&(t=id.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)};nn.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&&id.util.isArray(e.value))for(var s=0,c=0;o&&c0&&(n+=` -`);for(var o="",s=0;s{"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+=` +`);for(var o="",s=0;s1?n+="0x"+id.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===nn.Type.OCTETSTRING)m3n.test(t.value)||(n+="("+t.value+") "),n+="0x"+id.util.bytesToHex(t.value);else if(t.type===nn.Type.UTF8)try{n+=id.util.decodeUtf8(t.value)}catch(f){if(f.message==="URI malformed")n+="0x"+id.util.bytesToHex(t.value)+" (malformed UTF8)";else throw f}else t.type===nn.Type.PRINTABLESTRING||t.type===nn.Type.IA5String?n+=t.value:m3n.test(t.value)?n+="0x"+id.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var d5=I((Krf,A3n)=>{p();var Hit=ps();A3n.exports=Hit.md=Hit.md||{};Hit.md.algorithms=Hit.md.algorithms||{}});var Nfe=I((Zrf,y3n)=>{p();var IF=ps();d5();oc();var qCs=y3n.exports=IF.hmac=IF.hmac||{};qCs.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 IF.md.algorithms)e=IF.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=IF.util.createBuffer(c);else if(IF.util.isArray(c)){var l=c;c=IF.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=IF.util.createBuffer(),n=IF.util.createBuffer(),d=c.length();for(var u=0;u{p();var f5=ps();d5();oc();var _3n=C3n.exports=f5.md5=f5.md5||{};f5.md.md5=f5.md.algorithms.md5=_3n;_3n.create=function(){v3n||jCs();var t=null,e=f5.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),E3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=f5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(Crr.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};E3n(f,r,o);var h=f5.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var Crr=null,Git=null,UPe=null,Mfe=null,v3n=!1;function jCs(){Crr="\x80",Crr+=f5.util.fillString("\0",64),Git=[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],UPe=[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],Mfe=new Array(64);for(var t=0;t<64;++t)Mfe[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);v3n=!0}a(jCs,"_init");function E3n(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+Mfe[f]+e[f],d=UPe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+Mfe[f]+e[Git[f]],d=UPe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+Mfe[f]+e[Git[f]],d=UPe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+Mfe[f]+e[Git[f]],d=UPe[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(E3n,"_update")});var eZ=I((nnf,S3n)=>{p();var Wit=ps();oc();var b3n=S3n.exports=Wit.pem=Wit.pem||{};b3n.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+=Vit(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Vit(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Vit(n)),t.headers)for(var o=0;o1?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;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(Vit,"foldHeader");function HCs(t){return t.replace(/^\s+/,"")}a(HCs,"ltrim")});var QPe=I((snf,I3n)=>{p();var qd=ps();Fit();Arr();oc();I3n.exports=qd.des=qd.des||{};qd.des.startEncrypting=function(t,e,r,n){var o=zit({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};qd.des.createEncryptionCipher=function(t,e){return zit({key:t,output:null,decrypt:!1,mode:e})};qd.des.startDecrypting=function(t,e,r,n){var o=zit({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};qd.des.createDecryptionCipher=function(t,e){return zit({key:t,output:null,decrypt:!0,mode:e})};qd.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return T3n(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return T3n(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};qd.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=qd.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=ZCs(e),this._init=!0}};p5("DES-ECB",qd.cipher.modes.ecb);p5("DES-CBC",qd.cipher.modes.cbc);p5("DES-CFB",qd.cipher.modes.cfb);p5("DES-OFB",qd.cipher.modes.ofb);p5("DES-CTR",qd.cipher.modes.ctr);p5("3DES-ECB",qd.cipher.modes.ecb);p5("3DES-CBC",qd.cipher.modes.cbc);p5("3DES-CFB",qd.cipher.modes.cfb);p5("3DES-OFB",qd.cipher.modes.ofb);p5("3DES-CTR",qd.cipher.modes.ctr);function p5(t,e){var r=a(function(){return new qd.des.Algorithm(t,e)},"factory");qd.cipher.registerAlgorithm(t,r)}a(p5,"registerAlgorithm");var GCs=[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],$Cs=[-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],VCs=[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],WCs=[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],zCs=[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],YCs=[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],KCs=[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],JCs=[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 ZCs(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(ZCs,"_createKeys");function T3n(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^($Cs[g>>>24&63]|WCs[g>>>16&63]|YCs[g>>>8&63]|JCs[g&63]|GCs[A>>>24&63]|VCs[A>>>16&63]|zCs[A>>>8&63]|KCs[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(T3n,"_updateBlock");function zit(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=qd.cipher.createDecipher(r,t.key):n=qd.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof qd.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(zit,"_createCipher")});var Yit=I((lnf,x3n)=>{p();var Z_=ps();Nfe();d5();oc();var XCs=Z_.pkcs5=Z_.pkcs5||{},xF;Z_.util.isNodejs&&!Z_.options.usePureJavaScript&&(xF=require("crypto"));x3n.exports=Z_.pbkdf2=XCs.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),Z_.util.isNodejs&&!Z_.options.usePureJavaScript&&xF.pbkdf2&&(o===null||typeof o!="object")&&(xF.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?xF.pbkdf2Sync.length===4?xF.pbkdf2(t,e,r,n,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):xF.pbkdf2(t,e,r,n,o,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):xF.pbkdf2Sync.length===4?xF.pbkdf2Sync(t,e,r,n).toString("binary"):xF.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in Z_.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=Z_.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=Z_.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(Z_.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=Z_.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(Z_.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=Z_.util.xorBytes(m,g,c),A=g,++E,Z_.util.setImmediate(v);h+=y{p();var h5=ps();d5();oc();var R3n=D3n.exports=h5.sha256=h5.sha256||{};h5.md.sha256=h5.md.algorithms.sha256=R3n;R3n.create=function(){P3n||ebs();var t=null,e=h5.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),w3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=h5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(brr.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};w3n(h,r,o);var m=h5.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 brr=null,P3n=!1,k3n=null;function ebs(){brr="\x80",brr+=h5.util.fillString("\0",64),k3n=[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(ebs,"_init");function w3n(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+k3n[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(w3n,"_update")});var Trr=I((mnf,N3n)=>{p();var m5=ps();oc();var Kit=null;m5.util.isNodejs&&!m5.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Kit=require("crypto"));var tbs=N3n.exports=m5.prng=m5.prng||{};tbs.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=m5.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 m5.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)),m5.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=m5.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=m5.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=m5.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"),Kit?(e.seedFile=function(d,f){Kit.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return Kit.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 Tw=I((ynf,Irr)=>{p();var vg=ps();vj();Srr();Trr();oc();(function(){if(vg.random&&vg.random.getBytes){Irr.exports=vg.random;return}(function(t){var e={},r=new Array(4),n=vg.util.createBuffer();e.formatKey=function(h){var m=vg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),vg.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=vg.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 vg.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=vg.md.sha256;function o(){var h=vg.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=vg.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),vg.options.usePureJavaScript||!vg.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(!vg.random)vg.random=s;else for(var f in s)vg.random[f]=s[f];vg.random.createInstance=o,Irr.exports=vg.random})(typeof jQuery<"u"?jQuery:null)})()});var wrr=I((vnf,B3n)=>{p();var nb=ps();oc();var xrr=[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],M3n=[1,2,3,5],rbs=a(function(t,e){return t<>16-e},"rol"),nbs=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");B3n.exports=nb.rc2=nb.rc2||{};nb.rc2.expandKey=function(t,e){typeof t=="string"&&(t=nb.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(xrr[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,xrr[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,xrr[r.at(l+1)^r.at(l+s)]);return r};var O3n=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=nb.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]=rbs(A[d],M3n[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]=nbs(A[d],M3n[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");nb.rc2.startEncrypting=function(t,e,r){var n=nb.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};nb.rc2.createEncryptionCipher=function(t,e){return O3n(t,e,!0)};nb.rc2.startDecrypting=function(t,e,r){var n=nb.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};nb.rc2.createDecryptionCipher=function(t,e){return O3n(t,e,!1)}});var jPe=I((Snf,G3n)=>{p();var Rrr=ps();G3n.exports=Rrr.jsbn=Rrr.jsbn||{};var wF,ibs=0xdeadbeefcafe,L3n=(ibs&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");Rrr.jsbn.BigInteger=zt;function Ga(){return new zt(null)}a(Ga,"nbi");function obs(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(obs,"am1");function sbs(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(sbs,"am2");function F3n(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(F3n,"am3");typeof navigator>"u"?(zt.prototype.am=F3n,wF=28):L3n&&navigator.appName=="Microsoft Internet Explorer"?(zt.prototype.am=sbs,wF=30):L3n&&navigator.appName!="Netscape"?(zt.prototype.am=obs,wF=26):(zt.prototype.am=F3n,wF=28);zt.prototype.DB=wF;zt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(cbs,"bnpCopyTo");function lbs(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(lbs,"bnpFromInt");function bj(t){var e=Ga();return e.fromInt(t),e}a(bj,"nbv");function ubs(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:Q3n(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(dbs,"bnpClamp");function fbs(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=U3n(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+=U3n(n));return o?s:"0"}a(fbs,"bnToString");function pbs(){var t=Ga();return zt.ZERO.subTo(this,t),t}a(pbs,"bnNegate");function hbs(){return this.s<0?this.negate():this}a(hbs,"bnAbs");function mbs(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(mbs,"bnCompareTo");function Zit(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(Zit,"nbits");function gbs(){return this.t<=0?0:this.DB*(this.t-1)+Zit(this.data[this.t-1]^this.s&this.DM)}a(gbs,"bnBitLength");function Abs(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(Abs,"bnpDLShiftTo");function ybs(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(Ebs,"bnpLShiftTo");function _bs(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(vbs,"bnpSubTo");function Cbs(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(bbs,"bnpSquareTo");function Sbs(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(Sbs,"bnpDivRemTo");function Tbs(t){var e=Ga();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(zt.ZERO)>0&&t.subTo(e,e),e}a(Tbs,"bnMod");function tZ(t){this.m=t}a(tZ,"Classic");function Ibs(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(Ibs,"cConvert");function xbs(t){return t}a(xbs,"cRevert");function wbs(t){t.divRemTo(this.m,null,t)}a(wbs,"cReduce");function Rbs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(Rbs,"cMulTo");function Pbs(t,e){t.squareTo(e),this.reduce(e)}a(Pbs,"cSqrTo");tZ.prototype.convert=Ibs;tZ.prototype.revert=xbs;tZ.prototype.reduce=wbs;tZ.prototype.mulTo=Rbs;tZ.prototype.sqrTo=Pbs;function kbs(){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(kbs,"bnpInvDigit");function rZ(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(Dbs,"montConvert");function Nbs(t){var e=Ga();return t.copyTo(e),this.reduce(e),e}a(Nbs,"montRevert");function Mbs(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(Mbs,"montReduce");function Obs(t,e){t.squareTo(e),this.reduce(e)}a(Obs,"montSqrTo");function Bbs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(Bbs,"montMulTo");rZ.prototype.convert=Dbs;rZ.prototype.revert=Nbs;rZ.prototype.reduce=Mbs;rZ.prototype.mulTo=Bbs;rZ.prototype.sqrTo=Obs;function Lbs(){return(this.t>0?this.data[0]&1:this.s)==0}a(Lbs,"bnpIsEven");function Fbs(t,e){if(t>4294967295||t<1)return zt.ONE;var r=Ga(),n=Ga(),o=e.convert(this),s=Zit(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(Fbs,"bnpExp");function Ubs(t,e){var r;return t<256||e.isEven()?r=new tZ(e):r=new rZ(e),this.exp(t,r)}a(Ubs,"bnModPowInt");zt.prototype.copyTo=cbs;zt.prototype.fromInt=lbs;zt.prototype.fromString=ubs;zt.prototype.clamp=dbs;zt.prototype.dlShiftTo=Abs;zt.prototype.drShiftTo=ybs;zt.prototype.lShiftTo=Ebs;zt.prototype.rShiftTo=_bs;zt.prototype.subTo=vbs;zt.prototype.multiplyTo=Cbs;zt.prototype.squareTo=bbs;zt.prototype.divRemTo=Sbs;zt.prototype.invDigit=kbs;zt.prototype.isEven=Lbs;zt.prototype.exp=Fbs;zt.prototype.toString=fbs;zt.prototype.negate=pbs;zt.prototype.abs=hbs;zt.prototype.compareTo=mbs;zt.prototype.bitLength=gbs;zt.prototype.mod=Tbs;zt.prototype.modPowInt=Ubs;zt.ZERO=bj(0);zt.ONE=bj(1);function Qbs(){var t=Ga();return this.copyTo(t),t}a(Qbs,"bnClone");function qbs(){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(jbs,"bnByteValue");function Hbs(){return this.t==0?this.s:this.data[0]<<16>>16}a(Hbs,"bnShortValue");function Gbs(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(Gbs,"bnpChunkSize");function $bs(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a($bs,"bnSigNum");function Vbs(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=bj(r),o=Ga(),s=Ga(),c="";for(this.divRemTo(n,o,s);o.signum()>0;)c=(r+s.intValue()).toString(t).substr(1)+c,o.divRemTo(n,o,s);return s.intValue().toString(t)+c}a(Vbs,"bnpToRadix");function Wbs(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(Wbs,"bnpFromRadix");function zbs(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),krr,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(Ybs,"bnToByteArray");function Kbs(t){return this.compareTo(t)==0}a(Kbs,"bnEquals");function Jbs(t){return this.compareTo(t)<0?this:t}a(Jbs,"bnMin");function Zbs(t){return this.compareTo(t)>0?this:t}a(Zbs,"bnMax");function Xbs(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(c1s,"lbit");function l1s(){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(A1s,"bnpAddTo");function y1s(t){var e=Ga();return this.addTo(t,e),e}a(y1s,"bnAdd");function E1s(t){var e=Ga();return this.subTo(t,e),e}a(E1s,"bnSubtract");function _1s(t){var e=Ga();return this.multiplyTo(t,e),e}a(_1s,"bnMultiply");function v1s(){var t=Ga();return this.squareTo(t),t}a(v1s,"bnSquare");function C1s(t){var e=Ga();return this.divRemTo(t,e,null),e}a(C1s,"bnDivide");function b1s(t){var e=Ga();return this.divRemTo(t,null,e),e}a(b1s,"bnRemainder");function S1s(t){var e=Ga(),r=Ga();return this.divRemTo(t,e,r),new Array(e,r)}a(S1s,"bnDivideAndRemainder");function T1s(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(T1s,"bnpDMultiply");function I1s(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(I1s,"bnpDAddOffset");function qPe(){}a(qPe,"NullExp");function H3n(t){return t}a(H3n,"nNop");function x1s(t,e,r){t.multiplyTo(e,r)}a(x1s,"nMulTo");function w1s(t,e){t.squareTo(e)}a(w1s,"nSqrTo");qPe.prototype.convert=H3n;qPe.prototype.revert=H3n;qPe.prototype.mulTo=x1s;qPe.prototype.sqrTo=w1s;function R1s(t){return this.exp(t,new qPe)}a(R1s,"bnPow");function P1s(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var o;for(o=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=Ga();return t.copyTo(e),this.reduce(e),e}a(D1s,"barrettConvert");function N1s(t){return t}a(N1s,"barrettRevert");function M1s(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(M1s,"barrettReduce");function O1s(t,e){t.squareTo(e),this.reduce(e)}a(O1s,"barrettSqrTo");function B1s(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(B1s,"barrettMulTo");Bfe.prototype.convert=D1s;Bfe.prototype.revert=N1s;Bfe.prototype.reduce=M1s;Bfe.prototype.mulTo=B1s;Bfe.prototype.sqrTo=O1s;function L1s(t,e){var r=t.bitLength(),n,o=bj(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 tZ(e):e.isEven()?s=new Bfe(e):s=new rZ(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=Ga();for(s.sqrTo(c[1],f);l<=d;)c[l]=Ga(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=Ga(),y;for(r=Zit(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(F1s,"bnGCD");function U1s(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(U1s,"bnpModInt");function Q1s(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=bj(1),s=bj(0),c=bj(0),l=bj(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(Q1s,"bnModInverse");var y2=[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],q1s=(1<<26)/y2[y2.length-1];function j1s(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=y2[y2.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 g5=ps();d5();oc();var V3n=z3n.exports=g5.sha1=g5.sha1||{};g5.md.sha1=g5.md.algorithms.sha1=V3n;V3n.create=function(){W3n||$1s();var t=null,e=g5.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),$3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=g5.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,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};$3n(h,r,o);var m=g5.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 Drr=null,W3n=!1;function $1s(){Drr="\x80",Drr+=g5.util.fillString("\0",64),W3n=!0}a($1s,"_init");function $3n(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($3n,"_update")});var Nrr=I((Pnf,K3n)=>{p();var A5=ps();oc();Tw();Lfe();var Y3n=K3n.exports=A5.pkcs1=A5.pkcs1||{};Y3n.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=A5.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(Xit,"rsa_mgf1")});var Orr=I((Nnf,Mrr)=>{p();var Sj=ps();oc();jPe();Tw();(function(){if(Sj.prime){Mrr.exports=Sj.prime;return}var t=Mrr.exports=Sj.prime=Sj.prime||{},e=Sj.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||Sj.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 Sj.util.estimateCores(function(w,R){w&&(R=2),E=R-1,T()});T();function T(){E=Math.max(1,E);for(var w=[],R=0;Rh&&(y=d(h,m));var j=y.toString(16);N.target.postMessage({hex:j,workLoad:_}),y.dAddOffset(v,0)}}a(D,"workerMessage")}a(T,"generate")}a(u,"primeincFindPrimeWithWorkers");function d(h,m){var g=new e(h,m),A=h-1;return g.testBit(A)||g.bitwiseTo(e.ONE.shiftLeft(A),o,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}a(d,"generateRandom");function f(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}a(f,"getMillerRabinTests")})()});var HPe=I((Bnf,nFn)=>{p();var vi=ps();A2();jPe();Cj();Nrr();Orr();Tw();oc();typeof $a>"u"&&($a=vi.jsbn.BigInteger);var $a,Brr=vi.util.isNodejs?require("crypto"):null,pt=vi.asn1,xw=vi.util;vi.pki=vi.pki||{};nFn.exports=vi.pki.rsa=vi.rsa=vi.rsa||{};var Fo=vi.pki,V1s=[6,4,2,4,2,4,6,2],W1s={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"}]},z1s={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"}]},Y1s={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"}]},K1s=vi.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"}]}]},J1s={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"}]},Z1s=a(function(t){var e;if(t.algorithm in Fo.oids)e=Fo.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"),tFn=a(function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract($a.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract($a.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new $a(vi.util.bytesToHex(vi.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals($a.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var o=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);o.compareTo(s)<0;)o=o.add(e.p);var c=o.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return c=c.multiply(n.modInverse(e.n)).mod(e.n),c},"_modPow");Fo.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=rFn(t,e,r)):(o=vi.util.createBuffer(),o.putBytes(t));for(var c=new $a(o.toHex(),16),l=tFn(c,e,n),u=l.toString(16),d=vi.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(vi.util.hexToBytes(u)),d.getBytes()};Fo.rsa.decrypt=function(t,e,r,n){var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=o,s}var c=new $a(vi.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=tFn(c,e,r),u=l.toString(16),d=vi.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(vi.util.hexToBytes(u)),n!==!1?eot(d.getBytes(),e,r):d.getBytes()};Fo.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||vi.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};Fo.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new $a(null);r.fromInt(30);for(var n=0,o=a(function(h,m){return h|m},"op_or"),s=+new Date,c,l=0;t.keys===null&&(e<=0||lu?t.pqState=0:t.num.isProbablePrime(eSs(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(V1s[n++%8],0):t.pqState===2?t.pqState=t.num.subtract($a.ONE).gcd(t.e).compareTo($a.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract($a.ONE),t.q1=t.q.subtract($a.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo($a.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var f=t.e.modInverse(t.phi);t.keys={privateKey:Fo.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:Fo.rsa.setPublicKey(t.n,t.e)}}c=+new Date,l+=c-s,s=c}return t.keys!==null};Fo.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),!vi.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(J3n("generateKeyPair"))return Brr.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:Fo.privateKeyFromPem(d),publicKey:Fo.publicKeyFromPem(u)})});if(Z3n("generateKey")&&Z3n("exportKey"))return xw.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:eFn(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return xw.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=Fo.privateKeyFromAsn1(pt.fromDer(vi.util.createBuffer(l)));n(null,{privateKey:u,publicKey:Fo.setRsaPublicKey(u.n,u.e)})}});if(X3n("generateKey")&&X3n("exportKey")){var o=xw.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:eFn(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=xw.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=Fo.privateKeyFromAsn1(pt.fromDer(vi.util.createBuffer(h)));n(null,{privateKey:m,publicKey:Fo.setRsaPublicKey(m.n,m.e)})},d.onerror=function(f){n(f)}},o.onerror=function(l){n(l)};return}}else if(J3n("generateKeyPairSync")){var s=Brr.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Fo.privateKeyFromPem(s.privateKey),publicKey:Fo.publicKeyFromPem(s.publicKey)}}}var c=Fo.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Fo.rsa.stepKeyPairGenerationState(c,0),c.keys;X1s(c,r,n)};Fo.setRsaPublicKey=Fo.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 rFn(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return vi.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 Fo.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=eot(d,r,!0,void 0,c);var f=pt.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!pt.validate(f,J1s,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===vi.oids.md2||A===vi.oids.md5||A===vi.oids.sha1||A===vi.oids.sha224||A===vi.oids.sha256||A===vi.oids.sha384||A===vi.oids.sha512||A===vi.oids["sha512-224"]||A===vi.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===vi.oids.md2||A===vi.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=eot(d,r,!0,void 0,c),u===d},"verify")});var l=Fo.rsa.decrypt(o,r,!0,!1);return s.verify(n,l,r.n.bitLength())},r};Fo.setRsaPrivateKey=Fo.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=Fo.rsa.decrypt(d,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:eot};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return vi.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:Z1s},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 Fo.rsa.encrypt(m,u,h)},u};Fo.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(Fo.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())])};Fo.privateKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,W1s,e,r)&&(t=pt.fromDer(vi.util.createBuffer(e.privateKey))),e={},r=[],!pt.validate(t,z1s,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=vi.util.createBuffer(e.privateKeyModulus).toHex(),s=vi.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=vi.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=vi.util.createBuffer(e.privateKeyPrime1).toHex(),u=vi.util.createBuffer(e.privateKeyPrime2).toHex(),d=vi.util.createBuffer(e.privateKeyExponent1).toHex(),f=vi.util.createBuffer(e.privateKeyExponent2).toHex(),h=vi.util.createBuffer(e.privateKeyCoefficient).toHex(),Fo.setRsaPrivateKey(new $a(o,16),new $a(s,16),new $a(c,16),new $a(l,16),new $a(u,16),new $a(d,16),new $a(f,16),new $a(h,16))};Fo.privateKeyToAsn1=Fo.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,y5(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,y5(t.e)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,y5(t.d)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,y5(t.p)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,y5(t.q)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,y5(t.dP)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,y5(t.dQ)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,y5(t.qInv))])};Fo.publicKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,K1s,e,r)){var n=pt.derToOid(e.publicKeyOid);if(n!==Fo.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,Y1s,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=vi.util.createBuffer(e.publicKeyModulus).toHex(),c=vi.util.createBuffer(e.publicKeyExponent).toHex();return Fo.setRsaPublicKey(new $a(s,16),new $a(c,16))};Fo.publicKeyToAsn1=Fo.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(Fo.oids.rsaEncryption).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,"")]),pt.create(pt.Class.UNIVERSAL,pt.Type.BITSTRING,!1,[Fo.publicKeyToRSAPublicKey(t)])])};Fo.publicKeyToRSAPublicKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,y5(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,y5(t.e))])};function rFn(t,e,r){var n=vi.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=vi.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(eot,"_decodePkcs1_v1_5");function X1s(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){vi.prime.generateProbablePrime(l,n,u)}a(s,"getPrime");function c(l,u){if(l)return r(l);if(t.q=u,t.p.compareTo(t.q)<0){var d=t.p;t.p=t.q,t.q=d}if(t.p.subtract($a.ONE).gcd(t.e).compareTo($a.ONE)!==0){t.p=null,o();return}if(t.q.subtract($a.ONE).gcd(t.e).compareTo($a.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract($a.ONE),t.q1=t.q.subtract($a.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo($a.ONE)!==0){t.p=t.q=null,o();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,c);return}var f=t.e.modInverse(t.phi);t.keys={privateKey:Fo.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:Fo.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}a(c,"finish")}a(X1s,"_generateKeyPair");function y5(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=vi.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(y5,"_bnToBytes");function eSs(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(eSs,"_getMillerRabinTests");function J3n(t){return vi.util.isNodejs&&typeof Brr[t]=="function"}a(J3n,"_detectNodeCrypto");function Z3n(t){return typeof xw.globalScope<"u"&&typeof xw.globalScope.crypto=="object"&&typeof xw.globalScope.crypto.subtle=="object"&&typeof xw.globalScope.crypto.subtle[t]=="function"}a(Z3n,"_detectSubtleCrypto");function X3n(t){return typeof xw.globalScope<"u"&&typeof xw.globalScope.msCrypto=="object"&&typeof xw.globalScope.msCrypto.subtle=="object"&&typeof xw.globalScope.msCrypto.subtle[t]=="function"}a(X3n,"_detectSubtleMsCrypto");function eFn(t){for(var e=vi.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var An=ps();vj();A2();QPe();d5();Cj();Yit();eZ();Tw();wrr();HPe();oc();typeof iFn>"u"&&(iFn=An.jsbn.BigInteger);var iFn,Dt=An.asn1,ns=An.pki=An.pki||{};cFn.exports=ns.pbe=An.pbe=An.pbe||{};var nZ=ns.oids,tSs={name:"EncryptedPrivateKeyInfo",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},rSs={name:"PBES2Algorithms",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},nSs={name:"pkcs-12PbeParams",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.INTEGER,constructed:!1,capture:"iterations"}]};ns.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=An.random.getBytesSync(r.saltSize),o=r.count,s=Dt.integerToDer(o),c,l,u;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var d,f,h;switch(r.algorithm){case"aes128":c=16,d=16,f=nZ["aes128-CBC"],h=An.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=nZ["aes192-CBC"],h=An.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=nZ["aes256-CBC"],h=An.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=nZ.desCBC,h=An.des.createEncryptionCipher;break;default:var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),A=aFn(g),y=An.pkcs5.pbkdf2(e,n,o,c,A),E=An.random.getBytesSync(d),_=h(y);_.start(E),_.update(Dt.toDer(t)),_.finish(),u=_.output.getBytes();var v=iSs(n,s,c,g);l=Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OID,!1,Dt.oidToDer(nZ.pkcs5PBES2).getBytes()),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OID,!1,Dt.oidToDer(nZ.pkcs5PBKDF2).getBytes()),v]),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OID,!1,Dt.oidToDer(f).getBytes()),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OCTETSTRING,!1,E)])])])}else if(r.algorithm==="3des"){c=24;var b=new An.util.ByteBuffer(n),y=ns.pbe.generatePkcs12Key(e,b,1,o,c),E=ns.pbe.generatePkcs12Key(e,b,2,o,c),_=An.des.createEncryptionCipher(y);_.start(E),_.update(Dt.toDer(t)),_.finish(),u=_.output.getBytes(),l=Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OID,!1,Dt.oidToDer(nZ["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OCTETSTRING,!1,n),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.INTEGER,!1,s.getBytes())])])}else{var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var T=Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[l,Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OCTETSTRING,!1,u)]);return T};ns.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Dt.validate(t,tSs,n,o)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=Dt.derToOid(n.encryptionOid),l=ns.pbe.getCipher(c,n.encryptionParams,e),u=An.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Dt.fromDer(l.output)),r};ns.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Dt.toDer(t).getBytes()};return An.pem.encode(r,{maxline:e})};ns.encryptedPrivateKeyFromPem=function(t){var e=An.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return Dt.fromDer(e.body)};ns.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=ns.wrapRsaPrivateKey(ns.privateKeyToAsn1(t));return n=ns.encryptPrivateKeyInfo(n,e,r),ns.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=An.random.getBytesSync(16),l=An.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=An.random.getBytesSync(16),l=An.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=An.random.getBytesSync(16),l=An.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=An.random.getBytesSync(8),l=An.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=An.random.getBytesSync(8),l=An.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw u.algorithm=r.algorithm,u}var d=An.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Dt.toDer(ns.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:An.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return An.pem.encode(h)};ns.decryptRsaPrivateKey=function(t,e){var r=null,n=An.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var o=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw o.headerType=o,o}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,c;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,c=An.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=An.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=An.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=An.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=An.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return An.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return An.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return An.rc2.createDecryptionCipher(h,128)},"cipherFn");break;default:var o=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw o.algorithm=n.dekInfo.algorithm,o}var l=An.util.hexToBytes(n.dekInfo.parameters),u=An.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(An.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=ns.decryptPrivateKeyInfo(Dt.fromDer(r),e):r=Dt.fromDer(r),r!==null&&(r=ns.privateKeyFromAsn1(r)),r};ns.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in An.md))throw new Error('"sha1" hash algorithm unavailable.');s=An.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new An.util.ByteBuffer,h=new An.util.ByteBuffer;if(t!=null){for(l=0;l=0;l--)L=L>>8,L+=P.at(l)+B.at(l),B.setAt(l,L&255);N.putBuffer(B)}b=N,f.putBuffer(R)}return f.truncate(f.length()-o),f};ns.pbe.getCipher=function(t,e,r){switch(t){case ns.oids.pkcs5PBES2:return ns.pbe.getCipherForPBES2(t,e,r);case ns.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case ns.oids["pbewithSHAAnd40BitRC2-CBC"]:return ns.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}};ns.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Dt.validate(e,rSs,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}if(t=Dt.derToOid(n.kdfOid),t!==ns.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=Dt.derToOid(n.encOid),t!==ns.oids["aes128-CBC"]&&t!==ns.oids["aes192-CBC"]&&t!==ns.oids["aes256-CBC"]&&t!==ns.oids["des-EDE3-CBC"]&&t!==ns.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var c=n.kdfSalt,l=An.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(ns.oids[t]){case"aes128-CBC":u=16,d=An.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=An.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=An.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=An.des.createDecryptionCipher;break;case"desCBC":u=8,d=An.des.createDecryptionCipher;break}var f=sFn(n.prfOid),h=An.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};ns.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Dt.validate(e,nSs,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=An.util.createBuffer(n.salt),l=An.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case ns.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=An.des.startDecrypting;break;case ns.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,E){var _=An.rc2.createDecryptionCipher(y,40);return _.start(E,null),_},"cipherFn");break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=sFn(n.prfOid),m=ns.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=ns.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};ns.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in An.md))throw new Error('"md5" hash algorithm unavailable.');n=An.md.md5.create()}e===null&&(e="");for(var o=[oFn(n,t+e)],s=16,c=1;s{p();var Ffe=ps();A2();oc();var un=Ffe.asn1,Ufe=dFn.exports=Ffe.pkcs7asn1=Ffe.pkcs7asn1||{};Ffe.pkcs7=Ffe.pkcs7||{};Ffe.pkcs7.asn1=Ufe;var lFn={name:"ContentInfo",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:un.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Ufe.contentInfoValidator=lFn;var uFn={name:"EncryptedContentInfo",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:un.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:un.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Ufe.envelopedDataValidator={name:"EnvelopedData",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:un.Class.UNIVERSAL,type:un.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(uFn)};Ufe.encryptedDataValidator={name:"EncryptedData",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"version"}].concat(uFn)};var oSs={name:"SignerInfo",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:un.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:un.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:un.Class.UNIVERSAL,type:un.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:un.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Ufe.signedDataValidator={name:"SignedData",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:un.Class.UNIVERSAL,type:un.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},lFn,{name:"SignedData.Certificates",tagClass:un.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:un.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:un.Class.UNIVERSAL,type:un.Type.SET,capture:"signerInfos",optional:!0,value:[oSs]}]};Ufe.recipientInfoValidator={name:"RecipientInfo",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:un.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:un.Class.UNIVERSAL,type:un.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var Urr=I((Gnf,fFn)=>{p();var iZ=ps();oc();iZ.mgf=iZ.mgf||{};var sSs=fFn.exports=iZ.mgf.mgf1=iZ.mgf1=iZ.mgf1||{};sSs.create=function(t){var e={generate:a(function(r,n){for(var o=new iZ.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var tot=ps();Urr();pFn.exports=tot.mgf=tot.mgf||{};tot.mgf.mgf1=tot.mgf1});var rot=I((Ynf,mFn)=>{p();var oZ=ps();Tw();oc();var aSs=mFn.exports=oZ.pss=oZ.pss||{};aSs.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=oZ.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||oZ.random,l={};return l.encode=function(u,d){var f,h=d-1,m=Math.ceil(h/8),g=u.digest().getBytes();if(m>8*m-h&255;return w=String.fromCharCode(w.charCodeAt(0)&~R)+w.substr(1),w+E+"\xBC"},l.verify=function(u,d,f){var h,m=f-1,g=Math.ceil(m/8);if(d=d.substr(-g),g>8*g-m&255;if((y.charCodeAt(0)&_)!==0)throw new Error("Bits beyond keysize not zero as expected.");var v=r.generate(E,A),b="";for(h=0;h{p();var Ci=ps();vj();A2();QPe();d5();hFn();Cj();eZ();rot();HPe();oc();var ge=Ci.asn1,Dr=_Fn.exports=Ci.pki=Ci.pki||{},Va=Dr.oids,cp={};cp.CN=Va.commonName;cp.commonName="CN";cp.C=Va.countryName;cp.countryName="C";cp.L=Va.localityName;cp.localityName="L";cp.ST=Va.stateOrProvinceName;cp.stateOrProvinceName="ST";cp.O=Va.organizationName;cp.organizationName="O";cp.OU=Va.organizationalUnitName;cp.organizationalUnitName="OU";cp.E=Va.emailAddress;cp.emailAddress="E";var AFn=Ci.pki.rsa.publicKeyValidator,cSs={name:"Certificate",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:ge.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:ge.Class.UNIVERSAL,type:ge.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:ge.Class.UNIVERSAL,type:ge.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:ge.Class.UNIVERSAL,type:ge.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:ge.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:ge.Class.UNIVERSAL,type:ge.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:ge.Class.UNIVERSAL,type:ge.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:ge.Class.UNIVERSAL,type:ge.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:ge.Class.UNIVERSAL,type:ge.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},AFn,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:ge.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:ge.Class.UNIVERSAL,type:ge.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:ge.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:ge.Class.UNIVERSAL,type:ge.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:ge.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:ge.Class.UNIVERSAL,type:ge.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:ge.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:ge.Class.UNIVERSAL,type:ge.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},lSs={name:"rsapss",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:ge.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:ge.Class.UNIVERSAL,type:ge.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:ge.Class.UNIVERSAL,type:ge.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:ge.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:ge.Class.UNIVERSAL,type:ge.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:ge.Class.UNIVERSAL,type:ge.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:ge.Class.UNIVERSAL,type:ge.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:ge.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:ge.Class.UNIVERSAL,type:ge.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:ge.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:ge.Class.UNIVERSAL,type:ge.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},uSs={name:"CertificationRequestInfo",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:ge.Class.UNIVERSAL,type:ge.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},AFn,{name:"CertificationRequestInfo.attributes",tagClass:ge.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:ge.Class.UNIVERSAL,type:ge.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SET,constructed:!0}]}]}]},dSs={name:"CertificationRequest",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[uSs,{name:"CertificationRequest.signatureAlgorithm",tagClass:ge.Class.UNIVERSAL,type:ge.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:ge.Class.UNIVERSAL,type:ge.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:ge.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:ge.Class.UNIVERSAL,type:ge.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=iot({signatureOid:c.signatureOid,type:"certificate"});var d=ge.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=Ci.md.sha1.create(),h=ge.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return Tj(c.issuer,A)},c.issuer.addField=function(A){ww([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=Ci.md.sha1.create(),g=ge.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return Tj(c.subject,A)},c.subject.addField=function(A){ww([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=ge.fromDer(e.value);r.value.length>0&&r.value[0].type===ge.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===ge.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(e.pathLenConstraint=ge.derToInteger(s))}else if(e.name==="extKeyUsage")for(var r=ge.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=ge.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 cp&&(e.name=Dr.oids[cp[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 cp&&(e.shortName=cp[e.name]),e.type===Va.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=ge.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(ww,"_fillMissingFields");function EFn(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=ge.create(ge.Class.UNIVERSAL,ge.Type.BITSTRING,!1,c)}else if(t.name==="basicConstraints")t.value=ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(ge.create(ge.Class.UNIVERSAL,ge.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in t&&t.value.value.push(ge.create(ge.Class.UNIVERSAL,ge.Type.INTEGER,!1,ge.integerToDer(t.pathLenConstraint).getBytes()));else if(t.name==="extKeyUsage"){t.value=ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,[]);var l=t.value.value;for(var u in t)t[u]===!0&&(u in Va?l.push(ge.create(ge.Class.UNIVERSAL,ge.Type.OID,!1,ge.oidToDer(Va[u]).getBytes())):u.indexOf(".")!==-1&&l.push(ge.create(ge.Class.UNIVERSAL,ge.Type.OID,!1,ge.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=ge.create(ge.Class.UNIVERSAL,ge.Type.BITSTRING,!1,c)}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.value=ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,[]);for(var d,f=0;f128)throw new Error('Invalid "nsComment" content.');t.value=ge.create(ge.Class.UNIVERSAL,ge.Type.IA5STRING,!1,t.comment)}else if(t.name==="subjectKeyIdentifier"&&e.cert){var h=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=h.toHex(),t.value=ge.create(ge.Class.UNIVERSAL,ge.Type.OCTETSTRING,!1,h.getBytes())}else if(t.name==="authorityKeyIdentifier"&&e.cert){t.value=ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,[]);var l=t.value.value;if(t.keyIdentifier){var m=t.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;l.push(ge.create(ge.Class.CONTEXT_SPECIFIC,0,!1,m))}if(t.authorityCertIssuer){var g=[ge.create(ge.Class.CONTEXT_SPECIFIC,4,!0,[Qfe(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(ge.create(ge.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=Ci.util.hexToBytes(t.serialNumber===!0?e.cert.serialNumber:t.serialNumber);l.push(ge.create(ge.Class.CONTEXT_SPECIFIC,2,!1,A))}}else if(t.name==="cRLDistributionPoints"){t.value=ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,[]);for(var l=t.value.value,y=ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,[]),E=ge.create(ge.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(EFn,"_fillMissingExtensionFields");function Qrr(t,e){if(t===Va["RSASSA-PSS"]){var r=[];return e.hash.algorithmOid!==void 0&&r.push(ge.create(ge.Class.CONTEXT_SPECIFIC,0,!0,[ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,[ge.create(ge.Class.UNIVERSAL,ge.Type.OID,!1,ge.oidToDer(e.hash.algorithmOid).getBytes()),ge.create(ge.Class.UNIVERSAL,ge.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&r.push(ge.create(ge.Class.CONTEXT_SPECIFIC,1,!0,[ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,[ge.create(ge.Class.UNIVERSAL,ge.Type.OID,!1,ge.oidToDer(e.mgf.algorithmOid).getBytes()),ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,[ge.create(ge.Class.UNIVERSAL,ge.Type.OID,!1,ge.oidToDer(e.mgf.hash.algorithmOid).getBytes()),ge.create(ge.Class.UNIVERSAL,ge.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&r.push(ge.create(ge.Class.CONTEXT_SPECIFIC,2,!0,[ge.create(ge.Class.UNIVERSAL,ge.Type.INTEGER,!1,ge.integerToDer(e.saltLength).getBytes())])),ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,r)}else return ge.create(ge.Class.UNIVERSAL,ge.Type.NULL,!1,"")}a(Qrr,"_signatureParametersToAsn1");function fSs(t){var e=ge.create(ge.Class.CONTEXT_SPECIFIC,0,!0,[]);if(t.attributes.length===0)return e;for(var r=t.attributes,n=0;n=pSs&&t0&&n.value.push(Dr.certificateExtensionsToAsn1(t.extensions)),n};Dr.getCertificationRequestInfo=function(t){var e=ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,[ge.create(ge.Class.UNIVERSAL,ge.Type.INTEGER,!1,ge.integerToDer(t.version).getBytes()),Qfe(t.subject),Dr.publicKeyToAsn1(t.publicKey),fSs(t)]);return e};Dr.distinguishedNameToAsn1=function(t){return Qfe(t)};Dr.certificateToAsn1=function(t){var e=t.tbsCertificate||Dr.getTBSCertificate(t);return ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,[e,ge.create(ge.Class.UNIVERSAL,ge.Type.SEQUENCE,!0,[ge.create(ge.Class.UNIVERSAL,ge.Type.OID,!1,ge.oidToDer(t.signatureOid).getBytes()),Qrr(t.signatureOid,t.signatureParameters)]),ge.create(ge.Class.UNIVERSAL,ge.Type.BITSTRING,!1,"\0"+t.signature)])};Dr.certificateExtensionsToAsn1=function(t){var e=ge.create(ge.Class.CONTEXT_SPECIFIC,3,!0,[]),r=ge.create(ge.Class.UNIVERSAL,ge.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;Ci.util.isArray(h)||(h=[h]);for(var m=!1;!m&&h.length>0;){d=h.shift();try{m=d.verify(u)}catch{}}m||(c={message:"Certificate signature is invalid.",error: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"&&!Ci.util.isArray(T)?(T.message&&(c.message=T.message),T.error&&(c.error=T.error)):typeof T=="string"&&(c.error=T)),c;s=!1,++l}while(e.length>0);return!0}});var jrr=I((eif,CFn)=>{p();var bu=ps();A2();Nfe();Cj();Frr();Lrr();Tw();HPe();Lfe();oc();oot();var Ye=bu.asn1,Ks=bu.pki,$Pe=CFn.exports=bu.pkcs12=bu.pkcs12||{},vFn={name:"ContentInfo",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Ye.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},mSs={name:"PFX",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.INTEGER,constructed:!1,capture:"version"},vFn,{name:"PFX.macData",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Ye.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},gSs={name:"SafeBag",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Ye.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},ASs={name:"Attribute",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SET,constructed:!0,capture:"values"}]},ySs={name:"CertBag",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Ye.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Ye.Class.UNIVERSAL,type:Ye.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function GPe(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(GPe,"_getBagsByAttribute");$Pe.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Ye.validate(t,mSs,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=bu.util.hexToBytes(E.localKeyIdHex)),v===void 0&&!("friendlyName"in E)&&"bagType"in E&&(_[E.bagType]=GPe(c.safeContents,null,null,E.bagType)),v!==void 0&&(_.localKeyId=GPe(c.safeContents,"localKeyId",v,E.bagType)),"friendlyName"in E&&(_.friendlyName=GPe(c.safeContents,"friendlyName",E.friendlyName,E.bagType)),_},"getBags"),getBagsByFriendlyName:a(function(E,_){return GPe(c.safeContents,"friendlyName",E,_)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(E,_){return GPe(c.safeContents,"localKeyId",E,_)},"getBagsByLocalKeyId")};if(n.version.charCodeAt(0)!==3){var s=new Error("PKCS#12 PFX of version other than 3 not supported.");throw s.version=n.version.charCodeAt(0),s}if(Ye.derToOid(n.contentType)!==Ks.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Ye.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Ye.Class.UNIVERSAL||l.type!==Ye.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=qrr(l),n.mac){var u=null,d=0,f=Ye.derToOid(n.macAlgorithm);switch(f){case Ks.oids.sha1:u=bu.md.sha1.create(),d=20;break;case Ks.oids.sha256:u=bu.md.sha256.create(),d=32;break;case Ks.oids.sha384:u=bu.md.sha384.create(),d=48;break;case Ks.oids.sha512:u=bu.md.sha512.create(),d=64;break;case Ks.oids.md5:u=bu.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new bu.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(bu.util.bytesToHex(n.macIterations),16):1,g=$Pe.generateKey(r,h,3,m,d,u),A=bu.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 ESs(c,l.value,e,r),c};function qrr(t){if(t.composed||t.constructed){for(var e=bu.util.createBuffer(),r=0;r0&&(s=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SET,!0,u));var d=[],f=[];e!==null&&(bu.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var E=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,h),_=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Ks.oids.data).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,Ye.toDer(E).getBytes())])]);d.push(_)}var v=null;if(t!==null){var b=Ks.wrapRsaPrivateKey(Ks.privateKeyToAsn1(t));r===null?v=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Ks.oids.keyBag).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):v=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Ks.oids.pkcs8ShroudedKeyBag).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[Ks.encryptPrivateKeyInfo(b,r,n)]),s]);var T=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[v]),w=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Ks.oids.data).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,Ye.toDer(T).getBytes())])]);d.push(w)}var R=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=bu.md.sha1.create(),P=new bu.util.ByteBuffer(bu.random.getBytes(n.saltSize)),D=n.count,t=$Pe.generateKey(r,P,3,D,20),N=bu.hmac.create();N.start(l,t),N.update(Ye.toDer(R).getBytes());var B=N.getMac();x=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Ks.oids.sha1).getBytes()),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.NULL,!1,"")]),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,B.getBytes())]),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,P.getBytes()),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.INTEGER,!1,Ye.integerToDer(D).getBytes())])}return Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.INTEGER,!1,Ye.integerToDer(3).getBytes()),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Ks.oids.data).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,Ye.toDer(R).getBytes())])]),x])};$Pe.generateKey=bu.pbe.generatePkcs12Key});var Grr=I((nif,bFn)=>{p();var Ij=ps();A2();Cj();Lrr();eZ();Yit();jrr();rot();HPe();oc();oot();var Hrr=Ij.asn1,qfe=bFn.exports=Ij.pki=Ij.pki||{};qfe.pemToDer=function(t){var e=Ij.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Ij.util.createBuffer(e.body)};qfe.privateKeyFromPem=function(t){var e=Ij.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=Hrr.fromDer(e.body);return qfe.privateKeyFromAsn1(n)};qfe.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:Hrr.toDer(qfe.privateKeyToAsn1(t)).getBytes()};return Ij.pem.encode(r,{maxline:e})};qfe.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:Hrr.toDer(t).getBytes()};return Ij.pem.encode(r,{maxline:e})}});var Krr=I((oif,kFn)=>{p();var Jt=ps();A2();Nfe();$it();eZ();Grr();Tw();Lfe();oc();var lot=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&&(Ee.queue(t,Ee.createAlert(t,{level:Ee.Alert.Level.warning,description:Ee.Alert.Description.no_renegotiation})),Ee.flush(t)),t.process()};Ee.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===Ee.ConnectionEnd.client;if(r<38)t.error(t,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});else{var s=e.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:Jt.util.createBuffer(s.getBytes(32)),session_id:cT(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=cT(s,2),n.compression_methods=cT(s,1)),c=r-(c-s.length()),c>0){for(var l=cT(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:cT(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(cT(f,2).getBytes())}}}if(t.session.version&&(n.version.major!==t.session.version.major||n.version.minor!==t.session.version.minor))return t.error(t,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=Ee.getCipherSuite(n.cipher_suite);else for(var m=Jt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=Ee.getCipherSuite(m.getBytes(2)),t.session.cipherSuite===null););if(t.session.cipherSuite===null)return t.error(t,{message:"No cipher suites in common.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.handshake_failure},cipherSuite:Jt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=Ee.CompressionMethod.none}return n};Ee.createSecurityParameters=function(t,e){var r=t.entity===Ee.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:Ee.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:Ee.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:t.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:o,server_random:s}};Ee.handleServerHello=function(t,e,r){var n=Ee.parseHelloMessage(t,e,r);if(!t.fail){if(n.version.minor<=t.version.minor)t.version.minor=n.version.minor;else return t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=IFn,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=xSs,t.session.resuming=!1,Ee.createSecurityParameters(t,n)),t.session.id=o,t.process()}};Ee.handleClientHello=function(t,e,r){var n=Ee.parseHelloMessage(t,e,r);if(!t.fail){var o=n.session_id.bytes(),s=null;if(t.sessionCache&&(s=t.sessionCache.getSession(o),s===null?o="":(s.version.major!==n.version.major||s.version.minor>n.version.minor)&&(s=null,o="")),o.length===0&&(o=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;l0;)s=cT(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:Ee.Alert.Level.fatal,description:Ee.Alert.Description.bad_certificate}})}var u=t.entity===Ee.ConnectionEnd.client;(u||t.verifyClient===!0)&&l.length===0?t.error(t,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?SFn:Wrr:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],Ee.verifyCertificateChain(t,l)&&(t.expect=u?SFn:Wrr)),t.process()};Ee.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.unsupported_certificate}});t.expect=wSs,t.process()};Ee.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:cT(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:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}});try{var c=t.session.sp;c.pre_master_secret=s.decrypt(o.enc_pre_master_secret);var l=t.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{c.pre_master_secret=Jt.random.getBytes(48)}t.expect=zrr,t.session.clientCertificate!==null&&(t.expect=OSs),t.process()};Ee.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:cT(n,1),certificate_authorities:cT(n,2)};t.session.certificateRequest=o,t.expect=RSs,t.process()};Ee.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:cT(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:Ee.Alert.Level.fatal,description:Ee.Alert.Description.handshake_failure}})}t.expect=zrr,t.process()};Ee.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.insufficient_security}},o=0,s=t.verify(t,n.alert.description,o,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!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=Ee.createRecord(t,{type:Ee.ContentType.handshake,data:Ee.createCertificate(t)}),Ee.queue(t,e)),e=Ee.createRecord(t,{type:Ee.ContentType.handshake,data:Ee.createClientKeyExchange(t)}),Ee.queue(t,e),t.expect=DSs;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&Ee.queue(l,Ee.createRecord(l,{type:Ee.ContentType.handshake,data:Ee.createCertificateVerify(l,u)})),Ee.queue(l,Ee.createRecord(l,{type:Ee.ContentType.change_cipher_spec,data:Ee.createChangeCipherSpec()})),l.state.pending=Ee.createConnectionState(l),l.state.current.write=l.state.pending.write,Ee.queue(l,Ee.createRecord(l,{type:Ee.ContentType.handshake,data:Ee.createFinished(l)})),l.expect=IFn,Ee.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);Ee.getClientSignature(t,c)};Ee.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});var r=t.entity===Ee.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=Ee.createConnectionState(t)),t.state.current.read=t.state.pending.read,(!t.session.resuming&&r||t.session.resuming&&!r)&&(t.state.pending=null),t.expect=r?PSs:BSs,t.process()};Ee.handleFinished=function(t,e,r){var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s=e.fragment.getBytes();n=Jt.util.createBuffer(),n.putBuffer(t.session.md5.digest()),n.putBuffer(t.session.sha1.digest());var c=t.entity===Ee.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=lot;if(n=f(u.master_secret,l,n.getBytes(),d),n.getBytes()!==s)return t.error(t,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(Ee.queue(t,Ee.createRecord(t,{type:Ee.ContentType.change_cipher_spec,data:Ee.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,Ee.queue(t,Ee.createRecord(t,{type:Ee.ContentType.handshake,data:Ee.createFinished(t)}))),t.expect=c?kSs:LSs,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,Ee.flush(t),t.isConnected=!0,t.connected(t),t.process()};Ee.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case Ee.Alert.Description.close_notify:o="Connection closed.";break;case Ee.Alert.Description.unexpected_message:o="Unexpected message.";break;case Ee.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case Ee.Alert.Description.decryption_failed:o="Decryption failed.";break;case Ee.Alert.Description.record_overflow:o="Record overflow.";break;case Ee.Alert.Description.decompression_failure:o="Decompression failed.";break;case Ee.Alert.Description.handshake_failure:o="Handshake failure.";break;case Ee.Alert.Description.bad_certificate:o="Bad certificate.";break;case Ee.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case Ee.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case Ee.Alert.Description.certificate_expired:o="Certificate expired.";break;case Ee.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case Ee.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case Ee.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case Ee.Alert.Description.access_denied:o="Access denied.";break;case Ee.Alert.Description.decode_error:o="Decode error.";break;case Ee.Alert.Description.decrypt_error:o="Decrypt error.";break;case Ee.Alert.Description.export_restriction:o="Export restriction.";break;case Ee.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case Ee.Alert.Description.insufficient_security:o="Insufficient security.";break;case Ee.Alert.Description.internal_error:o="Internal error.";break;case Ee.Alert.Description.user_canceled:o="User canceled.";break;case Ee.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===Ee.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===Ee.ConnectionEnd.client?"server":"client",alert:n}),t.process()};Ee.handleHandshake=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=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 cot[t.entity][t.expect]?(t.entity===Ee.ConnectionEnd.server&&!t.open&&!t.fail&&(t.handshaking=!0,t.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:Jt.md.md5.create(),sha1:Jt.md.sha1.create()}),n!==Ee.HandshakeType.hello_request&&n!==Ee.HandshakeType.certificate_verify&&n!==Ee.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),cot[t.entity][t.expect][n](t,e,o)):Ee.handleUnexpected(t,e)};Ee.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};Ee.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===Ee.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();Ee.queue(t,Ee.createRecord(t,{type:Ee.ContentType.heartbeat,data:Ee.createHeartbeat(Ee.HeartbeatMessageType.heartbeat_response,s)})),Ee.flush(t)}else if(n===Ee.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Jt.util.createBuffer(s))}t.process()};var ISs=0,xSs=1,SFn=2,wSs=3,RSs=4,IFn=5,PSs=6,kSs=7,DSs=8,NSs=0,MSs=1,Wrr=2,OSs=3,zrr=4,BSs=5,LSs=6,ye=Ee.handleUnexpected,xFn=Ee.handleChangeCipherSpec,OA=Ee.handleAlert,X_=Ee.handleHandshake,wFn=Ee.handleApplicationData,BA=Ee.handleHeartbeat,Yrr=[];Yrr[Ee.ConnectionEnd.client]=[[ye,OA,X_,ye,BA],[ye,OA,X_,ye,BA],[ye,OA,X_,ye,BA],[ye,OA,X_,ye,BA],[ye,OA,X_,ye,BA],[xFn,OA,ye,ye,BA],[ye,OA,X_,ye,BA],[ye,OA,X_,wFn,BA],[ye,OA,X_,ye,BA]];Yrr[Ee.ConnectionEnd.server]=[[ye,OA,X_,ye,BA],[ye,OA,X_,ye,BA],[ye,OA,X_,ye,BA],[ye,OA,X_,ye,BA],[xFn,OA,ye,ye,BA],[ye,OA,X_,ye,BA],[ye,OA,X_,wFn,BA],[ye,OA,X_,ye,BA]];var xj=Ee.handleHelloRequest,FSs=Ee.handleServerHello,RFn=Ee.handleCertificate,TFn=Ee.handleServerKeyExchange,$rr=Ee.handleCertificateRequest,sot=Ee.handleServerHelloDone,PFn=Ee.handleFinished,cot=[];cot[Ee.ConnectionEnd.client]=[[ye,ye,FSs,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye],[xj,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,RFn,TFn,$rr,sot,ye,ye,ye,ye,ye,ye],[xj,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,TFn,$rr,sot,ye,ye,ye,ye,ye,ye],[xj,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,$rr,sot,ye,ye,ye,ye,ye,ye],[xj,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,sot,ye,ye,ye,ye,ye,ye],[xj,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye],[xj,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,PFn],[xj,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye],[xj,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye]];var USs=Ee.handleClientHello,QSs=Ee.handleClientKeyExchange,qSs=Ee.handleCertificateVerify;cot[Ee.ConnectionEnd.server]=[[ye,USs,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,RFn,ye,ye,ye,ye,ye,ye,ye,ye,ye],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,QSs,ye,ye,ye,ye],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,qSs,ye,ye,ye,ye,ye],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,PFn],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye]];Ee.generateKeys=function(t,e){var r=lot,n=e.client_random+e.server_random;t.session.resuming||(e.master_secret=r(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var o=2*e.mac_key_length+2*e.enc_key_length,s=t.version.major===Ee.Versions.TLS_1_0.major&&t.version.minor===Ee.Versions.TLS_1_0.minor;s&&(o+=2*e.fixed_iv_length);var c=r(e.master_secret,"key expansion",n,o),l={client_write_MAC_key:c.getBytes(e.mac_key_length),server_write_MAC_key:c.getBytes(e.mac_key_length),client_write_key:c.getBytes(e.enc_key_length),server_write_key:c.getBytes(e.enc_key_length)};return s&&(l.client_write_IV=c.getBytes(e.fixed_iv_length),l.server_write_IV=c.getBytes(e.fixed_iv_length)),l};Ee.createConnectionState=function(t){var e=t.entity===Ee.ConnectionEnd.client,r=a(function(){var s={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:a(function(c){return!0},"cipherFunction"),compressionState:null,compressFunction:a(function(c){return!0},"compressFunction"),updateSequenceNumber:a(function(){s.sequenceNumber[1]===4294967295?(s.sequenceNumber[1]=0,++s.sequenceNumber[0]):++s.sequenceNumber[1]},"updateSequenceNumber")};return s},"createMode"),n={read:r(),write:r()};if(n.read.update=function(s,c){return n.read.cipherFunction(c,n.read)?n.read.compressFunction(s,c,n.read)||s.error(s,{message:"Could not decompress record.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.bad_record_mac}}),!s.fail},n.write.update=function(s,c){return n.write.compressFunction(s,c,n.write)?n.write.cipherFunction(c,n.write)||s.error(s,{message:"Could not encrypt record.",send:!1,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=Ee.generateKeys(t,o),n.read.macKey=e?o.keys.server_write_MAC_key:o.keys.client_write_MAC_key,n.write.macKey=e?o.keys.client_write_MAC_key:o.keys.server_write_MAC_key,t.session.cipherSuite.initConnectionState(n,t,o),o.compression_algorithm){case Ee.CompressionMethod.none:break;case Ee.CompressionMethod.deflate:n.read.compressFunction=TSs,n.write.compressFunction=SSs;break;default:throw new Error("Unsupported compression algorithm.")}}return n};Ee.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};Ee.createRecord=function(t,e){if(!e.data)return null;var r={type:e.type,version:{major:t.version.major,minor:t.version.minor},length:e.data.length(),fragment:e.data};return r};Ee.createAlert=function(t,e){var r=Jt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),Ee.createRecord(t,{type:Ee.ContentType.alert,data:r})};Ee.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=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(Ee.HandshakeType.client_hello),A.putInt24(g),A.putByte(t.version.major),A.putByte(t.version.minor),A.putBytes(t.session.sp.client_random),Rw(A,1,Jt.util.createBuffer(m)),Rw(A,2,e),Rw(A,1,s),h>0&&Rw(A,2,l),A};Ee.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Jt.util.createBuffer();return n.putByte(Ee.HandshakeType.server_hello),n.putInt24(r),n.putByte(t.version.major),n.putByte(t.version.minor),n.putBytes(t.session.sp.server_random),Rw(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};Ee.createCertificate=function(t){var e=t.entity===Ee.ConnectionEnd.client,r=null;if(t.getCertificate){var n;e?n=t.session.certificateRequest:n=t.session.extensions.server_name.serverNameList,r=t.getCertificate(t,n)}var o=Jt.util.createBuffer();if(r!==null)try{Jt.util.isArray(r)||(r=[r]);for(var s=null,c=0;c0&&(r.putByte(Ee.HandshakeType.server_key_exchange),r.putInt24(e)),r};Ee.getClientSignature=function(t,e){var r=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:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};Ee.createCertificateVerify=function(t,e){var r=e.length+2,n=Jt.util.createBuffer();return n.putByte(Ee.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};Ee.createCertificateRequest=function(t){var e=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(Ee.HandshakeType.certificate_request),u.putInt24(l),Rw(u,1,e),Rw(u,2,r),u};Ee.createServerHelloDone=function(t){var e=Jt.util.createBuffer();return e.putByte(Ee.HandshakeType.server_hello_done),e.putInt24(0),e};Ee.createChangeCipherSpec=function(){var t=Jt.util.createBuffer();return t.putByte(1),t};Ee.createFinished=function(t){var e=Jt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===Ee.ConnectionEnd.client,n=t.session.sp,o=12,s=lot,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Jt.util.createBuffer();return l.putByte(Ee.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};Ee.createHeartbeat=function(t,e,r){typeof r>"u"&&(r=e.length);var n=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};Ee.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===Ee.ContentType.handshake||e.type===Ee.ContentType.alert||e.type===Ee.ContentType.change_cipher_spec))){if(e.type===Ee.ContentType.handshake){var r=e.fragment.bytes();t.session.md5.update(r),t.session.sha1.update(r),r=null}var n;if(e.fragment.length()<=Ee.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>Ee.MaxFragment;)n.push(Ee.createRecord(t,{type:e.type,data:Jt.util.createBuffer(o.slice(0,Ee.MaxFragment))})),o=o.slice(Ee.MaxFragment);o.length>0&&n.push(Ee.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};Ee.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 Ee.CipherSuites)r.push(Ee.CipherSuites[n])}var o=t.server?Ee.ConnectionEnd.server:Ee.ConnectionEnd.client,s=t.sessionCache?Ee.createSessionCache(t.sessionCache):null,c={version:{major:Ee.Version.major,minor:Ee.Version.minor},entity:o,sessionId:t.sessionId,caStore:e,sessionCache:s,cipherSuites:r,connected:t.connected,virtualHost:t.virtualHost||null,verifyClient:t.verifyClient||!1,verify:t.verify||function(f,h,m,g){return h},verifyOptions:t.verifyOptions||{},getCertificate:t.getCertificate||null,getPrivateKey:t.getPrivateKey||null,getSignature:t.getSignature||null,input: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===Ee.ConnectionEnd.client?"client":"server"),h.send&&(Ee.queue(f,Ee.createAlert(f,h.alert)),Ee.flush(f));var m=h.fatal!==!1;m&&(f.fail=!0),t.error(f,h),m&&f.close(!1)},"error"),deflate:t.deflate||null,inflate:t.inflate||null};c.reset=function(f){c.version={major:Ee.Version.major,minor:Ee.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===Ee.ConnectionEnd.client?ISs: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=Ee.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-Ee.ContentType.change_cipher_spec,g=Yrr[f.entity][f.expect];m in g?g[m](f,h):Ee.handleUnexpected(f,h)},"_update"),u=a(function(f){var h=0,m=f.input,g=m.length();if(g<5)h=5-g;else{f.record={type:m.getByte(),version:{major:m.getByte(),minor:m.getByte()},length:m.getInt16(),fragment: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:Ee.Alert.Level.fatal,description:Ee.Alert.Description.protocol_version}})}return h},"_readRecordHeader"),d=a(function(f){var h=0,m=f.input,g=m.length();if(g0&&(c.sessionCache&&(h=c.sessionCache.getSession(f)),h===null&&(f="")),f.length===0&&c.sessionCache&&(h=c.sessionCache.getSession(),h!==null&&(f=h.id)),c.session={id:f,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:Jt.md.md5.create(),sha1:Jt.md.sha1.create()},h&&(c.version=h.version,c.session.sp=h.sp),c.session.sp.client_random=Ee.createRandom().getBytes(),c.open=!0,Ee.queue(c,Ee.createRecord(c,{type:Ee.ContentType.handshake,data:Ee.createClientHello(c)})),Ee.flush(c)}},c.process=function(f){var h=0;return f&&c.input.putBytes(f),c.fail||(c.record!==null&&c.record.ready&&c.record.fragment.isEmpty()&&(c.record=null),c.record===null&&(h=u(c)),!c.fail&&c.record!==null&&!c.record.ready&&(h=d(c)),!c.fail&&c.record!==null&&c.record.ready&&l(c,c.record)),h},c.prepare=function(f){return Ee.queue(c,Ee.createRecord(c,{type:Ee.ContentType.application_data,data:Jt.util.createBuffer(f)})),Ee.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,Ee.queue(c,Ee.createRecord(c,{type:Ee.ContentType.heartbeat,data:Ee.createHeartbeat(Ee.HeartbeatMessageType.heartbeat_request,f,h)})),Ee.flush(c)},c.close=function(f){if(!c.fail&&c.sessionCache&&c.session){var h={id:c.session.id,version:c.session.version,sp:c.session.sp};h.sp.keys=null,c.sessionCache.setSession(h.id,h)}c.open&&(c.open=!1,c.input.clear(),(c.isConnected||c.handshaking)&&(c.isConnected=c.handshaking=!1,Ee.queue(c,Ee.createAlert(c,{level:Ee.Alert.Level.warning,description:Ee.Alert.Description.close_notify})),Ee.flush(c)),c.closed(c)),c.reset(f)},c};kFn.exports=Jt.tls=Jt.tls||{};for(aot in Ee)typeof Ee[aot]!="function"&&(Jt.tls[aot]=Ee[aot]);var aot;Jt.tls.prf_tls1=lot;Jt.tls.hmac_sha1=bSs;Jt.tls.createSessionCache=Ee.createSessionCache;Jt.tls.createConnection=Ee.createConnection});var MFn=I((cif,NFn)=>{p();var wj=ps();vj();Krr();var Pw=NFn.exports=wj.tls;Pw.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=Pw.BulkCipherAlgorithm.aes,t.cipher_type=Pw.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=Pw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:DFn};Pw.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=Pw.BulkCipherAlgorithm.aes,t.cipher_type=Pw.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=Pw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:DFn};function DFn(t,e,r){var n=e.entity===wj.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:wj.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:wj.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=VSs,t.write.cipherFunction=HSs,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=Pw.hmac_sha1}a(DFn,"initConnectionState");function HSs(t,e){var r=!1,n=e.macFunction(e.macKey,e.sequenceNumber,t);t.fragment.putBytes(n),e.updateSequenceNumber();var o;t.version.minor===Pw.Versions.TLS_1_0.minor?o=e.cipherState.init?null:e.cipherState.iv:o=wj.random.getBytesSync(16),e.cipherState.init=!0;var s=e.cipherState.cipher;return s.start({iv:o}),t.version.minor>=Pw.Versions.TLS_1_1.minor&&s.output.putBytes(o),s.update(t.fragment),s.finish(GSs)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(HSs,"encrypt_aes_cbc_sha1");function GSs(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(GSs,"encrypt_aes_cbc_sha1_padding");function $Ss(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=wj.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=WSs(e.macKey,c,u)&&r,r}a(VSs,"decrypt_aes_cbc_sha1");function WSs(t,e,r){var n=wj.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(WSs,"compareMacs")});var Xrr=I((dif,FFn)=>{p();var od=ps();d5();oc();var VPe=FFn.exports=od.sha512=od.sha512||{};od.md.sha512=od.md.algorithms.sha512=VPe;var BFn=od.sha384=od.sha512.sha384=od.sha512.sha384||{};BFn.create=function(){return VPe.create("SHA-384")};od.md.sha384=od.md.algorithms.sha384=BFn;od.sha512.sha256=od.sha512.sha256||{create:a(function(){return VPe.create("SHA-512/256")},"create")};od.md["sha512/256"]=od.md.algorithms["sha512/256"]=od.sha512.sha256;od.sha512.sha224=od.sha512.sha224||{create:a(function(){return VPe.create("SHA-512/224")},"create")};od.md["sha512/224"]=od.md.algorithms["sha512/224"]=od.sha512.sha224;VPe.create=function(t){if(LFn||zSs(),typeof t>"u"&&(t="SHA-512"),!(t in sZ))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=sZ[t],r=null,n=od.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),OFn(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=od.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes(Jrr.substr(0,l.blockLength-f));for(var h,m,g=l.fullMessageLength[0]*8,A=0;A>>0,g+=m,u.putInt32(g>>>0),g=h>>>0;u.putInt32(g);for(var y=new Array(r.length),A=0;A=128;){for(O=0;O<16;++O)e[O][0]=r.getInt32()>>>0,e[O][1]=r.getInt32()>>>0;for(;O<80;++O)U=e[O-2],q=U[0],Q=U[1],n=((q>>>19|Q<<13)^(Q>>>29|q<<3)^q>>>6)>>>0,o=((q<<13|Q>>>19)^(Q<<3|q>>>29)^(q<<26|Q>>>6))>>>0,$=e[O-15],q=$[0],Q=$[1],s=((q>>>1|Q<<31)^(q>>>8|Q<<24)^q>>>7)>>>0,c=((q<<31|Q>>>1)^(q<<24|Q>>>8)^(q<<25|Q>>>7))>>>0,z=e[O-7],W=e[O-16],Q=o+z[1]+c+W[1],e[O][0]=n+z[0]+s+W[0]+(Q/4294967296>>>0)>>>0,e[O][1]=Q>>>0;for(y=t[0][0],E=t[0][1],_=t[1][0],v=t[1][1],b=t[2][0],T=t[2][1],w=t[3][0],R=t[3][1],x=t[4][0],P=t[4][1],D=t[5][0],N=t[5][1],B=t[6][0],L=t[6][1],j=t[7][0],M=t[7][1],O=0;O<80;++O)d=((x>>>14|P<<18)^(x>>>18|P<<14)^(P>>>9|x<<23))>>>0,f=((x<<18|P>>>14)^(x<<14|P>>>18)^(P<<23|x>>>9))>>>0,h=(B^x&(D^B))>>>0,m=(L^P&(N^L))>>>0,l=((y>>>28|E<<4)^(E>>>2|y<<30)^(E>>>7|y<<25))>>>0,u=((y<<4|E>>>28)^(E<<30|y>>>2)^(E<<25|y>>>7))>>>0,g=(y&_|b&(y^_))>>>0,A=(E&v|T&(E^v))>>>0,Q=M+f+m+Zrr[O][1]+e[O][1],n=j+d+h+Zrr[O][0]+e[O][0]+(Q/4294967296>>>0)>>>0,o=Q>>>0,Q=u+A,s=l+g+(Q/4294967296>>>0)>>>0,c=Q>>>0,j=B,M=L,B=D,L=N,D=x,N=P,Q=R+o,x=w+n+(Q/4294967296>>>0)>>>0,P=Q>>>0,w=b,R=T,b=_,T=v,_=y,v=E,Q=o+c,y=n+s+(Q/4294967296>>>0)>>>0,E=Q>>>0;Q=t[0][1]+E,t[0][0]=t[0][0]+y+(Q/4294967296>>>0)>>>0,t[0][1]=Q>>>0,Q=t[1][1]+v,t[1][0]=t[1][0]+_+(Q/4294967296>>>0)>>>0,t[1][1]=Q>>>0,Q=t[2][1]+T,t[2][0]=t[2][0]+b+(Q/4294967296>>>0)>>>0,t[2][1]=Q>>>0,Q=t[3][1]+R,t[3][0]=t[3][0]+w+(Q/4294967296>>>0)>>>0,t[3][1]=Q>>>0,Q=t[4][1]+P,t[4][0]=t[4][0]+x+(Q/4294967296>>>0)>>>0,t[4][1]=Q>>>0,Q=t[5][1]+N,t[5][0]=t[5][0]+D+(Q/4294967296>>>0)>>>0,t[5][1]=Q>>>0,Q=t[6][1]+L,t[6][0]=t[6][0]+B+(Q/4294967296>>>0)>>>0,t[6][1]=Q>>>0,Q=t[7][1]+M,t[7][0]=t[7][0]+j+(Q/4294967296>>>0)>>>0,t[7][1]=Q>>>0,J-=128}}a(OFn,"_update")});var UFn=I(enr=>{p();var YSs=ps();A2();var Cg=YSs.asn1;enr.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Cg.Class.UNIVERSAL,type:Cg.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Cg.Class.UNIVERSAL,type:Cg.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Cg.Class.UNIVERSAL,type:Cg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Cg.Class.UNIVERSAL,type:Cg.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Cg.Class.UNIVERSAL,type:Cg.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};enr.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Cg.Class.UNIVERSAL,type:Cg.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Cg.Class.UNIVERSAL,type:Cg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Cg.Class.UNIVERSAL,type:Cg.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Cg.Class.UNIVERSAL,type:Cg.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var ZFn=I((gif,JFn)=>{p();var LA=ps();jPe();Tw();Xrr();oc();var $Fn=UFn(),KSs=$Fn.publicKeyValidator,JSs=$Fn.privateKeyValidator;typeof QFn>"u"&&(QFn=LA.jsbn.BigInteger);var QFn,rnr=LA.util.ByteBuffer,ib=typeof Buffer>"u"?Uint8Array:Buffer;LA.pki=LA.pki||{};JFn.exports=LA.pki.ed25519=LA.ed25519=LA.ed25519||{};var Js=LA.ed25519;Js.constants={};Js.constants.PUBLIC_KEY_BYTE_LENGTH=32;Js.constants.PRIVATE_KEY_BYTE_LENGTH=64;Js.constants.SEED_BYTE_LENGTH=32;Js.constants.SIGN_BYTE_LENGTH=64;Js.constants.HASH_BYTE_LENGTH=64;Js.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=LA.random.getBytesSync(Js.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==Js.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Js.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');e=RF({message:e,encoding:"binary"});for(var r=new ib(Js.constants.PUBLIC_KEY_BYTE_LENGTH),n=new ib(Js.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return tTs(r,n),{publicKey:r,privateKey:n}};Js.privateKeyFromAsn1=function(t){var e={},r=[],n=LA.asn1.validate(t,JSs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=LA.asn1.derToOid(e.privateKeyOid),c=LA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.privateKey,u=RF({message:LA.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};Js.publicKeyFromAsn1=function(t){var e={},r=[],n=LA.asn1.validate(t,KSs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=LA.asn1.derToOid(e.publicKeyOid),c=LA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.ed25519PublicKey;if(l.length!==Js.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return RF({message:l,encoding:"binary"})};Js.publicKeyFromPrivateKey=function(t){t=t||{};var e=RF({message:t.privateKey,encoding:"binary"});if(e.length!==Js.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Js.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new ib(Js.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function RF(t){var e=t.message;if(e instanceof Uint8Array||e instanceof ib)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 rnr(e,r)}else if(!(e instanceof rnr))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 ib(e.length()),o=0;o=0;--r){if(t[e+r]WPe[r])return!1}return!1}a(iTs,"_isCanonicalSignatureScalar");function VFn(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)*WPe[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*WPe[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a(VFn,"modL");function inr(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;VFn(t,e)}a(inr,"reduce");function onr(t,e){var r=Vi(),n=Vi(),o=Vi(),s=Vi(),c=Vi(),l=Vi(),u=Vi(),d=Vi(),f=Vi();Hfe(r,t[1],t[0]),Hfe(f,e[1],e[0]),ql(r,r,f),jfe(n,t[0],t[1]),jfe(f,e[0],e[1]),ql(n,n,f),ql(o,t[3],e[3]),ql(o,o,XSs),ql(s,t[2],e[2]),jfe(s,s,s),Hfe(c,n,r),Hfe(l,s,o),jfe(u,s,o),jfe(d,n,r),ql(t[0],c,l),ql(t[1],d,u),ql(t[2],u,l),ql(t[3],c,d)}a(onr,"add");function HFn(t,e,r){for(var n=0;n<4;++n)KFn(t[n],e[n],r)}a(HFn,"cswap");function snr(t,e){var r=Vi(),n=Vi(),o=Vi();lTs(o,e[2]),ql(r,e[0],o),ql(n,e[1],o),dot(t,n),t[31]^=zFn(r)<<7}a(snr,"pack");function dot(t,e){var r,n,o,s=Vi(),c=Vi();for(r=0;r<16;++r)c[r]=e[r];for(tnr(c),tnr(c),tnr(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,KFn(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(dot,"pack25519");function oTs(t,e){var r=Vi(),n=Vi(),o=Vi(),s=Vi(),c=Vi(),l=Vi(),u=Vi();return Rj(t[2],uot),sTs(t[1],e),aZ(o,t[1]),ql(s,o,ZSs),Hfe(o,o,t[2]),jfe(s,t[2],s),aZ(c,s),aZ(l,c),ql(u,l,c),ql(r,u,o),ql(r,r,s),aTs(r,r),ql(r,r,o),ql(r,r,s),ql(r,r,s),ql(t[0],r,s),aZ(n,t[0]),ql(n,n,s),GFn(n,o)&&ql(t[0],t[0],eTs),aZ(n,t[0]),ql(n,n,s),GFn(n,o)?-1:(zFn(t[0])===e[31]>>7&&Hfe(t[0],nnr,t[0]),ql(t[3],t[0],t[1]),0)}a(oTs,"unpackneg");function sTs(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(sTs,"unpack25519");function aTs(t,e){var r=Vi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)aZ(r,r),n!==1&&ql(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(aTs,"pow2523");function GFn(t,e){var r=new ib(32),n=new ib(32);return dot(r,t),dot(n,e),WFn(r,0,n,0)}a(GFn,"neq25519");function WFn(t,e,r,n){return cTs(t,e,r,n,32)}a(WFn,"crypto_verify_32");function cTs(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(cTs,"vn");function zFn(t){var e=new ib(32);return dot(e,t),e[0]&1}a(zFn,"par25519");function YFn(t,e,r){var n,o;for(Rj(t[0],nnr),Rj(t[1],uot),Rj(t[2],uot),Rj(t[3],nnr),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,HFn(t,e,n),onr(e,t),onr(t,t),HFn(t,e,n)}a(YFn,"scalarmult");function anr(t,e){var r=[Vi(),Vi(),Vi(),Vi()];Rj(r[0],qFn),Rj(r[1],jFn),Rj(r[2],uot),ql(r[3],qFn,jFn),YFn(t,r,e)}a(anr,"scalarbase");function Rj(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(Rj,"set25519");function lTs(t,e){var r=Vi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)aZ(r,r),n!==2&&n!==4&&ql(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(lTs,"inv25519");function tnr(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(tnr,"car25519");function KFn(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(KFn,"sel25519");function Vi(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var lT=ps();oc();Tw();jPe();t8n.exports=lT.kem=lT.kem||{};var XFn=lT.jsbn.BigInteger;lT.kem.rsa={};lT.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||lT.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new XFn(lT.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(XFn.ONE)<=0);l=lT.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=lT.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};lT.kem.kdf1=function(t,e){e8n(this,t,0,e||t.digestLength)};lT.kem.kdf2=function(t,e){e8n(this,t,1,e||t.digestLength)};function e8n(t,e,r,n){t.generate=function(o,s){for(var c=new lT.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new lT.util.ByteBuffer,d=r;d{p();var da=ps();oc();o8n.exports=da.log=da.log||{};da.log.levels=["none","error","warning","info","debug","verbose","max"];var fot={},unr=[],KPe=null;da.log.LEVEL_LOCKED=2;da.log.NO_LEVEL_CHECK=4;da.log.INTERPOLATE=8;for(E5=0;E5"u"||e?t.flags|=da.log.LEVEL_LOCKED:t.flags&=~da.log.LEVEL_LOCKED};da.log.addLogger=function(t){unr.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(n8n={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},JPe=a(function(t,e){da.log.prepareStandard(e);var r=n8n[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),Gfe=da.log.makeLogger(JPe)):(JPe=a(function(e,r){da.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),Gfe=da.log.makeLogger(JPe)),da.log.setLevel(Gfe,"debug"),da.log.addLogger(Gfe),KPe=Gfe):console={log:a(function(){},"log")};var Gfe,n8n,JPe;KPe!==null&&typeof window<"u"&&window.location&&(YPe=new URL(window.location.href).searchParams,YPe.has("console.level")&&da.log.setLevel(KPe,YPe.get("console.level").slice(-1)[0]),YPe.has("console.lock")&&(i8n=YPe.get("console.lock").slice(-1)[0],i8n=="true"&&da.log.lock(KPe)));var YPe,i8n;da.log.consoleLogger=KPe});var c8n=I((Tif,a8n)=>{p();a8n.exports=d5();$it();Lfe();Srr();Xrr()});var d8n=I((xif,u8n)=>{p();var Xr=ps();vj();A2();QPe();Cj();eZ();Frr();Tw();oc();oot();var Xe=Xr.asn1,ev=u8n.exports=Xr.pkcs7=Xr.pkcs7||{};ev.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 ev.messageFromAsn1(n)};ev.messageToPem=function(t,e){var r={type:"PKCS7",body:Xe.toDer(t.toAsn1()).getBytes()};return Xr.pem.encode(r,{maxline:e})};ev.messageFromAsn1=function(t){var e={},r=[];if(!Xe.validate(t,ev.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=ev.createEnvelopedData();break;case Xr.pki.oids.encryptedData:s=ev.createEncryptedData();break;case Xr.pki.oids.signedData:s=ev.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};ev.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(fnr(t,n,ev.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 om=ps();vj();Nfe();$it();Lfe();oc();var hot=f8n.exports=om.ssh=om.ssh||{};hot.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(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 `;s+="Encryption: "+o+`\r `,s+="Comment: "+r+`\r -`;var c=om.util.createBuffer();$fe(c,n),_5(c,t.e),_5(c,t.n);var l=om.util.encode64(c.bytes(),64),u=Math.floor(l.length/66)+1;s+="Public-Lines: "+u+`\r -`,s+=l;var d=om.util.createBuffer();_5(d,t.d),_5(d,t.p),_5(d,t.q),_5(d,t.qInv);var f;if(!e)f=om.util.encode64(d.bytes(),64);else{var h=d.length()+16-1;h-=h%16;var m=pot(d.bytes());m.truncate(m.length()-h+d.length()),d.putBuffer(m);var g=om.util.createBuffer();g.putBuffer(pot("\0\0\0\0",e)),g.putBuffer(pot("\0\0\0",e));var A=om.aes.createEncryptionCipher(g.truncate(8),"CBC");A.start(om.util.createBuffer().fillWithByte(0,16)),A.update(d.copy()),A.finish();var y=A.output;y.truncate(16),f=om.util.encode64(y.bytes(),64)}u=Math.floor(f.length/66)+1,s+=`\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 Private-Lines: `+u+`\r -`,s+=f;var E=pot("putty-private-key-file-mac-key",e),_=om.util.createBuffer();$fe(_,n),$fe(_,o),$fe(_,r),_.putInt32(c.length()),_.putBuffer(c),_.putInt32(d.length()),_.putBuffer(d);var v=om.hmac.create();return v.start("sha1",E),v.update(_.bytes()),s+=`\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 Private-MAC: `+v.digest().toHex()+`\r -`,s};hot.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=om.util.createBuffer();return $fe(n,r),_5(n,t.e),_5(n,t.n),r+" "+om.util.encode64(n.bytes())+" "+e};hot.privateKeyToOpenSSH=function(t,e){return e?om.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):om.pki.privateKeyToPem(t)};hot.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||om.md.md5.create(),n="ssh-rsa",o=om.util.createBuffer();$fe(o,n),_5(o,t.e),_5(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 _5(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=om.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(_5,"_addBigIntegerToBuffer");function $fe(t,e){t.putInt32(e.length),t.putString(e)}a($fe,"_addStringToBuffer");function pot(){for(var t=om.md.sha1.create(),e=arguments.length,r=0;r{p();h8n.exports=ps();vj();MFn();A2();Fit();QPe();ZFn();Nfe();r8n();s8n();c8n();Urr();Yit();eZ();Nrr();jrr();d8n();Grr();Orr();Trr();rot();Tw();wrr();p8n();Krr();oc()});var y8n=I(cZ=>{"use strict";p();Object.defineProperty(cZ,"__esModule",{value:!0});cZ.convert=cZ.Format=void 0;var ZPe=m8n(),Pj;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(Pj=cZ.Format||(cZ.Format={}));function g8n(t){var e=ZPe.pki.pemToDer(t),r=ZPe.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(g8n,"myASN");function ATs(t){var e=g8n(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(ATs,"txtFormat");function A8n(t,e){switch(e){case Pj.der:return ZPe.pki.pemToDer(t);case Pj.pem:return t;case Pj.txt:return ATs(t);case Pj.asn1:return g8n(t);case Pj.fingerprint:var r=ZPe.md.sha1.create(),n=A8n(t,Pj.der);return r.update(n.getBytes()),r.digest().toHex();case Pj.x509:return ZPe.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(A8n,"convert");cZ.convert=A8n});var S8n=I(ob=>{"use strict";p();var kj=ob&&ob.__assign||function(){return kj=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})(pnr.Agent),(0,_8n.setGlobalDispatcher)(new _8n.Agent({connect:{ca:e}}))}},"addToGlobalAgent");ob.addToGlobalAgent=ETs});var T8n=I((qif,hnr)=>{p();function _Ts(){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(_Ts,"all");process.platform!=="win32"?hnr.exports.all=()=>[]:hnr.exports.all=_Ts});var nl=I((zif,k8n)=>{"use strict";p();k8n.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 Rnr=I((Kif,O8n)=>{"use strict";p();var Wfe=0,bnr=1e3,Snr=(bnr>>1)-1,Dj,Tnr=Symbol("kFastTimer"),kF=[],Inr=-2,xnr=-1,N8n=0,D8n=1;function wnr(){Wfe+=Snr;let t=0,e=kF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=xnr,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===xnr?(r._state=Inr,--e!==0&&(kF[t]=kF[e])):++t}kF.length=e,kF.length!==0&&M8n()}a(wnr,"onTick");function M8n(){Dj?.refresh?Dj.refresh():(clearTimeout(Dj),Dj=setTimeout(wnr,Snr),Dj?.unref())}a(M8n,"refreshTimeout");var _ot=class{static{a(this,"FastTimer")}[Tnr]=!0;_state=Inr;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===Inr&&kF.push(this),(!Dj||kF.length===1)&&M8n(),this._state=N8n}clear(){this._state=xnr,this._idleStart=-1}};O8n.exports={setTimeout(t,e,r){return e<=bnr?setTimeout(t,e,r):new _ot(t,e,r)},clearTimeout(t){t[Tnr]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new _ot(t,e,r)},clearFastTimeout(t){t.clear()},now(){return Wfe},tick(t=0){Wfe+=t-bnr+1,wnr(),wnr()},reset(){Wfe=0,kF.length=0,clearTimeout(Dj),Dj=null},kFastTimer:Tnr}});var co=I((Xif,s6n)=>{"use strict";p();var B8n=Symbol.for("undici.error.UND_ERR"),sd=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[B8n]===!0}get[B8n](){return!0}},L8n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),Pnr=class extends sd{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[L8n]===!0}get[L8n](){return!0}},F8n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),knr=class extends sd{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[F8n]===!0}get[F8n](){return!0}},U8n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),Dnr=class extends sd{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[U8n]===!0}get[U8n](){return!0}},Q8n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),Nnr=class extends sd{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[Q8n]===!0}get[Q8n](){return!0}},q8n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),Mnr=class extends sd{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[q8n]===!0}get[q8n](){return!0}},j8n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),Onr=class extends sd{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[j8n]===!0}get[j8n](){return!0}},H8n=Symbol.for("undici.error.UND_ERR_ABORT"),vot=class extends sd{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[H8n]===!0}get[H8n](){return!0}},G8n=Symbol.for("undici.error.UND_ERR_ABORTED"),Bnr=class extends vot{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[G8n]===!0}get[G8n](){return!0}},$8n=Symbol.for("undici.error.UND_ERR_INFO"),Lnr=class extends sd{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[$8n]===!0}get[$8n](){return!0}},V8n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),Fnr=class extends sd{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[V8n]===!0}get[V8n](){return!0}},W8n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),Unr=class extends sd{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[W8n]===!0}get[W8n](){return!0}},z8n=Symbol.for("undici.error.UND_ERR_DESTROYED"),Qnr=class extends sd{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[z8n]===!0}get[z8n](){return!0}},Y8n=Symbol.for("undici.error.UND_ERR_CLOSED"),qnr=class extends sd{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[Y8n]===!0}get[Y8n](){return!0}},K8n=Symbol.for("undici.error.UND_ERR_SOCKET"),jnr=class extends sd{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[K8n]===!0}get[K8n](){return!0}},J8n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),Hnr=class extends sd{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[J8n]===!0}get[J8n](){return!0}},Z8n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),Gnr=class extends sd{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[Z8n]===!0}get[Z8n](){return!0}},X8n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),$nr=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[X8n]===!0}get[X8n](){return!0}},e6n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),Vnr=class extends sd{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[e6n]===!0}get[e6n](){return!0}},t6n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),Wnr=class extends sd{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[t6n]===!0}get[t6n](){return!0}},r6n=Symbol.for("undici.error.UND_ERR_RESPONSE"),znr=class extends sd{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[r6n]===!0}get[r6n](){return!0}},n6n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),Ynr=class extends sd{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[n6n]===!0}get[n6n](){return!0}},i6n=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),Knr=class extends sd{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[i6n]===!0}get[i6n](){return!0}},Jnr=class extends sd{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},o6n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),Znr=class extends sd{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[o6n]===!0}get[o6n](){return!0}};s6n.exports={AbortError:vot,HTTPParserError:$nr,UndiciError:sd,HeadersTimeoutError:knr,HeadersOverflowError:Dnr,BodyTimeoutError:Nnr,RequestContentLengthMismatchError:Fnr,ConnectTimeoutError:Pnr,InvalidArgumentError:Mnr,InvalidReturnValueError:Onr,RequestAbortedError:Bnr,ClientDestroyedError:Qnr,ClientClosedError:qnr,InformationalError:Lnr,SocketError:jnr,NotSupportedError:Hnr,ResponseContentLengthMismatchError:Unr,BalancedPoolMissingUpstreamError:Gnr,ResponseExceededMaxSizeError:Vnr,RequestRetryError:Wnr,ResponseError:znr,SecureProxyConnectionError:Ynr,MaxOriginsReachedError:Knr,Socks5ProxyError:Jnr,MessageSizeExceededError:Znr}});var bot=I((rof,c6n)=>{"use strict";p();var Xnr=["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"],Cot={};Object.setPrototypeOf(Cot,null);var a6n={};Object.setPrototypeOf(a6n,null);function CTs(t){let e=a6n[t];return e===void 0&&(e=Buffer.from(t)),e}a(CTs,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:l6n,headerNameLowerCasedRecord:bTs}=bot(),eir=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 XPe=require("node:assert"),{kDestroyed:g6n,kBodyUsed:zfe,kListeners:Iot,kBody:p6n}=nl(),{IncomingMessage:STs}=require("node:http"),A6n=require("node:stream"),TTs=require("node:net"),{stringify:ITs}=require("node:querystring"),{EventEmitter:xTs}=require("node:events"),Tot=Rnr(),{InvalidArgumentError:bg,ConnectTimeoutError:wTs}=co(),{headerNameLowerCasedRecord:RTs}=bot(),{tree:y6n}=f6n(),[PTs,kTs]=process.versions.node.split(".",2).map(t=>Number(t)),wot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[p6n]=e,this[zfe]=!1}async*[Symbol.asyncIterator](){XPe(!this[zfe],"disturbed"),this[zfe]=!0,yield*this[p6n]}};function h6n(){}a(h6n,"noop");function DTs(t){return Rot(t)?(S6n(t)===0&&t.on("data",function(){XPe(!1)}),typeof t.readableDidRead!="boolean"&&(t[zfe]=!1,xTs.prototype.on.call(t,"data",function(){this[zfe]=!0})),t):t&&typeof t.pipeTo=="function"?new wot(t):t&&R6n(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&b6n(t)?new wot(t):t}a(DTs,"wrapRequestBody");function Rot(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Rot,"isStream");function E6n(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(E6n,"isBlobLike");function _6n(t){return t.includes("?")||t.includes("#")}a(_6n,"pathHasQueryOrFragment");function NTs(t,e){if(_6n(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=ITs(e);return r&&(t+="?"+r),t}a(NTs,"serializePathWithQuery");function v6n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(v6n,"isValidPort");function xot(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(xot,"isHttpOrHttpsPrefixed");function C6n(t){if(typeof t=="string"){if(t=new URL(t),!xot(t.origin||t.protocol))throw new bg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new bg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&v6n(t.port)===!1)throw new bg("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 bg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new bg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new bg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new bg("Invalid URL origin: the origin must be a string or null/undefined.");if(!xot(t.origin||t.protocol))throw new bg("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(!xot(t.origin||t.protocol))throw new bg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(C6n,"parseURL");function MTs(t){if(t=C6n(t),t.pathname!=="/"||t.search||t.hash)throw new bg("invalid url");return t}a(MTs,"parseOrigin");function OTs(t){if(t[0]==="["){let r=t.indexOf("]");return XPe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(OTs,"getHostname");function BTs(t){if(!t)return null;XPe(typeof t=="string");let e=OTs(t);return TTs.isIP(e)?"":e}a(BTs,"getServerName");function LTs(t){return JSON.parse(JSON.stringify(t))}a(LTs,"deepClone");function FTs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(FTs,"isAsyncIterable");function b6n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(b6n,"isIterable");function UTs(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(UTs,"hasSafeIterator");function S6n(t){if(t==null)return 0;if(Rot(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(E6n(t))return t.size!=null?t.size:null;if(w6n(t))return t.byteLength}return null}a(S6n,"bodyLength");function T6n(t){return t&&!!(t.destroyed||t[g6n]||A6n.isDestroyed?.(t))}a(T6n,"isDestroyed");function I6n(t,e){t==null||!Rot(t)||T6n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===STs&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[g6n]=!0))}a(I6n,"destroy");var QTs=/timeout=(\d+)/;function qTs(t){let e=t.match(QTs);return e?parseInt(e[1],10)*1e3:null}a(qTs,"parseKeepAliveTimeout");function x6n(t){return typeof t=="string"?RTs[t]??t.toLowerCase():y6n.lookup(t)??t.toString("latin1").toLowerCase()}a(x6n,"headerNameToString");function jTs(t){return y6n.lookup(t)??t.toString("latin1").toLowerCase()}a(jTs,"bufferToLowerCasedHeaderName");function HTs(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(HTs,"parseHeaders");function GTs(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a($Ts,"encodeRawHeaders");function w6n(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(w6n,"isBuffer");function VTs(t,e,r){if(!t||typeof t!="object")throw new bg("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new bg("invalid onConnect method");if(typeof t.onError!="function")throw new bg("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new bg("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new bg("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new bg("invalid onHeaders method");if(typeof t.onData!="function")throw new bg("invalid onData method");if(typeof t.onComplete!="function")throw new bg("invalid onComplete method")}}}a(VTs,"assertRequestHandler");function WTs(t){return!!(t&&(A6n.isDisturbed(t)||t[zfe]))}a(WTs,"isDisturbed");function zTs(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(zTs,"getSocketInfo");function YTs(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(YTs,"ReadableStreamFrom");function R6n(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(R6n,"isFormDataLike");function KTs(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(KTs,"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 JTs(t){return P6n[t]===1}a(JTs,"isTokenCharCode");var ZTs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function XTs(t){if(t.length>=12)return ZTs.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return h6n;let r=null,n=null,o=Tot.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>m6n(t.deref(),e))})},e.timeout);return()=>{Tot.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return h6n;let r=null,n=Tot.setFastTimeout(()=>{r=setImmediate(()=>{m6n(t.deref(),e)})},e.timeout);return()=>{Tot.clearFastTimeout(n),clearImmediate(r)}};function m6n(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 wTs(r))}a(m6n,"onConnectTimeout");function cIs(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(cIs,"getProtocolFromUrlString");var k6n=Object.create(null);k6n.enumerable=!0;var tir={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},D6n={...tir,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(tir,null);Object.setPrototypeOf(D6n,null);N6n.exports={kEnumerableProperty:k6n,isDisturbed:WTs,isBlobLike:E6n,parseOrigin:MTs,parseURL:C6n,getServerName:BTs,isStream:Rot,isIterable:b6n,hasSafeIterator:UTs,isAsyncIterable:FTs,isDestroyed:T6n,headerNameToString:x6n,bufferToLowerCasedHeaderName:jTs,addListener:iIs,removeAllListeners:oIs,errorRequest:sIs,parseRawHeaders:GTs,encodeRawHeaders:$Ts,parseHeaders:HTs,parseKeepAliveTimeout:qTs,destroy:I6n,bodyLength:S6n,deepClone:LTs,ReadableStreamFrom:YTs,isBuffer:w6n,assertRequestHandler:VTs,getSocketInfo:zTs,isFormDataLike:R6n,pathHasQueryOrFragment:_6n,serializePathWithQuery:NTs,addAbortListener:KTs,isValidHTTPToken:XTs,isValidHeaderValue:tIs,isTokenCharCode:JTs,parseRangeHeader:nIs,normalizedMethodRecordsBase:tir,normalizedMethodRecords:D6n,isValidPort:v6n,isHttpOrHttpsPrefixed:xot,nodeMajor:PTs,nodeMinor:kTs,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:DTs,setupConnectTimeout:aIs,getProtocolFromUrlString:cIs}});var iir=I((dof,F6n)=>{"use strict";p();var{kConnected:M6n,kPending:O6n,kRunning:B6n,kSize:L6n,kFree:lIs,kQueued:uIs}=nl(),rir=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[M6n],this.pending=e[O6n],this.running=e[B6n],this.size=e[L6n]}},nir=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[M6n],this.free=e[lIs],this.pending=e[O6n],this.queued=e[uIs],this.running=e[B6n],this.size=e[L6n]}};F6n.exports={ClientStats:rir,PoolStats:nir}});var Nj=I((hof,Q6n)=>{"use strict";p();var il=require("node:diagnostics_channel"),cir=require("node:util"),lZ=cir.debuglog("undici"),eke=cir.debuglog("fetch"),Pot=cir.debuglog("websocket"),uT={beforeConnect:il.channel("undici:client:beforeConnect"),connected:il.channel("undici:client:connected"),connectError:il.channel("undici:client:connectError"),sendHeaders:il.channel("undici:client:sendHeaders"),create:il.channel("undici:request:create"),bodySent:il.channel("undici:request:bodySent"),bodyChunkSent:il.channel("undici:request:bodyChunkSent"),bodyChunkReceived:il.channel("undici:request:bodyChunkReceived"),headers:il.channel("undici:request:headers"),trailers:il.channel("undici:request:trailers"),error:il.channel("undici:request:error"),open:il.channel("undici:websocket:open"),close:il.channel("undici:websocket:close"),socketError:il.channel("undici:websocket:socket_error"),ping:il.channel("undici:websocket:ping"),pong:il.channel("undici:websocket:pong"),proxyConnected:il.channel("undici:proxy:connected")},oir=!1;function U6n(t=lZ){if(!oir){if(uT.beforeConnect.hasSubscribers||uT.connected.hasSubscribers||uT.connectError.hasSubscribers||uT.sendHeaders.hasSubscribers){oir=!0;return}oir=!0,il.subscribe("undici:client:beforeConnect",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),il.subscribe("undici:client:connected",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),il.subscribe("undici:client:connectError",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),il.subscribe("undici:client:sendHeaders",e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s%s",r,o,n)})}}a(U6n,"trackClientEvents");var sir=!1;function dIs(t=lZ){if(!sir){if(uT.headers.hasSubscribers||uT.trailers.hasSubscribers||uT.error.hasSubscribers){sir=!0;return}sir=!0,il.subscribe("undici:request:headers",e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s%s - HTTP %d",r,o,n,s)}),il.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),il.subscribe("undici:request:error",e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s%s errored - %s",r,o,n,s.message)})}}a(dIs,"trackRequestEvents");var air=!1;function fIs(t=Pot){if(!air){if(uT.open.hasSubscribers||uT.close.hasSubscribers||uT.socketError.hasSubscribers||uT.ping.hasSubscribers||uT.pong.hasSubscribers){air=!0;return}air=!0,il.subscribe("undici:websocket:open",e=>{if(e.address!=null){let{address:r,port:n}=e.address;t("connection opened %s%s",r,n?`:${n}`:"")}else t("connection opened")}),il.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),il.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),il.subscribe("undici:websocket:ping",e=>{t("ping received")}),il.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(fIs,"trackWebSocketEvents");(lZ.enabled||eke.enabled)&&(U6n(eke.enabled?eke:lZ),dIs(eke.enabled?eke:lZ));Pot.enabled&&(U6n(lZ.enabled?lZ:Pot),fIs(Pot));Q6n.exports={channels:uT}});var H6n=I((Aof,j6n)=>{"use strict";p();var{InvalidArgumentError:Fc,NotSupportedError:pIs}=co(),v5=require("node:assert"),{isValidHTTPToken:lir,isValidHeaderValue:uir,isStream:hIs,destroy:mIs,isBuffer:gIs,isFormDataLike:AIs,isIterable:yIs,hasSafeIterator:EIs,isBlobLike:_Is,serializePathWithQuery:vIs,assertRequestHandler:CIs,getServerName:bIs,normalizedMethodRecords:SIs,getProtocolFromUrlString:TIs}=ko(),{channels:sb}=Nj(),{headerNameLowerCasedRecord:q6n}=bot(),IIs=/[^\u0021-\u00ff]/;function xIs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a(xIs,"isValidContentLengthHeaderValue");var kw=Symbol("handler"),dir=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 Fc("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Fc("path must be an absolute URL or start with a slash");if(IIs.test(r))throw new Fc("invalid request path");if(typeof n!="string")throw new Fc("method must be a string");if(SIs[n]===void 0&&!lir(n))throw new Fc("invalid request method");if(d&&typeof d!="string")throw new Fc("upgrade must be a string");if(d&&!uir(d))throw new Fc("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Fc("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Fc("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Fc("invalid reset");if(g!=null&&typeof g!="boolean")throw new Fc("invalid expectContinue");if(y!=null)throw new Fc("invalid throwOnError");if(E!=null&&E!==0)throw new Fc("maxRedirections is not supported, use the redirect interceptor");if(_!=null&&(!Number.isInteger(_)||_<0||_>255))throw new Fc("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(hIs(o)){this.body=o;let b=this.body._readableState;(!b||!b.autoDestroy)&&(this.endHandler=a(function(){mIs(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(gIs(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(AIs(o)||yIs(o)||_Is(o))this.body=o;else throw new Fc("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?vIs(r,c):r,this.origin=e,this.protocol=TIs(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 Fc("headers array must be even");for(let b=0;b{"use strict";p();var{InvalidArgumentError:wIs}=co();$6n.exports=class G6n{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new G6n(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"),fir(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"),fir(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"),fir(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new wIs("invalid onError method");this.#e.onError?.(r)}};function fir(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(fir,"toRawHeaderValue")});var rke=I((bof,V6n)=>{"use strict";p();var RIs=require("node:events"),PIs=tke(),kIs=a(t=>(e,r)=>t(e,PIs.wrap(r)),"wrapInterceptor"),pir=class extends RIs{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=kIs(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")})}};V6n.exports=pir});var Y6n=I((Iof,z6n)=>{"use strict";p();var{parseHeaders:hir}=ko(),{InvalidArgumentError:DIs}=co(),mir=Symbol("resume"),gir=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[mir]=null;rawHeaders=null;rawTrailers=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[mir]?.())}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}};z6n.exports=class W6n{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new W6n(e):e}onConnect(e,r){this.#t=new gir(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,hir(r),n)}onHeaders(e,r,n,o){return this.#t[mir]=n,this.#t.rawHeaders=r,this.#e.onResponseStart?.(this.#t,e,hir(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,hir(e))}onError(e){if(!this.#e.onResponseError)throw new DIs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var dZ=I((Rof,K6n)=>{"use strict";p();var NIs=rke(),MIs=Y6n(),{ClientDestroyedError:Air,ClientClosedError:OIs,InvalidArgumentError:Dot}=co(),{kDestroy:BIs,kClose:LIs,kClosed:nke,kDestroyed:Yfe,kDispatch:FIs}=nl(),Mj=Symbol("onDestroyed"),uZ=Symbol("onClosed"),yir=Symbol("webSocketOptions"),Eir=class extends NIs{static{a(this,"DispatcherBase")}[Yfe]=!1;[Mj]=null;[nke]=!1;[uZ]=null;constructor(e){super(),this[yir]=e?.webSocket??{}}get webSocketOptions(){return{maxFragments:this[yir].maxFragments??131072,maxPayloadSize:this[yir].maxPayloadSize??128*1024*1024}}get destroyed(){return this[Yfe]}get closed(){return this[nke]}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 Dot("invalid callback");if(this[Yfe]){let n=new Air;queueMicrotask(()=>e(n,null));return}if(this[nke]){this[uZ]?this[uZ].push(e):queueMicrotask(()=>e(null,null));return}this[nke]=!0,this[uZ]??=[],this[uZ].push(e);let r=a(()=>{let n=this[uZ];this[uZ]=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 Dot("invalid callback");if(this[Yfe]){this[Mj]?this[Mj].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new Air),this[Yfe]=!0,this[Mj]??=[],this[Mj].push(r);let n=a(()=>{let o=this[Mj];this[Mj]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new Dot("handler must be an object");r=MIs.unwrap(r);try{if(!e||typeof e!="object")throw new Dot("opts must be an object.");if(this[Yfe]||this[Mj])throw new Air;if(this[nke])throw new OIs;return this[FIs](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};K6n.exports=Eir});var fZ=I((Nof,X6n)=>{"use strict";p();var UIs=require("node:net"),J6n=require("node:assert"),Z6n=ko(),{InvalidArgumentError:QIs}=co(),_ir,qIs=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 jIs({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new QIs("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new qIs(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:"){_ir||(_ir=require("node:tls")),A=A||l.servername||Z6n.getServerName(h)||null;let T=A||f;J6n(T);let w=s||u.get(T)||null;g=g||443,v=_ir.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 J6n(!E,"httpSocket can only be sent on TLS update"),g=g||80,v=UIs.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=Z6n.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(jIs,"buildConnector");X6n.exports=jIs});var e9n=I(vir=>{"use strict";p();Object.defineProperty(vir,"__esModule",{value:!0});vir.enumToMap=HIs;function HIs(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(HIs,"enumToMap")});var t9n=I(qe=>{"use strict";p();Object.defineProperty(qe,"__esModule",{value:!0});qe.SPECIAL_HEADERS=qe.MINOR=qe.MAJOR=qe.HTAB_SP_VCHAR_OBS_TEXT=qe.QUOTED_STRING=qe.CONNECTION_TOKEN_CHARS=qe.HEADER_CHARS=qe.TOKEN=qe.HEX=qe.URL_CHAR=qe.USERINFO_CHARS=qe.MARK=qe.ALPHANUM=qe.NUM=qe.HEX_MAP=qe.NUM_MAP=qe.ALPHA=qe.STATUSES_HTTP=qe.H_METHOD_MAP=qe.METHOD_MAP=qe.METHODS_RTSP=qe.METHODS_ICE=qe.METHODS_HTTP=qe.HEADER_STATE=qe.FINISH=qe.STATUSES=qe.METHODS=qe.LENIENT_FLAGS=qe.FLAGS=qe.TYPE=qe.ERROR=void 0;var GIs=e9n();qe.ERROR={OK:0,INTERNAL:1,STRICT:2,CR_EXPECTED:25,LF_EXPECTED:3,UNEXPECTED_CONTENT_LENGTH:4,UNEXPECTED_SPACE:30,CLOSED_CONNECTION:5,INVALID_METHOD:6,INVALID_URL:7,INVALID_CONSTANT:8,INVALID_VERSION:9,INVALID_HEADER_TOKEN:10,INVALID_CONTENT_LENGTH:11,INVALID_CHUNK_SIZE:12,INVALID_STATUS:13,INVALID_EOF_STATE:14,INVALID_TRANSFER_ENCODING:15,CB_MESSAGE_BEGIN:16,CB_HEADERS_COMPLETE:17,CB_MESSAGE_COMPLETE:18,CB_CHUNK_HEADER:19,CB_CHUNK_COMPLETE:20,PAUSED:21,PAUSED_UPGRADE:22,PAUSED_H2_UPGRADE:23,USER:24,CB_URL_COMPLETE:26,CB_STATUS_COMPLETE:27,CB_METHOD_COMPLETE:32,CB_VERSION_COMPLETE:33,CB_HEADER_FIELD_COMPLETE:28,CB_HEADER_VALUE_COMPLETE:29,CB_CHUNK_EXTENSION_NAME_COMPLETE:34,CB_CHUNK_EXTENSION_VALUE_COMPLETE:35,CB_RESET:31,CB_PROTOCOL_COMPLETE:38};qe.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};qe.FLAGS={CONNECTION_KEEP_ALIVE:1,CONNECTION_CLOSE:2,CONNECTION_UPGRADE:4,CHUNKED:8,UPGRADE:16,CONTENT_LENGTH:32,SKIPBODY:64,TRAILING:128,TRANSFER_ENCODING:512};qe.LENIENT_FLAGS={HEADERS:1,CHUNKED_LENGTH:2,KEEP_ALIVE:4,TRANSFER_ENCODING:8,VERSION:16,DATA_AFTER_CLOSE:32,OPTIONAL_LF_AFTER_CR:64,OPTIONAL_CRLF_AFTER_CHUNK:128,OPTIONAL_CR_BEFORE_LF:256,SPACES_AFTER_CHUNK_SIZE:512};qe.METHODS={DELETE:0,GET:1,HEAD:2,POST:3,PUT:4,CONNECT:5,OPTIONS:6,TRACE:7,COPY:8,LOCK:9,MKCOL:10,MOVE:11,PROPFIND:12,PROPPATCH:13,SEARCH:14,UNLOCK:15,BIND:16,REBIND:17,UNBIND:18,ACL:19,REPORT:20,MKACTIVITY:21,CHECKOUT:22,MERGE:23,"M-SEARCH":24,NOTIFY:25,SUBSCRIBE:26,UNSUBSCRIBE:27,PATCH:28,PURGE:29,MKCALENDAR:30,LINK:31,UNLINK:32,SOURCE:33,PRI:34,DESCRIBE:35,ANNOUNCE:36,SETUP:37,PLAY:38,PAUSE:39,TEARDOWN:40,GET_PARAMETER:41,SET_PARAMETER:42,REDIRECT:43,RECORD:44,FLUSH:45,QUERY:46};qe.STATUSES={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,RESPONSE_IS_STALE:110,REVALIDATION_FAILED:111,DISCONNECTED_OPERATION:112,HEURISTIC_EXPIRATION:113,MISCELLANEOUS_WARNING:199,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,TRANSFORMATION_APPLIED:214,IM_USED:226,MISCELLANEOUS_PERSISTENT_WARNING:299,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,SWITCH_PROXY:306,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,PAGE_EXPIRED:419,ENHANCE_YOUR_CALM:420,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL:430,REQUEST_HEADER_FIELDS_TOO_LARGE:431,LOGIN_TIMEOUT:440,NO_RESPONSE:444,RETRY_WITH:449,BLOCKED_BY_PARENTAL_CONTROL:450,UNAVAILABLE_FOR_LEGAL_REASONS:451,CLIENT_CLOSED_LOAD_BALANCED_REQUEST:460,INVALID_X_FORWARDED_FOR:463,REQUEST_HEADER_TOO_LARGE:494,SSL_CERTIFICATE_ERROR:495,SSL_CERTIFICATE_REQUIRED:496,HTTP_REQUEST_SENT_TO_HTTPS_PORT:497,INVALID_TOKEN:498,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511,WEB_SERVER_UNKNOWN_ERROR:520,WEB_SERVER_IS_DOWN:521,CONNECTION_TIMEOUT:522,ORIGIN_IS_UNREACHABLE:523,TIMEOUT_OCCURED:524,SSL_HANDSHAKE_FAILED:525,INVALID_SSL_CERTIFICATE:526,RAILGUN_ERROR:527,SITE_IS_OVERLOADED:529,SITE_IS_FROZEN:530,IDENTITY_PROVIDER_AUTHENTICATION_ERROR:561,NETWORK_READ_TIMEOUT:598,NETWORK_CONNECT_TIMEOUT:599};qe.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};qe.HEADER_STATE={GENERAL:0,CONNECTION:1,CONTENT_LENGTH:2,TRANSFER_ENCODING:3,UPGRADE:4,CONNECTION_KEEP_ALIVE:5,CONNECTION_CLOSE:6,CONNECTION_UPGRADE:7,TRANSFER_ENCODING_CHUNKED:8};qe.METHODS_HTTP=[qe.METHODS.DELETE,qe.METHODS.GET,qe.METHODS.HEAD,qe.METHODS.POST,qe.METHODS.PUT,qe.METHODS.CONNECT,qe.METHODS.OPTIONS,qe.METHODS.TRACE,qe.METHODS.COPY,qe.METHODS.LOCK,qe.METHODS.MKCOL,qe.METHODS.MOVE,qe.METHODS.PROPFIND,qe.METHODS.PROPPATCH,qe.METHODS.SEARCH,qe.METHODS.UNLOCK,qe.METHODS.BIND,qe.METHODS.REBIND,qe.METHODS.UNBIND,qe.METHODS.ACL,qe.METHODS.REPORT,qe.METHODS.MKACTIVITY,qe.METHODS.CHECKOUT,qe.METHODS.MERGE,qe.METHODS["M-SEARCH"],qe.METHODS.NOTIFY,qe.METHODS.SUBSCRIBE,qe.METHODS.UNSUBSCRIBE,qe.METHODS.PATCH,qe.METHODS.PURGE,qe.METHODS.MKCALENDAR,qe.METHODS.LINK,qe.METHODS.UNLINK,qe.METHODS.PRI,qe.METHODS.SOURCE,qe.METHODS.QUERY];qe.METHODS_ICE=[qe.METHODS.SOURCE];qe.METHODS_RTSP=[qe.METHODS.OPTIONS,qe.METHODS.DESCRIBE,qe.METHODS.ANNOUNCE,qe.METHODS.SETUP,qe.METHODS.PLAY,qe.METHODS.PAUSE,qe.METHODS.TEARDOWN,qe.METHODS.GET_PARAMETER,qe.METHODS.SET_PARAMETER,qe.METHODS.REDIRECT,qe.METHODS.RECORD,qe.METHODS.FLUSH,qe.METHODS.GET,qe.METHODS.POST];qe.METHOD_MAP=(0,GIs.enumToMap)(qe.METHODS);qe.H_METHOD_MAP=Object.fromEntries(Object.entries(qe.METHODS).filter(([t])=>t.startsWith("H")));qe.STATUSES_HTTP=[qe.STATUSES.CONTINUE,qe.STATUSES.SWITCHING_PROTOCOLS,qe.STATUSES.PROCESSING,qe.STATUSES.EARLY_HINTS,qe.STATUSES.RESPONSE_IS_STALE,qe.STATUSES.REVALIDATION_FAILED,qe.STATUSES.DISCONNECTED_OPERATION,qe.STATUSES.HEURISTIC_EXPIRATION,qe.STATUSES.MISCELLANEOUS_WARNING,qe.STATUSES.OK,qe.STATUSES.CREATED,qe.STATUSES.ACCEPTED,qe.STATUSES.NON_AUTHORITATIVE_INFORMATION,qe.STATUSES.NO_CONTENT,qe.STATUSES.RESET_CONTENT,qe.STATUSES.PARTIAL_CONTENT,qe.STATUSES.MULTI_STATUS,qe.STATUSES.ALREADY_REPORTED,qe.STATUSES.TRANSFORMATION_APPLIED,qe.STATUSES.IM_USED,qe.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,qe.STATUSES.MULTIPLE_CHOICES,qe.STATUSES.MOVED_PERMANENTLY,qe.STATUSES.FOUND,qe.STATUSES.SEE_OTHER,qe.STATUSES.NOT_MODIFIED,qe.STATUSES.USE_PROXY,qe.STATUSES.SWITCH_PROXY,qe.STATUSES.TEMPORARY_REDIRECT,qe.STATUSES.PERMANENT_REDIRECT,qe.STATUSES.BAD_REQUEST,qe.STATUSES.UNAUTHORIZED,qe.STATUSES.PAYMENT_REQUIRED,qe.STATUSES.FORBIDDEN,qe.STATUSES.NOT_FOUND,qe.STATUSES.METHOD_NOT_ALLOWED,qe.STATUSES.NOT_ACCEPTABLE,qe.STATUSES.PROXY_AUTHENTICATION_REQUIRED,qe.STATUSES.REQUEST_TIMEOUT,qe.STATUSES.CONFLICT,qe.STATUSES.GONE,qe.STATUSES.LENGTH_REQUIRED,qe.STATUSES.PRECONDITION_FAILED,qe.STATUSES.PAYLOAD_TOO_LARGE,qe.STATUSES.URI_TOO_LONG,qe.STATUSES.UNSUPPORTED_MEDIA_TYPE,qe.STATUSES.RANGE_NOT_SATISFIABLE,qe.STATUSES.EXPECTATION_FAILED,qe.STATUSES.IM_A_TEAPOT,qe.STATUSES.PAGE_EXPIRED,qe.STATUSES.ENHANCE_YOUR_CALM,qe.STATUSES.MISDIRECTED_REQUEST,qe.STATUSES.UNPROCESSABLE_ENTITY,qe.STATUSES.LOCKED,qe.STATUSES.FAILED_DEPENDENCY,qe.STATUSES.TOO_EARLY,qe.STATUSES.UPGRADE_REQUIRED,qe.STATUSES.PRECONDITION_REQUIRED,qe.STATUSES.TOO_MANY_REQUESTS,qe.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,qe.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,qe.STATUSES.LOGIN_TIMEOUT,qe.STATUSES.NO_RESPONSE,qe.STATUSES.RETRY_WITH,qe.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,qe.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,qe.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,qe.STATUSES.INVALID_X_FORWARDED_FOR,qe.STATUSES.REQUEST_HEADER_TOO_LARGE,qe.STATUSES.SSL_CERTIFICATE_ERROR,qe.STATUSES.SSL_CERTIFICATE_REQUIRED,qe.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,qe.STATUSES.INVALID_TOKEN,qe.STATUSES.CLIENT_CLOSED_REQUEST,qe.STATUSES.INTERNAL_SERVER_ERROR,qe.STATUSES.NOT_IMPLEMENTED,qe.STATUSES.BAD_GATEWAY,qe.STATUSES.SERVICE_UNAVAILABLE,qe.STATUSES.GATEWAY_TIMEOUT,qe.STATUSES.HTTP_VERSION_NOT_SUPPORTED,qe.STATUSES.VARIANT_ALSO_NEGOTIATES,qe.STATUSES.INSUFFICIENT_STORAGE,qe.STATUSES.LOOP_DETECTED,qe.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,qe.STATUSES.NOT_EXTENDED,qe.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,qe.STATUSES.WEB_SERVER_UNKNOWN_ERROR,qe.STATUSES.WEB_SERVER_IS_DOWN,qe.STATUSES.CONNECTION_TIMEOUT,qe.STATUSES.ORIGIN_IS_UNREACHABLE,qe.STATUSES.TIMEOUT_OCCURED,qe.STATUSES.SSL_HANDSHAKE_FAILED,qe.STATUSES.INVALID_SSL_CERTIFICATE,qe.STATUSES.RAILGUN_ERROR,qe.STATUSES.SITE_IS_OVERLOADED,qe.STATUSES.SITE_IS_FROZEN,qe.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,qe.STATUSES.NETWORK_READ_TIMEOUT,qe.STATUSES.NETWORK_CONNECT_TIMEOUT];qe.ALPHA=[];for(let t=65;t<=90;t++)qe.ALPHA.push(String.fromCharCode(t)),qe.ALPHA.push(String.fromCharCode(t+32));qe.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};qe.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};qe.NUM=["0","1","2","3","4","5","6","7","8","9"];qe.ALPHANUM=qe.ALPHA.concat(qe.NUM);qe.MARK=["-","_",".","!","~","*","'","(",")"];qe.USERINFO_CHARS=qe.ALPHANUM.concat(qe.MARK).concat(["%",";",":","&","=","+","$",","]);qe.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(qe.ALPHANUM);qe.HEX=qe.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);qe.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(qe.ALPHANUM);qe.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&qe.HEADER_CHARS.push(t);qe.CONNECTION_TOKEN_CHARS=qe.HEADER_CHARS.filter(t=>t!==44);qe.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&qe.QUOTED_STRING.push(t);qe.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)qe.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)qe.HTAB_SP_VCHAR_OBS_TEXT.push(t);qe.MAJOR=qe.NUM_MAP;qe.MINOR=qe.MAJOR;qe.SPECIAL_HEADERS={connection:qe.HEADER_STATE.CONNECTION,"content-length":qe.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":qe.HEADER_STATE.CONNECTION,"transfer-encoding":qe.HEADER_STATE.TRANSFER_ENCODING,upgrade:qe.HEADER_STATE.UPGRADE};qe.default={ERROR:qe.ERROR,TYPE:qe.TYPE,FLAGS:qe.FLAGS,LENIENT_FLAGS:qe.LENIENT_FLAGS,METHODS:qe.METHODS,STATUSES:qe.STATUSES,FINISH:qe.FINISH,HEADER_STATE:qe.HEADER_STATE,ALPHA:qe.ALPHA,NUM_MAP:qe.NUM_MAP,HEX_MAP:qe.HEX_MAP,NUM:qe.NUM,ALPHANUM:qe.ALPHANUM,MARK:qe.MARK,USERINFO_CHARS:qe.USERINFO_CHARS,URL_CHAR:qe.URL_CHAR,HEX:qe.HEX,TOKEN:qe.TOKEN,HEADER_CHARS:qe.HEADER_CHARS,CONNECTION_TOKEN_CHARS:qe.CONNECTION_TOKEN_CHARS,QUOTED_STRING:qe.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:qe.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:qe.MAJOR,MINOR:qe.MINOR,SPECIAL_HEADERS:qe.SPECIAL_HEADERS,METHODS_HTTP:qe.METHODS_HTTP,METHODS_ICE:qe.METHODS_ICE,METHODS_RTSP:qe.METHODS_RTSP,METHOD_MAP:qe.METHOD_MAP,H_METHOD_MAP:qe.H_METHOD_MAP,STATUSES_HTTP:qe.STATUSES_HTTP}});var bir=I((qof,r9n)=>{"use strict";p();var{Buffer:$Is}=require("node:buffer"),VIs="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==",Cir;Object.defineProperty(r9n,"exports",{get:a(()=>Cir||(Cir=$Is.from(VIs,"base64")),"get")})});var i9n=I((Gof,n9n)=>{"use strict";p();var{Buffer:WIs}=require("node:buffer"),zIs="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==",Sir;Object.defineProperty(n9n,"exports",{get:a(()=>Sir||(Sir=WIs.from(zIs,"base64")),"get")})});var ike=I((Wof,f9n)=>{"use strict";p();var o9n=["GET","HEAD","POST"],YIs=new Set(o9n),KIs=[101,204,205,304],s9n=[301,302,303,307,308],JIs=new Set(s9n),a9n=["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"],ZIs=new Set(a9n),c9n=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],XIs=["",...c9n],exs=new Set(c9n),txs=["follow","manual","error"],l9n=["GET","HEAD","OPTIONS","TRACE"],rxs=new Set(l9n),nxs=["navigate","same-origin","no-cors","cors"],ixs=["omit","same-origin","include"],oxs=["default","no-store","reload","no-cache","force-cache","only-if-cached"],sxs=["content-encoding","content-language","content-location","content-type","content-length"],axs=["half"],u9n=["CONNECT","TRACE","TRACK"],cxs=new Set(u9n),d9n=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],lxs=new Set(d9n);f9n.exports={subresource:d9n,forbiddenMethods:u9n,requestBodyHeader:sxs,referrerPolicy:XIs,requestRedirect:txs,requestMode:nxs,requestCredentials:ixs,requestCache:oxs,redirectStatus:s9n,corsSafeListedMethods:o9n,nullBodyStatus:KIs,safeMethods:l9n,badPorts:a9n,requestDuplex:axs,subresourceSet:lxs,badPortsSet:ZIs,redirectStatusSet:JIs,corsSafeListedMethodsSet:YIs,safeMethodsSet:rxs,forbiddenMethodsSet:cxs,referrerPolicyTokens:exs}});var Iir=I((Yof,p9n)=>{"use strict";p();var Tir=Symbol.for("undici.globalOrigin.1");function uxs(){return globalThis[Tir]}a(uxs,"getGlobalOrigin");function dxs(t){if(t===void 0){Object.defineProperty(globalThis,Tir,{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,Tir,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(dxs,"setGlobalOrigin");p9n.exports={getGlobalOrigin:uxs,setGlobalOrigin:dxs}});var Not=I((Zof,h9n)=>{"use strict";p();var fxs=new TextDecoder;function pxs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),fxs.decode(t))}a(pxs,"utf8DecodeBytes");h9n.exports={utf8DecodeBytes:pxs}});var DF=I((tsf,y9n)=>{"use strict";p();var m9n=require("node:assert"),{utf8DecodeBytes:hxs}=Not();function mxs(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(Exs,"isomorphicDecode");var _xs=/[^\x00-\xFF]/;function vxs(t){return m9n(!_xs.test(t)),t}a(vxs,"isomorphicEncode");function Cxs(t){return JSON.parse(hxs(t))}a(Cxs,"parseJSONFromBytes");function bxs(t,e=!0,r=!0){return A9n(t,e,r,g9n)}a(bxs,"removeASCIIWhitespace");function A9n(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(A9n,"removeChars");function Sxs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return m9n(typeof e=="string"),e}a(Sxs,"serializeJavascriptValueToJSONString");y9n.exports={collectASequenceOfCodePoints:mxs,collectASequenceOfCodePointsFast:gxs,forgivingBase64:yxs,isASCIIWhitespace:g9n,isomorphicDecode:Exs,isomorphicEncode:vxs,parseJSONFromBytes:Cxs,removeASCIIWhitespace:bxs,removeChars:A9n,serializeJavascriptValueToJSONString:Sxs}});var Dw=I((isf,S9n)=>{"use strict";p();var Oot=require("node:assert"),{forgivingBase64:Txs,collectASequenceOfCodePoints:xir,collectASequenceOfCodePointsFast:oke,isomorphicDecode:Ixs,removeASCIIWhitespace:xxs,removeChars:wxs}=DF(),Rxs=new TextEncoder,ske=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,Pxs=/[\u000A\u000D\u0009\u0020]/u,kxs=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function Dxs(t){Oot(t.protocol==="data:");let e=v9n(t,!0);e=e.slice(5);let r={position:0},n=oke(",",e,r),o=n.length;if(n=xxs(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=C9n(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=Ixs(c);if(c=Txs(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=wir(n);return l==="failure"&&(l=wir("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(Dxs,"dataURLProcessor");function v9n(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(v9n,"URLSerializer");function C9n(t){let e=Rxs.encode(t);return Nxs(e)}a(C9n,"stringPercentDecode");function E9n(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(E9n,"isHexCharByte");function _9n(t){return t>=48&&t<=57?t-48:(t&223)-55}a(_9n,"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=oke(";",t,e);if(n=Mot(n,!1,!0),n.length===0||!ske.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionPxs.test(d),t,e);let l=xir(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=b9n(t,e,!0),oke(";",t,e);else if(u=oke(";",t,e),u=Mot(u,!1,!0),u.length===0)continue;l.length!==0&&ske.test(l)&&(u.length===0||kxs.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(wir,"parseMIMEType");function b9n(t,e,r=!1){let n=e.position,o="";for(Oot(t[e.position]==='"'),e.position++;o+=xir(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{Oot(s==='"');break}}return r?o:t.slice(n,e.position)}a(b9n,"collectAnHTTPQuotedString");function Mxs(t){Oot(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",ske.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(Mxs,"serializeAMimeType");function Oxs(t){return t===13||t===10||t===9||t===32}a(Oxs,"isHTTPWhiteSpace");function Mot(t,e=!0,r=!0){return wxs(t,e,r,Oxs)}a(Mot,"removeHTTPWhitespace");function Bxs(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(Bxs,"minimizeSupportedMimeType");S9n.exports={dataURLProcessor:Dxs,URLSerializer:v9n,stringPercentDecode:C9n,parseMIMEType:wir,collectAnHTTPQuotedString:b9n,serializeAMimeType:Mxs,removeHTTPWhitespace:Mot,minimizeSupportedMimeType:Bxs,HTTP_TOKEN_CODEPOINTS:ske}});var NF=I((asf,Pir)=>{"use strict";p();var T9n={__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 Lxs(t){try{return T9n[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(Lxs,"detectRuntimeFeatureByNodeModule");function Fxs(t,e){return typeof T9n[t]()[e]<"u"}a(Fxs,"detectRuntimeFeatureByExportedProperty");var I9n=["markAsUncloneable","zstd"],Uxs={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},x9n=["crypto","sqlite"],Qxs=[...x9n,...I9n];function qxs(t){if(x9n.includes(t))return Lxs(`node:${t}`);if(I9n.includes(t)){let[e,r]=Uxs[t];return Fxs(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(qxs,"detectRuntimeFeature");var Rir=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(Qxs.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=qxs(e);return this.#e.set(e,r),r}},w9n=new Rir;Pir.exports.runtimeFeatures=w9n;Pir.exports.default=w9n});var FA=I((usf,P9n)=>{"use strict";p();var jxs=require("node:assert"),{types:up,inspect:Hxs}=require("node:util"),{runtimeFeatures:Gxs}=NF(),kir=1,Dir=2,Bot=3,Lot=4,Nir=5,Fot=6,Mir=7,dT=8,R9n=Function.call.bind(Function.prototype[Symbol.hasInstance]),lt={converters:{},util:{},errors:{},is:{}};lt.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};lt.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return lt.errors.exception({header:t.prefix,message:r})};lt.errors.invalidArgument=function(t){return lt.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};lt.brandCheck=function(t,e){if(!R9n(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};lt.brandCheckMultiple=function(t){let e=t.map(r=>lt.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};lt.argumentLengthCheck=function({length:t},e,r){if(tR9n(t,e)};lt.util.Type=function(t){switch(typeof t){case"undefined":return kir;case"boolean":return Dir;case"string":return Bot;case"symbol":return Lot;case"number":return Nir;case"bigint":return Fot;case"function":case"object":return t===null?Mir:dT}};lt.util.Types={UNDEFINED:kir,BOOLEAN:Dir,STRING:Bot,SYMBOL:Lot,NUMBER:Nir,BIGINT:Fot,NULL:Mir,OBJECT:dT};lt.util.TypeValueToString=function(t){switch(lt.util.Type(t)){case kir:return"Undefined";case Dir:return"Boolean";case Bot:return"String";case Lot:return"Symbol";case Nir:return"Number";case Fot:return"BigInt";case Mir:return"Null";case dT:return"Object"}};lt.util.markAsUncloneable=Gxs.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};lt.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=-Math.pow(2,e-1),o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),lt.util.HasFlag(n,lt.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw lt.errors.exception({header:"Integer conversion",message:`Could not convert ${lt.util.Stringify(t)} to an integer.`});if(c=lt.util.IntegerPart(c),co)throw lt.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&<.util.HasFlag(n,lt.attributes.Clamp)?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=lt.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};lt.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};lt.util.Stringify=function(t){switch(lt.util.Type(t)){case Lot:return`Symbol(${t.description})`;case dT:return Hxs(t);case Bot:return`"${t}"`;case Fot:return`${t}n`;default:return`${t}`}};lt.util.IsResizableArrayBuffer=function(t){if(up.isArrayBuffer(t))return t.resizable;if(up.isSharedArrayBuffer(t))return t.growable;throw lt.errors.exception({header:"IsResizableArrayBuffer",message:`"${lt.util.Stringify(t)}" is not an array buffer.`})};lt.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};lt.sequenceConverter=function(t){return(e,r,n,o)=>{if(lt.util.Type(e)!==dT)throw lt.errors.exception({header:r,message:`${n} (${lt.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw lt.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};lt.recordConverter=function(t,e){return(r,n,o)=>{if(lt.util.Type(r)!==dT)throw lt.errors.exception({header:n,message:`${o} ("${lt.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!up.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=lt.util.Stringify(u),f=t(u,n,`Key ${d} in ${o}`),h=e(r[u],n,`${o}[${d}]`);s[f]=h}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};lt.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw lt.errors.exception({header:n,message:`Expected ${o} ("${lt.util.Stringify(r)}") to be an instance of ${e}.`});return r}};lt.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&<.util.Type(e)!==dT)throw lt.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let s of t){let{key:c,defaultValue:l,required:u,converter:d}=s;if(u===!0&&(e==null||!Object.hasOwn(e,c)))throw lt.errors.exception({header:r,message:`Missing required key "${c}".`});let f=e?.[c],h=l!==void 0;if(h&&f===void 0&&(f=l()),u||h||f!==void 0){if(f=d(f,r,`${n}.${c}`),s.allowedValues&&!s.allowedValues.includes(f))throw lt.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};lt.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};lt.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};lt.is.ReadableStream=lt.util.MakeTypeAssertion(ReadableStream);lt.is.Blob=lt.util.MakeTypeAssertion(Blob);lt.is.URLSearchParams=lt.util.MakeTypeAssertion(URLSearchParams);lt.is.File=lt.util.MakeTypeAssertion(File);lt.is.URL=lt.util.MakeTypeAssertion(URL);lt.is.AbortSignal=lt.util.MakeTypeAssertion(AbortSignal);lt.is.MessagePort=lt.util.MakeTypeAssertion(MessagePort);lt.is.BufferSource=function(t){return up.isArrayBuffer(t)||ArrayBuffer.isView(t)&&up.isArrayBuffer(t.buffer)};lt.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(up.isTypedArray(e)||up.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(jxs(up.isAnyArrayBuffer(e)),o=e.byteLength),r.detached)return new Uint8Array(0);let s=new Uint8Array(o),c=new Uint8Array(r,n,o);return s.set(c),s};lt.converters.DOMString=function(t,e,r,n){if(t===null&<.util.HasFlag(n,lt.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw lt.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};lt.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw lt.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a ByteString.`});let n=String(t);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};lt.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};lt.converters.boolean=function(t){return!!t};lt.converters.any=function(t){return t};lt.converters["long long"]=function(t,e,r){return lt.util.ConvertToInt(t,64,"signed",0,e,r)};lt.converters["unsigned long long"]=function(t,e,r){return lt.util.ConvertToInt(t,64,"unsigned",0,e,r)};lt.converters["unsigned long"]=function(t,e,r){return lt.util.ConvertToInt(t,32,"unsigned",0,e,r)};lt.converters["unsigned short"]=function(t,e,r,n){return lt.util.ConvertToInt(t,16,"unsigned",n,e,r)};lt.converters.ArrayBuffer=function(t,e,r,n){if(lt.util.Type(t)!==dT||!up.isArrayBuffer(t))throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!lt.util.HasFlag(n,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t))throw lt.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};lt.converters.SharedArrayBuffer=function(t,e,r,n){if(lt.util.Type(t)!==dT||!up.isSharedArrayBuffer(t))throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!lt.util.HasFlag(n,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t))throw lt.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};lt.converters.TypedArray=function(t,e,r,n,o){if(lt.util.Type(t)!==dT||!up.isTypedArray(t)||t.constructor.name!==e.name)throw lt.errors.conversionFailed({prefix:r,argument:`${n} ("${lt.util.Stringify(t)}")`,types:[e.name]});if(!lt.util.HasFlag(o,lt.attributes.AllowShared)&&up.isSharedArrayBuffer(t.buffer))throw lt.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!lt.util.HasFlag(o,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t.buffer))throw lt.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};lt.converters.DataView=function(t,e,r,n){if(lt.util.Type(t)!==dT||!up.isDataView(t))throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["DataView"]});if(!lt.util.HasFlag(n,lt.attributes.AllowShared)&&up.isSharedArrayBuffer(t.buffer))throw lt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!lt.util.HasFlag(n,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t.buffer))throw lt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};lt.converters.ArrayBufferView=function(t,e,r,n){if(lt.util.Type(t)!==dT||!up.isArrayBufferView(t))throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!lt.util.HasFlag(n,lt.attributes.AllowShared)&&up.isSharedArrayBuffer(t.buffer))throw lt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!lt.util.HasFlag(n,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t.buffer))throw lt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};lt.converters.BufferSource=function(t,e,r,n){if(up.isArrayBuffer(t))return lt.converters.ArrayBuffer(t,e,r,n);if(up.isArrayBufferView(t))return n&=~lt.attributes.AllowShared,lt.converters.ArrayBufferView(t,e,r,n);throw up.isSharedArrayBuffer(t)?lt.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};lt.converters.AllowSharedBufferSource=function(t,e,r,n){if(up.isArrayBuffer(t))return lt.converters.ArrayBuffer(t,e,r,n);if(up.isSharedArrayBuffer(t))return lt.converters.SharedArrayBuffer(t,e,r,n);if(up.isArrayBufferView(t))return n|=lt.attributes.AllowShared,lt.converters.ArrayBufferView(t,e,r,n);throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};lt.converters["sequence"]=lt.sequenceConverter(lt.converters.ByteString);lt.converters["sequence>"]=lt.sequenceConverter(lt.converters["sequence"]);lt.converters["record"]=lt.recordConverter(lt.converters.ByteString,lt.converters.ByteString);lt.converters.Blob=lt.interfaceConverter(lt.is.Blob,"Blob");lt.converters.AbortSignal=lt.interfaceConverter(lt.is.AbortSignal,"AbortSignal");lt.converters.EventHandlerNonNull=function(t){return lt.util.Type(t)!==dT?null:typeof t=="function"?t:()=>{}};lt.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};P9n.exports={webidl:lt}});var fT=I((fsf,G9n)=>{"use strict";p();var{Transform:$xs}=require("node:stream"),k9n=require("node:zlib"),{redirectStatusSet:Vxs,referrerPolicyTokens:Wxs,badPortsSet:zxs}=ike(),{getGlobalOrigin:D9n}=Iir(),{collectAnHTTPQuotedString:Yxs,parseMIMEType:Kxs}=Dw(),{performance:Jxs}=require("node:perf_hooks"),{ReadableStreamFrom:Zxs,isValidHTTPToken:N9n,normalizedMethodRecordsBase:Xxs}=ko(),cke=require("node:assert"),{isUint8Array:ews}=require("node:util/types"),{webidl:Oj}=FA(),{isomorphicEncode:Oir,collectASequenceOfCodePoints:pZ,removeChars:tws}=DF();function M9n(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(M9n,"responseURL");function rws(t,e){if(!Vxs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&B9n(r)&&(O9n(r)||(r=nws(r)),r=new URL(r,M9n(t))),r&&!r.hash&&(r.hash=e),r}a(rws,"responseLocationURL");function O9n(t){for(let e=0;e126||r<32)return!1}return!0}a(O9n,"isValidEncodedURL");function nws(t){return Buffer.from(t,"binary").toString("utf8")}a(nws,"normalizeBinaryStringToUtf8");function mZ(t){return t.urlList[t.urlList.length-1]}a(mZ,"requestCurrentURL");function iws(t){let e=mZ(t);return j9n(e)&&zxs.has(e.port)?"blocked":"allowed"}a(iws,"requestBadPort");function ows(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(ows,"isErrorLike");function sws(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(sws,"isValidReasonPhrase");var aws=N9n;function B9n(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(B9n,"isValidHeaderValue");function cws(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(Wxs.has(o)){r=o;break}}return r}a(cws,"parseReferrerPolicy");function lws(t,e){let r=cws(e);r!==""&&(t.referrerPolicy=r)}a(lws,"setRequestReferrerPolicyOnRedirect");function uws(){return"allowed"}a(uws,"crossOriginResourcePolicyCheck");function dws(){return"success"}a(dws,"corsCheck");function fws(){return"success"}a(fws,"TAOCheck");function pws(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(pws,"appendFetchMetadata");function hws(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&&Lir(t.origin)&&!Lir(mZ(t))&&(e=null);break;case"same-origin":ake(t,mZ(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(hws,"appendRequestOriginHeader");function Kfe(t,e){return t}a(Kfe,"coarsenTime");function mws(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??Bir(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=mZ(t);return hZ(n)&&!hZ(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=mZ(t);return ake(n,s)?n:hZ(n)&&!hZ(s)?"no-referrer":o}case"same-origin":return ake(t,n)?n:"no-referrer";case"origin-when-cross-origin":return ake(t,n)?n:o;case"no-referrer-when-downgrade":{let s=mZ(t);return hZ(n)&&!hZ(s)?"no-referrer":n}}}a(Ews,"determineRequestsReferrer");function Bir(t,e=!1){return cke(Oj.is.URL(t)),t=new URL(t),q9n(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(Bir,"stripURLForReferrer");var _ws=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)$/),vws=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function F9n(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),vws(t)):_ws(t)}a(F9n,"isOriginIPPotentiallyTrustworthy");function Cws(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||F9n(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(Cws,"isOriginPotentiallyTrustworthy");function hZ(t){return Oj.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:Cws(t.origin):!1}a(hZ,"isURLPotentiallyTrustworthy");function bws(t){}a(bws,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function ake(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(ake,"sameOrigin");function Sws(t){return t.controller.state==="aborted"}a(Sws,"isAborted");function Tws(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(Tws,"isCancelled");function Iws(t){return Xxs[t.toLowerCase()]??t}a(Iws,"normalizeMethod");var xws=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function U9n(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,xws),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(U9n,"createIterator");function wws(t,e,r,n=0,o=1){let s=U9n(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Oj.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Oj.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Oj.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(Oj.brandCheck(this,e),Oj.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(wws,"iteratorMixin");function Rws(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();Q9n(s,n,o)}catch(s){o(s)}}a(Rws,"fullyReadBody");function Pws(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(Pws,"readableStreamClose");async function Q9n(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(!ews(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(Q9n,"readAllBytes");function q9n(t){cke("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(q9n,"urlIsLocal");function Lir(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(Lir,"urlHasHttpsScheme");function j9n(t){cke("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(j9n,"urlIsHttpHttpsScheme");function kws(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&pZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&pZ(u=>u===" "||u===" ",r,n);let o=pZ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&pZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&pZ(u=>u===" "||u===" ",r,n);let c=pZ(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(kws,"simpleRangeHeaderValue");function Dws(t,e,r){let n="bytes ";return n+=Oir(`${t}`),n+="-",n+=Oir(`${e}`),n+="/",n+=Oir(`${r}`),n}a(Dws,"buildContentRange");var Fir=class extends $xs{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?k9n.createInflate(this.#e):k9n.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 Fir(t)}a(Nws,"createInflate");function Mws(t){let e=null,r=null,n=null,o=H9n("content-type",t);if(o===null)return"failure";for(let s of o){let c=Kxs(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(Mws,"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 H9n(t,e){let r=e.get(t,!0);return r===null?null:Ows(r)}a(H9n,"getDecodeSplit");function Bws(t){return!1}a(Bws,"hasAuthenticationEntry");function Lws(t){return!!(t.username||t.password)}a(Lws,"includesCredentials");function Fws(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(Fws,"isTraversableNavigable");var Uir=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return D9n()}get origin(){return this.baseUrl?.origin}policyContainer=L9n()},Qir=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new Uir},Uws=new Qir;G9n.exports={isAborted:Sws,isCancelled:Tws,isValidEncodedURL:O9n,ReadableStreamFrom:Zxs,tryUpgradeRequestToAPotentiallyTrustworthyURL:bws,clampAndCoarsenConnectionTimingInfo:mws,coarsenedSharedCurrentTime:gws,determineRequestsReferrer:Ews,makePolicyContainer:L9n,clonePolicyContainer:yws,appendFetchMetadata:pws,appendRequestOriginHeader:hws,TAOCheck:fws,corsCheck:dws,crossOriginResourcePolicyCheck:uws,createOpaqueTimingInfo:Aws,setRequestReferrerPolicyOnRedirect:lws,isValidHTTPToken:N9n,requestBadPort:iws,requestCurrentURL:mZ,responseURL:M9n,responseLocationURL:rws,isURLPotentiallyTrustworthy:hZ,isValidReasonPhrase:sws,sameOrigin:ake,normalizeMethod:Iws,iteratorMixin:wws,createIterator:U9n,isValidHeaderName:aws,isValidHeaderValue:B9n,isErrorLike:ows,fullyReadBody:Rws,readableStreamClose:Pws,urlIsLocal:q9n,urlHasHttpsScheme:Lir,urlIsHttpHttpsScheme:j9n,readAllBytes:Q9n,simpleRangeHeaderValue:kws,buildContentRange:Dws,createInflate:Nws,extractMimeType:Mws,getDecodeSplit:H9n,environmentSettingsObject:Uws,isOriginIPPotentiallyTrustworthy:F9n,hasAuthenticationEntry:Bws,includesCredentials:Lws,isTraversableNavigable:Fws}});var Uot=I((msf,V9n)=>{"use strict";p();var{iteratorMixin:Qws}=fT(),{kEnumerableProperty:Jfe}=ko(),{webidl:xc}=FA(),$9n=require("node:util"),MF=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(xc.util.markAsUncloneable(this),e!==void 0)throw xc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){xc.brandCheck(this,t);let o="FormData.append";xc.argumentLengthCheck(arguments,2,o),e=xc.converters.USVString(e),arguments.length===3||xc.is.Blob(r)?(r=xc.converters.Blob(r,o,"value"),n!==void 0&&(n=xc.converters.USVString(n))):r=xc.converters.USVString(r);let s=qir(e,r,n);this.#e.push(s)}delete(e){xc.brandCheck(this,t),xc.argumentLengthCheck(arguments,1,"FormData.delete"),e=xc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){xc.brandCheck(this,t),xc.argumentLengthCheck(arguments,1,"FormData.get"),e=xc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return xc.brandCheck(this,t),xc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=xc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return xc.brandCheck(this,t),xc.argumentLengthCheck(arguments,1,"FormData.has"),e=xc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){xc.brandCheck(this,t);let o="FormData.set";xc.argumentLengthCheck(arguments,2,o),e=xc.converters.USVString(e),arguments.length===3||xc.is.Blob(r)?(r=xc.converters.Blob(r,o,"value"),n!==void 0&&(n=xc.converters.USVString(n))):r=xc.converters.USVString(r);let s=qir(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)}[$9n.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=$9n.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:qws,setFormDataState:jws}=MF;Reflect.deleteProperty(MF,"getFormDataState");Reflect.deleteProperty(MF,"setFormDataState");Qws("FormData",MF,qws,"name","value");Object.defineProperties(MF.prototype,{append:Jfe,delete:Jfe,get:Jfe,getAll:Jfe,has:Jfe,set:Jfe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function qir(t,e,r){if(typeof e!="string"){if(xc.is.File(e)||(e=new File([e],"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=new File([e],r,n)}}return{name:t,value:e}}a(qir,"makeEntry");xc.is.FormData=xc.util.MakeTypeAssertion(MF);V9n.exports={FormData:MF,makeEntry:qir,setFormDataState:jws}});var Y9n=I((ysf,z9n)=>{"use strict";p();var{bufferToLowerCasedHeaderName:Hws}=ko(),{HTTP_TOKEN_CODEPOINTS:Gws}=Dw(),{makeEntry:$ws}=Uot(),{webidl:jir}=FA(),Hir=require("node:assert"),{isomorphicDecode:W9n}=DF(),Vws=Buffer.from("--"),Gir=new TextDecoder,Wws=new TextDecoder("utf-8",{ignoreBOM:!0});function zws(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(Yws,"validateBoundary");function Kws(t,e){Hir(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw ab("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw ab("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 ab("expected a value starting with -- and the boundary");if(Xws(t,Vws,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw ab("expected CRLF");s.position+=2;let l=Zws(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 ab("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 ab("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",zws(f)||(f=""),g=new File([m],d,{type:f})):g=Wws.decode(Buffer.from(m)),Hir(jir.is.USVString(u)),Hir(typeof g=="string"&&jir.is.USVString(g)||jir.is.File(g)),o.push($ws(u,g,d))}}a(Kws,"multipartFormDataParser");function Jws(t,e){t[e.position]===59&&e.position++,Nw(c=>c===32||c===9,t,e);let r=Nw(c=>Vir(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++,Nw(c=>c===32||c===9,t,e);let s;if(o){let c=Nw(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 ab("unknown encoding, expected utf-8''");s=decodeURIComponent(Gir.decode(c.subarray(7)))}else if(t[e.position]===34){e.position++;let c=Nw(l=>l!==10&&l!==13&&l!==34,t,e);if(t[e.position]!==34)throw ab("Closing quote not found");e.position++,s=Gir.decode(c).replace(/%0A/ig,` -`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=Nw(l=>Vir(l)&&l!==59,t,e);s=Gir.decode(c)}return{name:n,value:s,extended:o}}a(Jws,"parseContentDispositionAttribute");function Zws(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 ab("header name is null");return{name:r,filename:n,contentType:o,encoding:s}}let c=Nw(l=>l!==10&&l!==13&&l!==58,t,e);if(c=$ir(c,!0,!0,l=>l===9||l===32),!Gws.test(c.toString()))throw ab("header name does not match the field-name token production");if(t[e.position]!==58)throw ab("expected :");switch(e.position++,Nw(l=>l===32||l===9,t,e),Hws(c)){case"content-disposition":{r=n=null;let l=!1;if(Nw(d=>Vir(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw ab("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=$ir(l,!1,!0,u=>u===9||u===32),o=W9n(l);break}case"content-transfer-encoding":{let l=Nw(u=>u!==10&&u!==13,t,e);l=$ir(l,!1,!0,u=>u===9||u===32),s=W9n(l);break}default:Nw(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw ab("expected CRLF");e.position+=2}}a(Zws,"parseMultipartFormDataHeaders");function Nw(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($ir,"removeChars");function Xws(t,e,r){if(t.length{"use strict";p();function rRs(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(rRs,"createDeferredPromise");K9n.exports={createDeferredPromise:rRs}});var Xfe=I((Ssf,tUn)=>{"use strict";p();var Yir=ko(),{ReadableStreamFrom:nRs,readableStreamClose:iRs,fullyReadBody:oRs,extractMimeType:sRs}=fT(),{FormData:J9n,setFormDataState:aRs}=Uot(),{webidl:E2}=FA(),Wir=require("node:assert"),{isErrored:zir,isDisturbed:cRs}=require("node:stream"),{isUint8Array:lRs}=require("node:util/types"),{serializeAMimeType:uRs}=Dw(),{multipartFormDataParser:dRs}=Y9n(),{createDeferredPromise:fRs}=lke(),{parseJSONFromBytes:pRs}=DF(),{utf8DecodeBytes:hRs}=Not(),{runtimeFeatures:mRs}=NF(),gRs=mRs.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),Qot=new TextEncoder;function ARs(){}a(ARs,"noop");var yRs=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!cRs(e)&&!zir(e)&&e.cancel("Response object has been garbage collected").catch(ARs)});function X9n(t,e=!1){let r=null,n=null;E2.is.ReadableStream(t)?r=t:E2.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),Wir(E2.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(E2.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(E2.is.BufferSource(t))s=E2.util.getCopyOfBytesHeldByBufferSource(t);else if(E2.is.FormData(t)){let d=`----formdata-undici-0${`${gRs(1e11)}`.padStart(11,"0")}`,f=`--${d}\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 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=Qot.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=Not.encode(f+`; name="${h(m(_))}"\r \r ${m(v)}\r -`);g.push(b),c+=b.byteLength}else{let b=Qot.encode(`${f}; name="${h(m(_))}"`+(v.name?`; filename="${h(v.name)}"`:"")+`\r +`);g.push(b),c+=b.byteLength}else{let b=Not.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=Qot.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(E2.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(Yir.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=E2.is.ReadableStream(t)?t:nRs(t)}return(typeof s=="string"||lRs(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(zir(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!zir(r)&&n.enqueue(typeof d=="string"?Qot.encode(d):new Uint8Array(d));queueMicrotask(()=>iRs(n))})(),[{stream:r,source:s,length:c},l]}a(X9n,"extractBody");function ERs(t,e=!1){return E2.is.ReadableStream(t)&&(Wir(!Yir.isDisturbed(t),"The body has already been consumed."),Wir(!t.locked,"The stream is locked.")),X9n(t,e)}a(ERs,"safelyExtractBody");function _Rs(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a(_Rs,"cloneBody");function vRs(t,e){return{blob(){return Zfe(this,n=>{let o=Z9n(e(this));return o===null?o="":o&&(o=uRs(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return Zfe(this,n=>new Uint8Array(n).buffer,t,e)},text(){return Zfe(this,hRs,t,e)},json(){return Zfe(this,pRs,t,e)},formData(){return Zfe(this,n=>{let o=Z9n(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=dRs(n,o),c=new J9n;return aRs(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new J9n;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 Zfe(this,n=>new Uint8Array(n),t,e)}}}a(vRs,"bodyMixinMethods");function CRs(t,e){Object.assign(t.prototype,vRs(t,e))}a(CRs,"mixinBody");function Zfe(t,e,r,n){try{E2.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),eUn(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=fRs(),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):(oRs(t.body,c,s),o.promise)}a(Zfe,"consumeBody");function eUn(t){let e=t.body;return e!=null&&(e.stream.locked||Yir.isDisturbed(e.stream))}a(eUn,"bodyUnusable");function Z9n(t){let e=t.headersList,r=sRs(e);return r==="failure"?null:r}a(Z9n,"bodyMimeType");tUn.exports={extractBody:X9n,safelyExtractBody:ERs,cloneBody:_Rs,mixinBody:CRs,streamRegistry:yRs,bodyUnusable:eUn}});var gUn=I((xsf,mUn)=>{"use strict";p();var Mi=require("node:assert"),Ti=ko(),{channels:rUn}=Nj(),Kir=Rnr(),{RequestContentLengthMismatchError:gZ,ResponseContentLengthMismatchError:nUn,RequestAbortedError:dUn,HeadersTimeoutError:bRs,HeadersOverflowError:SRs,SocketError:AZ,InformationalError:epe,BodyTimeoutError:TRs,HTTPParserError:IRs,ResponseExceededMaxSizeError:xRs}=co(),{kUrl:fUn,kReset:cb,kClient:$ot,kParser:ad,kBlocking:fke,kRunning:sm,kPending:nor,kSize:iUn,kWriting:Bj,kQueue:_2,kNoRef:uke,kKeepAliveDefaultTimeout:wRs,kHostHeader:RRs,kPendingIdx:PRs,kRunningIdx:Mw,kError:tv,kPipelining:Hot,kSocket:EZ,kKeepAliveTimeoutValue:Vot,kMaxHeadersSize:kRs,kKeepAliveMaxTimeout:DRs,kKeepAliveTimeoutThreshold:NRs,kHeadersTimeout:MRs,kBodyTimeout:ORs,kStrictContentLength:Xir,kMaxRequests:oUn,kCounter:BRs,kMaxResponseSize:LRs,kOnError:sUn,kResume:OF,kHTTPContext:pUn,kClosed:eor}=nl(),pT=t9n(),aUn=Buffer.alloc(0),qot=Buffer[Symbol.species],FRs=Ti.removeAllListeners,_Z=Symbol("kIdleSocketValidation"),yZ=Symbol("kIdleSocketValidationTimeout"),ior=Symbol("kSocketUsed"),Jir;function URs(){let t=process.env.JEST_WORKER_ID?bir():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(i9n())}catch{}return e||(e=new WebAssembly.Module(t||bir())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Mi(dp.ptr===n);let c=o-b5+C5.byteOffset;return dp.onStatus(new qot(C5.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Mi(dp.ptr===n),dp.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Mi(dp.ptr===n);let c=o-b5+C5.byteOffset;return dp.onHeaderField(new qot(C5.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Mi(dp.ptr===n);let c=o-b5+C5.byteOffset;return dp.onHeaderValue(new qot(C5.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Mi(dp.ptr===n),dp.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Mi(dp.ptr===n);let c=o-b5+C5.byteOffset;return dp.onBody(new qot(C5.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Mi(dp.ptr===n),dp.onMessageComplete()),"wasm_on_message_complete")}})}a(URs,"lazyllhttp");var Zir=null,dp=null,C5=null,jot=0,b5=null,QRs=0,dke=1,tpe=2|dke,Got=4|dke,tor=8|QRs,ror=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(pT.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[kRs],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[LRs]}setTimeout(e,r){e!==this.timeoutValue||r&dke^this.timeoutType&dke?(this.timeout&&(Kir.clearTimeout(this.timeout),this.timeout=null),e&&(r&dke?this.timeout=Kir.setFastTimeout(cUn,e,this.timeoutWeakRef):(this.timeout=setTimeout(cUn,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||(Mi(this.ptr!=null),Mi(dp===null),this.llhttp.llhttp_resume(this.ptr),Mi(this.timeoutType===Got),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||aUn),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Mi(dp===null),Mi(this.ptr!=null),Mi(!this.paused);let{socket:r,llhttp:n}=this;e.length>jot&&(b5&&n.free(b5),jot=Math.ceil(e.length/4096)*4096,b5=n.malloc(jot)),new Uint8Array(n.memory.buffer,b5,jot).set(e);try{let o;try{C5=e,dp=this,o=n.llhttp_execute(this.ptr,b5,e.length)}finally{dp=null,C5=null}if(o!==pT.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-b5);if(o===pT.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===pT.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Ti.destroy(r,o)}}finish(){Mi(dp===null),Mi(this.ptr!=null),Mi(!this.paused);let{llhttp:e}=this,r;try{dp=this,r=e.llhttp_finish(this.ptr)}finally{dp=null}return r===pT.ERROR.OK?null:r===pT.ERROR.PAUSED||r===pT.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,aUn)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new nUn;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 IRs(l,pT.ERROR[e],r)}destroy(){Mi(dp===null),Mi(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Kir.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[sm]===0)return Ti.destroy(e,new AZ("bad response",Ti.getSocketInfo(e))),-1;let n=r[_2][r[Mw]];return n?(n.onResponseStarted(),0):-1}onHeaderField(e){let r=this.headers.length;return(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length),0}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=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 SRs)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Mi(r),Mi(n[EZ]===o),Mi(!o.destroyed),Mi(!this.paused),Mi((s.length&1)===0);let l=n[_2][n[Mw]];Mi(l),Mi(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[ad].destroy(),o[ad]=null,o[$ot]=null,o[tv]=null,FRs(o),n[EZ]=null,n[pUn]=null,n[_2][n[Mw]++]=null,n.emit("disconnect",n[fUn],[n],new epe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ti.destroy(o,u)}n[OF]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;if(o[sm]===0)return Ti.destroy(s,new AZ("bad response",Ti.getSocketInfo(s))),-1;let u=o[_2][o[Mw]];if(!u)return-1;if(Mi(!this.upgrade),Mi(this.statusCode<200),e===100)return Ti.destroy(s,new AZ("bad response",Ti.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ti.destroy(s,new AZ("bad upgrade",Ti.getSocketInfo(s))),-1;if(Mi(this.timeoutType===tpe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[cb]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[ORs];this.setTimeout(f,Got)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Mi(o[sm]===1),this.upgrade=!0,2;if(r)return Mi(o[sm]===1),this.upgrade=!0,2;if(Mi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Hot]){let f=this.keepAlive?Ti.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[NRs],o[DRs]);h<=0?s[cb]=!0:o[Vot]=h}else o[Vot]=o[wRs]}else s[cb]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[fke]&&(s[fke]=!1,o[OF]()),d?pT.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[_2][r[Mw]];return Mi(c),Mi(this.timeoutType===Got),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Mi(o>=200),s>-1&&this.bytesRead+e.length>s?(Ti.destroy(n,new xRs),-1):(this.bytesRead+=e.length,c.onData(e)===!1?pT.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;Mi(n>=100),Mi((this.headers.length&1)===0);let d=e[_2][e[Mw]];if(Mi(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 nUn),-1;if(d.onComplete(s),e[_2][e[Mw]++]=null,r[ior]=e[nor]===0,r[Bj])return Mi(e[sm]===0),Ti.destroy(r,new epe("reset")),pT.ERROR.PAUSED;if(u){if(r[cb]&&e[sm]===0)return Ti.destroy(r,new epe("reset")),pT.ERROR.PAUSED;e[Hot]==null||e[Hot]===1?setImmediate(e[OF]):e[OF]()}else return Ti.destroy(r,new epe("reset")),pT.ERROR.PAUSED;return 0}};function cUn(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===tpe?(!r[Bj]||r.writableNeedDrain||o[sm]>1)&&(Mi(!s,"cannot be paused while waiting for headers"),Ti.destroy(r,new bRs)):n===Got?s||Ti.destroy(r,new TRs):n===tor&&(Mi(o[sm]===0&&o[Vot]),Ti.destroy(r,new epe("socket idle timeout")))}a(cUn,"onParserTimeout");function qRs(t,e){if(t[EZ]=e,Zir||(Zir=URs()),e.errored)throw e.errored;if(e.destroyed)throw new AZ("destroyed");return e[uke]=!1,e[Bj]=!1,e[cb]=!1,e[fke]=!1,e[_Z]=0,e[yZ]=null,e[ior]=!1,e[ad]=new ror(t,e,Zir),Ti.addListener(e,"error",jRs),Ti.addListener(e,"readable",HRs),Ti.addListener(e,"end",GRs),Ti.addListener(e,"close",$Rs),e[eor]=!1,e.on("close",VRs),{version:"h1",defaultPipelining:1,write(r){return KRs(t,r)},resume(){zRs(t)},destroy(r,n){e[eor]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[Bj]||e[cb]||e[fke]||e[_Z]===1||r&&(t[sm]>0&&!r.idempotent||t[sm]>0&&(r.upgrade||r.method==="CONNECT")||t[sm]>0&&Ti.bodyLength(r.body)!==0&&(Ti.isStream(r.body)||Ti.isAsyncIterable(r.body)||Ti.isFormDataLike(r.body))))}}}a(qRs,"connectH1");function jRs(t){Mi(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[ad];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[tv]=r,this[$ot][sUn](r));return}this[tv]=t,this[$ot][sUn](t)}a(jRs,"onHttpSocketError");function HRs(){this[ad]?.readMore()}a(HRs,"onHttpSocketReadable");function GRs(){let t=this[ad];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Ti.destroy(this,e);return}Ti.destroy(this,new AZ("other side closed",Ti.getSocketInfo(this)))}a(GRs,"onHttpSocketEnd");function $Rs(){let t=this[ad];hUn(this),t&&(!this[tv]&&t.statusCode&&!t.shouldKeepAlive&&(this[tv]=t.finish()||this[tv]),this[ad].destroy(),this[ad]=null);let e=this[tv]||new AZ("closed",Ti.getSocketInfo(this)),r=this[$ot];if(r[EZ]=null,r[pUn]=null,r.destroyed){Mi(r[nor]===0);let n=r[_2].splice(r[Mw]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[_2][r[Mw]];r[_2][r[Mw]++]=null,Ti.errorRequest(r,n,e)}r[PRs]=r[Mw],Mi(r[sm]===0),r.emit("disconnect",r[fUn],[r],e),r[OF]()}a($Rs,"onHttpSocketClose");function VRs(){this[eor]=!0}a(VRs,"onSocketClose");function hUn(t){t[yZ]&&(clearTimeout(t[yZ]),t[yZ]=null),t[_Z]=0}a(hUn,"clearIdleSocketValidation");function WRs(t,e){e[_Z]=1,e[yZ]=setTimeout(()=>{e[yZ]=null,e[_Z]=2,t[EZ]===e&&!e.destroyed&&t[OF]()},0),e[yZ].unref?.()}a(WRs,"scheduleIdleSocketValidation");function zRs(t){let e=t[EZ];if(e&&!e.destroyed){if(t[iUn]===0?!e[uke]&&e.unref&&(e.unref(),e[uke]=!0):e[uke]&&e.ref&&(e.ref(),e[uke]=!1),t[sm]===0&&t[nor]>0&&e[ior]){if(e[_Z]===0)return WRs(t,e),e[ad].readMore(),e.destroyed,void 0;if(e[_Z]===1)return e[ad].readMore(),e.destroyed,void 0}if(t[sm]===0&&(e[ad].readMore(),e.destroyed))return;if(t[iUn]===0)e[ad].timeoutType!==tor&&e[ad].setTimeout(t[Vot],tor);else if(t[sm]>0&&e[ad].statusCode<200&&e[ad].timeoutType!==tpe){let r=t[_2][t[Mw]],n=r.headersTimeout!=null?r.headersTimeout:t[MRs];e[ad].setTimeout(n,tpe)}}}a(zRs,"resumeH1");function YRs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(YRs,"shouldSendContentLength");function KRs(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)){Jir||(Jir=Xfe().extractBody);let[E,_]=Jir(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),YRs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[Xir])return Ti.errorRequest(t,e,new gZ),!1;process.emitWarning(new gZ)}let g=t[EZ];hUn(g);let A=a(E=>{e.aborted||e.completed||(Ti.errorRequest(t,e,E||new dUn),Ti.destroy(u),Ti.destroy(g,new epe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ti.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[cb]=!0),(s||r==="CONNECT")&&(g[cb]=!0),l!=null&&(g[cb]=l),t[oUn]&&g[BRs]++>=t[oUn]&&(g[cb]=!0),c&&(g[fke]=!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=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 `;if(typeof o=="string"?y+=`host: ${o}\r -`:y+=t[RRs],s?y+=`connection: upgrade\r +`:y+=t[Fws],s?y+=`connection: upgrade\r upgrade: ${s}\r -`:t[Hot]&&!g[cb]?y+=`connection: keep-alive\r +`:t[Lot]&&!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 dUn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Mi(o.destroyed||o[Bj]&&r[sm]<=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(JRs,"writeStream");function lUn(t,e,r,n,o,s,c,l){try{e?Ti.isBuffer(e)&&(Mi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return M9n.sendHeaders.hasSubscribers&&M9n.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?q9n(A,null,t,e,g,f,y,h):Ti.isBuffer(u)?q9n(A,u,t,e,g,f,y,h):Ti.isBlobLike(u)?typeof u.stream=="function"?j9n(A,u.stream(),t,e,g,f,y,h):aRs(A,u,t,e,g,f,y,h):Ti.isStream(u)?sRs(A,u,t,e,g,f,y,h):Ti.isIterable(u)?j9n(A,u,t,e,g,f,y,h):Oi(!1),!0}a(oRs,"writeH1");function sRs(t,e,r,n,o,s,c,l){Oi(s!==0||r[lm]===0,"stream body cannot be pipelined");let u=!1,d=new Qot({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 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 \r -`,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[cb]=!0)):s===0?o.write(`${c}content-length: 0\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"):(Mi(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[OF]()}catch(u){t(u)}}a(lUn,"writeBuffer");async function ZRs(t,e,r,n,o,s,c,l){Mi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new gZ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\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 \r -`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[cb]=!0),r[OF]()}catch(u){t(u)}}a(ZRs,"writeBlob");async function uUn(t,e,r,n,o,s,c,l){Mi(s!==0||r[sm]===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)=>{Mi(u===null),o[tv]?g(o[tv]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new Wot({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[tv])throw o[tv];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(uUn,"writeIterable");var Wot=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[Bj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[tv])throw r[tv];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[Xir])throw new gZ;process.emitWarning(new gZ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[cb]=!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[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"):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[ad].timeout&&r[ad].timeoutType===tpe&&r[ad].timeout.refresh&&r[ad].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[Bj]=!1,e[tv])throw e[tv];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[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 \r `,"latin1"):e.write(`${c}\r `,"latin1"):r===null&&e.write(`\r 0\r \r -`,"latin1"),r!==null&&o!==r){if(n[Xir])throw new gZ;process.emitWarning(new gZ)}e[ad].timeout&&e[ad].timeoutType===tpe&&e[ad].timeout.refresh&&e[ad].timeout.refresh(),n[OF]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[Bj]=!1,e&&(Mi(n[sm]<=1,"pipeline should only contain this request"),o(e))}};mUn.exports=qRs});var TUn=I((Psf,SUn)=>{"use strict";p();var Bw=require("node:assert"),{pipeline:XRs}=require("node:stream"),hs=ko(),{RequestContentLengthMismatchError:cor,RequestAbortedError:ePs,SocketError:gke,InformationalError:Lj,InvalidArgumentError:tPs}=co(),{kUrl:mke,kReset:Jot,kClient:hT,kRunning:Ake,kPending:rPs,kQueue:Fj,kPendingIdx:uor,kRunningIdx:v2,kError:mT,kSocket:bf,kStrictContentLength:nPs,kOnError:rpe,kMaxConcurrentStreams:Yot,kPingInterval:AUn,kHTTP2Session:BF,kHTTP2InitialWindowSize:iPs,kHTTP2ConnectionWindowSize:oPs,kResume:S5,kSize:sPs,kHTTPContext:dor,kClosed:lor,kBodyTimeout:aPs,kEnableConnectProtocol:pke,kRemoteSettings:hke,kHTTP2Stream:zot,kHTTP2SessionState:por}=nl(),{channels:yUn}=Nj(),Ow=Symbol("open streams"),EUn,Kot;try{Kot=require("node:http2")}catch{Kot={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:cPs,HTTP2_HEADER_METHOD:_Un,HTTP2_HEADER_PATH:vUn,HTTP2_HEADER_SCHEME:oor,HTTP2_HEADER_CONTENT_LENGTH:lPs,HTTP2_HEADER_EXPECT:uPs,HTTP2_HEADER_STATUS:sor,HTTP2_HEADER_PROTOCOL:dPs,NGHTTP2_REFUSED_STREAM:fPs,NGHTTP2_CANCEL:pPs}}=Kot;function aor(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(aor,"parseH2Headers");function hPs(t,e){t[bf]=e;let r=t[iPs],n=t[oPs],o=Kot.connect(t[mke],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[Yot],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[bf]=e,o[Ow]=0,o[hT]=t,o[bf]=e,o[por]={ping:{interval:t[AUn]===0?null:setInterval(yPs,t[AUn],o).unref()}},o[pke]=!1,o[hke]=!1,n&&hs.addListener(o,"connect",gPs.bind(o,n)),hs.addListener(o,"error",EPs),hs.addListener(o,"frameError",_Ps),hs.addListener(o,"end",vPs),hs.addListener(o,"goaway",CPs),hs.addListener(o,"close",bPs),hs.addListener(o,"remoteSettings",APs),o.unref(),t[BF]=o,e[BF]=o,hs.addListener(e,"error",TPs),hs.addListener(e,"end",IPs),hs.addListener(e,"close",SPs),e[lor]=!1,e.on("close",xPs),{version:"h2",defaultPipelining:1/0,write(s){return RPs(t,s)},resume(){mPs(t)},destroy(s,c){e[lor]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[Ake]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[hke]===!1||hs.bodyLength(s.body)!==0&&(hs.isStream(s.body)||hs.isAsyncIterable(s.body)||hs.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[hke]===!1;return!1}}}a(hPs,"connectH2");function mPs(t){let e=t[bf];e?.destroyed===!1&&(t[sPs]===0||t[Yot]===0?(e.unref(),t[BF].unref()):(e.ref(),t[BF].ref()))}a(mPs,"resumeH2");function gPs(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(gPs,"applyConnectionWindowSize");function APs(t){if(this[hT][Yot]=t.maxConcurrentStreams??this[hT][Yot],this[hke]===!0&&this[pke]===!0&&t.enableConnectProtocol===!1){let e=new Lj("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[bf][mT]=e,this[hT][rpe](e);return}this[pke]=t.enableConnectProtocol??this[pke],this[hke]=!0,this[hT][S5]()}a(APs,"onHttp2RemoteSettings");function yPs(t){let e=t[por];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[hT],c=this[hT];if(n!=null){let l=new Lj(`HTTP/2: "PING" errored - type ${n.message}`);c[mT]=l,s[rpe](l)}else s.emit("ping",o)}a(r,"onPing")}a(yPs,"onHttp2SendPing");function EPs(t){Bw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[bf][mT]=t,this[hT][rpe](t)}a(EPs,"onHttp2SessionError");function _Ps(t,e,r){if(r===0){let n=new Lj(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[bf][mT]=n,this[hT][rpe](n)}}a(_Ps,"onHttp2FrameError");function vPs(){let t=new gke("other side closed",hs.getSocketInfo(this[bf]));this.destroy(t),hs.destroy(this[bf],t)}a(vPs,"onHttp2SessionEnd");function CPs(t){let e=this[mT]||new gke(`HTTP/2: "GOAWAY" frame received with code ${t}`,hs.getSocketInfo(this[bf])),r=this[hT];if(r[bf]=null,r[dor]=null,this.close(),this[BF]=null,hs.destroy(this[bf],e),r[v2]{e.aborted||e.completed||(x=x||new ePs,hs.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[rpe](x),t[S5]()),hs.destroy(m,x))},"abort");try{e.onConnect(_)}catch(x){hs.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[pke]===!1?(hs.errorRequest(t,e,new Lj("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[_Un]="CONNECT",g[dPs]="websocket",g[vUn]=s,f==="ws:"||f==="wss:"?g[oor]=f==="ws:"?"http":"https":g[oor]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[zot]=!0,A.once("response",(x,P)=>{let{[sor]:D,...N}=x;e.onUpgrade(D,aor(N),A),++n[Ow],t[Fj][t[v2]++]=null}),A.on("error",()=>{(A.rstCode===fPs||A.rstCode===pPs)&&_(new Lj(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[Ow]-=1,n[Ow]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[zot]=!0,A.on("response",x=>{let{[sor]:P,...D}=x;e.onUpgrade(P,aor(D),A),++n[Ow],t[Fj][t[v2]++]=null}),A.once("close",()=>{n[Ow]-=1,n[Ow]===0&&n.unref()}),A.setTimeout(r),!0);g[vUn]=s,g[oor]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let b=hs.bodyLength(m);if(hs.isFormDataLike(m)){EUn??=Xfe().extractBody;let[x,P]=EUn(m);g["content-type"]=P,m=x.stream,b=x.length}if(b==null&&(b=e.contentLength),v||(b=null),wPs(o)&&b>0&&e.contentLength!=null&&e.contentLength!==b){if(t[nPs])return hs.errorRequest(t,e,new cor),!1;process.emitWarning(new cor)}if(b!=null&&(Bw(m||b===0,"no body must not have content length"),g[lPs]=`${b}`),n.ref(),yUn.sendHeaders.hasSubscribers){let x="";for(let P in g)x+=`${P}: ${g[P]}\r -`;yUn.sendHeaders.publish({request:e,headers:x,socket:n[bf]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[uPs]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[zot]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[zot]=!0,R()),++n[Ow],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[sor]:P,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(P),aor(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[Fj][t[v2]++]=null,t[S5]()):(_(new Lj("HTTP/2: stream half-closed (remote)")),t[Fj][t[v2]++]=null,t[uor]=t[v2],t[S5]())}),A.once("close",()=>{A.removeAllListeners("data"),n[Ow]-=1,n[Ow]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),_(x)}),A.once("frameError",(x,P)=>{A.removeAllListeners("data"),_(new Lj(`HTTP/2: "frameError" received - type ${x}, code ${P}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new Lj(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[Ow]-=1,n[Ow]===0&&n.unref(),_(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||b===0?CUn(_,A,null,t,e,t[bf],b,v):hs.isBuffer(m)?CUn(_,A,m,t,e,t[bf],b,v):hs.isBlobLike(m)?typeof m.stream=="function"?bUn(_,A,m.stream(),t,e,t[bf],b,v):kPs(_,A,m,t,e,t[bf],b,v):hs.isStream(m)?PPs(_,t[bf],v,A,m,t,e,b):hs.isIterable(m)?bUn(_,A,m,t,e,t[bf],b,v):Bw(!1)}a(R,"writeBodyH2")}a(RPs,"writeH2");function CUn(t,e,r,n,o,s,c,l){try{r!=null&&hs.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[Jot]=!0),o.onRequestSent(),n[S5]()}catch(u){t(u)}}a(CUn,"writeBuffer");function PPs(t,e,r,n,o,s,c,l){Bw(l!==0||s[Ake]===0,"stream body cannot be pipelined");let u=XRs(o,n,f=>{f?(hs.destroy(u,f),t(f)):(hs.removeAllListeners(u),c.onRequestSent(),r||(e[Jot]=!0),s[S5]())});hs.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(PPs,"writeStream");async function kPs(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 cor;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Jot]=!0),n[S5]()}catch(u){t(u)}}a(kPs,"writeBlob");async function bUn(t,e,r,n,o,s,c,l){Bw(c!==0||n[Ake]===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[mT]?m(s[mT]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[mT])throw s[mT];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Jot]=!0),n[S5]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(bUn,"writeIterable");SUn.exports=hPs});var jj=I((Nsf,NUn)=>{"use strict";p();var LF=require("node:assert"),RUn=require("node:net"),yke=require("node:http"),vZ=ko(),{ClientStats:DPs}=iir(),{channels:npe}=Nj(),NPs=H6n(),MPs=dZ(),{InvalidArgumentError:cd,InformationalError:OPs,ClientDestroyedError:BPs}=co(),LPs=fZ(),{kUrl:T5,kServerName:qj,kClient:FPs,kBusy:mor,kConnect:UPs,kResuming:CZ,kRunning:Cke,kPending:bke,kSize:Eke,kQueue:C2,kConnected:QPs,kConnecting:ipe,kNeedDrain:Qj,kKeepAliveDefaultTimeout:IUn,kHostHeader:qPs,kPendingIdx:b2,kRunningIdx:UF,kError:jPs,kPipelining:Zot,kKeepAliveTimeoutValue:HPs,kMaxHeadersSize:GPs,kKeepAliveMaxTimeout:$Ps,kKeepAliveTimeoutThreshold:VPs,kHeadersTimeout:WPs,kBodyTimeout:zPs,kStrictContentLength:YPs,kConnector:_ke,kMaxRequests:gor,kCounter:KPs,kClose:JPs,kDestroy:ZPs,kDispatch:XPs,kLocalAddress:vke,kMaxResponseSize:eks,kOnError:tks,kHTTPContext:nh,kMaxConcurrentStreams:rks,kHTTP2InitialWindowSize:nks,kHTTP2ConnectionWindowSize:iks,kResume:FF,kPingInterval:oks}=nl(),sks=gUn(),aks=TUn(),Uj=Symbol("kClosedResolve"),cks=yke&&yke.maxHeaderSize&&Number.isInteger(yke.maxHeaderSize)&&yke.maxHeaderSize>0?()=>yke.maxHeaderSize:()=>{throw new cd("http module not available or http.maxHeaderSize invalid")},xUn=a(()=>{},"noop");function PUn(t){return t[Zot]??t[nh]?.defaultPipelining??1}a(PUn,"getPipelining");var Aor=class extends MPs{static{a(this,"Client")}constructor(e,{maxHeaderSize:r,headersTimeout:n,socketTimeout:o,requestTimeout:s,connectTimeout:c,bodyTimeout:l,idleTimeout:u,keepAlive:d,keepAliveTimeout:f,maxKeepAliveTimeout:h,keepAliveMaxTimeout:m,keepAliveTimeoutThreshold:g,socketPath:A,pipelining:y,tls:E,strictContentLength:_,maxCachedSessions:v,connect:b,maxRequestsPerClient:T,localAddress:w,maxResponseSize:R,autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P,maxConcurrentStreams:D,allowH2:N,useH2c:B,initialWindowSize:L,connectionWindowSize:j,pingInterval:M,webSocket:O}={}){if(d!==void 0)throw new cd("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new cd("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new cd("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new cd("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new cd("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new cd("invalid maxHeaderSize")}else r=cks();if(A!=null&&typeof A!="string")throw new cd("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new cd("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new cd("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new cd("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new cd("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new cd("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new cd("bodyTimeout must be a positive integer or zero");if(b!=null&&typeof b!="function"&&typeof b!="object")throw new cd("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new cd("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||RUn.isIP(w)===0))throw new cd("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new cd("maxResponseSize must be a positive number");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new cd("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new cd("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new cd("maxConcurrentStreams must be a positive integer, greater than 0");if(B!=null&&typeof B!="boolean")throw new cd("useH2c must be a valid boolean value");if(L!=null&&(!Number.isInteger(L)||L<1))throw new cd("initialWindowSize must be a positive integer, greater than 0");if(j!=null&&(!Number.isInteger(j)||j<1))throw new cd("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new cd("pingInterval must be a positive integer, greater or equal to 0");if(super({webSocket:O}),typeof b!="function")b=LPs({...E,maxCachedSessions:v,allowH2:N,useH2c:B,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P}:void 0,...b});else{let q=b;b=a((Q,U)=>q({...Q,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},U),"connect")}this[T5]=vZ.parseOrigin(e),this[_ke]=b,this[Zot]=y??1,this[GPs]=r,this[IUn]=f??4e3,this[$Ps]=m??6e5,this[VPs]=g??2e3,this[HPs]=this[IUn],this[qj]=null,this[vke]=w??null,this[CZ]=0,this[Qj]=0,this[qPs]=`host: ${this[T5].hostname}${this[T5].port?`:${this[T5].port}`:""}\r -`,this[zPs]=l??3e5,this[WPs]=n??3e5,this[YPs]=_??!0,this[gor]=T,this[Uj]=null,this[eks]=R>-1?R:-1,this[nh]=null,this[rks]=D??100,this[nks]=L??262144,this[iks]=j??524288,this[oks]=M??6e4,this[C2]=[],this[UF]=0,this[b2]=0,this[FF]=q=>yor(this,q),this[tks]=q=>kUn(this,q)}get pipelining(){return this[Zot]}set pipelining(e){this[Zot]=e,this[FF](!0)}get stats(){return new DPs(this)}get[bke](){return this[C2].length-this[b2]}get[Cke](){return this[b2]-this[UF]}get[Eke](){return this[C2].length-this[UF]}get[QPs](){return!!this[nh]&&!this[ipe]&&!this[nh].destroyed}get[mor](){return!!(this[nh]?.busy(null)||this[Eke]>=(PUn(this)||1)||this[bke]>0)}[UPs](e){DUn(this),this.once("connect",e)}[XPs](e,r){let n=new NPs(this[T5].origin,e,r);return this[C2].push(n),this[CZ]||(vZ.bodyLength(n.body)==null&&vZ.isIterable(n.body)?(this[CZ]=1,queueMicrotask(()=>yor(this))):this[FF](!0)),this[CZ]&&this[Qj]!==2&&this[mor]&&(this[Qj]=2),this[Qj]<2}[JPs](){return new Promise(e=>{this[Eke]?this[Uj]=e:e(null)})}[ZPs](e){return new Promise(r=>{let n=this[C2].splice(this[b2]);for(let s=0;s{this[Uj]&&(this[Uj](),this[Uj]=null),r(null)},"callback");this[nh]?(this[nh].destroy(e,o),this[nh]=null):queueMicrotask(o),this[FF]()})}};function kUn(t,e){if(t[Cke]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){LF(t[b2]===t[UF]);let r=t[C2].splice(t[UF]);for(let n=0;n{if(s){hor(t,s,{host:e,hostname:r,protocol:n,port:o}),t[FF]();return}if(t.destroyed){vZ.destroy(c.on("error",xUn),new BPs),t[FF]();return}LF(c);try{t[nh]=c.alpnProtocol==="h2"?aks(t,c):sks(t,c)}catch(l){c.destroy().on("error",xUn),hor(t,l,{host:e,hostname:r,protocol:n,port:o}),t[FF]();return}t[ipe]=!1,c[KPs]=0,c[gor]=t[gor],c[FPs]=t,c[jPs]=null,npe.connected.hasSubscribers&&npe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[nh]?.version,servername:t[qj],localAddress:t[vke]},connector:t[_ke],socket:c}),t.emit("connect",t[T5],[t]),t[FF]()})}catch(s){hor(t,s,{host:e,hostname:r,protocol:n,port:o}),t[FF]()}}a(DUn,"connect");function hor(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[ipe]=!1,npe.connectError.hasSubscribers&&npe.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[nh]?.version,servername:t[qj],localAddress:t[vke]},connector:t[_ke],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(LF(t[Cke]===0);t[bke]>0&&t[C2][t[b2]].servername===t[qj];){let c=t[C2][t[b2]++];vZ.errorRequest(t,c,e)}else kUn(t,e);t.emit("connectionError",t[T5],[t],e)}}a(hor,"handleConnectError");function wUn(t){t[Qj]=0,t.emit("drain",t[T5],[t])}a(wUn,"emitDrain");function yor(t,e){t[CZ]!==2&&(t[CZ]=2,lks(t,e),t[CZ]=0,t[UF]>256&&(t[C2].splice(0,t[UF]),t[b2]-=t[UF],t[UF]=0))}a(yor,"resume");function lks(t,e){for(;;){if(t.destroyed){LF(t[bke]===0);return}if(t[Uj]&&!t[Eke]){t[Uj](),t[Uj]=null;return}if(t[nh]&&t[nh].resume(),t[mor])t[Qj]=2;else if(t[Qj]===2){e?(t[Qj]=1,queueMicrotask(()=>wUn(t))):wUn(t);continue}if(t[bke]===0||t[Cke]>=(PUn(t)||1))return;let r=t[C2][t[b2]];if(r===null)return;if(t[T5].protocol==="https:"&&t[qj]!==r.servername){if(t[Cke]>0)return;t[qj]=r.servername,t[nh]?.destroy(new OPs("servername changed"),()=>{t[nh]=null,yor(t)})}if(t[ipe])return;if(!t[nh]){DUn(t);return}if(t[nh].destroyed||t[nh].busy(r))return;!r.aborted&&t[nh].write(r)?t[b2]++:t[C2].splice(t[b2],1)}}a(lks,"_resume");NUn.exports=Aor});var Eor=I((Lsf,MUn)=>{"use strict";p();var Xot=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)}};MUn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Xot}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Xot),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 est=I((Qsf,HUn)=>{"use strict";p();var{PoolStats:uks}=iir(),dks=dZ(),fks=Eor(),{kConnected:_or,kSize:OUn,kRunning:BUn,kPending:LUn,kQueued:Ske,kBusy:pks,kFree:hks,kUrl:mks,kClose:gks,kDestroy:Aks,kDispatch:yks}=nl(),Sg=Symbol("clients"),rv=Symbol("needDrain"),Tke=Symbol("queue"),vor=Symbol("closed resolve"),Cor=Symbol("onDrain"),FUn=Symbol("onConnect"),UUn=Symbol("onDisconnect"),QUn=Symbol("onConnectionError"),bor=Symbol("get dispatcher"),qUn=Symbol("add client"),jUn=Symbol("remove client"),Sor=class extends dks{static{a(this,"PoolBase")}[Tke]=new fks;[Ske]=0;[Sg]=[];[rv]=!1;[Cor](e,r,n){let o=this[Tke],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[Ske]--,s=!e.dispatch(c.opts,c.handler)}if(e[rv]=s,!s&&this[rv]&&(this[rv]=!1,this.emit("drain",r,[this,...n])),this[vor]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[UUn]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[QUn]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[pks](){return this[rv]}get[_or](){let e=0;for(let{[_or]:r}of this[Sg])e+=r;return e}get[hks](){let e=0;for(let{[_or]:r,[rv]:n}of this[Sg])e+=r&&!n;return e}get[LUn](){let e=this[Ske];for(let{[LUn]:r}of this[Sg])e+=r;return e}get[BUn](){let e=0;for(let{[BUn]:r}of this[Sg])e+=r;return e}get[OUn](){let e=this[Ske];for(let{[OUn]:r}of this[Sg])e+=r;return e}get stats(){return new uks(this)}[gks](){if(this[Tke].isEmpty()){let e=[];for(let r=0;r{this[vor]=e})}[Aks](e){for(;;){let n=this[Tke].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[Sg].length);for(let n=0;n{this[rv]&&this[Cor](e,e[mks],[e,this])}),this}[jUn](e){e.close(()=>{let r=this[Sg].indexOf(e);r!==-1&&this[Sg].splice(r,1)}),this[rv]=this[Sg].some(r=>!r[rv]&&r.closed!==!0&&r.destroyed!==!0)}};HUn.exports={PoolBase:Sor,kClients:Sg,kNeedDrain:rv,kAddClient:qUn,kRemoveClient:jUn,kGetDispatcher:bor}});var bZ=I((Hsf,WUn)=>{"use strict";p();var{PoolBase:Eks,kClients:tst,kNeedDrain:_ks,kAddClient:vks,kGetDispatcher:Cks,kRemoveClient:bks}=est(),Sks=jj(),{InvalidArgumentError:Tor}=co(),GUn=ko(),{kUrl:$Un}=nl(),Tks=fZ(),rst=Symbol("options"),Ior=Symbol("connections"),VUn=Symbol("factory");function Iks(t,e){return new Sks(t,e)}a(Iks,"defaultFactory");var xor=class extends Eks{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=Iks,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 Tor("invalid connections");if(typeof n!="function")throw new Tor("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new Tor("connect must be a function or an object");typeof o!="function"&&(o=Tks({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(g),this[Ior]=r||null,this[$Un]=GUn.parseOrigin(e),this[rst]={...GUn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[rst].interceptors=g.interceptors?{...g.interceptors}:void 0,this[VUn]=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[tst].indexOf(_);v!==-1&&this[tst].splice(v,1)}})}[Cks](){let e=this[rst].clientTtl;for(let r of this[tst])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[bks](r);else if(!r[_ks])return r;if(!this[Ior]||this[tst].length{"use strict";p();var{BalancedPoolMissingUpstreamError:xks,InvalidArgumentError:wks}=co(),{PoolBase:Rks,kClients:UA,kNeedDrain:Ike,kAddClient:Pks,kRemoveClient:kks,kGetDispatcher:Dks}=est(),Nks=bZ(),{kUrl:nst}=nl(),ist=ko(),zUn=Symbol("factory"),xke=Symbol("options"),YUn=Symbol("kGreatestCommonDivisor"),SZ=Symbol("kCurrentWeight"),TZ=Symbol("kIndex"),Lw=Symbol("kWeight"),ost=Symbol("kMaxWeightPerServer"),sst=Symbol("kErrorPenalty");function Mks(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Mks,"getGreatestCommonDivisor");function Oks(t,e){return new Nks(t,e)}a(Oks,"defaultFactory");var wor=class extends Rks{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Oks,...n}={}){if(typeof r!="function")throw new wks("factory must be a function.");super(n),this[xke]={...ist.deepClone(n)},this[xke].interceptors=n.interceptors?{...n.interceptors}:void 0,this[TZ]=-1,this[SZ]=0,this[ost]=this[xke].maxWeightPerServer||100,this[sst]=this[xke].errorPenalty||15,Array.isArray(e)||(e=[e]),this[zUn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=ist.parseOrigin(e).origin;if(this[UA].find(o=>o[nst].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[zUn](r,this[xke]);this[Pks](n),n.on("connect",()=>{n[Lw]=Math.min(this[ost],n[Lw]+this[sst])}),n.on("connectionError",()=>{n[Lw]=Math.max(1,n[Lw]-this[sst]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Lw]=Math.max(1,n[Lw]-this[sst]),this._updateBalancedPoolStats())});for(let o of this[UA])o[Lw]=this[ost];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[nst].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[kks](n),this}getUpstream(e){let r=ist.parseOrigin(e).origin;return this[UA].find(n=>n[nst].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[UA].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[nst].origin)}[Dks](){if(this[UA].length===0)throw new xks;if(!this[UA].find(s=>!s[Ike]&&s.closed!==!0&&s.destroyed!==!0)||this[UA].map(s=>s[Ike]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[UA].findIndex(s=>!s[Ike]);for(;n++this[UA][o][Lw]&&!s[Ike]&&(o=this[TZ]),this[TZ]===0&&(this[SZ]=this[SZ]-this[YUn],this[SZ]<=0&&(this[SZ]=this[ost])),s[Lw]>=this[SZ]&&!s[Ike])return s}return this[SZ]=this[UA][o][Lw],this[TZ]=o,this[UA][o]}};KUn.exports=wor});var t7n=I((Ysf,e7n)=>{"use strict";p();var{PoolBase:Bks,kClients:ast,kNeedDrain:Lks,kAddClient:ZUn,kGetDispatcher:Fks,kRemoveClient:Uks}=est(),Qks=jj(),{InvalidArgumentError:Ror}=co(),XUn=ko(),{kUrl:Por}=nl(),qks=fZ(),wke=Symbol("options"),kor=Symbol("connections"),Dor=Symbol("factory"),cst=Symbol("index");function jks(t,e){return new Qks(t,e)}a(jks,"defaultFactory");var Nor=class extends Bks{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 Ror("invalid connections");if(typeof n!="function")throw new Ror("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new Ror("connect must be a function or an object");typeof o!="function"&&(o=qks({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[kor]=r||null,this[Por]=XUn.parseOrigin(e),this[wke]={...XUn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[wke].interceptors=g.interceptors?{...g.interceptors}:void 0,this[Dor]=n,this[cst]=-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[ast].indexOf(_);v!==-1&&this[ast].splice(v,1)}})}[Fks](){let e=this[wke].clientTtl,r=this[ast].length;if(r===0){let o=this[Dor](this[Por],this[wke]);return this[ZUn](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[Uks](o),n++;continue}if(!o[Lks])return o;n++}if(!this[kor]||r{"use strict";p();var{InvalidArgumentError:lst,MaxOriginsReachedError:Hks}=co(),{kClients:Fw,kRunning:r7n,kClose:Gks,kDestroy:$ks,kDispatch:Vks,kUrl:Wks}=nl(),zks=dZ(),Yks=bZ(),Kks=jj(),Jks=ko(),n7n=Symbol("onConnect"),i7n=Symbol("onDisconnect"),o7n=Symbol("onConnectionError"),s7n=Symbol("onDrain"),a7n=Symbol("factory"),Mor=Symbol("options"),Rke=Symbol("origins");function Zks(t,e){return e&&e.connections===1?new Kks(t,e):new Yks(t,e)}a(Zks,"defaultFactory");var Oor=class extends zks{static{a(this,"Agent")}constructor({factory:e=Zks,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new lst("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new lst("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new lst("maxOrigins must be a number greater than 0");super(o),n&&typeof n!="function"&&(n={...n}),this[Mor]={...Jks.deepClone(o),maxOrigins:r,connect:n},this[a7n]=e,this[Fw]=new Map,this[Rke]=new Set,this[s7n]=(s,c)=>{this.emit("drain",s,[this,...c])},this[n7n]=(s,c)=>{this.emit("connect",s,[this,...c])},this[i7n]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[o7n]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[r7n](){let e=0;for(let{dispatcher:r}of this[Fw].values())e+=r[r7n];return e}[Vks](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new lst("opts.origin must be a non-empty string or URL.");if(this[Rke].size>=this[Mor].maxOrigins&&!this[Rke].has(n))throw new Hks;let o=this[Fw].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[Fw].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[Fw].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[Rke].delete(n))},"closeClientIfUnused");s=this[a7n](e.origin,this[Mor]).on("drain",this[s7n]).on("connect",(l,u)=>{let d=this[Fw].get(n);d&&(d.count+=1),this[n7n](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[i7n](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[o7n](l,u,d)}),this[Fw].set(n,{count:0,dispatcher:s}),this[Rke].add(n)}return s.dispatch(e,r)}[Gks](){let e=[];for(let{dispatcher:r}of this[Fw].values())e.push(r.close());return this[Fw].clear(),Promise.all(e)}[$ks](e){let r=[];for(let{dispatcher:n}of this[Fw].values())r.push(n.destroy(e));return this[Fw].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[Fw].values())r.stats&&(e[r[Wks].origin]=r.stats);return e}};c7n.exports=Oor});var d7n=I((taf,u7n)=>{"use strict";p();var{Buffer:Gj}=require("node:buffer"),Bor=require("node:net"),{InvalidArgumentError:Hj}=co();function Xks(t){if(Bor.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:Gj.from(r)}}if(Bor.isIPv6(t))return{type:4,buffer:l7n(t)};let e=Gj.from(t,"utf8");if(e.length>255)throw new Hj("Domain name too long (max 255 bytes)");return{type:3,buffer:Gj.concat([Gj.from([e.length]),e])}}a(Xks,"parseAddress");function l7n(t){let e=Gj.alloc(16),r=t;if(t.includes(".")){let o=t.lastIndexOf(":"),s=t.slice(o+1);if(Bor.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:n2s}=require("node:events"),{Buffer:xZ}=require("node:buffer"),{InvalidArgumentError:ope,Socks5ProxyError:$j}=co(),{debuglog:i2s}=require("node:util"),{parseAddress:o2s}=d7n(),QF=i2s("undici:socks5"),f7n=xZ.alloc(0),ust=5,spe={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},p7n={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},wZ={IPV4:1,DOMAIN:3,IPV6:4},I5={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},hE={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},Lor=class extends n2s{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new ope("socket is required");this.socket=e,this.options=r,this.state=hE.INITIAL,this.buffer=f7n,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(spe.USERNAME_PASSWORD),this.authMethods.push(spe.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){QF("received data",e.length,"bytes in state",this.state),this.buffer=xZ.concat([this.buffer,e]);try{switch(this.state){case hE.HANDSHAKING:this.handleHandshakeResponse();break;case hE.AUTHENTICATING:this.handleAuthResponse();break;case hE.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){QF("socket error",e),this.state=hE.ERROR,this.emit("error",e),this.destroy()}onClose(){QF("socket closed"),this.state=hE.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=hE.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==hE.INITIAL)throw new ope("Handshake already started");QF("starting handshake with",this.authMethods.length,"auth methods"),this.state=hE.HANDSHAKING;let e=xZ.alloc(2+this.authMethods.length);e[0]=ust,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!==ust)throw new $j(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===spe.NO_ACCEPTABLE)throw new $j("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),QF("server selected auth method",r),r===spe.NO_AUTH)this.markAuthenticated();else if(r===spe.USERNAME_PASSWORD)this.state=hE.AUTHENTICATING,this.sendAuthRequest();else throw new $j(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new ope("Username and password required for authentication");QF("sending username/password auth");let n=xZ.from(e),o=xZ.from(r);if(n.length>255||o.length>255)throw new ope("Username or password too long");let s=xZ.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 $j(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new $j("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),QF("authentication successful"),this.markAuthenticated()}connect(e,r){if(this.state===hE.CONNECTING||this.state===hE.CONNECTED)throw new ope("Connection already in progress");if(this.state!==hE.AUTHENTICATED)throw new ope("Client must be authenticated before CONNECT");QF("connecting to",e,r),this.state=hE.CONNECTING;let n=this.buildConnectRequest(p7n.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=o2s(r),c=xZ.alloc(4+s.length+2);return c[0]=ust,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!==ust)throw new $j(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===wZ.IPV4)o+=6;else if(n===wZ.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===wZ.IPV6)o+=18;else throw new $j(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var{URL:g7n}=require("node:url"),For,s2s=dZ(),{InvalidArgumentError:A7n}=co(),{Socks5Client:a2s,STATES:c2s}=m7n(),{kDispatch:y7n,kClose:l2s,kDestroy:u2s}=nl(),d2s=bZ(),f2s=fZ(),{debuglog:p2s}=require("node:util"),Vj=p2s("undici:socks5-proxy"),Uor=Symbol("proxy url"),h2s=Symbol("proxy headers"),E7n=Symbol("proxy auth"),_7n=Symbol("proxy protocol"),RZ=Symbol("pools"),v7n=Symbol("connector"),Qor=Symbol("request tls settings"),C7n=!1,qor=class extends s2s{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),C7n||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),C7n=!0),!e)throw new A7n("Proxy URL is mandatory");let n=typeof e=="string"?new g7n(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new A7n("Proxy URL must use socks5:// or socks:// protocol");this[Uor]=n,this[h2s]=r.headers||{},this[_7n]=r.proxyTls?"https:":"http:",this[Qor]=r.requestTls,this[E7n]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[v7n]=r.connect||f2s({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[RZ]=new Map}async createSocks5Connection(e,r){let n=this[Uor].hostname,o=parseInt(this[Uor].port)||1080;Vj("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{this[v7n]({hostname:n,host:n,port:o,protocol:this[_7n]},(d,f)=>{d?u(d):l(f)})}),c=new a2s(s,this[E7n]);return c.on("error",l=>{Vj("SOCKS5 error:",l),s.destroy()}),await c.handshake(),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 authentication timeout"))},5e3),f=a(()=>{clearTimeout(d),c.removeListener("error",h),l()},"onAuthenticated"),h=a(m=>{clearTimeout(d),c.removeListener("authenticated",f),u(m)},"onError");c.state===c2s.AUTHENTICATED?(clearTimeout(d),l()):(c.once("authenticated",f),c.once("error",h))}),await c.connect(e,r),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 connection timeout"))},5e3),f=a(m=>{Vj("SOCKS5 tunnel established to",e,r,"via",m),clearTimeout(d),c.removeListener("error",h),l()},"onConnected"),h=a(m=>{clearTimeout(d),c.removeListener("connected",f),u(m)},"onError");c.once("connected",f),c.once("error",h)}),s}[y7n](e,r){let{origin:n}=e;Vj("dispatching request to",n,"via SOCKS5");try{let o=String(n),s=this[RZ].get(o);return(!s||s.destroyed||s.closed)&&(s=new d2s(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(c,l)=>{try{let u=new g7n(n),d=u.hostname,f=parseInt(u.port)||(u.protocol==="https:"?443:80);Vj("establishing SOCKS5 connection to",d,f);let h=await this.createSocks5Connection(d,f),m=h;u.protocol==="https:"&&(For||(For=require("node:tls")),Vj("upgrading to TLS"),m=For.connect({...this[Qor],socket:h,servername:this[Qor]?.servername||d}),await new Promise((g,A)=>{m.once("secureConnect",g),m.once("error",A)})),l(null,m)}catch(u){Vj("SOCKS5 connection error:",u),l(u)}},"connect")}),this[RZ].set(o,s)),s[y7n](e,r)}catch(o){if(Vj("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[l2s](){let e=[];for(let r of this[RZ].values())e.push(r.close());this[RZ].clear(),await Promise.all(e)}async[u2s](e){let r=[];for(let n of this[RZ].values())r.push(n.destroy(e));this[RZ].clear(),await Promise.all(r)}};b7n.exports=qor});var Vor=I((uaf,O7n)=>{"use strict";p();var{kProxy:ape,kClose:P7n,kDestroy:k7n,kDispatch:S7n}=nl(),m2s=IZ(),D7n=bZ(),N7n=dZ(),{InvalidArgumentError:PZ,RequestAbortedError:g2s,SecureProxyConnectionError:A2s}=co(),T7n=fZ(),M7n=jj(),{channels:I7n}=Nj(),y2s=jor(),dst=Symbol("proxy agent"),Wj=Symbol("proxy client"),qF=Symbol("proxy headers"),Hor=Symbol("request tls settings"),x7n=Symbol("proxy tls settings"),w7n=Symbol("connect endpoint function"),R7n=Symbol("tunnel proxy");function E2s(t){return t==="https:"?443:80}a(E2s,"defaultProtocolPort");function _2s(t,e){return new D7n(t,e)}a(_2s,"defaultFactory");var v2s=a(()=>{},"noop");function C2s(t,e){return e.connections===1?new M7n(t,e):new D7n(t,e)}a(C2s,"defaultAgentFactory");var Gor=class extends N7n{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new PZ("Proxy URL is mandatory");super(),this[qF]=r,o?this.#e=o(e,{connect:n}):this.#e=new M7n(e,{connect:n})}[S7n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new PZ("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[qF],...c},this.#e[S7n](e,r)}[P7n](){return this.#e.close()}[k7n](e){return this.#e.destroy(e)}},$or=class extends N7n{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new PZ("Proxy uri is mandatory");let{clientFactory:r=_2s}=e;if(typeof r!="function")throw new PZ("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[ape]={uri:s,protocol:u},this[Hor]=e.requestTls,this[x7n]=e.proxyTls,this[qF]=e.headers||{},this[R7n]=n,e.auth&&e.token)throw new PZ("opts.auth cannot be used in combination with opts.token");e.auth?this[qF]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[qF]["proxy-authorization"]=e.token:d&&f&&(this[qF]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=T7n({...e.proxyTls});this[w7n]=T7n({...e.requestTls});let g=e.factory||C2s,A=a((y,E)=>{let{protocol:_}=new URL(y);return this[ape].protocol==="socks5:"||this[ape].protocol==="socks:"?new y2s(this[ape].uri,{headers:this[qF],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls,requestTls:e.requestTls}):!this[R7n]&&_==="http:"&&this[ape].protocol==="http:"?new Gor(this[ape].uri,{headers:this[qF],connect:m,factory:g}):g(y,E)},"factory");u==="socks5:"||u==="socks:"?this[Wj]=null:this[Wj]=r(o,{connect:m}),this[dst]=new m2s({...e,factory:A,connect:a(async(y,E)=>{if(!this[Wj]){E(new PZ("Cannot establish tunnel connection without a proxy client"));return}let _=y.host;y.port||(_+=`:${E2s(y.protocol)}`);try{let v={origin:c,port:l,path:_,signal:y.signal,headers:{...this[qF],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[x7n]?.servername||h},{socket:b,statusCode:T}=await this[Wj].connect(v);if(T!==200){b.on("error",v2s).destroy(),E(new g2s(`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[Hor]?w=this[Hor].servername:w=y.servername,this[w7n]({...y,servername:w,httpSocket:b},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new A2s(v)):E(v)}},"connect")})}dispatch(e,r){let n=b2s(e.headers);if(S2s(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[dst].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[dst].close()];return this[Wj]&&e.push(this[Wj].close()),Promise.all(e)}[k7n](){let e=[this[dst].destroy()];return this[Wj]&&e.push(this[Wj].destroy()),Promise.all(e)}};function b2s(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new PZ("Proxy-Authorization should be sent in ProxyAgent constructor")}a(S2s,"throwIfProxyAuthIsSent");O7n.exports=$or});var Q7n=I((paf,U7n)=>{"use strict";p();var T2s=dZ(),{kClose:I2s,kDestroy:x2s,kClosed:B7n,kDestroyed:L7n,kDispatch:w2s,kNoProxyAgent:Pke,kHttpProxyAgent:zj,kHttpsProxyAgent:kZ}=nl(),F7n=Vor(),R2s=IZ(),P2s={"http:":80,"https:":443},Wor=class extends T2s{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[Pke]=new R2s(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[zj]=new F7n({...s,uri:c}):this[zj]=this[Pke];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[kZ]=new F7n({...s,uri:l}):this[kZ]=this[zj],this.#o()}[w2s](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[I2s](){return Promise.all([this[Pke].close(),!this[zj][B7n]&&this[zj].close(),!this[kZ][B7n]&&this[kZ].close()])}[x2s](e){return Promise.all([this[Pke].destroy(e),!this[zj][L7n]&&this[zj].destroy(e),!this[kZ][L7n]&&this[kZ].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||P2s[r]||0,this.#i(n,o)?r==="https:"?this[kZ]:this[zj]:this[Pke]}#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 cpe=require("node:assert"),{kRetryHandlerDefaultRetry:q7n}=nl(),{RequestRetryError:kke}=co(),k2s=tke(),{isDisturbed:j7n,parseRangeHeader:H7n,wrapRequestBody:D2s}=ko();function N2s(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(N2s,"calculateRetryAfterHeader");var zor=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=k2s.wrap(n),this.opts={...s,body:D2s(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[q7n],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(j7n(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[q7n](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 kke("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 kke("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=H7n(n["content-range"]);if(!s)throw new kke("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new kke("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});let{start:c,size:l,end:u=l?l-1:null}=s;cpe(this.start===c,"content-range mismatch"),cpe(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=H7n(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;cpe(c!=null&&Number.isFinite(c),"content-range mismatch"),cpe(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}cpe(Number.isFinite(this.start)),cpe(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 kke("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||j7n(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))}};G7n.exports=zor});var V7n=I((Eaf,$7n)=>{"use strict";p();var M2s=rke(),O2s=fst(),Yor=class extends M2s{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()}};$7n.exports=Yor});var Y7n=I((Caf,z7n)=>{"use strict";p();var{InvalidArgumentError:W7n}=co(),B2s=jj(),Kor=class extends B2s{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new W7n("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 W7n("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};z7n.exports=Kor});var iQn=I((Taf,nQn)=>{"use strict";p();var X7n=require("node:assert"),{Readable:L2s}=require("node:stream"),{RequestAbortedError:eQn,NotSupportedError:F2s,InvalidArgumentError:U2s,AbortError:pst}=co(),tQn=ko(),{ReadableStreamFrom:Q2s}=ko(),gT=Symbol("kConsume"),hst=Symbol("kReading"),DZ=Symbol("kBody"),K7n=Symbol("kAbort"),rQn=Symbol("kContentType"),Jor=Symbol("kContentLength"),Zor=Symbol("kUsed"),mst=Symbol("kBytesRead"),q2s=a(()=>{},"noop"),Xor=class extends L2s{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[K7n]=r,this[gT]=null,this[mst]=0,this[DZ]=null,this[Zor]=!1,this[rQn]=n,this[Jor]=Number.isFinite(o)?o:null,this[hst]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new eQn),e&&this[K7n](),this[Zor]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[hst]=!0,this[Zor]=!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[hst]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[mst]+=e.length,this[gT])?(tsr(this[gT],e),this[hst]?super.push(e):!0):super.push(e)}text(){return Dke(this,"text")}json(){return Dke(this,"json")}blob(){return Dke(this,"blob")}bytes(){return Dke(this,"bytes")}arrayBuffer(){return Dke(this,"arrayBuffer")}async formData(){throw new F2s}get bodyUsed(){return tQn.isDisturbed(this)}get body(){return this[DZ]||(this[DZ]=Q2s(this),this[gT]&&(this[DZ].getReader(),X7n(this[DZ].locked))),this[DZ]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new U2s("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 pst):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[Jor]&&this[Jor]>n||this[mst]>n)&&this.destroy(new pst),r){let c=a(()=>{this.destroy(r.reason??new pst)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new pst):o(null)})}else this.on("close",o);this.on("error",q2s).on("data",()=>{this[mst]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function j2s(t){return t[DZ]?.locked===!0||t[gT]!==null}a(j2s,"isLocked");function H2s(t){return tQn.isDisturbed(t)||j2s(t)}a(H2s,"isUnusable");function Dke(t,e){return X7n(!t[gT]),new Promise((r,n)=>{if(H2s(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[gT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){rsr(this[gT],o)}).on("close",function(){this[gT].body!==null&&rsr(this[gT],new eQn)}),G2s(t[gT])})})}a(Dke,"consume");function G2s(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(esr,"chunksDecode");function J7n(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 $2s=require("node:assert"),{AsyncResource:V2s}=require("node:async_hooks"),{Readable:W2s}=iQn(),{InvalidArgumentError:lpe,RequestAbortedError:oQn}=co(),Uw=ko();function Nke(){}a(Nke,"noop");var gst=class extends V2s{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new lpe("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 lpe("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new lpe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new lpe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new lpe("invalid method");if(l&&typeof l!="function")throw new lpe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw Uw.isStream(c)&&Uw.destroy(c.on("error",Nke),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 oQn:n&&(this.removeAbortListener=Uw.addAbortListener(n,()=>{this.reason=n.reason??new oQn,this.res?Uw.destroy(this.res.on("error",Nke),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}$2s(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"?Uw.parseRawHeaders(r):Uw.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?Uw.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new W2s({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,Uw.destroy(y.on("error",Nke),E),queueMicrotask(()=>{throw E})}}onData(e){return this.res.push(e)}onComplete(e){Uw.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(()=>{Uw.destroy(r.on("error",Nke),e)})),o&&(this.body=null,Uw.isStream(o)&&(o.on("error",Nke),Uw.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function sQn(t,e){if(e===void 0)return new Promise((r,n)=>{sQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new gst(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(sQn,"request");nsr.exports=sQn;nsr.exports.RequestHandler=gst});var Mke=I((kaf,uQn)=>{"use strict";p();var{addAbortListener:z2s}=ko(),{RequestAbortedError:Y2s}=co(),upe=Symbol("kListener"),x5=Symbol("kSignal");function cQn(t){t.abort?t.abort(t[x5]?.reason):t.reason=t[x5]?.reason??new Y2s,lQn(t)}a(cQn,"abort");function K2s(t,e){if(t.reason=null,t[x5]=null,t[upe]=null,!!e){if(e.aborted){cQn(t);return}t[x5]=e,t[upe]=()=>{cQn(t)},z2s(t[x5],t[upe])}}a(K2s,"addSignal");function lQn(t){t[x5]&&("removeEventListener"in t[x5]?t[x5].removeEventListener("abort",t[upe]):t[x5].removeListener("abort",t[upe]),t[x5]=null,t[upe]=null)}a(lQn,"removeSignal");uQn.exports={addSignal:K2s,removeSignal:lQn}});var hQn=I((Maf,pQn)=>{"use strict";p();var J2s=require("node:assert"),{finished:Z2s}=require("node:stream"),{AsyncResource:X2s}=require("node:async_hooks"),{InvalidArgumentError:dpe,InvalidReturnValueError:eDs}=co(),jF=ko(),{addSignal:tDs,removeSignal:dQn}=Mke();function rDs(){}a(rDs,"noop");var isr=class extends X2s{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new dpe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new dpe("invalid callback");if(typeof r!="function")throw new dpe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new dpe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new dpe("invalid method");if(u&&typeof u!="function")throw new dpe("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw jF.isStream(l)&&jF.destroy(l.on("error",rDs),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,jF.isStream(l)&&l.on("error",f=>{this.onError(f)}),tDs(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}J2s(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"?jF.parseRawHeaders(r):jF.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 eDs("expected Writable");return Z2s(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:E,abort:_}=this;this.res=null,(m||!A?.readable)&&jF.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;dQn(this),r&&(this.trailers=jF.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;dQn(this),this.factory=null,r?(this.res=null,jF.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,jF.destroy(s,e))}};function fQn(t,e,r){if(r===void 0)return new Promise((n,o)=>{fQn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new isr(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(fQn,"stream");pQn.exports=fQn});var yQn=I((Laf,AQn)=>{"use strict";p();var{Readable:gQn,Duplex:nDs,PassThrough:iDs}=require("node:stream"),oDs=require("node:assert"),{AsyncResource:sDs}=require("node:async_hooks"),{InvalidArgumentError:Oke,InvalidReturnValueError:aDs,RequestAbortedError:osr}=co(),w5=ko(),{addSignal:cDs,removeSignal:lDs}=Mke();function mQn(){}a(mQn,"noop");var fpe=Symbol("resume"),ssr=class extends gQn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[fpe]=null}_read(){let{[fpe]:e}=this;e&&(this[fpe]=null,e())}_destroy(e,r){this._read(),r(e)}},asr=class extends gQn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[fpe]=e}_read(){this[fpe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new osr),r(e)}},csr=class extends sDs{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Oke("invalid opts");if(typeof r!="function")throw new Oke("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 Oke("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Oke("invalid method");if(c&&typeof c!="function")throw new Oke("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 ssr().on("error",mQn),this.ret=new nDs({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[fpe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new osr),A&&u&&A(),w5.destroy(f,u),w5.destroy(h,u),w5.destroy(m,u),lDs(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,cDs(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}oDs(!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"?w5.parseRawHeaders(r):w5.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new asr(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?w5.parseRawHeaders(r):w5.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",mQn),u}if(!l||typeof l.on!="function")throw new aDs("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;w5.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||w5.destroy(u,new osr)}),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,w5.destroy(r,e)}};function uDs(t,e){try{let r=new csr(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new iDs().destroy(r)}}a(uDs,"pipeline");AQn.exports=uDs});var SQn=I((Qaf,bQn)=>{"use strict";p();var{InvalidArgumentError:lsr,SocketError:dDs}=co(),{AsyncResource:fDs}=require("node:async_hooks"),EQn=require("node:assert"),_Qn=ko(),{kHTTP2Stream:pDs}=nl(),{addSignal:hDs,removeSignal:vQn}=Mke(),usr=class extends fDs{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new lsr("invalid opts");if(typeof r!="function")throw new lsr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new lsr("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,hDs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}EQn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new dDs("bad upgrade",null)}onUpgrade(e,r,n){EQn(n[pDs]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;vQn(this),this.callback=null;let l=this.responseHeaders==="raw"?_Qn.parseRawHeaders(r):_Qn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;vQn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function CQn(t,e){if(e===void 0)return new Promise((r,n)=>{CQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new usr(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(CQn,"upgrade");bQn.exports=CQn});var RQn=I((Haf,wQn)=>{"use strict";p();var mDs=require("node:assert"),{AsyncResource:gDs}=require("node:async_hooks"),{InvalidArgumentError:dsr,SocketError:ADs}=co(),TQn=ko(),{addSignal:yDs,removeSignal:IQn}=Mke(),fsr=class extends gDs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new dsr("invalid opts");if(typeof r!="function")throw new dsr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new dsr("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,yDs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}mDs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new ADs("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"?TQn.parseRawHeaders(r):TQn.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 xQn(t,e){if(e===void 0)return new Promise((r,n)=>{xQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new fsr(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(xQn,"connect");wQn.exports=xQn});var PQn=I((Vaf,ppe)=>{"use strict";p();ppe.exports.request=aQn();ppe.exports.stream=hQn();ppe.exports.pipeline=yQn();ppe.exports.upgrade=SQn();ppe.exports.connect=RQn()});var hsr=I((zaf,DQn)=>{"use strict";p();var{UndiciError:EDs}=co(),kQn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),psr=class extends EDs{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[kQn]===!0}get[kQn](){return!0}};DQn.exports={MockNotMatchedError:psr}});var NZ=I((Jaf,NQn)=>{"use strict";p();NQn.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 Bke=I((Xaf,GQn)=>{"use strict";p();var{MockNotMatchedError:hpe}=hsr(),{kDispatches:MZ,kMockAgent:_Ds,kOriginalDispatch:vDs,kOrigin:CDs,kGetNetConnect:bDs,kTotalDispatchCount:Asr}=NZ(),{serializePathWithQuery:SDs}=ko(),{STATUS_CODES:TDs}=require("node:http"),{types:{isPromise:IDs}}=require("node:util"),{InvalidArgumentError:msr}=co();function R5(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(R5,"matchValue");function OQn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(OQn,"lowerCaseEntries");function BQn(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=BQn(e,r);if(!R5(n,o))return!1}return!0}a(LQn,"matchHeaders");function xDs(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(xDs,"normalizeSearchParams");function gsr(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(gsr,"safeUrl");function wDs(t,{path:e,method:r,body:n,headers:o}){let s=R5(t.path,e),c=R5(t.method,r),l=typeof t.body<"u"?R5(t.body,n):!0,u=LQn(t,o);return s&&c&&l&&u}a(wDs,"matchKey");function FQn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(FQn,"getResponseData");function UQn(t,e){let r=e.query?SDs(e.path,e.query):e.path,n=typeof r=="string"?gsr(r):r,o=MQn(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?R5(MQn(gsr(c)),o):R5(gsr(c),n));if(s.length===0)throw new hpe(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>R5(c,e.method)),s.length===0)throw new hpe(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?R5(c,e.body):!0),s.length===0)throw new hpe(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>LQn(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new hpe(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(UQn,"getMockDispatch");function RDs(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[Asr]=(t[Asr]||0)+1,c}a(RDs,"addMockDispatch");function ysr(t,e){let r=t.findIndex(n=>n.consumed?wDs(n,e):!1);r!==-1&&t.splice(r,1)}a(ysr,"deleteMockDispatch");function MQn(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(MQn,"removeTrailingSlash");function QQn(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(QQn,"buildKey");function Esr(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,E(this[MZ])},d):E(this[MZ]);function E(v,b=s){if(g)return;let T=Array.isArray(t.headers)?_sr(t.headers):t.headers,w=typeof b=="function"?b({...t,headers:T}):b;if(IDs(w))return w.then(D=>E(v,D));if(g)return;let R=FQn(w),x=Esr(c),P=Esr(l);e.onHeaders?.(o,x,_,qQn(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(P),ysr(v,r)}a(E,"handleReply");function _(){}return a(_,"resume"),!0}a(jQn,"mockDispatch");function kDs(){let t=this[_Ds],e=this[CDs],r=this[vDs];return a(function(o,s){if(t.isMockActive)try{jQn.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[bDs](),u=this[MZ][Asr]||this[MZ].length,f=`, ${this[MZ].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new hpe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(HQn(l,e))r.call(this,o,s);else throw new hpe(`${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(kDs,"buildMockDispatch");function HQn(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>R5(n,r.host)))}a(HQn,"checkNetConnect");function DDs(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(DDs,"normalizeOrigin");function NDs(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new msr("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new msr("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new msr("options.ignoreTrailingSlash must to be a boolean");return r}a(NDs,"buildAndValidateMockOptions");GQn.exports={getResponseData:FQn,getMockDispatch:UQn,addMockDispatch:RDs,deleteMockDispatch:ysr,buildKey:QQn,generateKeyValues:Esr,matchValue:R5,getResponse:PDs,getStatusText:qQn,mockDispatch:jQn,buildMockDispatch:kDs,checkNetConnect:HQn,buildAndValidateMockOptions:NDs,getHeaderByName:BQn,buildHeadersFromArray:_sr,normalizeSearchParams:xDs,normalizeOrigin:DDs}});var xsr=I((rcf,Isr)=>{"use strict";p();var{getResponseData:MDs,buildKey:ODs,addMockDispatch:vsr}=Bke(),{kDispatches:Ast,kDispatchKey:yst,kDefaultHeaders:Csr,kDefaultTrailers:bsr,kContentLength:Ssr,kMockDispatch:Est,kIgnoreTrailingSlash:_st}=NZ(),{InvalidArgumentError:P5}=co(),{serializePathWithQuery:BDs}=ko(),mpe=class{static{a(this,"MockScope")}constructor(e){this[Est]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new P5("waitInMs must be a valid integer > 0");return this[Est].delay=e,this}persist(){return this[Est].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new P5("repeatTimes must be a valid integer > 0");return this[Est].times=e,this}},Tsr=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new P5("opts must be an object");if(typeof e.path>"u")throw new P5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=BDs(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[yst]=ODs(e),this[Ast]=r,this[_st]=e.ignoreTrailingSlash??!1,this[Csr]={},this[bsr]={},this[Ssr]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=MDs(r),s=this[Ssr]?{"content-length":o.length}:{},c={...this[Csr],...s,...n.headers},l={...this[bsr],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new P5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new P5("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 P5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=vsr(this[Ast],this[yst],s,{ignoreTrailingSlash:this[_st]});return new mpe(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=vsr(this[Ast],this[yst],n,{ignoreTrailingSlash:this[_st]});return new mpe(o)}replyWithError(e){if(typeof e>"u")throw new P5("error must be defined");let r=vsr(this[Ast],this[yst],{error:e},{ignoreTrailingSlash:this[_st]});return new mpe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new P5("headers must be defined");return this[Csr]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new P5("trailers must be defined");return this[bsr]=e,this}replyContentLength(){return this[Ssr]=!0,this}};Isr.exports.MockInterceptor=Tsr;Isr.exports.MockScope=mpe});var ksr=I((ocf,JQn)=>{"use strict";p();var{promisify:LDs}=require("node:util"),FDs=jj(),{buildMockDispatch:UDs}=Bke(),{kDispatches:wsr,kMockAgent:$Qn,kClose:VQn,kOriginalClose:WQn,kOrigin:zQn,kOriginalDispatch:QDs,kConnected:Rsr,kIgnoreTrailingSlash:YQn}=NZ(),{MockInterceptor:qDs}=xsr(),KQn=nl(),{InvalidArgumentError:jDs}=co(),Psr=class extends FDs{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new jDs("Argument opts.agent must implement Agent");super(e,r),this[$Qn]=r.agent,this[zQn]=e,this[YQn]=r.ignoreTrailingSlash??!1,this[wsr]=[],this[Rsr]=1,this[QDs]=this.dispatch,this[WQn]=this.close.bind(this),this.dispatch=UDs.call(this),this.close=this[VQn]}get[KQn.kConnected](){return this[Rsr]}intercept(e){return new qDs(e&&{ignoreTrailingSlash:this[YQn],...e},this[wsr])}cleanMocks(){this[wsr]=[]}async[VQn](){await LDs(this[WQn])(),this[Rsr]=0,this[$Qn][KQn.kClients].delete(this[zQn])}};JQn.exports=Psr});var Msr=I((ccf,Nsr)=>{"use strict";p();var{kMockCallHistoryAddLog:HDs}=NZ(),{InvalidArgumentError:Jj}=co();function Yj(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 Jj("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(Yj,"handleFilterCallsWithOptions");function GDs(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new Jj("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(GDs,"buildAndValidateFilterCallsOptions");function Kj(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 Jj(`${t} parameter should be one of string, regexp, undefined or null`)}}a(Kj,"makeFilterCalls");function $Ds(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 Jj("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a($Ds,"computeUrlWithMaybeSearchParameters");var vst=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=$Ds(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)}},Dsr=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 Jj("nthCall must be called with a number");if(!Number.isInteger(e))throw new Jj("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new Jj("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",...GDs(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=Yj(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=Yj(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=Yj(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=Yj(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=Yj(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=Yj(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=Yj(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=Yj(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new Jj("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=Kj.call(this,"protocol");filterCallsByHost=Kj.call(this,"host");filterCallsByPort=Kj.call(this,"port");filterCallsByOrigin=Kj.call(this,"origin");filterCallsByPath=Kj.call(this,"path");filterCallsByHash=Kj.call(this,"hash");filterCallsByFullUrl=Kj.call(this,"fullUrl");filterCallsByMethod=Kj.call(this,"method");clear(){this.logs=[]}[HDs](e){let r=new vst(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};Nsr.exports.MockCallHistory=Dsr;Nsr.exports.MockCallHistoryLog=vst});var Fsr=I((dcf,iqn)=>{"use strict";p();var{promisify:VDs}=require("node:util"),WDs=bZ(),{buildMockDispatch:zDs}=Bke(),{kDispatches:Osr,kMockAgent:ZQn,kClose:XQn,kOriginalClose:eqn,kOrigin:tqn,kOriginalDispatch:YDs,kConnected:Bsr,kIgnoreTrailingSlash:rqn}=NZ(),{MockInterceptor:KDs}=xsr(),nqn=nl(),{InvalidArgumentError:JDs}=co(),Lsr=class extends WDs{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new JDs("Argument opts.agent must implement Agent");super(e,r),this[ZQn]=r.agent,this[tqn]=e,this[rqn]=r.ignoreTrailingSlash??!1,this[Osr]=[],this[Bsr]=1,this[YDs]=this.dispatch,this[eqn]=this.close.bind(this),this.dispatch=zDs.call(this),this.close=this[XQn]}get[nqn.kConnected](){return this[Bsr]}intercept(e){return new KDs(e&&{ignoreTrailingSlash:this[rqn],...e},this[Osr])}cleanMocks(){this[Osr]=[]}async[XQn](){await VDs(this[eqn])(),this[Bsr]=0,this[ZQn][nqn.kClients].delete(this[tqn])}};iqn.exports=Lsr});var sqn=I((mcf,oqn)=>{"use strict";p();var{Transform:ZDs}=require("node:stream"),{Console:XDs}=require("node:console"),eNs=process.versions.icu?"\u2705":"Y ",tNs=process.versions.icu?"\u274C":"N ";oqn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new ZDs({transform(r,n,o){o(null,r)}}),this.logger=new XDs({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?eNs:tNs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var Hsr=I((ycf,pqn)=>{"use strict";p();var{kClients:OZ}=nl(),rNs=IZ(),{kAgent:Usr,kMockAgentSet:Cst,kMockAgentGet:aqn,kDispatches:Qsr,kIsMockActive:bst,kNetConnect:BZ,kGetNetConnect:nNs,kOptions:Sst,kFactory:Tst,kMockAgentRegisterCallHistory:qsr,kMockAgentIsCallHistoryEnabled:Lke,kMockAgentAddCallHistoryLog:cqn,kMockAgentMockCallHistoryInstance:gpe,kMockAgentAcceptsNonStandardSearchParameters:lqn,kMockCallHistoryAddLog:iNs,kIgnoreTrailingSlash:uqn}=NZ(),oNs=ksr(),sNs=Fsr(),{matchValue:aNs,normalizeSearchParams:cNs,buildAndValidateMockOptions:lNs,normalizeOrigin:dqn}=Bke(),{InvalidArgumentError:fqn,UndiciError:uNs}=co(),dNs=rke(),fNs=sqn(),{MockCallHistory:pNs}=Msr(),jsr=class extends dNs{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=lNs(e);if(this[BZ]=!0,this[bst]=!0,this[Lke]=r.enableCallHistory??!1,this[lqn]=r.acceptNonStandardSearchParameters??!1,this[uqn]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new fqn("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new rNs(e);this[Usr]=n,this[OZ]=n[OZ],this[Sst]=r,this[Lke]&&this[qsr]()}get(e){let r=dqn(e),n=this[uqn]?r.replace(/\/$/,""):r,o=this[aqn](n);return o||(o=this[Tst](n),this[Cst](n,o)),o}dispatch(e,r){e.origin=dqn(e.origin),this.get(e.origin),this[cqn](e);let n=this[lqn],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=cNs(c,n);o.path=`${s}?${l}`}return this[Usr].dispatch(o,r)}async close(){this.clearCallHistory(),await this[Usr].close(),this[OZ].clear()}deactivate(){this[bst]=!1}activate(){this[bst]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[BZ])?this[BZ].push(e):this[BZ]=[e];else if(typeof e>"u")this[BZ]=!0;else throw new fqn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[BZ]=!1}enableCallHistory(){return this[Lke]=!0,this}disableCallHistory(){return this[Lke]=!1,this}getCallHistory(){return this[gpe]}clearCallHistory(){this[gpe]!==void 0&&this[gpe].clear()}get isMockActive(){return this[bst]}[qsr](){this[gpe]===void 0&&(this[gpe]=new pNs)}[cqn](e){this[Lke]&&(this[qsr](),this[gpe][iNs](e))}[Cst](e,r){this[OZ].set(e,{count:0,dispatcher:r})}[Tst](e){let r=Object.assign({agent:this},this[Sst]);return this[Sst]&&this[Sst].connections===1?new oNs(e,r):new sNs(e,r)}[aqn](e){let r=this[OZ].get(e);if(r?.dispatcher)return r.dispatcher;if(typeof e!="string"){let n=this[Tst]("http://localhost:9999");return this[Cst](e,n),n}for(let[n,o]of Array.from(this[OZ]))if(o&&typeof n!="string"&&aNs(n,e)){let s=this[Tst](e);return this[Cst](e,s),s[Qsr]=o.dispatcher[Qsr],s}}[nNs](){return this[BZ]}pendingInterceptors(){let e=this[OZ];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[Qsr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new fNs}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new uNs(r.length===1?`1 interceptor is pending: +`,"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: ${e.format(r)}`.trim():`${r.length} interceptors are pending: -${e.format(r)}`.trim())}};pqn.exports=jsr});var Gsr=I((vcf,Aqn)=>{"use strict";p();var{InvalidArgumentError:hNs}=co(),{runtimeFeatures:mNs}=NF();function gNs(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(gNs,"createHeaderFilters");var hqn=mNs.has("crypto")?require("node:crypto"):null,ANs=hqn?.hash?t=>hqn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function gqn(t){return Array.isArray(t)&&(t.length&1)===0}a(gqn,"isUndiciHeaders");function yNs(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(yNs,"isUrlExcludedFactory");function ENs(t){let e={};if(!t)return e;if(gqn(t)){for(let r=0;r{"use strict";p();var{writeFile:vNs,readFile:CNs,mkdir:bNs}=require("node:fs/promises"),{dirname:SNs,resolve:yqn}=require("node:path"),{setTimeout:TNs,clearTimeout:Eqn}=require("node:timers"),{InvalidArgumentError:_qn,UndiciError:INs}=co(),{hashId:xNs,isUrlExcludedFactory:wNs,normalizeHeaders:vqn,createHeaderFilters:Cqn}=Gsr();function Fke(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||vqn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:bqn(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(Fke,"formatRequestKey");function bqn(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(bqn,"filterHeadersForMatching");function Sqn(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(Sqn,"filterHeadersForStorage");function Uke(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 xNs(r)}a(Uke,"createRequestHash");var $sr=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=Cqn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=wNs(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=Fke(e,this.#s,this.matchOptions),o=Uke(n),s=vqn(r.headers),c={statusCode:r.statusCode,headers:Sqn(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=Fke(e,this.#s,this.matchOptions),n=Uke(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 _qn("Snapshot path is required");try{let n=await CNs(yqn(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 INs(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new _qn("Snapshot path is required");let n=yqn(r);await bNs(SNs(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await vNs(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=Fke(e,this.#s,this.matchOptions),n=Uke(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=Fke(e,this.#s,this.matchOptions),n=Uke(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&&(Eqn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=TNs(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(Eqn(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};Tqn.exports={SnapshotRecorder:$sr,formatRequestKey:Fke,createRequestHash:Uke,filterHeadersForMatching:bqn,filterHeadersForStorage:Sqn,createHeaderFilters:Cqn}});var Rqn=I((xcf,wqn)=>{"use strict";p();var RNs=IZ(),PNs=Hsr(),{SnapshotRecorder:kNs}=Iqn(),DNs=tke(),{InvalidArgumentError:NNs,UndiciError:MNs}=co(),{validateSnapshotMode:ONs}=Gsr(),lb=Symbol("kSnapshotRecorder"),k5=Symbol("kSnapshotMode"),Qke=Symbol("kSnapshotPath"),Vsr=Symbol("kSnapshotLoaded"),Ist=Symbol("kRealAgent"),xqn=!1,Wsr=class extends PNs{static{a(this,"SnapshotAgent")}constructor(e={}){xqn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),xqn=!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[k5]=r,this[Qke]=n,this[lb]=new kNs({snapshotPath:this[Qke],mode:this[k5],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[Vsr]=!1,(this[k5]==="record"||this[k5]==="update"||this[k5]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[Ist]=new RNs(e)),(this[k5]==="playback"||this[k5]==="update")&&this[Qke]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=DNs.wrap(r);let n=this[k5];if(this[lb].isUrlExcluded(e))return this[Ist].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[Vsr])return this.#e(e,r);let o=this[lb].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new MNs(`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[lb].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[Ist].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[lb].loadSnapshots(e||this[Qke]),this[Vsr]=!0,this[k5]==="playback"&&this.#n()}async saveSnapshots(e){return this[lb].saveSnapshots(e||this[Qke])}#n(){for(let e of this[lb].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[lb]}getMode(){return this[k5]}clearSnapshots(){this[lb].clear()}resetCallCounts(){this[lb].resetCallCounts()}deleteSnapshot(e){return this[lb].deleteSnapshot(e)}getSnapshotInfo(e){return this[lb].getSnapshotInfo(e)}replaceSnapshots(e){this[lb].replaceSnapshots(e)}async close(){await this[lb].close(),await this[Ist]?.close(),await super.close()}};wqn.exports=Wsr});var xst=I((Pcf,Nqn)=>{"use strict";p();var BNs=Symbol.for("undici.globalDispatcher.2"),Pqn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:LNs}=co(),FNs=IZ();Dqn()===void 0&&kqn(new FNs);function kqn(t){if(!t||typeof t.dispatch!="function")throw new LNs("Argument agent must implement Agent");Object.defineProperty(globalThis,BNs,{value:t,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,Pqn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(kqn,"setGlobalDispatcher");function Dqn(){return globalThis[Pqn]}a(Dqn,"getGlobalDispatcher");var UNs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];Nqn.exports={setGlobalDispatcher:kqn,getGlobalDispatcher:Dqn,installedExports:UNs}});var Ape=I((Mcf,Mqn)=>{"use strict";p();var HF=require("node:assert"),QNs=tke();Mqn.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=QNs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return HF(!this.#t),HF(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return HF(!this.#t),HF(!this.#r),HF(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return HF(!this.#t),HF(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return HF(!this.#t),HF(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var Jsr=I((Lcf,Fqn)=>{"use strict";p();var ub=ko(),{kBodyUsed:qke}=nl(),Ksr=require("node:assert"),{InvalidArgumentError:zsr}=co(),qNs=require("node:events"),jNs=[300,301,302,303,307,308],Oqn=Symbol("body"),Bqn=a(()=>{},"noop"),wst=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[Oqn]=e,this[qke]=!1}async*[Symbol.asyncIterator](){Ksr(!this[qke],"disturbed"),this[qke]=!0,yield*this[Oqn]}},Ysr=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new zsr("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 zsr("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=[],ub.isStream(this.opts.body)?(ub.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Ksr(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[qke]=!1,qNs.prototype.on.call(this.opts.body,"data",function(){this[qke]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new wst(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&ub.isIterable(this.opts.body)&&!ub.isFormDataLike(this.opts.body)&&(this.opts.body=new wst(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",ub.isStream(this.opts.body)&&ub.destroy(this.opts.body.on("error",Bqn)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",ub.isStream(this.opts.body)&&ub.destroy(this.opts.body.on("error",Bqn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||ub.isDisturbed(this.opts.body)||jNs.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}=ub.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 zsr(`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=HNs(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 Lqn(t,e,r){if(t.length===4)return ub.headerNameToString(t)==="host";if(e&&ub.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=ub.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a(Lqn,"shouldRemoveHeader");function HNs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var GNs=Jsr();function $Ns({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 GNs(e,s,l,o);return e(l,u)},"Intercept")}a($Ns,"createRedirectInterceptor");Uqn.exports=$Ns});var jqn=I((Hcf,qqn)=>{"use strict";p();var VNs=Ape(),{ResponseError:WNs}=co(),Zsr=class extends VNs{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 WNs("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)}};qqn.exports=()=>t=>a(function(r,n){return t(r,new Zsr(r,{handler:n}))},"Intercept")});var Gqn=I((Vcf,Hqn)=>{"use strict";p();var zNs=fst();Hqn.exports=t=>e=>a(function(n,o){return e(n,new zNs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var Vqn=I((Ycf,$qn)=>{"use strict";p();var{InvalidArgumentError:YNs,RequestAbortedError:KNs}=co(),JNs=Ape(),Xsr=class extends JNs{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 YNs("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 KNs(`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 ZNs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new Xsr({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(ZNs,"createDumpInterceptor");$qn.exports=ZNs});var Kqn=I((Zcf,Yqn)=>{"use strict";p();var{isIP:XNs}=require("node:net"),{lookup:eMs}=require("node:dns"),tMs=Ape(),{InvalidArgumentError:LZ,InformationalError:rMs}=co(),ear=Math.pow(2,31)-1;function nMs(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(nMs,"hasSafeIterator");function Wqn(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(Wqn,"isHostHeader");function iMs(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"&&nMs(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(iMs,"normalizeHeaders");function oMs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},rar=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 tar(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 rMs("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){eMs(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===ear?(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===ear?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===ear?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 nar(this,e,r)}},nar=class extends tMs{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:zqn(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}}};Yqn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new LZ("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new LZ("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new LZ("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new LZ("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new LZ("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new LZ("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 LZ("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 rar(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return XNs(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:zqn(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var ype=I((tlf,Zqn)=>{"use strict";p();var{safeHTTPMethods:Jqn,pathHasQueryOrFragment:sMs,hasSafeIterator:aMs}=ko(),{serializePathWithQuery:cMs}=ko();function lMs(t){if(!t.origin)throw new Error("opts.origin is undefined");let e=t.path||"/";return t.query&&!sMs(e)&&(e=cMs(e,t.query)),{origin:t.origin.toString(),method:t.method,path:e,headers:t.headers}}a(lMs,"makeCacheKey");function uMs(t){let e;if(t.headers==null)e={};else if(typeof t.headers=="object")if(e={},aMs(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(uMs,"normalizeHeaders");function dMs(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(dMs,"assertCacheKey");function fMs(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(fMs,"assertCacheValue");function pMs(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 EMs(t){switch(t[3]){case",":return _Ms(t);case" ":return vMs(t);default:return CMs(t)}}a(EMs,"parseHttpDate");function _Ms(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(_Ms,"parseImfDate");function vMs(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(vMs,"parseAscTimeDate");function CMs(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(CMs,"parseRfc850Date");Xqn.exports={parseHttpDate:EMs}});var ijn=I((alf,njn)=>{"use strict";p();var bMs=ko(),{parseCacheControlHeader:SMs,parseVaryHeader:TMs,isEtagUsable:IMs}=ype(),{parseHttpDate:tjn}=ejn();function xMs(){}a(xMs,"noop");var rjn=[200,203,204,206,300,301,308,404,405,410,414,501],wMs=[206],RMs=2147483647e3,iar=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(!bMs.safeHTTPMethods.includes(this.#e.method)&&r>=200&&r<=399){try{this.#n.delete(this.#e)?.catch?.(xMs)}catch{}return s()}let l=n["cache-control"],u=n["last-modified"]&&rjn.includes(r);if(!l&&!n.expires&&!u&&!this.#r)return s();let d=l?SMs(l):{};if(!PMs(this.#t,r,n,d,this.#e.headers))return s();let f=Date.now(),h=n.age?kMs(n.age):void 0;if(h&&h>=RMs)return s();let m=typeof n.date=="string"?tjn(n.date):void 0,g=DMs(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=TMs(n.vary,this.#e.headers),!E))return s();let _=NMs(A,d,y),v=MMs(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"&&IMs(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 PMs(t,e,r,n,o){return!(e<200||wMs.includes(e)||!rjn.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(PMs,"canCacheResponse");function kMs(t){let e=parseInt(Array.isArray(t)?t[0]:t);return isNaN(e)?void 0:e*1e3}a(kMs,"getAge");function DMs(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=tjn(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(DMs,"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 MMs(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(MMs,"stripNecessaryHeaders");function OMs(t){return t instanceof Date&&Number.isFinite(t.valueOf())}a(OMs,"isValidDate");njn.exports=iar});var sar=I((ulf,ajn)=>{"use strict";p();var{Writable:BMs}=require("node:stream"),{EventEmitter:LMs}=require("node:events"),{assertCacheKey:ojn,assertCacheValue:FMs}=ype(),oar=class extends LMs{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){ojn(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?sjn(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){ojn(e),FMs(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new BMs({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=sjn(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(sjn,"findEntry");ajn.exports=oar});var ljn=I((plf,cjn)=>{"use strict";p();var UMs=require("node:assert"),aar=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(UMs(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}};cjn.exports=aar});var pjn=I((glf,fjn)=>{"use strict";p();var ujn=require("node:assert"),{Readable:QMs}=require("node:stream"),Epe=ko(),jke=ijn(),qMs=sar(),jMs=ljn(),{assertCacheStore:HMs,assertCacheMethods:GMs,makeCacheKey:$Ms,normalizeHeaders:VMs,parseCacheControlHeader:WMs}=ype(),{AbortError:zMs}=co();function YMs(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 KMs(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(KMs,"needsRevalidation");function JMs(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(JMs,"isStale");function ZMs(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(ZMs,"withinStaleWhileRevalidateWindow");function XMs(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,[],lar,"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 jke(e,r,n))}a(XMs,"handleUncachedResponse");function car(t,e,r,n,o,s){let c=Epe.isStream(r.body)?r.body:QMs.from(r.body??[]);ujn(!c.destroyed,"stream should not be destroyed"),ujn(!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 zMs)}};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(car,"sendCachedValue");function djn(t,e,r,n,o,s,c){if(!c)return XMs(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new jke(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=JMs(c,s),f=KMs(c,s,o);if(d||f){if(Epe.isStream(o.body)&&Epe.bodyLength(o.body)!==0)return t(o,new jke(e,r,n));if(!f&&ZMs(c))return car(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 jke(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?car(n,o,c,u,y,d):Epe.isStream(c.body)&&c.body.on("error",lar).destroy()},new jke(e,r,n),h))}Epe.isStream(o.body)&&o.body.on("error",lar).destroy(),car(n,o,c,u,null,!1)}a(djn,"handleResult");fjn.exports=(t={})=>{let{store:e=new qMs,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(HMs(e,"opts.store"),GMs(r,"opts.methods"),YMs(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=Epe.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;Edjn(u,c,m,f,d,h,A)):djn(u,c,m,f,d,h,g)}}});var yjn=I((Elf,Ajn)=>{"use strict";p();var{createInflate:uar,createGunzip:hjn,createBrotliDecompress:eOs,createZstdDecompress:tOs}=require("node:zlib"),{pipeline:rOs}=require("node:stream"),nOs=Ape(),{runtimeFeatures:iOs}=NF(),mjn={gzip:hjn,"x-gzip":hjn,br:eOs,deflate:uar,compress:uar,"x-compress":uar,...iOs.has("zstd")?{zstd:tOs}:{}},oOs=[204,304],gjn=!1,dar=class extends nOs{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=oOs,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(!mjn[c])return o.length=0,o;o.push(mjn[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),rOs(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 sOs(t={}){return gjn||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),gjn=!0),e=>(r,n)=>{let o=new dar(n,t);return e(r,o)}}a(sOs,"createDecompressInterceptor");Ajn.exports=sOs});var vjn=I((Clf,_jn)=>{"use strict";p();var{RequestAbortedError:aOs}=co(),Ejn=5*1024*1024,far=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=Ejn;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=Ejn){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 aOs(`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)}};_jn.exports=far});var bjn=I((Tlf,Cjn)=>{"use strict";p();var cOs=require("node:diagnostics_channel"),lOs=ko(),uOs=vjn(),{normalizeHeaders:dOs,makeCacheKey:fOs,makeDeduplicationKey:pOs}=ype(),Rst=cOs.channel("undici:request:pending-requests");Cjn.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(!lOs.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:dOs(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=fOs(d),m=pOs(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new uOs(f,()=>{l.delete(m),Rst.hasSubscribers&&Rst.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),Rst.hasSubscribers&&Rst.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var Ijn=I((wlf,Tjn)=>{"use strict";p();var{Writable:hOs}=require("node:stream"),{assertCacheKey:par,assertCacheValue:mOs}=ype(),har,AT=3,Sjn=2*1e3*1e3*1e3;Tjn.exports=class{static{a(this,"SqliteCacheStore")}#e=Sjn;#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>Sjn)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}}har||(har=require("node:sqlite").DatabaseSync),this.#r=new har(e?.location??":memory:"),this.#r.exec(` +${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(` PRAGMA journal_mode = WAL; PRAGMA synchronous = NORMAL; PRAGMA temp_store = memory; PRAGMA optimize; - CREATE TABLE IF NOT EXISTS cacheInterceptorV${AT} ( + CREATE TABLE IF NOT EXISTS cacheInterceptorV${ST} ( -- Data specific to us id INTEGER PRIMARY KEY AUTOINCREMENT, url TEXT NOT NULL, @@ -256,8 +241,8 @@ ${e.format(r)}`.trim())}};pqn.exports=jsr});var Gsr=I((vcf,Aqn)=>{"use strict";p staleAt INTEGER NOT NULL ); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${AT}_getValuesQuery ON cacheInterceptorV${AT}(url, method, deleteAt); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${AT}_deleteByUrlQuery ON cacheInterceptorV${AT}(deleteAt); + 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); `),this.#n=this.#r.prepare(` SELECT id, @@ -271,14 +256,14 @@ ${e.format(r)}`.trim())}};pqn.exports=jsr});var Gsr=I((vcf,Aqn)=>{"use strict";p vary, cachedAt, staleAt - FROM cacheInterceptorV${AT} + FROM cacheInterceptorV${ST} WHERE url = ? AND method = ? ORDER BY deleteAt ASC `),this.#i=this.#r.prepare(` - UPDATE cacheInterceptorV${AT} SET + UPDATE cacheInterceptorV${ST} SET body = ?, deleteAt = ?, statusCode = ?, @@ -291,7 +276,7 @@ ${e.format(r)}`.trim())}};pqn.exports=jsr});var Gsr=I((vcf,Aqn)=>{"use strict";p WHERE id = ? `),this.#o=this.#r.prepare(` - INSERT INTO cacheInterceptorV${AT} ( + INSERT INTO cacheInterceptorV${ST} ( url, method, body, @@ -305,121 +290,121 @@ ${e.format(r)}`.trim())}};pqn.exports=jsr});var Gsr=I((vcf,Aqn)=>{"use strict";p cachedAt, staleAt ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - `),this.#a=this.#r.prepare(`DELETE FROM cacheInterceptorV${AT} WHERE url = ?`),this.#c=this.#r.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV${AT}`),this.#s=this.#r.prepare(`DELETE FROM cacheInterceptorV${AT} WHERE deleteAt <= ?`),this.#u=this.#t===1/0?null:this.#r.prepare(` - DELETE FROM cacheInterceptorV${AT} + `),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} WHERE id IN ( SELECT id - FROM cacheInterceptorV${AT} + FROM cacheInterceptorV${ST} ORDER BY cachedAt ASC LIMIT ? ) - `)}close(){this.#r.close()}get(e){par(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){par(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){par(e),mOs(r);let n=0,o=[],s=this;return new hOs({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(!gOs(o[h],f[h])){d=!1;break}}if(d)return u}}};function gOs(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(gOs,"headerValueEquals")});var FZ=I((klf,Njn)=>{"use strict";p();var{kConstruct:AOs}=nl(),{kEnumerableProperty:_pe}=ko(),{iteratorMixin:yOs,isValidHeaderName:Hke,isValidHeaderValue:wjn}=fT(),{webidl:Ra}=FA(),mar=require("node:assert"),Pst=require("node:util");function xjn(t){return t===10||t===13||t===9||t===32}a(xjn,"isHTTPWhiteSpaceCharCode");function Rjn(t){let e=0,r=t.length;for(;r>e&&xjn(t.charCodeAt(r-1));)--r;for(;r>e&&xjn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(Rjn,"headerValueNormalize");function Pjn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(Pjn,"fill");function gar(t,e,r){if(r=Rjn(r),Hke(e)){if(!wjn(r))throw Ra.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw Ra.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(Djn(t)==="immutable")throw new TypeError("immutable");return Dst(t).append(e,r,!1)}a(gar,"appendHeader");function EOs(t){let e=Dst(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],mar(s!==null);return r.sort(kjn)}}},S2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){Ra.util.markAsUncloneable(this),e!==AOs&&(this.#t=new kst,this.#e="none",e!==void 0&&(e=Ra.converters.HeadersInit(e,"Headers constructor","init"),Pjn(this,e)))}append(e,r){Ra.brandCheck(this,t),Ra.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=Ra.converters.ByteString(e,n,"name"),r=Ra.converters.ByteString(r,n,"value"),gar(this,e,r)}delete(e){if(Ra.brandCheck(this,t),Ra.argumentLengthCheck(arguments,1,"Headers.delete"),e=Ra.converters.ByteString(e,"Headers.delete","name"),!Hke(e))throw Ra.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){Ra.brandCheck(this,t),Ra.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=Ra.converters.ByteString(e,r,"name"),!Hke(e))throw Ra.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Ra.brandCheck(this,t),Ra.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=Ra.converters.ByteString(e,r,"name"),!Hke(e))throw Ra.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){Ra.brandCheck(this,t),Ra.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=Ra.converters.ByteString(e,n,"name"),r=Ra.converters.ByteString(r,n,"value"),r=Rjn(r),Hke(e)){if(!wjn(r))throw Ra.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw Ra.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){Ra.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[Pst.inspect.custom](e,r){return r.depth??=e,`Headers ${Pst.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:Djn,setHeadersGuard:_Os,getHeadersList:Dst,setHeadersList:vOs}=S2;Reflect.deleteProperty(S2,"getHeadersGuard");Reflect.deleteProperty(S2,"setHeadersGuard");Reflect.deleteProperty(S2,"getHeadersList");Reflect.deleteProperty(S2,"setHeadersList");yOs("Headers",S2,EOs,0,1);Object.defineProperties(S2.prototype,{append:_pe,delete:_pe,get:_pe,has:_pe,set:_pe,getSetCookie:_pe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[Pst.inspect.custom]:{enumerable:!1}});Ra.converters.HeadersInit=function(t,e,r){if(Ra.util.Type(t)===Ra.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!Pst.types.isProxy(t)&&n===S2.prototype.entries)try{return Dst(t).entriesList}catch{}return typeof n=="function"?Ra.converters["sequence>"](t,e,r,n.bind(t)):Ra.converters["record"](t,e,r)}throw Ra.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};Njn.exports={fill:Pjn,compareHeaderName:kjn,Headers:S2,HeadersList:kst,getHeadersGuard:Djn,setHeadersGuard:_Os,setHeadersList:vOs,getHeadersList:Dst}});var $ke=I((Mlf,$jn)=>{"use strict";p();var{Headers:Ujn,HeadersList:Mjn,fill:COs,getHeadersGuard:bOs,setHeadersGuard:Qjn,setHeadersList:qjn}=FZ(),{extractBody:Ojn,cloneBody:SOs,mixinBody:TOs,streamRegistry:jjn,bodyUnusable:IOs}=Xfe(),Hjn=ko(),Bjn=require("node:util"),{kEnumerableProperty:yT}=Hjn,{isValidReasonPhrase:xOs,isCancelled:wOs,isAborted:ROs,isErrorLike:POs,environmentSettingsObject:kOs}=fT(),{redirectStatusSet:DOs,nullBodyStatus:NOs}=ike(),{webidl:Zs}=FA(),{URLSerializer:Ljn}=Dw(),{kConstruct:Mst}=nl(),Aar=require("node:assert"),{isomorphicEncode:MOs,serializeJavascriptValueToJSONString:OOs}=DF(),BOs=new TextEncoder("utf-8"),ET=class t{static{a(this,"Response")}#e;#t;static error(){return Gke(Ost(),"immutable")}static json(e,r=void 0){Zs.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=Zs.converters.ResponseInit(r));let n=BOs.encode(OOs(e)),o=Ojn(n),s=Gke(vpe({}),"response");return Fjn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){Zs.argumentLengthCheck(arguments,1,"Response.redirect"),e=Zs.converters.USVString(e),r=Zs.converters["unsigned short"](r);let n;try{n=new URL(e,kOs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!DOs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=Gke(vpe({}),"immutable");o.#t.status=r;let s=MOs(Ljn(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(Zs.util.markAsUncloneable(this),e===Mst)return;e!==null&&(e=Zs.converters.BodyInit(e,"Response","body")),r=Zs.converters.ResponseInit(r),this.#t=vpe({}),this.#e=new Ujn(Mst),Qjn(this.#e,"response"),qjn(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=Ojn(e);n={body:o,type:s}}Fjn(this,r,n)}get type(){return Zs.brandCheck(this,t),this.#t.type}get url(){Zs.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":Ljn(r,!0)}get redirected(){return Zs.brandCheck(this,t),this.#t.urlList.length>1}get status(){return Zs.brandCheck(this,t),this.#t.status}get ok(){return Zs.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return Zs.brandCheck(this,t),this.#t.statusText}get headers(){return Zs.brandCheck(this,t),this.#e}get body(){return Zs.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return Zs.brandCheck(this,t),!!this.#t.body&&Hjn.isDisturbed(this.#t.body.stream)}clone(){if(Zs.brandCheck(this,t),IOs(this.#t))throw Zs.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=yar(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&jjn.register(this,new WeakRef(this.#t.body.stream)),Gke(e,bOs(this.#e))}[Bjn.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 ${Bjn.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:LOs,setResponseHeaders:FOs,getResponseState:UZ,setResponseState:UOs}=ET;Reflect.deleteProperty(ET,"getResponseHeaders");Reflect.deleteProperty(ET,"setResponseHeaders");Reflect.deleteProperty(ET,"getResponseState");Reflect.deleteProperty(ET,"setResponseState");TOs(ET,UZ);Object.defineProperties(ET.prototype,{type:yT,url:yT,status:yT,ok:yT,redirected:yT,statusText:yT,headers:yT,clone:yT,body:yT,bodyUsed:yT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(ET,{json:yT,redirect:yT,error:yT});function yar(t){if(t.internalResponse)return Gjn(yar(t.internalResponse),t.type);let e=vpe({...t,body:null});return t.body!=null&&(e.body=SOs(t.body)),e}a(yar,"cloneResponse");function vpe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new Mjn(t?.headersList):new Mjn,urlList:t?.urlList?[...t.urlList]:[]}}a(vpe,"makeResponse");function Ost(t){let e=POs(t);return vpe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(Ost,"makeNetworkError");function QOs(t){return t.type==="error"&&t.status===0}a(QOs,"isNetworkError");function Nst(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 Aar(!(n in e)),r[n]=o,!0}})}a(Nst,"makeFilteredResponse");function Gjn(t,e){if(e==="basic")return Nst(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Nst(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Nst(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return Nst(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});Aar(!1)}a(Gjn,"filterResponse");function qOs(t,e=null){return Aar(wOs(t)),ROs(t)?Ost(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):Ost(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(qOs,"makeAppropriateNetworkError");function Fjn(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&&!xOs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(UZ(t).status=e.status),"statusText"in e&&e.statusText!=null&&(UZ(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&COs(LOs(t),e.headers),r){if(NOs.includes(t.status))throw Zs.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});UZ(t).body=r.body,r.type!=null&&!UZ(t).headersList.contains("content-type",!0)&&UZ(t).headersList.append("content-type",r.type,!0)}}a(Fjn,"initializeResponse");function Gke(t,e){let r=new ET(Mst);UOs(r,t);let n=new Ujn(Mst);return FOs(r,n),qjn(n,t.headersList),Qjn(n,e),t.urlList.length!==0&&t.body?.stream&&jjn.register(r,new WeakRef(t.body.stream)),r}a(Gke,"fromInnerResponse");Zs.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?Zs.converters.USVString(t,e,r):Zs.is.Blob(t)||Zs.is.BufferSource(t)||Zs.is.FormData(t)||Zs.is.URLSearchParams(t)?t:Zs.converters.DOMString(t,e,r)};Zs.converters.BodyInit=function(t,e,r){return Zs.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:Zs.converters.XMLHttpRequestBodyInit(t,e,r)};Zs.converters.ResponseInit=Zs.dictionaryConverter([{key:"status",converter:Zs.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:Zs.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:Zs.converters.HeadersInit}]);Zs.is.Response=Zs.util.MakeTypeAssertion(ET);$jn.exports={isNetworkError:QOs,makeNetworkError:Ost,makeResponse:vpe,makeAppropriateNetworkError:qOs,filterResponse:Gjn,Response:ET,cloneResponse:yar,fromInnerResponse:Gke,getResponseState:UZ}});var Cpe=I((Llf,oHn)=>{"use strict";p();var{extractBody:jOs,mixinBody:HOs,cloneBody:GOs,bodyUnusable:Vjn}=Xfe(),{Headers:Zjn,fill:$Os,HeadersList:Fst,setHeadersGuard:Ear,getHeadersGuard:VOs,setHeadersList:Xjn,getHeadersList:Wjn}=FZ(),Lst=ko(),zjn=require("node:util"),{isValidHTTPToken:WOs,sameOrigin:Yjn,environmentSettingsObject:Bst}=fT(),{forbiddenMethodsSet:zOs,corsSafeListedMethodsSet:YOs,referrerPolicy:KOs,requestRedirect:JOs,requestMode:ZOs,requestCredentials:XOs,requestCache:e5s,requestDuplex:t5s}=ike(),{kEnumerableProperty:am,normalizedMethodRecordsBase:r5s,normalizedMethodRecords:n5s}=Lst,{webidl:Oi}=FA(),{URLSerializer:i5s}=Dw(),{kConstruct:Ust}=nl(),o5s=require("node:assert"),{getMaxListeners:eHn,setMaxListeners:s5s,defaultMaxListeners:a5s}=require("node:events"),c5s=Symbol("abortController"),tHn=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Qst=new WeakMap,_ar;try{_ar=eHn(new AbortController().signal)>0}catch{_ar=!1}function Kjn(t){return e;function e(){let r=t.deref();if(r!==void 0){tHn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Qst.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()}Qst.delete(r.signal)}}}}a(Kjn,"buildAbort");var Jjn=!1,db=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Oi.util.markAsUncloneable(this),e===Ust)return;Oi.argumentLengthCheck(arguments,1,"Request constructor"),e=Oi.converters.RequestInfo(e),r=Oi.converters.RequestInit(r);let o=null,s=null,c=Bst.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 o5s(Oi.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=Bst.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&Yjn(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:Bst.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&&!Yjn(v,Bst.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 Oi.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=n5s[_];if(v!==void 0)o.method=v;else{if(!WOs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(zOs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=r5s[b]??_,o.method=_}!Jjn&&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"}),Jjn=!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[c5s]=m;let _=new WeakRef(m),v=Kjn(_);_ar&&eHn(l)===a5s&&s5s(1500,l),Lst.addAbortListener(l,v),tHn.register(m,{signal:l,abort:v},v)}if(this.#r=new Zjn(Ust),Xjn(this.#r,o.headersList),Ear(this.#r,"request"),h==="no-cors"){if(!YOs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);Ear(this.#r,"request-no-cors")}if(f){let _=Wjn(this.#r),v=r.headers!==void 0?r.headers:new Fst(_);if(_.clear(),v instanceof Fst){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else $Os(this.#r,v)}let g=Oi.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]=jOs(r.body,o.keepalive);A=_,v&&!Wjn(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(Vjn(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 Oi.brandCheck(this,t),this.#n.method}get url(){return Oi.brandCheck(this,t),i5s(this.#n.url)}get headers(){return Oi.brandCheck(this,t),this.#r}get destination(){return Oi.brandCheck(this,t),this.#n.destination}get referrer(){return Oi.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Oi.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Oi.brandCheck(this,t),this.#n.mode}get credentials(){return Oi.brandCheck(this,t),this.#n.credentials}get cache(){return Oi.brandCheck(this,t),this.#n.cache}get redirect(){return Oi.brandCheck(this,t),this.#n.redirect}get integrity(){return Oi.brandCheck(this,t),this.#n.integrity}get keepalive(){return Oi.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Oi.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Oi.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Oi.brandCheck(this,t),this.#e}get body(){return Oi.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Oi.brandCheck(this,t),!!this.#n.body&&Lst.isDisturbed(this.#n.body.stream)}get duplex(){return Oi.brandCheck(this,t),"half"}clone(){if(Oi.brandCheck(this,t),Vjn(this.#n))throw new TypeError("unusable");let e=nHn(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Qst.get(this.signal);n===void 0&&(n=new Set,Qst.set(this.signal,n));let o=new WeakRef(r);n.add(o),Lst.addAbortListener(r.signal,Kjn(o))}return iHn(e,this.#t,r.signal,VOs(this.#r))}[zjn.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 ${zjn.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:l5s,getRequestDispatcher:u5s,setRequestDispatcher:d5s,setRequestHeaders:f5s,getRequestState:rHn,setRequestState:p5s}=db;Reflect.deleteProperty(db,"setRequestSignal");Reflect.deleteProperty(db,"getRequestDispatcher");Reflect.deleteProperty(db,"setRequestDispatcher");Reflect.deleteProperty(db,"setRequestHeaders");Reflect.deleteProperty(db,"getRequestState");Reflect.deleteProperty(db,"setRequestState");HOs(db,rHn);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 Fst(t.headersList):new Fst}}a(qst,"makeRequest");function nHn(t){let e=qst({...t,body:null});return t.body!=null&&(e.body=GOs(t.body)),e}a(nHn,"cloneRequest");function iHn(t,e,r,n){let o=new db(Ust);p5s(o,t),d5s(o,e),l5s(o,r);let s=new Zjn(Ust);return f5s(o,s),Xjn(s,t.headersList),Ear(s,n),o}a(iHn,"fromInnerRequest");Object.defineProperties(db.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}});Oi.is.Request=Oi.util.MakeTypeAssertion(db);Oi.converters.RequestInfo=function(t){return typeof t=="string"?Oi.converters.USVString(t):Oi.is.Request(t)?t:Oi.converters.USVString(t)};Oi.converters.RequestInit=Oi.dictionaryConverter([{key:"method",converter:Oi.converters.ByteString},{key:"headers",converter:Oi.converters.HeadersInit},{key:"body",converter:Oi.nullableConverter(Oi.converters.BodyInit)},{key:"referrer",converter:Oi.converters.USVString},{key:"referrerPolicy",converter:Oi.converters.DOMString,allowedValues:KOs},{key:"mode",converter:Oi.converters.DOMString,allowedValues:ZOs},{key:"credentials",converter:Oi.converters.DOMString,allowedValues:XOs},{key:"cache",converter:Oi.converters.DOMString,allowedValues:e5s},{key:"redirect",converter:Oi.converters.DOMString,allowedValues:JOs},{key:"integrity",converter:Oi.converters.DOMString},{key:"keepalive",converter:Oi.converters.boolean},{key:"signal",converter:Oi.nullableConverter(t=>Oi.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Oi.converters.any},{key:"duplex",converter:Oi.converters.DOMString,allowedValues:t5s},{key:"dispatcher",converter:Oi.converters.any},{key:"priority",converter:Oi.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);oHn.exports={Request:db,makeRequest:qst,fromInnerRequest:iHn,cloneRequest:nHn,getRequestDispatcher:u5s,getRequestState:rHn}});var pHn=I((Qlf,fHn)=>{"use strict";p();var h5s=require("node:assert"),{runtimeFeatures:aHn}=NF(),QZ=new Map([["sha256",0],["sha384",1],["sha512",2]]),Car;if(aHn.has("crypto")){Car=require("node:crypto");let t=Car.getHashes();t.length===0&&QZ.clear();for(let e of QZ.keys())t.includes(e)===!1&&QZ.delete(e)}else QZ.clear();var sHn=Map.prototype.get.bind(QZ),bar=Map.prototype.has.bind(QZ),m5s=aHn.has("crypto")===!1||QZ.size===0?()=>!0:(t,e)=>{let r=lHn(e);if(r.length===0)return!0;let n=cHn(r);for(let o of n){let s=o.alg,c=o.val,l=uHn(s,t);if(dHn(l,c))return!0}return!1};function cHn(t){let e=[],r=null;for(let n of t){if(h5s(bar(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=sHn(o),c=n.alg,l=sHn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a(cHn,"getStrongestMetadata");function lHn(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(!bar(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(lHn,"parseMetadata");var uHn=a((t,e)=>Car.hash(t,e,"base64"),"applyAlgorithmToBytes");function dHn(t,e){let r=t.length;r!==0&&t[r-1]==="="&&(r-=1),r!==0&&t[r-1]==="="&&(r-=1);let n=e.length;if(n!==0&&e[n-1]==="="&&(n-=1),n!==0&&e[n-1]==="="&&(n-=1),r!==n)return!1;for(let o=0;o{"use strict";p();var{makeNetworkError:ol,makeAppropriateNetworkError:Vke,filterResponse:Sar,makeResponse:jst,fromInnerResponse:g5s,getResponseState:A5s}=$ke(),{HeadersList:Tar}=FZ(),{Request:y5s,cloneRequest:E5s,getRequestDispatcher:_5s,getRequestState:v5s}=Cpe(),T2=require("node:zlib"),{makePolicyContainer:C5s,clonePolicyContainer:b5s,requestBadPort:S5s,TAOCheck:T5s,appendRequestOriginHeader:I5s,responseLocationURL:x5s,requestCurrentURL:_T,setRequestReferrerPolicyOnRedirect:w5s,tryUpgradeRequestToAPotentiallyTrustworthyURL:R5s,createOpaqueTimingInfo:kar,appendFetchMetadata:P5s,corsCheck:k5s,crossOriginResourcePolicyCheck:D5s,determineRequestsReferrer:N5s,coarsenedSharedCurrentTime:Wke,sameOrigin:Rar,isCancelled:Zj,isAborted:hHn,isErrorLike:M5s,fullyReadBody:O5s,readableStreamClose:B5s,urlIsLocal:L5s,urlIsHttpHttpsScheme:Vst,urlHasHttpsScheme:F5s,clampAndCoarsenConnectionTimingInfo:U5s,simpleRangeHeaderValue:Q5s,buildContentRange:q5s,createInflate:j5s,extractMimeType:H5s,hasAuthenticationEntry:G5s,includesCredentials:mHn,isTraversableNavigable:$5s}=fT(),qZ=require("node:assert"),{safelyExtractBody:Wst,extractBody:gHn}=Xfe(),{redirectStatusSet:_Hn,nullBodyStatus:vHn,safeMethodsSet:V5s,requestBodyHeader:W5s,subresourceSet:z5s}=ike(),Y5s=require("node:events"),{Readable:K5s,pipeline:J5s,finished:Z5s,isErrored:X5s,isReadable:Hst}=require("node:stream"),{addAbortListener:e4s,bufferToLowerCasedHeaderName:AHn}=ko(),{dataURLProcessor:t4s,serializeAMimeType:r4s,minimizeSupportedMimeType:n4s}=Dw(),{getGlobalDispatcher:i4s}=xst(),{webidl:Dar}=FA(),{STATUS_CODES:yHn}=require("node:http"),{bytesMatch:o4s}=pHn(),{createDeferredPromise:s4s}=lke(),{isomorphicEncode:Gst}=DF(),{runtimeFeatures:a4s}=NF(),c4s=a4s.has("zstd"),l4s=["GET","HEAD"],u4s=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",Iar,$st=class extends Y5s{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 d4s(t){CHn(t,"fetch")}a(d4s,"handleFetchDone");function f4s(t,e=void 0){Dar.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=s4s(),n;try{n=new y5s(t,e)}catch(f){return r.reject(f),r.promise}let o=v5s(n);if(n.signal.aborted)return xar(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 e4s(n.signal,()=>{l=!0,qZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();xar(r,o,f,n.signal.reason,u.controller)}),u=SHn({request:o,processResponseEndOfBody:d4s,processResponse:a(f=>{if(!l){if(f.aborted){xar(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(g5s(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:_5s(n),requestObject:n}),r.promise}a(f4s,"fetch");function CHn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;Vst(r)&&n!==null&&(t.timingAllowPassed||(n=kar({startTime:n.startTime}),o=""),n.endTime=Wke(),t.timingInfo=n,bHn(n,r.href,e,globalThis,o,"",t.status))}a(CHn,"finalizeAndReportTiming");var bHn=performance.markResourceTiming;function xar(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&Hst(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=A5s(r);s.body?.stream!=null&&Hst(s.body.stream)&&o.error(n)}a(xar,"abortFetch");function SHn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=i4s(),requestObject:u=null}){qZ(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=Wke(f),m=kar({startTime:h}),g={controller:new $st(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return qZ(!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=b5s(t.client.policyContainer):t.policyContainer=C5s()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,z5s.has(t.destination),THn(g,!1),g.controller}a(SHn,"fetching");async function THn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!L5s(_T(r))&&(n=ol("local URLs only")),R5s(r),S5s(r)==="blocked"&&(n=ol("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=N5s(r)),n===null){let s=_T(r);Rar(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await EHn(t)):r.mode==="same-origin"?n=ol('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=ol('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await EHn(t)):Vst(_T(r))?(r.responseTainting="cors",n=await IHn(t)):n=ol("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=Sar(n,"basic"):r.responseTainting==="cors"?n=Sar(n,"cors"):r.responseTainting==="opaque"?n=Sar(n,"opaque"):qZ(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=ol()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||vHn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>war(t,ol(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!o4s(l,r.integrity)){s("integrity mismatch");return}n.body=Wst(l)[0],war(t,n)},"processBody");O5s(n.body,c,s)}else war(t,n)}catch(r){t.controller.terminate(r)}}a(THn,"mainFetch");function EHn(t){if(Zj(t)&&t.request.redirectCount===0)return Promise.resolve(Vke(t));let{request:e}=t,{protocol:r}=_T(e);switch(r){case"about:":return Promise.resolve(ol("about scheme is not supported"));case"blob:":{Iar||(Iar=require("node:buffer").resolveObjectURL);let n=_T(e);if(n.search.length!==0)return Promise.resolve(ol("NetworkError when attempting to fetch resource."));let o=Iar(n.toString());if(e.method!=="GET"||!Dar.is.Blob(o))return Promise.resolve(ol("invalid method"));let s=jst(),c=o.size,l=Gst(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=Q5s(d,!0);if(f==="failure")return Promise.resolve(ol("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(ol("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m+1,u),A=gHn(g);s.body=A[0];let y=Gst(`${g.size}`),E=q5s(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=gHn(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=_T(e),o=t4s(n);if(o==="failure")return Promise.resolve(ol("failed to fetch the data URL"));let s=r4s(o.mimeType);return Promise.resolve(jst({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Wst(o.body)[0]}))}case"file:":return Promise.resolve(ol("not implemented... yet..."));case"http:":case"https:":return IHn(t).catch(n=>ol(n));default:return Promise.resolve(ol("unknown scheme"))}}a(EHn,"schemeFetch");function p4s(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(p4s,"finalizeResponse");function war(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!Vst(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=kar(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=H5s(e.headersList);f!=="failure"&&(u.contentType=n4s(f))}t.request.initiatorType!=null&&bHn(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():Z5s(o.body.stream,()=>{n()})}a(war,"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 Par(t),e.responseTainting==="cors"&&k5s(e,r)==="failure")return ol("cors failure");T5s(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&D5s(e.origin,e.client,e.destination,n)==="blocked"?ol("blocked"):(_Hn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=ol("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await h4s(t,r):qZ(!1)),r.timingInfo=o,r)}a(IHn,"httpFetch");function h4s(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=x5s(n,_T(r).hash),o==null)return e}catch(c){return Promise.resolve(ol(c))}if(!Vst(o))return Promise.resolve(ol("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(ol("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!Rar(r,o))return Promise.resolve(ol('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(ol('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(ol());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!l4s.includes(r.method)){r.method="GET",r.body=null;for(let c of W5s)r.headersList.delete(c)}Rar(_T(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&&(qZ(r.body.source!=null),r.body=Wst(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=Wke(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),w5s(r,n),THn(t,!0)}a(h4s,"httpRedirectFetch");async function Par(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=E5s(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=Gst(`${f}`)),h!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,Dar.is.URL(s.referrer)&&s.headersList.append("referer",Gst(s.referrer.href),!0),I5s(s),P5s(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",u4s,!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)||(F5s(_T(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(!(G5s(s)&&(s.useURLCredentials===void 0||!mHn(_T(s))))){if(mHn(_T(s))&&e){let{username:g,password:A}=_T(s);m=`Basic ${Buffer.from(`${g}:${A}`).toString("base64")}`}}m!==null&&s.headersList.append("Authorization",m,!1)}if(l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return ol("only if cached");let m=await m4s(o,d,r);!V5s.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||$5s(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=Wst(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return Zj(t)?Vke(t):c;t.controller.connection.destroy(),c=await Par(t,!0)}if(c.status===407)return n.window==="no-window"?ol():Zj(t)?Vke(t):ol("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(Zj(t))return Vke(t);t.controller.connection.destroy(),c=await Par(t,e,!0)}return c}a(Par,"httpNetworkOrCacheFetch");async function m4s(t,e=!1,r=!1){qZ(!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*(_){Zj(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{Zj(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{Zj(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=jst({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=jst({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),Vke(t,A)):ol(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{Zj(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(hHn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){B5s(t.controller.controller),p4s(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),X5s(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){hHn(t)?(o.aborted=!0,Hst(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):Hst(h)&&t.controller.controller.error(new TypeError("terminated",{cause:M5s(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=_T(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=U5s(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=Wke(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=Wke(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,P){if(w<200)return!1;let D=new Tar;for(let M=0;Mq)return T(new Error(`too many content-encodings in response: ${O.length}, maximum allowed is ${q}`)),!0;for(let Q=O.length-1;Q>=0;--Q){let U=O[Q].trim();if(U==="x-gzip"||U==="gzip")L.push(T2.createGunzip({flush:T2.constants.Z_SYNC_FLUSH,finishFlush:T2.constants.Z_SYNC_FLUSH}));else if(U==="deflate")L.push(j5s({flush:T2.constants.Z_SYNC_FLUSH,finishFlush:T2.constants.Z_SYNC_FLUSH}));else if(U==="br")L.push(T2.createBrotliDecompress({flush:T2.constants.BROTLI_OPERATION_FLUSH,finishFlush:T2.constants.BROTLI_OPERATION_FLUSH}));else if(U==="zstd"&&c4s)L.push(T2.createZstdDecompress({flush:T2.constants.ZSTD_e_continue,finishFlush:T2.constants.ZSTD_e_end}));else{L.length=0;break}}}let j=this.onError.bind(this);return b({status:w,statusText:P,headersList:D,body:L.length?J5s(this.body,...L,M=>{M&&this.onError(M)}).on("error",j):this.body.on("error",j)}),!0},onData(w){if(t.controller.dump)return;let R=w;return s.encodedBodySize+=R.byteLength,this.body.push(R)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.ended=!0,this.body.push(null)},onError(w){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(w),t.controller.terminate(w),T(w)},onRequestUpgrade(w,R,x,P){if(P.session!=null&&R!==200||P.session==null&&R!==101)return!1;let D=new Tar;for(let[N,B]of Object.entries(x)){if(B==null)continue;let L=N.toLowerCase();if(Array.isArray(B))for(let j of B)D.append(L,String(j),!0);else D.append(L,String(B),!0)}return b({status:R,statusText:yHn[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 Tar;for(let D=0;D{"use strict";p();var g4s=require("node:assert"),{URLSerializer:wHn}=Dw(),{isValidHeaderName:A4s}=fT();function y4s(t,e,r=!1){let n=wHn(t,r),o=wHn(e,r);return n===o}a(y4s,"urlEquals");function E4s(t){g4s(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),A4s(r)&&e.push(r);return e}a(E4s,"getFieldValues");RHn.exports={urlEquals:y4s,getFieldValues:E4s}});var MHn=I((Ylf,NHn)=>{"use strict";p();var Nar=require("node:assert"),{kConstruct:_4s}=nl(),{urlEquals:v4s,getFieldValues:Mar}=PHn(),{kEnumerableProperty:jZ,isDisturbed:C4s}=ko(),{webidl:Xn}=FA(),{cloneResponse:kHn,fromInnerResponse:b4s,getResponseState:S4s}=$ke(),{Request:Yke,fromInnerRequest:T4s,getRequestState:D5}=Cpe(),{fetching:I4s}=zke(),{urlIsHttpHttpsScheme:zst,readAllBytes:x4s}=fT(),{createDeferredPromise:bpe}=lke(),Yst=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==_4s&&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=D5(m);if(!zst(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=D5(new Yke(m));if(!zst(g.url))throw Xn.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=bpe();s.push(I4s({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=Mar(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=bpe(),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=D5(e):o=D5(new Yke(e)),!zst(o.url)||o.method!=="GET")throw Xn.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=S4s(r);if(s.status===206)throw Xn.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=Mar(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&&(C4s(s.body.stream)||s.body.stream.locked))throw Xn.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=kHn(s),l=bpe();if(s.body!=null){let A=s.body.stream.getReader();x4s(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=bpe(),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=D5(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else Nar(typeof e=="string"),o=D5(new Yke(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=bpe(),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=D5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=D5(new Yke(e)));let s=bpe(),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=T4s(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);Nar(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(!zst(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);Nar(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=""),!v4s(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Mar(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=D5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=D5(new Yke(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=b4s(kHn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(Yst.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:jZ,matchAll:jZ,add:jZ,addAll:jZ,put:jZ,delete:jZ,keys:jZ});var DHn=[{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(DHn);Xn.converters.MultiCacheQueryOptions=Xn.dictionaryConverter([...DHn,{key:"cacheName",converter:Xn.converters.DOMString}]);Xn.converters.Response=Xn.interfaceConverter(Xn.is.Response,"Response");Xn.converters["sequence"]=Xn.sequenceConverter(Xn.converters.RequestInfo);NHn.exports={Cache:Yst}});var BHn=I((Zlf,OHn)=>{"use strict";p();var{Cache:Kst}=MHn(),{webidl:mE}=FA(),{kEnumerableProperty:Kke}=ko(),{kConstruct:Jke}=nl(),Jst=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==Jke&&mE.illegalConstructor(),mE.util.markAsUncloneable(this)}async match(e,r={}){if(mE.brandCheck(this,t),mE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=mE.converters.RequestInfo(e),r=mE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Kst(Jke,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Kst(Jke,n).match(e,r);if(s!==void 0)return s}}async has(e){mE.brandCheck(this,t);let r="CacheStorage.has";return mE.argumentLengthCheck(arguments,1,r),e=mE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){mE.brandCheck(this,t);let r="CacheStorage.open";if(mE.argumentLengthCheck(arguments,1,r),e=mE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Kst(Jke,o)}let n=[];return this.#e.set(e,n),new Kst(Jke,n)}async delete(e){mE.brandCheck(this,t);let r="CacheStorage.delete";return mE.argumentLengthCheck(arguments,1,r),e=mE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return mE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Jst.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Kke,has:Kke,open:Kke,delete:Kke,keys:Kke});OHn.exports={CacheStorage:Jst}});var FHn=I((tuf,LHn)=>{"use strict";p();LHn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Oar=I((nuf,HHn)=>{"use strict";p();function w4s(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(w4s,"isCTLExcludingHtab");function UHn(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(UHn,"validateCookieName");function QHn(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(QHn,"validateCookieValue");function qHn(t){for(let e=0;ee.toString().padStart(2,"0"));function jHn(t){return typeof t=="number"&&(t=new Date(t)),`${P4s[t.getUTCDay()]}, ${Zst[t.getUTCDate()]} ${k4s[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Zst[t.getUTCHours()]}:${Zst[t.getUTCMinutes()]}:${Zst[t.getUTCSeconds()]} GMT`}a(jHn,"toIMFDate");function D4s(t){if(t<0)throw new Error("Invalid cookie max-age")}a(D4s,"validateCookieMaxAge");function N4s(t){if(t.name.length===0)return null;UHn(t.name),QHn(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"&&(D4s(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(R4s(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(qHn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${jHn(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");HHn.exports={isCTLExcludingHtab:w4s,validateCookieName:UHn,validateCookiePath:qHn,validateCookieValue:QHn,toIMFDate:jHn,stringify:N4s}});var $Hn=I((suf,GHn)=>{"use strict";p();var{collectASequenceOfCodePointsFast:Xst}=DF(),{maxNameValuePairSize:M4s,maxAttributeValueSize:O4s}=FHn(),{isCTLExcludingHtab:B4s}=Oar(),L4s=require("node:assert");function F4s(t){if(B4s(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=Xst(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=Xst("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>M4s?null:{name:n,value:o,...Spe(r)}}a(F4s,"parseSetCookie");function Spe(t,e={}){if(t.length===0)return e;L4s(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=Xst(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=Xst("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>O4s)return Spe(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 Spe(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 Spe(t,e)}a(Spe,"parseUnparsedAttributes");GHn.exports={parseSetCookie:F4s,parseUnparsedAttributes:Spe}});var YHn=I((luf,zHn)=>{"use strict";p();var{parseSetCookie:VHn}=$Hn(),{stringify:U4s}=Oar(),{webidl:Wa}=FA(),{Headers:Q4s}=FZ(),eat=Wa.brandCheckMultiple([Q4s,globalThis.Headers].filter(Boolean));function q4s(t){Wa.argumentLengthCheck(arguments,1,"getCookies"),eat(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(q4s,"getCookies");function j4s(t,e,r){eat(t);let n="deleteCookie";Wa.argumentLengthCheck(arguments,2,n),e=Wa.converters.DOMString(e,n,"name"),r=Wa.converters.DeleteCookieAttributes(r),WHn(t,{name:e,value:"",expires:new Date(0),...r})}a(j4s,"deleteCookie");function H4s(t){Wa.argumentLengthCheck(arguments,1,"getSetCookies"),eat(t);let e=t.getSetCookie();return e?e.map(r=>VHn(r)):[]}a(H4s,"getSetCookies");function G4s(t){return t=Wa.converters.DOMString(t),VHn(t)}a(G4s,"parseCookie");function WHn(t,e){Wa.argumentLengthCheck(arguments,2,"setCookie"),eat(t),e=Wa.converters.Cookie(e);let r=U4s(e);r&&t.append("set-cookie",r,!0)}a(WHn,"setCookie");Wa.converters.DeleteCookieAttributes=Wa.dictionaryConverter([{converter:Wa.nullableConverter(Wa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);Wa.converters.Cookie=Wa.dictionaryConverter([{converter:Wa.converters.DOMString,key:"name"},{converter:Wa.converters.DOMString,key:"value"},{converter:Wa.nullableConverter(t=>typeof t=="number"?Wa.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Wa.sequenceConverter(Wa.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);zHn.exports={getCookies:q4s,deleteCookie:j4s,getSetCookies:H4s,setCookie:WHn,parseCookie:G4s}});var nat=I((fuf,JHn)=>{"use strict";p();var{webidl:li}=FA(),{kEnumerableProperty:fb}=ko(),{kConstruct:KHn}=nl(),Tpe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===KHn){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(KHn,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:$4s}=Tpe;delete Tpe.createFastMessageEvent;var tat=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}},rat=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(Tpe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:fb,origin:fb,lastEventId:fb,source:fb,ports:fb,initMessageEvent:fb});Object.defineProperties(tat.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:fb,code:fb,wasClean:fb});Object.defineProperties(rat.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:fb,filename:fb,lineno:fb,colno:fb,error:fb});li.converters.MessagePort=li.interfaceConverter(li.is.MessagePort,"MessagePort");li.converters["sequence"]=li.sequenceConverter(li.converters.MessagePort);var Bar=[{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([...Bar,{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([...Bar,{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([...Bar,{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}]);JHn.exports={MessageEvent:Tpe,CloseEvent:tat,ErrorEvent:rat,createFastMessageEvent:$4s}});var Xj=I((muf,ZHn)=>{"use strict";p();var V4s="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",W4s={enumerable:!0,writable:!1,configurable:!1},z4s={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},Y4s={SENT:1,RECEIVED:2},K4s={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},J4s=65535,Z4s={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},X4s=Buffer.allocUnsafe(0),eBs={text:1,typedArray:2,arrayBuffer:3,blob:4};ZHn.exports={uid:V4s,sentCloseFrameState:Y4s,staticPropertyDescriptors:W4s,states:z4s,opcodes:K4s,maxUnsigned16Bit:J4s,parserStates:Z4s,emptyBuffer:X4s,sendHints:eBs}});var HZ=I((Auf,nGn)=>{"use strict";p();var{states:iat,opcodes:Ipe}=Xj(),{isUtf8:tBs}=require("node:buffer"),{removeHTTPWhitespace:XHn}=Dw(),{collectASequenceOfCodePointsFast:rBs}=DF();function nBs(t){return t===iat.CONNECTING}a(nBs,"isConnecting");function iBs(t){return t===iat.OPEN}a(iBs,"isEstablished");function oBs(t){return t===iat.CLOSING}a(oBs,"isClosing");function sBs(t){return t===iat.CLOSED}a(sBs,"isClosed");function aBs(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(aBs,"fireEvent");function cBs(t,e,r){t.onMessage(e,r)}a(cBs,"websocketMessageReceived");function lBs(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(lBs,"toArrayBuffer");function uBs(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(uBs,"isValidSubprotocol");function dBs(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(dBs,"isValidStatusCode");function eGn(t){return t===Ipe.CLOSE||t===Ipe.PING||t===Ipe.PONG}a(eGn,"isControlFrame");function tGn(t){return t===Ipe.CONTINUATION}a(tGn,"isContinuationFrame");function rGn(t){return t===Ipe.TEXT||t===Ipe.BINARY}a(rGn,"isTextBinaryFrame");function fBs(t){return rGn(t)||tGn(t)||eGn(t)}a(fBs,"isValidOpcode");function pBs(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(hBs,"isValidClientWindowBits");function mBs(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(mBs,"getURLRecord");function gBs(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(gBs,"validateCloseCodeAndReason");var ABs=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(tBs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();nGn.exports={isConnecting:nBs,isEstablished:iBs,isClosing:oBs,isClosed:sBs,fireEvent:aBs,isValidSubprotocol:uBs,isValidStatusCode:dBs,websocketMessageReceived:cBs,utf8Decode:ABs,isControlFrame:eGn,isContinuationFrame:tGn,isTextBinaryFrame:rGn,isValidOpcode:fBs,parseExtensions:pBs,isValidClientWindowBits:hBs,toArrayBuffer:lBs,getURLRecord:mBs,validateCloseCodeAndReason:gBs}});var wpe=I((_uf,oGn)=>{"use strict";p();var{runtimeFeatures:yBs}=NF(),{maxUnsigned16Bit:iGn,opcodes:EBs}=Xj(),oat=8*1024,Zke=null,xpe=oat,_Bs=yBs.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;oiGn?(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;uiGn?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|EBs.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]}};oGn.exports={WebsocketFrameSend:Far,generateMask:Lar}});var sat=I((buf,dGn)=>{"use strict";p();var{uid:vBs,states:Uar,sentCloseFrameState:Qar,emptyBuffer:sGn,opcodes:CBs}=Xj(),{parseExtensions:bBs,isClosed:SBs,isClosing:TBs,isEstablished:lGn,isConnecting:IBs,validateCloseCodeAndReason:xBs}=HZ(),{makeRequest:wBs}=Cpe(),{fetching:RBs}=zke(),{Headers:PBs,getHeadersList:kBs}=FZ(),{getDecodeSplit:DBs}=fT(),{WebsocketFrameSend:NBs}=wpe(),MBs=require("node:assert"),{runtimeFeatures:OBs}=NF(),aGn=OBs.has("crypto")?require("node:crypto"):null,cGn=!1;function BBs(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=wBs({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=kBs(new PBs(o.headers));c.headersList=f}let l=aGn.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),RBs({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){N5(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){N5(n,1002,"Received network error or non-200 status code.",f.error);return}}if(cGn===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),cGn=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){N5(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){N5(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){N5(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=aGn.hash("sha1",l+vBs,"base64");if(h!==m){N5(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=bBs(g),!A.has("permessage-deflate"))){N5(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!DBs("sec-websocket-protocol",c.headersList).includes(y)){N5(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(BBs,"establishWebSocketConnection");function uGn(t,e,r,n=!1){if(e??=null,r??="",n&&xBs(e,r),!(SBs(t.readyState)||TBs(t.readyState)))if(!lGn(t.readyState))N5(t),t.readyState=Uar.CLOSING;else if(!t.closeState.has(Qar.SENT)&&!t.closeState.has(Qar.RECEIVED)){let o=new NBs;r.length!==0&&e===null&&(e=1e3),MBs(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=sGn: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=sGn,t.socket.write(o.createFrame(CBs.CLOSE)),t.closeState.add(Qar.SENT),t.readyState=Uar.CLOSING}else t.readyState=Uar.CLOSING}a(uGn,"closeWebSocketConnection");function N5(t,e,r,n){lGn(t.readyState)&&uGn(t,e,r,!1),t.controller.abort(),IBs(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(N5,"failWebsocketConnection");dGn.exports={establishWebSocketConnection:BBs,failWebsocketConnection:N5,closeWebSocketConnection:uGn}});var pGn=I((Iuf,fGn)=>{"use strict";p();var{createInflateRaw:LBs,Z_DEFAULT_WINDOWBITS:FBs}=require("node:zlib"),{isValidClientWindowBits:UBs}=HZ(),{MessageSizeExceededError:QBs}=co(),qBs=Buffer.from([0,0,255,255]),aat=Symbol("kBuffer"),Xke=Symbol("kLength"),qar=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=FBs;if(this.#t.serverMaxWindowBits){if(!UBs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=LBs({windowBits:o})}catch(s){n(s);return}this.#e[aat]=[],this.#e[Xke]=0,this.#e.on("data",s=>{if(this.#e[Xke]+=s.length,this.#r>0&&this.#e[Xke]>this.#r){n(new QBs),this.#e.removeAllListeners(),this.#e=null;return}this.#e[aat].push(s)}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#e.write(e),r&&this.#e.write(qBs),this.#e.flush(()=>{if(!this.#e)return;let o=Buffer.concat(this.#e[aat],this.#e[Xke]);this.#e[aat].length=0,this.#e[Xke]=0,n(null,o)})}};fGn.exports={PerMessageDeflate:qar}});var $ar=I((Ruf,yGn)=>{"use strict";p();var{Writable:jBs}=require("node:stream"),HBs=require("node:assert"),{parserStates:pb,opcodes:Rpe,states:GBs,emptyBuffer:hGn,sentCloseFrameState:e2e}=Xj(),{isValidStatusCode:$Bs,isValidOpcode:VBs,websocketMessageReceived:mGn,utf8Decode:WBs,isControlFrame:jar,isTextBinaryFrame:Har,isContinuationFrame:zBs}=HZ(),{failWebsocketConnection:gE}=sat(),{WebsocketFrameSend:gGn}=wpe(),{PerMessageDeflate:YBs}=pGn(),{MessageSizeExceededError:AGn}=co(),Gar=class extends jBs{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=pb.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 YBs(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&&!jar(this.#o.opcode)&&this.#o.payloadLength+this.#t>this.#l?(gE(this.#c,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#n;)if(this.#i===pb.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!==Rpe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!VBs(o))return gE(this.#c,1002,"Invalid opcode received"),e();if(s)return gE(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){gE(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){gE(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Har(o)){gE(this.#c,1002,"Invalid frame type was fragmented.");return}if(Har(o)&&this.#s.length>0){gE(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){gE(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&jar(o)){gE(this.#c,1002,"Control frame either too large or fragmented");return}if(zBs(o)&&this.#s.length===0&&!this.#o.compressed){gE(this.#c,1002,"Unexpected continuation frame");return}if(l<=125){if(this.#o.payloadLength=l,this.#i=pb.READ_DATA,!this.#p())return}else l===126?this.#i=pb.PAYLOADLENGTH_16:l===127&&(this.#i=pb.PAYLOADLENGTH_64);Har(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===pb.PAYLOADLENGTH_16){if(this.#r<2)return e();let r=this.consume(2);if(this.#o.payloadLength=r.readUInt16BE(0),this.#i=pb.READ_DATA,!this.#p())return}else if(this.#i===pb.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){gE(this.#c,1009,"Received payload length > 2^31 bytes.");return}if(this.#o.payloadLength=o,this.#i=pb.READ_DATA,!this.#p())return}else if(this.#i===pb.READ_DATA){if(this.#r{if(n){let s=n instanceof AGn?1009:1007;gE(this.#c,s,n.message);return}if(this.writeFragments(o)){if(this.#l>0&&this.#t>this.#l){gE(this.#c,1009,new AGn().message);return}if(!this.#o.fin){this.#i=pb.INFO,this.#n=!0,this.run(e);return}mGn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=pb.INFO,this.run(e)}},this.#t),this.#n=!1;break}else{if(!this.writeFragments(r))return;!this.#o.fragmented&&this.#o.fin&&mGn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#i=pb.INFO}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return hGn;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?(gE(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&&!$Bs(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=WBs(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===Rpe.CLOSE){if(n===1)return gE(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 gE(this.#c,o,s),!1}if(!this.#c.closeState.has(e2e.SENT)&&!this.#c.closeState.has(e2e.RECEIVED)){let o=hGn;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new gGn(o);this.#c.socket.write(s.createFrame(Rpe.CLOSE)),this.#c.closeState.add(e2e.SENT)}return this.#c.readyState=GBs.CLOSING,this.#c.closeState.add(e2e.RECEIVED),!1}else if(r===Rpe.PING){if(!this.#c.closeState.has(e2e.RECEIVED)){let o=new gGn(e);this.#c.socket.write(o.createFrame(Rpe.PONG)),this.#c.onPing(e)}}else r===Rpe.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};yGn.exports={ByteParser:Gar}});var CGn=I((Duf,vGn)=>{"use strict";p();var{WebsocketFrameSend:_Gn}=wpe(),{opcodes:EGn,sendHints:GZ}=Xj(),KBs=Eor(),War=class{static{a(this,"SendQueue")}#e=new KBs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==GZ.blob){if(this.#t){let s={promise:null,callback:r,frame:Var(e,n)};this.#e.push(s)}else if(n===GZ.text){let{0:s,1:c}=_Gn.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(Var(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=Var(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 Var(t,e){return new _Gn(JBs(t,e)).createFrame(e===GZ.text?EGn.TEXT:EGn.BINARY)}a(Var,"createFrame");function JBs(t,e){switch(e){case GZ.text:case GZ.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case GZ.arrayBuffer:case GZ.blob:return new Uint8Array(t)}}a(JBs,"toBuffer");vGn.exports={SendQueue:War}});var wGn=I((Ouf,xGn)=>{"use strict";p();var{isArrayBuffer:ZBs}=require("node:util/types"),{webidl:hi}=FA(),{URLSerializer:XBs}=Dw(),{environmentSettingsObject:bGn}=fT(),{staticPropertyDescriptors:eH,states:GF,sentCloseFrameState:zar,sendHints:cat,opcodes:Yar}=Xj(),{isConnecting:eLs,isEstablished:SGn,isClosing:TGn,isClosed:tLs,isValidSubprotocol:rLs,fireEvent:lat,utf8Decode:nLs,toArrayBuffer:iLs,getURLRecord:oLs}=HZ(),{establishWebSocketConnection:sLs,closeWebSocketConnection:aLs,failWebsocketConnection:IGn}=sat(),{ByteParser:cLs}=$ar(),{kEnumerableProperty:Qw}=ko(),{getGlobalDispatcher:lLs}=xst(),{ErrorEvent:uLs,CloseEvent:dLs,createFastMessageEvent:fLs}=nat(),{SendQueue:pLs}=CGn(),{WebsocketFrameSend:hLs}=wpe(),{channels:M5}=Nj();function mLs(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(mLs,"getSocketAddress");var nv=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=GF.CLOSING,M5.socketError.hasSubscribers&&M5.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{M5.ping.hasSubscribers&&M5.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{M5.pong.hasSubscribers&&M5.pong.publish({payload:e,websocket:this})},"onPong"),readyState:GF.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),hi.util.markAsUncloneable(this);let n="WebSocket constructor";hi.argumentLengthCheck(arguments,1,n);let o=hi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=hi.converters.USVString(e),r=o.protocols;let s=bGn.settingsObject.baseUrl,c=oLs(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=>rLs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=bGn.settingsObject;this.#o.controller=sLs(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){hi.brandCheck(this,t),e!==void 0&&(e=hi.converters["unsigned short"](e,"WebSocket.close","code",hi.attributes.Clamp)),r!==void 0&&(r=hi.converters.USVString(r)),e??=null,r??="",aLs(this.#o,e,r,!0)}send(e){hi.brandCheck(this,t);let r="WebSocket.send";if(hi.argumentLengthCheck(arguments,1,r),e=hi.converters.WebSocketSendData(e,r,"data"),eLs(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!SGn(this.#o.readyState)||TGn(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},cat.text)}else ZBs(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},cat.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},cat.typedArray)):hi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},cat.blob))}get readyState(){return hi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return hi.brandCheck(this,t),this.#t}get url(){return hi.brandCheck(this,t),XBs(this.#s)}get extensions(){return hi.brandCheck(this,t),this.#n}get protocol(){return hi.brandCheck(this,t),this.#r}get onopen(){return hi.brandCheck(this,t),this.#e.open}set onopen(e){hi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=hi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return hi.brandCheck(this,t),this.#e.error}set onerror(e){hi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=hi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return hi.brandCheck(this,t),this.#e.close}set onclose(e){hi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=hi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return hi.brandCheck(this,t),this.#e.message}set onmessage(e){hi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=hi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return hi.brandCheck(this,t),this.#a}set binaryType(e){hi.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 cLs(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 pLs(e.socket),this.#o.readyState=GF.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),lat("open",this),M5.open.hasSubscribers){let d=e.headersList.entries;M5.open.publish({address:mLs(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!==GF.OPEN)return;let n;if(e===Yar.TEXT)try{n=nLs(r)}catch{IGn(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===Yar.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=iLs(r));lat("message",this,fLs,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(zar.SENT)&&this.#o.closeState.has(zar.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=GF.CLOSED,this.#o.closeState.has(zar.RECEIVED)||(r=1006,lat("error",this,(s,c)=>new uLs(s,c),{error:new TypeError(n)})),lat("close",this,(s,c)=>new dLs(s,c),{wasClean:e,code:r,reason:n}),M5.close.hasSubscribers&&M5.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(SGn(n)&&!TGn(n)&&!tLs(n)){let o=new hLs(r);e.#o.socket.write(o.createFrame(Yar.PING))}}},{ping:gLs}=nv;Reflect.deleteProperty(nv,"ping");nv.CONNECTING=nv.prototype.CONNECTING=GF.CONNECTING;nv.OPEN=nv.prototype.OPEN=GF.OPEN;nv.CLOSING=nv.prototype.CLOSING=GF.CLOSING;nv.CLOSED=nv.prototype.CLOSED=GF.CLOSED;Object.defineProperties(nv.prototype,{CONNECTING:eH,OPEN:eH,CLOSING:eH,CLOSED:eH,url:Qw,readyState:Qw,bufferedAmount:Qw,onopen:Qw,onerror:Qw,onclose:Qw,close:Qw,onmessage:Qw,binaryType:Qw,send:Qw,extensions:Qw,protocol:Qw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(nv,{CONNECTING:eH,OPEN:eH,CLOSING:eH,CLOSED:eH});hi.converters["sequence"]=hi.sequenceConverter(hi.converters.DOMString);hi.converters["DOMString or sequence"]=function(t,e,r){return hi.util.Type(t)===hi.util.Types.OBJECT&&Symbol.iterator in t?hi.converters["sequence"](t):hi.converters.DOMString(t,e,r)};hi.converters.WebSocketInit=hi.dictionaryConverter([{key:"protocols",converter:hi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:hi.converters.any,defaultValue:a(()=>lLs(),"defaultValue")},{key:"headers",converter:hi.nullableConverter(hi.converters.HeadersInit)}]);hi.converters["DOMString or sequence or WebSocketInit"]=function(t){return hi.util.Type(t)===hi.util.Types.OBJECT&&!(Symbol.iterator in t)?hi.converters.WebSocketInit(t):{protocols:hi.converters["DOMString or sequence"](t)}};hi.converters.WebSocketSendData=function(t){return hi.util.Type(t)===hi.util.Types.OBJECT&&(hi.is.Blob(t)||hi.is.BufferSource(t))?t:hi.converters.USVString(t)};xGn.exports={WebSocket:nv,ping:gLs}});var Kar=I((Fuf,kGn)=>{"use strict";p();var{webidl:uat}=FA(),{validateCloseCodeAndReason:ALs}=HZ(),{kConstruct:RGn}=nl(),{kEnumerableProperty:PGn}=ko();function yLs(){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(yLs,"createInheritableDOMException");var $Z=class t extends yLs(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=uat.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===RGn)return;r!==null&&(r=uat.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";ALs(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,RGn);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:ELs}=$Z;delete $Z.createUnvalidatedWebSocketError;Object.defineProperties($Z.prototype,{closeCode:PGn,reason:PGn,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});uat.is.WebSocketError=uat.util.MakeTypeAssertion($Z);kGn.exports={WebSocketError:$Z,createUnvalidatedWebSocketError:ELs}});var BGn=I((quf,OGn)=>{"use strict";p();var{createDeferredPromise:Jar}=lke(),{environmentSettingsObject:DGn}=fT(),{states:Ppe,opcodes:dat,sentCloseFrameState:kpe}=Xj(),{webidl:fp}=FA(),{getURLRecord:_Ls,isValidSubprotocol:vLs,isEstablished:CLs,utf8Decode:bLs}=HZ(),{establishWebSocketConnection:SLs,failWebsocketConnection:Zar,closeWebSocketConnection:Xar}=sat(),{channels:NGn}=Nj(),{WebsocketFrameSend:TLs}=wpe(),{ByteParser:ILs}=$ar(),{WebSocketError:xLs,createUnvalidatedWebSocketError:wLs}=Kar(),{kEnumerableProperty:fat}=ko(),{utf8DecodeBytes:RLs}=Not(),MGn=!1,pat=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=>Zar(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=Ppe.CLOSING,NGn.socketError.hasSubscribers&&NGn.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:Ppe.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){MGn||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),MGn=!0),fp.argumentLengthCheck(arguments,1,"WebSocket"),e=fp.converters.USVString(e),r!==null&&(r=fp.converters.WebSocketStreamOptions(r));let n=DGn.settingsObject.baseUrl,o=_Ls(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=>vLs(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=Jar(),this.#r=Jar(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{CLs(this.#a.readyState)||(Zar(this.#a),this.#a.readyState=Ppe.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=DGn.settingsObject;this.#a.controller=SLs(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=fp.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;Xar(this.#a,r,n,!0)}#u(e){e=fp.converters.WebSocketStreamWrite(e);let r=Jar(),n=null,o=null;if(fp.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=dat.BINARY;else{let s;try{s=fp.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=dat.TEXT}if(!this.#a.closeState.has(kpe.SENT)&&!this.#a.closeState.has(kpe.RECEIVED)){let s=new TLs(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 ILs(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=Ppe.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(()=>Xar(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!==Ppe.OPEN)return;let n;if(e===dat.TEXT)try{n=bLs(r)}catch{Zar(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===dat.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(kpe.SENT)&&this.#a.closeState.has(kpe.RECEIVED);if(this.#a.readyState=Ppe.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new xLs("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(kpe.SENT)&&!this.#a.closeState.has(kpe.RECEIVED)&&(n=1006);let o=r?.reason==null?"":RLs(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=wLs("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";fp.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),Xar(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(pat.prototype,{url:fat,opened:fat,closed:fat,close:fat,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});fp.converters.WebSocketStreamOptions=fp.dictionaryConverter([{key:"protocols",converter:fp.sequenceConverter(fp.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:fp.nullableConverter(fp.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);fp.converters.WebSocketCloseInfo=fp.dictionaryConverter([{key:"closeCode",converter:a(t=>fp.converters["unsigned short"](t,fp.attributes.EnforceRange),"converter")},{key:"reason",converter:fp.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);fp.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?fp.converters.USVString(t):fp.converters.BufferSource(t)};OGn.exports={WebSocketStream:pat}});var FGn=I((Guf,LGn)=>{"use strict";p();function PLs(t){return t.indexOf("\0")===-1}a(PLs,"isValidLastEventId");function kLs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(kLs,"isASCIINumber");LGn.exports={isValidLastEventId:PLs,isASCIINumber:kLs}});var jGn=I((Wuf,qGn)=>{"use strict";p();var{Transform:DLs}=require("node:stream"),{isASCIINumber:UGn,isValidLastEventId:QGn}=FGn(),$F=[239,187,191],ecr=10,hat=13,NLs=58,MLs=32,tcr=class extends DLs{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]===$F[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===$F[0]&&this.buffer[1]===$F[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===$F[0]&&this.buffer[1]===$F[1]&&this.buffer[2]===$F[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===$F[0]&&this.buffer[1]===$F[1]&&this.buffer[2]===$F[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&UGn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&QGn(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}}};qGn.exports={EventSourceStream:tcr}});var KGn=I((Kuf,YGn)=>{"use strict";p();var{pipeline:OLs}=require("node:stream"),{fetching:BLs}=zke(),{makeRequest:LLs}=Cpe(),{webidl:iv}=FA(),{EventSourceStream:FLs}=jGn(),{parseMIMEType:ULs}=Dw(),{createFastMessageEvent:QLs}=nat(),{isNetworkError:HGn}=$ke(),{kEnumerableProperty:VZ}=ko(),{environmentSettingsObject:GGn}=fT(),$Gn=!1,VGn=3e3,t2e=0,WGn=1,r2e=2,qLs="anonymous",jLs="use-credentials",Dpe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=t2e;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),iv.util.markAsUncloneable(this);let n="EventSource constructor";iv.argumentLengthCheck(arguments,1,n),$Gn||($Gn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=iv.converters.USVString(e),r=iv.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=GGn,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=qLs;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=GGn.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=LLs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===r2e)return;this.#n=t2e;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!HGn(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(HGn(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?ULs(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=WGn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new FLs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(QLs(u.type,u.options))},"push")});OLs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=BLs(e)}#u(){this.#n!==r2e&&(this.#n=t2e,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===t2e&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){iv.brandCheck(this,t),this.#n!==r2e&&(this.#n=r2e,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=iv.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=iv.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=iv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},zGn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:t2e,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:WGn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:r2e,writable:!1}};Object.defineProperties(Dpe,zGn);Object.defineProperties(Dpe.prototype,zGn);Object.defineProperties(Dpe.prototype,{close:VZ,onerror:VZ,onmessage:VZ,onopen:VZ,readyState:VZ,url:VZ,withCredentials:VZ});iv.converters.EventSourceInitDict=iv.dictionaryConverter([{key:"withCredentials",converter:iv.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:iv.converters.any},{key:"node",converter:iv.dictionaryConverter([{key:"reconnectionTime",converter:iv.converters["unsigned long"],defaultValue:a(()=>VGn,"defaultValue")},{key:"dispatcher",converter:iv.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);YGn.exports={EventSource:Dpe,defaultReconnectionTime:VGn}});var rcr=I((Xuf,yn)=>{"use strict";p();var HLs=jj(),ZGn=rke(),GLs=bZ(),$Ls=JUn(),VLs=t7n(),WLs=IZ(),zLs=Vor(),YLs=jor(),KLs=Q7n(),JLs=V7n(),ZLs=Y7n(),XGn=co(),gat=ko(),{InvalidArgumentError:mat}=XGn,Npe=PQn(),XLs=fZ(),e3s=ksr(),{MockCallHistory:t3s,MockCallHistoryLog:r3s}=Msr(),n3s=Hsr(),i3s=Fsr(),o3s=Rqn(),s3s=hsr(),a3s=fst(),{getGlobalDispatcher:e$n,setGlobalDispatcher:c3s}=xst(),l3s=Ape(),u3s=Jsr();Object.assign(ZGn.prototype,Npe);yn.exports.Dispatcher=ZGn;yn.exports.Client=HLs;yn.exports.Pool=GLs;yn.exports.BalancedPool=$Ls;yn.exports.RoundRobinPool=VLs;yn.exports.Agent=WLs;yn.exports.ProxyAgent=zLs;yn.exports.Socks5ProxyAgent=YLs;yn.exports.EnvHttpProxyAgent=KLs;yn.exports.RetryAgent=JLs;yn.exports.H2CClient=ZLs;yn.exports.RetryHandler=a3s;yn.exports.DecoratorHandler=l3s;yn.exports.RedirectHandler=u3s;yn.exports.interceptors={redirect:Qqn(),responseError:jqn(),retry:Gqn(),dump:Vqn(),dns:Kqn(),cache:pjn(),decompress:yjn(),deduplicate:bjn()};yn.exports.cacheStores={MemoryCacheStore:sar()};var d3s=Ijn();yn.exports.cacheStores.SqliteCacheStore=d3s;yn.exports.buildConnector=XLs;yn.exports.errors=XGn;yn.exports.util={parseHeaders:gat.parseHeaders,headerNameToString:gat.headerNameToString};function n2e(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 mat("invalid url");if(r!=null&&typeof r!="object")throw new mat("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new mat("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(gat.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=gat.parseURL(e);let{agent:o,dispatcher:s=e$n()}=r;if(o)throw new mat("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(n2e,"makeDispatcher");yn.exports.setGlobalDispatcher=c3s;yn.exports.getGlobalDispatcher=e$n;var f3s=zke().fetch,JGn=typeof __filename<"u"?__filename:void 0;function t$n(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,t$n),!o.stack)return;let s=o.stack.split(` + `)}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(` `).slice(1).join(` `);t.stack=r?`${r} -${s}`:o.stack}a(t$n,"appendFetchStackTrace");yn.exports.fetch=a(function(e,r=void 0){return f3s(e,r).catch(n=>{throw JGn?t$n(n,JGn):n&&typeof n=="object"&&Error.captureStackTrace(n,yn.exports.fetch),n})},"fetch");yn.exports.Headers=FZ().Headers;yn.exports.Response=$ke().Response;yn.exports.Request=Cpe().Request;yn.exports.FormData=Uot().FormData;var{setGlobalOrigin:p3s,getGlobalOrigin:h3s}=Iir();yn.exports.setGlobalOrigin=p3s;yn.exports.getGlobalOrigin=h3s;var{CacheStorage:m3s}=BHn(),{kConstruct:g3s}=nl();yn.exports.caches=new m3s(g3s);var{deleteCookie:A3s,getCookies:y3s,getSetCookies:E3s,setCookie:_3s,parseCookie:v3s}=YHn();yn.exports.deleteCookie=A3s;yn.exports.getCookies=y3s;yn.exports.getSetCookies=E3s;yn.exports.setCookie=_3s;yn.exports.parseCookie=v3s;var{parseMIMEType:C3s,serializeAMimeType:b3s}=Dw();yn.exports.parseMIMEType=C3s;yn.exports.serializeAMimeType=b3s;var{CloseEvent:S3s,ErrorEvent:T3s,MessageEvent:I3s}=nat(),{WebSocket:x3s,ping:w3s}=wGn();yn.exports.WebSocket=x3s;yn.exports.CloseEvent=S3s;yn.exports.ErrorEvent=T3s;yn.exports.MessageEvent=I3s;yn.exports.ping=w3s;yn.exports.WebSocketStream=BGn().WebSocketStream;yn.exports.WebSocketError=Kar().WebSocketError;yn.exports.request=n2e(Npe.request);yn.exports.stream=n2e(Npe.stream);yn.exports.pipeline=n2e(Npe.pipeline);yn.exports.connect=n2e(Npe.connect);yn.exports.upgrade=n2e(Npe.upgrade);yn.exports.MockClient=e3s;yn.exports.MockCallHistory=t3s;yn.exports.MockCallHistoryLog=r3s;yn.exports.MockPool=i3s;yn.exports.MockAgent=n3s;yn.exports.SnapshotAgent=o3s;yn.exports.mockErrors=s3s;var{EventSource:R3s}=KGn();yn.exports.EventSource=R3s;function P3s(){globalThis.fetch=yn.exports.fetch,globalThis.Headers=yn.exports.Headers,globalThis.Response=yn.exports.Response,globalThis.Request=yn.exports.Request,globalThis.FormData=yn.exports.FormData,globalThis.WebSocket=yn.exports.WebSocket,globalThis.CloseEvent=yn.exports.CloseEvent,globalThis.ErrorEvent=yn.exports.ErrorEvent,globalThis.MessageEvent=yn.exports.MessageEvent,globalThis.EventSource=yn.exports.EventSource}a(P3s,"install");yn.exports.install=P3s});var _$n,v$n=_e(()=>{p();_$n=typeof globalThis=="object"?globalThis:global});var C$n=_e(()=>{p();v$n()});var b$n=_e(()=>{p();C$n()});var VF,mcr=_e(()=>{p();VF="1.9.0"});function nFs(t){var e=new Set([t]),r=new Set,n=t.match(S$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(S$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 S$n,T$n,I$n=_e(()=>{p();mcr();S$n=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(nFs,"_makeCompatibilityCheck");T$n=nFs(VF)});function B5(t,e,r,n){var o;n===void 0&&(n=!1);var s=s2e[o2e]=(o=s2e[o2e])!==null&&o!==void 0?o:{version:VF};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!==VF){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+VF);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+VF+"."),!0}function bT(t){var e,r,n=(e=s2e[o2e])===null||e===void 0?void 0:e.version;if(!(!n||!T$n(n)))return(r=s2e[o2e])===null||r===void 0?void 0:r[t]}function L5(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+VF+".");var r=s2e[o2e];r&&delete r[t]}var iFs,o2e,s2e,zZ=_e(()=>{p();b$n();mcr();I$n();iFs=VF.split(".")[0],o2e=Symbol.for("opentelemetry.js.api."+iFs),s2e=_$n;a(B5,"registerGlobal");a(bT,"getGlobal");a(L5,"unregisterGlobal")});function a2e(t,e,r){var n=bT("diag");if(n)return r.unshift(e),n[t].apply(n,sFs([],oFs(r),!1))}var oFs,sFs,x$n,w$n=_e(()=>{p();zZ();oFs=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},sFs=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"})(Pa||(Pa={}))});function R$n(t,e){tPa.ALL&&(t=Pa.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",Pa.ERROR),warn:r("warn",Pa.WARN),info:r("info",Pa.INFO),debug:r("debug",Pa.DEBUG),verbose:r("verbose",Pa.VERBOSE)}}var P$n=_e(()=>{p();Tat();a(R$n,"createLogLevelDiagLogger")});var aFs,cFs,lFs,AE,YZ=_e(()=>{p();w$n();P$n();Tat();zZ();aFs=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},cFs=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 B5("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){L5(lFs,r)},r.createComponentLogger=function(o){return new x$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 uFs,dFs,k$n,D$n=_e(()=>{p();uFs=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},dFs=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.")},k$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=uFs(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();N$n=Symbol("BaggageEntryMetadata")});function O$n(t){return t===void 0&&(t={}),new k$n(new Map(Object.entries(t)))}function Ope(t){return typeof t!="string"&&(fFs.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:N$n,toString:a(function(){return t},"toString")}}var fFs,gcr=_e(()=>{p();YZ();D$n();M$n();fFs=AE.instance();a(O$n,"createBaggage");a(Ope,"baggageEntryMetadataFromString")});function hb(t){return Symbol.for(t)}var pFs,Iat,c2e=_e(()=>{p();a(hb,"createContextKey");pFs=(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})(),Iat=new pFs});var Acr,B$n,L$n=_e(()=>{p();Acr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],B$n=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();KZ=(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)}})(),hFs=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return bFs},t.prototype.createHistogram=function(e,r){return SFs},t.prototype.createCounter=function(e,r){return CFs},t.prototype.createUpDownCounter=function(e,r){return TFs},t.prototype.createObservableGauge=function(e,r){return xFs},t.prototype.createObservableCounter=function(e,r){return IFs},t.prototype.createObservableUpDownCounter=function(e,r){return wFs},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),xat=(function(){function t(){}return a(t,"NoopMetric"),t})(),mFs=(function(t){KZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(xat),gFs=(function(t){KZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(xat),AFs=(function(t){KZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(xat),yFs=(function(t){KZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(xat),ycr=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),EFs=(function(t){KZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(ycr),_Fs=(function(t){KZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(ycr),vFs=(function(t){KZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(ycr),Ecr=new hFs,CFs=new mFs,bFs=new AFs,SFs=new yFs,TFs=new gFs,IFs=new EFs,xFs=new _Fs,wFs=new vFs;a(F$n,"createNoopMeter")});var wat,U$n=_e(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(wat||(wat={}))});var Rat,Pat,vcr=_e(()=>{p();Rat={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},Pat={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var RFs,PFs,Q$n,q$n=_e(()=>{p();c2e();RFs=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},PFs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();q$n();zZ();YZ();kFs=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},DFs=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"})(Sf||(Sf={}))});var u2e,d2e,Bpe,kat=_e(()=>{p();bcr();u2e="0000000000000000",d2e="00000000000000000000000000000000",Bpe={traceId:d2e,spanId:u2e,traceFlags:Sf.NONE}});var nH,Dat=_e(()=>{p();kat();nH=(function(){function t(e){e===void 0&&(e=Bpe),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 Nat(t){return t.getValue(Scr)||void 0}function j$n(){return Nat(rH.getInstance().active())}function f2e(t,e){return t.setValue(Scr,e)}function H$n(t){return t.deleteValue(Scr)}function G$n(t,e){return f2e(t,new nH(e))}function Mat(t){var e;return(e=Nat(t))===null||e===void 0?void 0:e.spanContext()}var Scr,Tcr=_e(()=>{p();c2e();Dat();l2e();Scr=hb("OpenTelemetry Context Key SPAN");a(Nat,"getSpan");a(j$n,"getActiveSpan");a(f2e,"setSpan");a(H$n,"deleteSpan");a(G$n,"setSpanContext");a(Mat,"getSpanContext")});function JZ(t){return MFs.test(t)&&t!==d2e}function Icr(t){return OFs.test(t)&&t!==u2e}function mb(t){return JZ(t.traceId)&&Icr(t.spanId)}function $$n(t){return new nH(t)}var MFs,OFs,Oat=_e(()=>{p();kat();Dat();MFs=/^([0-9a-f]{32})$/i,OFs=/^[0-9a-f]{16}$/i;a(JZ,"isValidTraceId");a(Icr,"isValidSpanId");a(mb,"isSpanContextValid");a($$n,"wrapSpanContext")});function BFs(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var xcr,Bat,wcr=_e(()=>{p();l2e();Tcr();Dat();Oat();xcr=rH.getInstance(),Bat=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=xcr.active());var o=!!r?.root;if(o)return new nH;var s=n&&Mat(n);return BFs(s)&&mb(s)?new nH(s):new nH},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??xcr.active(),d=this.startSpan(e,s,u),f=f2e(u,d);return xcr.with(f,l,void 0,d)}},t})();a(BFs,"isSpanContext")});var LFs,Lat,Rcr=_e(()=>{p();wcr();LFs=new Bat,Lat=(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):LFs},t})()});var V$n,W$n=_e(()=>{p();wcr();V$n=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new Bat},t})()});var FFs,p2e,Pcr=_e(()=>{p();Rcr();W$n();FFs=new V$n,p2e=(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 Lat(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:FFs},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,r,n)},t})()});var gb,z$n=_e(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(gb||(gb={}))});var Lpe,Y$n=_e(()=>{p();(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(Lpe||(Lpe={}))});var Fpe,K$n=_e(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Fpe||(Fpe={}))});function J$n(t){return qFs.test(t)}function Z$n(t){return jFs.test(t)&&!HFs.test(t)}var kcr,UFs,QFs,qFs,jFs,HFs,X$n=_e(()=>{p();kcr="[_0-9a-z-*/]",UFs="[a-z]"+kcr+"{0,255}",QFs="[a-z0-9]"+kcr+"{0,240}@[a-z]"+kcr+"{0,13}",qFs=new RegExp("^(?:"+UFs+"|"+QFs+")$"),jFs=/^[ -~]{0,255}[!-~]$/,HFs=/,|=/;a(J$n,"validateKey");a(Z$n,"validateValue")});var eVn,GFs,tVn,rVn,nVn,iVn=_e(()=>{p();X$n();eVn=32,GFs=512,tVn=",",rVn="=",nVn=(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+rVn+e.get(n)),r},[]).join(tVn)},t.prototype._parse=function(e){e.length>GFs||(this._internalState=e.split(tVn).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(rVn);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);J$n(c)&&Z$n(l)&&r.set(c,l)}return r},new Map),this._internalState.size>eVn&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,eVn))))},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 oVn(t){return new nVn(t)}var sVn=_e(()=>{p();iVn();a(oVn,"createTraceState")});var Tg,aVn=_e(()=>{p();l2e();Tg=rH.getInstance()});var Dn,cVn=_e(()=>{p();YZ();Dn=AE.instance()});var $Fs,lVn,uVn=_e(()=>{p();_cr();$Fs=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return Ecr},t})(),lVn=new $Fs});var Dcr,dVn,fVn=_e(()=>{p();uVn();zZ();YZ();Dcr="metrics",dVn=(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 B5(Dcr,e,AE.instance())},t.prototype.getMeterProvider=function(){return bT(Dcr)||lVn},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){L5(Dcr,AE.instance())},t})()});var ZZ,pVn=_e(()=>{p();fVn();ZZ=dVn.getInstance()});var hVn,mVn=_e(()=>{p();hVn=(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 Mcr(t){return t.getValue(Ncr)||void 0}function gVn(){return Mcr(rH.getInstance().active())}function AVn(t,e){return t.setValue(Ncr,e)}function yVn(t){return t.deleteValue(Ncr)}var Ncr,EVn=_e(()=>{p();l2e();c2e();Ncr=hb("OpenTelemetry Baggage Key");a(Mcr,"getBaggage");a(gVn,"getActiveBaggage");a(AVn,"setBaggage");a(yVn,"deleteBaggage")});var Ocr,VFs,_Vn,vVn=_e(()=>{p();zZ();mVn();vcr();EVn();gcr();YZ();Ocr="propagation",VFs=new hVn,_Vn=(function(){function t(){this.createBaggage=O$n,this.getBaggage=Mcr,this.getActiveBaggage=gVn,this.setBaggage=AVn,this.deleteBaggage=yVn}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return B5(Ocr,e,AE.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=Pat),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=Rat),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){L5(Ocr,AE.instance())},t.prototype._getGlobalPropagator=function(){return bT(Ocr)||VFs},t})()});var ST,CVn=_e(()=>{p();vVn();ST=_Vn.getInstance()});var Bcr,bVn,SVn=_e(()=>{p();zZ();Pcr();Oat();Tcr();YZ();Bcr="trace",bVn=(function(){function t(){this._proxyTracerProvider=new p2e,this.wrapSpanContext=$$n,this.isSpanContextValid=mb,this.deleteSpan=H$n,this.getSpan=Nat,this.getActiveSpan=j$n,this.getSpanContext=Mat,this.setSpan=f2e,this.setSpanContext=G$n}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=B5(Bcr,this._proxyTracerProvider,AE.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return bT(Bcr)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){L5(Bcr,AE.instance()),this._proxyTracerProvider=new p2e},t})()});var Su,TVn=_e(()=>{p();SVn();Su=bVn.getInstance()});var F5={};Ri(F5,{DiagConsoleLogger:()=>B$n,DiagLogLevel:()=>Pa,INVALID_SPANID:()=>u2e,INVALID_SPAN_CONTEXT:()=>Bpe,INVALID_TRACEID:()=>d2e,ProxyTracer:()=>Lat,ProxyTracerProvider:()=>p2e,ROOT_CONTEXT:()=>Iat,SamplingDecision:()=>gb,SpanKind:()=>Lpe,SpanStatusCode:()=>Fpe,TraceFlags:()=>Sf,ValueType:()=>wat,baggageEntryMetadataFromString:()=>Ope,context:()=>Tg,createContextKey:()=>hb,createNoopMeter:()=>F$n,createTraceState:()=>oVn,default:()=>WFs,defaultTextMapGetter:()=>Rat,defaultTextMapSetter:()=>Pat,diag:()=>Dn,isSpanContextValid:()=>mb,isValidSpanId:()=>Icr,isValidTraceId:()=>JZ,metrics:()=>ZZ,propagation:()=>ST,trace:()=>Su});var WFs,lo=_e(()=>{p();gcr();c2e();L$n();Tat();_cr();U$n();vcr();Rcr();Pcr();z$n();Y$n();K$n();bcr();sVn();Oat();kat();aVn();cVn();pVn();CVn();TVn();WFs={context:Tg,diag:Dn,metrics:ZZ,propagation:ST,trace:Su}});var q2e=I(sc=>{"use strict";p();Object.defineProperty(sc,"__esModule",{value:!0});sc.regexpCode=sc.getEsmExportName=sc.getProperty=sc.safeStringify=sc.stringify=sc.strConcat=sc.addCodeArg=sc.str=sc._=sc.nil=sc._Code=sc.Name=sc.IDENTIFIER=sc._CodeOrName=void 0;var U2e=class{static{a(this,"_CodeOrName")}};sc._CodeOrName=U2e;sc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var aX=class extends U2e{static{a(this,"Name")}constructor(e){if(super(),!sc.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}}};sc.Name=aX;var $w=class extends U2e{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),{})}};sc._Code=$w;sc.nil=new $w("");function lWn(t,...e){let r=[t[0]],n=0;for(;n{"use strict";p();Object.defineProperty(yb,"__esModule",{value:!0});yb.ValueScope=yb.ValueScopeName=yb.Scope=yb.varKinds=yb.UsedValueState=void 0;var Ab=q2e(),ylr=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},ect;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(ect||(yb.UsedValueState=ect={}));yb.varKinds={const:new Ab.Name("const"),let:new Ab.Name("let"),var:new Ab.Name("var")};var tct=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Ab.Name?e:this.name(e)}name(e){return new Ab.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};yb.Scope=tct;var rct=class extends Ab.Name{static{a(this,"ValueScopeName")}constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Ab._)`.${new Ab.Name(r)}[${n}]`}};yb.ValueScopeName=rct;var n9s=(0,Ab._)`\n`,Elr=class extends tct{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?n9s:Ab.nil}}get(){return this._scope}name(e){return new rct(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,c=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let f=l.get(c);if(f)return f}else l=this._values[s]=new Map;l.set(c,o);let u=this._scope[s]||(this._scope[s]=[]),d=u.length;return u[d]=r.ref,o.setValue(r,{property:s,itemIndex:d}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ab._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=Ab.nil;for(let c in e){let l=e[c];if(!l)continue;let u=n[c]=n[c]||new Map;l.forEach(d=>{if(u.has(d))return;u.set(d,ect.Started);let f=r(d);if(f){let h=this.opts.es5?yb.varKinds.var:yb.varKinds.const;s=(0,Ab._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,Ab._)`${s}${f}${this.opts._n}`;else throw new ylr(d);u.set(d,ect.Completed)})}return s}};yb.ValueScope=Elr});var ms=I(ws=>{"use strict";p();Object.defineProperty(ws,"__esModule",{value:!0});ws.or=ws.and=ws.not=ws.CodeGen=ws.operators=ws.varKinds=ws.ValueScopeName=ws.ValueScope=ws.Scope=ws.Name=ws.regexpCode=ws.stringify=ws.getProperty=ws.nil=ws.strConcat=ws.str=ws._=void 0;var ka=q2e(),x2=_lr(),cH=q2e();Object.defineProperty(ws,"_",{enumerable:!0,get:a(function(){return cH._},"get")});Object.defineProperty(ws,"str",{enumerable:!0,get:a(function(){return cH.str},"get")});Object.defineProperty(ws,"strConcat",{enumerable:!0,get:a(function(){return cH.strConcat},"get")});Object.defineProperty(ws,"nil",{enumerable:!0,get:a(function(){return cH.nil},"get")});Object.defineProperty(ws,"getProperty",{enumerable:!0,get:a(function(){return cH.getProperty},"get")});Object.defineProperty(ws,"stringify",{enumerable:!0,get:a(function(){return cH.stringify},"get")});Object.defineProperty(ws,"regexpCode",{enumerable:!0,get:a(function(){return cH.regexpCode},"get")});Object.defineProperty(ws,"Name",{enumerable:!0,get:a(function(){return cH.Name},"get")});var sct=_lr();Object.defineProperty(ws,"Scope",{enumerable:!0,get:a(function(){return sct.Scope},"get")});Object.defineProperty(ws,"ValueScope",{enumerable:!0,get:a(function(){return sct.ValueScope},"get")});Object.defineProperty(ws,"ValueScopeName",{enumerable:!0,get:a(function(){return sct.ValueScopeName},"get")});Object.defineProperty(ws,"varKinds",{enumerable:!0,get:a(function(){return sct.varKinds},"get")});ws.operators={GT:new ka._Code(">"),GTE:new ka._Code(">="),LT:new ka._Code("<"),LTE:new ka._Code("<="),EQ:new ka._Code("==="),NEQ:new ka._Code("!=="),NOT:new ka._Code("!"),OR:new ka._Code("||"),AND:new ka._Code("&&"),ADD:new ka._Code("+")};var XF=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},vlr=class extends XF{static{a(this,"Def")}constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?x2.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=Gpe(this.rhs,e,r)),this}get names(){return this.rhs instanceof ka._CodeOrName?this.rhs.names:{}}},nct=class extends XF{static{a(this,"Assign")}constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof ka.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Gpe(this.rhs,e,r),this}get names(){let e=this.lhs instanceof ka.Name?{}:{...this.lhs.names};return oct(e,this.rhs)}},Clr=class extends nct{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}},blr=class extends XF{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Slr=class extends XF{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Tlr=class extends XF{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Ilr=class extends XF{static{a(this,"AnyCode")}constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Gpe(this.code,e,r),this}get names(){return this.code instanceof ka._CodeOrName?this.code.names:{}}},j2e=class extends XF{static{a(this,"ParentNode")}constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(i9s(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>uX(e,r.names),{})}},e8=class extends j2e{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},xlr=class extends j2e{static{a(this,"Root")}},Hpe=class extends e8{static{a(this,"Else")}};Hpe.kind="else";var cX=class t extends e8{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 Hpe(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(dWn(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=Gpe(this.condition,e,r),this}get names(){let e=super.names;return oct(e,this.condition),this.else&&uX(e,this.else.names),e}};cX.kind="if";var lX=class extends e8{static{a(this,"For")}};lX.kind="for";var wlr=class extends lX{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=Gpe(this.iteration,e,r),this}get names(){return uX(super.names,this.iteration.names)}},Rlr=class extends lX{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?x2.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=oct(super.names,this.from);return oct(e,this.to)}},ict=class extends lX{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=Gpe(this.iterable,e,r),this}get names(){return uX(super.names,this.iterable.names)}},H2e=class extends e8{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)}};H2e.kind="func";var G2e=class extends j2e{static{a(this,"Return")}render(e){return"return "+super.render(e)}};G2e.kind="return";var Plr=class extends e8{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&&uX(e,this.catch.names),this.finally&&uX(e,this.finally.names),e}},$2e=class extends e8{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};$2e.kind="catch";var V2e=class extends e8{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};V2e.kind="finally";var klr=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 x2.Scope({parent:e}),this._nodes=[new xlr]}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 vlr(e,s,n)),s}const(e,r,n){return this._def(x2.varKinds.const,e,r,n)}let(e,r,n){return this._def(x2.varKinds.let,e,r,n)}var(e,r,n){return this._def(x2.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new nct(e,r,n))}add(e,r){return this._leafNode(new Clr(e,ws.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==ka.nil&&this._leafNode(new Ilr(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,ka.addCodeArg)(r,o));return r.push("}"),new ka._Code(r)}if(e,r,n){if(this._blockNode(new cX(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 cX(e))}else(){return this._elseNode(new Hpe)}endIf(){return this._endBlockNode(cX,Hpe)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new wlr(e),r)}forRange(e,r,n,o,s=this.opts.es5?x2.varKinds.var:x2.varKinds.let){let c=this._scope.toName(e);return this._for(new Rlr(s,c,r,n),()=>o(c))}forOf(e,r,n,o=x2.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof ka.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ka._)`${c}.length`,l=>{this.var(s,(0,ka._)`${c}[${l}]`),n(s)})}return this._for(new ict("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?x2.varKinds.var:x2.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,ka._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new ict("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(lX)}label(e){return this._leafNode(new blr(e))}break(e){return this._leafNode(new Slr(e))}return(e){let r=new G2e;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(G2e)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Plr;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new $2e(s),r(s)}return n&&(this._currNode=o.finally=new V2e,this.code(n)),this._endBlockNode($2e,V2e)}throw(e){return this._leafNode(new Tlr(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=ka.nil,n,o){return this._blockNode(new H2e(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(H2e)}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 cX))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}};ws.CodeGen=klr;function uX(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(uX,"addNames");function oct(t,e){return e instanceof ka._CodeOrName?uX(t,e.names):t}a(oct,"addExprNames");function Gpe(t,e,r){if(t instanceof ka.Name)return n(t);if(!o(t))return t;return new ka._Code(t._items.reduce((s,c)=>(c instanceof ka.Name&&(c=n(c)),c instanceof ka._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 ka._Code&&s._items.some(c=>c instanceof ka.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a(Gpe,"optimizeExpr");function i9s(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(i9s,"subtractNames");function dWn(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,ka._)`!${Dlr(t)}`}a(dWn,"not");ws.not=dWn;var o9s=fWn(ws.operators.AND);function s9s(...t){return t.reduce(o9s)}a(s9s,"and");ws.and=s9s;var a9s=fWn(ws.operators.OR);function c9s(...t){return t.reduce(a9s)}a(c9s,"or");ws.or=c9s;function fWn(t){return(e,r)=>e===ka.nil?r:r===ka.nil?e:(0,ka._)`${Dlr(e)} ${t} ${Dlr(r)}`}a(fWn,"mappend");function Dlr(t){return t instanceof ka.Name?t:(0,ka._)`(${t})`}a(Dlr,"par")});var za=I(Qs=>{"use strict";p();Object.defineProperty(Qs,"__esModule",{value:!0});Qs.checkStrictMode=Qs.getErrorPath=Qs.Type=Qs.useFunc=Qs.setEvaluated=Qs.evaluatedPropsToName=Qs.mergeEvaluated=Qs.eachItem=Qs.unescapeJsonPointer=Qs.escapeJsonPointer=Qs.escapeFragment=Qs.unescapeFragment=Qs.schemaRefOrVal=Qs.schemaHasRulesButRef=Qs.schemaHasRules=Qs.checkUnknownRules=Qs.alwaysValidSchema=Qs.toHash=void 0;var Hl=ms(),l9s=q2e();function u9s(t){let e={};for(let r of t)e[r]=!0;return e}a(u9s,"toHash");Qs.toHash=u9s;function d9s(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(mWn(t,e),!gWn(e,t.self.RULES.all))}a(d9s,"alwaysValidSchema");Qs.alwaysValidSchema=d9s;function mWn(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]||EWn(t,`unknown keyword: "${s}"`)}a(mWn,"checkUnknownRules");Qs.checkUnknownRules=mWn;function gWn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(gWn,"schemaHasRules");Qs.schemaHasRules=gWn;function f9s(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(f9s,"schemaHasRulesButRef");Qs.schemaHasRulesButRef=f9s;function p9s({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Hl._)`${r}`}return(0,Hl._)`${t}${e}${(0,Hl.getProperty)(n)}`}a(p9s,"schemaRefOrVal");Qs.schemaRefOrVal=p9s;function h9s(t){return AWn(decodeURIComponent(t))}a(h9s,"unescapeFragment");Qs.unescapeFragment=h9s;function m9s(t){return encodeURIComponent(Mlr(t))}a(m9s,"escapeFragment");Qs.escapeFragment=m9s;function Mlr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(Mlr,"escapeJsonPointer");Qs.escapeJsonPointer=Mlr;function AWn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(AWn,"unescapeJsonPointer");Qs.unescapeJsonPointer=AWn;function g9s(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(g9s,"eachItem");Qs.eachItem=g9s;function pWn({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof Hl.Name?(s instanceof Hl.Name?t(o,s,c):e(o,s,c),c):s instanceof Hl.Name?(e(o,c,s),s):r(s,c);return l===Hl.Name&&!(u instanceof Hl.Name)?n(o,u):u}}a(pWn,"makeMergeEvaluated");Qs.mergeEvaluated={props:pWn({mergeNames:a((t,e,r)=>t.if((0,Hl._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Hl._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Hl._)`${r} || {}`).code((0,Hl._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Hl._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Hl._)`${r} || {}`),Olr(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:yWn}),items:pWn({mergeNames:a((t,e,r)=>t.if((0,Hl._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Hl._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Hl._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Hl._)`${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 yWn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Hl._)`{}`);return e!==void 0&&Olr(t,r,e),r}a(yWn,"evaluatedPropsToName");Qs.evaluatedPropsToName=yWn;function Olr(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Hl._)`${e}${(0,Hl.getProperty)(n)}`,!0))}a(Olr,"setEvaluated");Qs.setEvaluated=Olr;var hWn={};function A9s(t,e){return t.scopeValue("func",{ref:e,code:hWn[e.code]||(hWn[e.code]=new l9s._Code(e.code))})}a(A9s,"useFunc");Qs.useFunc=A9s;var Nlr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Nlr||(Qs.Type=Nlr={}));function y9s(t,e,r){if(t instanceof Hl.Name){let n=e===Nlr.Num;return r?n?(0,Hl._)`"[" + ${t} + "]"`:(0,Hl._)`"['" + ${t} + "']"`:n?(0,Hl._)`"/" + ${t}`:(0,Hl._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Hl.getProperty)(t).toString():"/"+Mlr(t)}a(y9s,"getErrorPath");Qs.getErrorPath=y9s;function EWn(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(EWn,"checkStrictMode");Qs.checkStrictMode=EWn});var t8=I(Blr=>{"use strict";p();Object.defineProperty(Blr,"__esModule",{value:!0});var yE=ms(),E9s={data:new yE.Name("data"),valCxt:new yE.Name("valCxt"),instancePath:new yE.Name("instancePath"),parentData:new yE.Name("parentData"),parentDataProperty:new yE.Name("parentDataProperty"),rootData:new yE.Name("rootData"),dynamicAnchors:new yE.Name("dynamicAnchors"),vErrors:new yE.Name("vErrors"),errors:new yE.Name("errors"),this:new yE.Name("this"),self:new yE.Name("self"),scope:new yE.Name("scope"),json:new yE.Name("json"),jsonPos:new yE.Name("jsonPos"),jsonLen:new yE.Name("jsonLen"),jsonPart:new yE.Name("jsonPart")};Blr.default=E9s});var W2e=I(EE=>{"use strict";p();Object.defineProperty(EE,"__esModule",{value:!0});EE.extendErrors=EE.resetErrorsCount=EE.reportExtraError=EE.reportError=EE.keyword$DataError=EE.keywordError=void 0;var Ya=ms(),act=za(),ov=t8();EE.keywordError={message:a(({keyword:t})=>(0,Ya.str)`must pass "${t}" keyword validation`,"message")};EE.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,Ya.str)`"${t}" keyword must be ${e} ($data)`:(0,Ya.str)`"${t}" keyword is invalid ($data)`,"message")};function _9s(t,e=EE.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=CWn(t,e,r);n??(c||l)?_Wn(s,u):vWn(o,(0,Ya._)`[${u}]`)}a(_9s,"reportError");EE.reportError=_9s;function v9s(t,e=EE.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=CWn(t,e,r);_Wn(o,l),s||c||vWn(n,ov.default.vErrors)}a(v9s,"reportExtraError");EE.reportExtraError=v9s;function C9s(t,e){t.assign(ov.default.errors,e),t.if((0,Ya._)`${ov.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ya._)`${ov.default.vErrors}.length`,e),()=>t.assign(ov.default.vErrors,null)))}a(C9s,"resetErrorsCount");EE.resetErrorsCount=C9s;function b9s({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,ov.default.errors,l=>{t.const(c,(0,Ya._)`${ov.default.vErrors}[${l}]`),t.if((0,Ya._)`${c}.instancePath === undefined`,()=>t.assign((0,Ya._)`${c}.instancePath`,(0,Ya.strConcat)(ov.default.instancePath,s.errorPath))),t.assign((0,Ya._)`${c}.schemaPath`,(0,Ya.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Ya._)`${c}.schema`,r),t.assign((0,Ya._)`${c}.data`,n))})}a(b9s,"extendErrors");EE.extendErrors=b9s;function _Wn(t,e){let r=t.const("err",e);t.if((0,Ya._)`${ov.default.vErrors} === null`,()=>t.assign(ov.default.vErrors,(0,Ya._)`[${r}]`),(0,Ya._)`${ov.default.vErrors}.push(${r})`),t.code((0,Ya._)`${ov.default.errors}++`)}a(_Wn,"addError");function vWn(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,Ya._)`new ${t.ValidationError}(${e})`):(r.assign((0,Ya._)`${n}.errors`,e),r.return(!1))}a(vWn,"returnErrors");var dX={keyword:new Ya.Name("keyword"),schemaPath:new Ya.Name("schemaPath"),params:new Ya.Name("params"),propertyName:new Ya.Name("propertyName"),message:new Ya.Name("message"),schema:new Ya.Name("schema"),parentSchema:new Ya.Name("parentSchema")};function CWn(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Ya._)`{}`:S9s(t,e,r)}a(CWn,"errorObjectCode");function S9s(t,e,r={}){let{gen:n,it:o}=t,s=[T9s(o,r),I9s(t,r)];return x9s(t,e,s),n.object(...s)}a(S9s,"errorObject");function T9s({errorPath:t},{instancePath:e}){let r=e?(0,Ya.str)`${t}${(0,act.getErrorPath)(e,act.Type.Str)}`:t;return[ov.default.instancePath,(0,Ya.strConcat)(ov.default.instancePath,r)]}a(T9s,"errorInstancePath");function I9s({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,Ya.str)`${e}/${t}`;return r&&(o=(0,Ya.str)`${o}${(0,act.getErrorPath)(r,act.Type.Str)}`),[dX.schemaPath,o]}a(I9s,"errorSchemaPath");function x9s(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([dX.keyword,o],[dX.params,typeof e=="function"?e(t):e||(0,Ya._)`{}`]),u.messages&&n.push([dX.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([dX.schema,c],[dX.parentSchema,(0,Ya._)`${f}${h}`],[ov.default.data,s]),d&&n.push([dX.propertyName,d])}a(x9s,"extraErrorProps")});var SWn=I($pe=>{"use strict";p();Object.defineProperty($pe,"__esModule",{value:!0});$pe.boolOrEmptySchema=$pe.topBoolOrEmptySchema=void 0;var w9s=W2e(),R9s=ms(),P9s=t8(),k9s={message:"boolean schema is false"};function D9s(t){let{gen:e,schema:r,validateName:n}=t;r===!1?bWn(t,!1):typeof r=="object"&&r.$async===!0?e.return(P9s.default.data):(e.assign((0,R9s._)`${n}.errors`,null),e.return(!0))}a(D9s,"topBoolOrEmptySchema");$pe.topBoolOrEmptySchema=D9s;function N9s(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),bWn(t)):r.var(e,!0)}a(N9s,"boolOrEmptySchema");$pe.boolOrEmptySchema=N9s;function bWn(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,w9s.reportError)(o,k9s,void 0,e)}a(bWn,"falseSchemaError")});var Llr=I(Vpe=>{"use strict";p();Object.defineProperty(Vpe,"__esModule",{value:!0});Vpe.getRules=Vpe.isJSONType=void 0;var M9s=["string","number","integer","boolean","null","object","array"],O9s=new Set(M9s);function B9s(t){return typeof t=="string"&&O9s.has(t)}a(B9s,"isJSONType");Vpe.isJSONType=B9s;function L9s(){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(L9s,"getRules");Vpe.getRules=L9s});var Flr=I(lH=>{"use strict";p();Object.defineProperty(lH,"__esModule",{value:!0});lH.shouldUseRule=lH.shouldUseGroup=lH.schemaHasRulesForType=void 0;function F9s({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&TWn(t,n)}a(F9s,"schemaHasRulesForType");lH.schemaHasRulesForType=F9s;function TWn(t,e){return e.rules.some(r=>IWn(t,r))}a(TWn,"shouldUseGroup");lH.shouldUseGroup=TWn;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");lH.shouldUseRule=IWn});var z2e=I(_E=>{"use strict";p();Object.defineProperty(_E,"__esModule",{value:!0});_E.reportTypeError=_E.checkDataTypes=_E.checkDataType=_E.coerceAndCheckDataType=_E.getJSONTypes=_E.getSchemaTypes=_E.DataType=void 0;var U9s=Llr(),Q9s=Flr(),q9s=W2e(),is=ms(),xWn=za(),Wpe;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Wpe||(_E.DataType=Wpe={}));function j9s(t){let e=wWn(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(j9s,"getSchemaTypes");_E.getSchemaTypes=j9s;function wWn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(U9s.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(wWn,"getJSONTypes");_E.getJSONTypes=wWn;function H9s(t,e){let{gen:r,data:n,opts:o}=t,s=G9s(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,Q9s.schemaHasRulesForType)(t,e[0]));if(c){let l=Qlr(e,n,o.strictNumbers,Wpe.Wrong);r.if(l,()=>{s.length?$9s(t,e,s):qlr(t)})}return c}a(H9s,"coerceAndCheckDataType");_E.coerceAndCheckDataType=H9s;var RWn=new Set(["string","number","integer","boolean","null"]);function G9s(t,e){return e?t.filter(r=>RWn.has(r)||e==="array"&&r==="array"):[]}a(G9s,"coerceToTypes");function $9s(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,is._)`typeof ${o}`),l=n.let("coerced",(0,is._)`undefined`);s.coerceTypes==="array"&&n.if((0,is._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,is._)`${o}[0]`).assign(c,(0,is._)`typeof ${o}`).if(Qlr(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,is._)`${l} !== undefined`);for(let d of r)(RWn.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),qlr(t),n.endIf(),n.if((0,is._)`${l} !== undefined`,()=>{n.assign(o,l),V9s(t,l)});function u(d){switch(d){case"string":n.elseIf((0,is._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,is._)`"" + ${o}`).elseIf((0,is._)`${o} === null`).assign(l,(0,is._)`""`);return;case"number":n.elseIf((0,is._)`${c} == "boolean" || ${o} === null - || (${c} == "string" && ${o} && ${o} == +${o})`).assign(l,(0,is._)`+${o}`);return;case"integer":n.elseIf((0,is._)`${c} === "boolean" || ${o} === null - || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,(0,is._)`+${o}`);return;case"boolean":n.elseIf((0,is._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf((0,is._)`${o} === "true" || ${o} === 1`).assign(l,!0);return;case"null":n.elseIf((0,is._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(l,null);return;case"array":n.elseIf((0,is._)`${c} === "string" || ${c} === "number" - || ${c} === "boolean" || ${o} === null`).assign(l,(0,is._)`[${o}]`)}}a(u,"coerceSpecificType")}a($9s,"coerceData");function V9s({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,is._)`${e} !== undefined`,()=>t.assign((0,is._)`${e}[${r}]`,n))}a(V9s,"assignParentData");function Ulr(t,e,r,n=Wpe.Correct){let o=n===Wpe.Correct?is.operators.EQ:is.operators.NEQ,s;switch(t){case"null":return(0,is._)`${e} ${o} null`;case"array":s=(0,is._)`Array.isArray(${e})`;break;case"object":s=(0,is._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,is._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,is._)`typeof ${e} ${o} ${t}`}return n===Wpe.Correct?s:(0,is.not)(s);function c(l=is.nil){return(0,is.and)((0,is._)`typeof ${e} == "number"`,l,r?(0,is._)`isFinite(${e})`:is.nil)}}a(Ulr,"checkDataType");_E.checkDataType=Ulr;function Qlr(t,e,r,n){if(t.length===1)return Ulr(t[0],e,r,n);let o,s=(0,xWn.toHash)(t);if(s.array&&s.object){let c=(0,is._)`typeof ${e} != "object"`;o=s.null?c:(0,is._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=is.nil;s.number&&delete s.integer;for(let c in s)o=(0,is.and)(o,Ulr(c,e,r,n));return o}a(Qlr,"checkDataTypes");_E.checkDataTypes=Qlr;var W9s={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,is._)`{type: ${t}}`:(0,is._)`{type: ${e}}`,"params")};function qlr(t){let e=z9s(t);(0,q9s.reportError)(e,W9s)}a(qlr,"reportTypeError");_E.reportTypeError=qlr;function z9s(t){let{gen:e,data:r,schema:n}=t,o=(0,xWn.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(z9s,"getTypeErrorContext")});var kWn=I(cct=>{"use strict";p();Object.defineProperty(cct,"__esModule",{value:!0});cct.assignDefaults=void 0;var zpe=ms(),Y9s=za();function K9s(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(K9s,"assignDefaults");cct.assignDefaults=K9s;function PWn(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,zpe._)`${s}${(0,zpe.getProperty)(e)}`;if(o){(0,Y9s.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,zpe._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,zpe._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,zpe._)`${l} = ${(0,zpe.stringify)(r)}`)}a(PWn,"assignDefault")});var Vw=I(bl=>{"use strict";p();Object.defineProperty(bl,"__esModule",{value:!0});bl.validateUnion=bl.validateArray=bl.usePattern=bl.callValidateCode=bl.schemaProperties=bl.allSchemaProperties=bl.noPropertyInData=bl.propertyInData=bl.isOwnProperty=bl.hasPropFunc=bl.reportMissingProp=bl.checkMissingProp=bl.checkReportMissingProp=void 0;var ld=ms(),jlr=za(),uH=t8(),J9s=za();function Z9s(t,e){let{gen:r,data:n,it:o}=t;r.if(Glr(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ld._)`${e}`},!0),t.error()})}a(Z9s,"checkReportMissingProp");bl.checkReportMissingProp=Z9s;function X9s({gen:t,data:e,it:{opts:r}},n,o){return(0,ld.or)(...n.map(s=>(0,ld.and)(Glr(t,e,s,r.ownProperties),(0,ld._)`${o} = ${s}`)))}a(X9s,"checkMissingProp");bl.checkMissingProp=X9s;function eUs(t,e){t.setParams({missingProperty:e},!0),t.error()}a(eUs,"reportMissingProp");bl.reportMissingProp=eUs;function DWn(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ld._)`Object.prototype.hasOwnProperty`})}a(DWn,"hasPropFunc");bl.hasPropFunc=DWn;function Hlr(t,e,r){return(0,ld._)`${DWn(t)}.call(${e}, ${r})`}a(Hlr,"isOwnProperty");bl.isOwnProperty=Hlr;function tUs(t,e,r,n){let o=(0,ld._)`${e}${(0,ld.getProperty)(r)} !== undefined`;return n?(0,ld._)`${o} && ${Hlr(t,e,r)}`:o}a(tUs,"propertyInData");bl.propertyInData=tUs;function Glr(t,e,r,n){let o=(0,ld._)`${e}${(0,ld.getProperty)(r)} === undefined`;return n?(0,ld.or)(o,(0,ld.not)(Hlr(t,e,r))):o}a(Glr,"noPropertyInData");bl.noPropertyInData=Glr;function NWn(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(NWn,"allSchemaProperties");bl.allSchemaProperties=NWn;function rUs(t,e){return NWn(e).filter(r=>!(0,jlr.alwaysValidSchema)(t,e[r]))}a(rUs,"schemaProperties");bl.schemaProperties=rUs;function nUs({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,ld._)`${t}, ${e}, ${n}${o}`:e,h=[[uH.default.instancePath,(0,ld.strConcat)(uH.default.instancePath,s)],[uH.default.parentData,c.parentData],[uH.default.parentDataProperty,c.parentDataProperty],[uH.default.rootData,uH.default.rootData]];c.opts.dynamicRef&&h.push([uH.default.dynamicAnchors,uH.default.dynamicAnchors]);let m=(0,ld._)`${f}, ${r.object(...h)}`;return u!==ld.nil?(0,ld._)`${l}.call(${u}, ${m})`:(0,ld._)`${l}(${m})`}a(nUs,"callValidateCode");bl.callValidateCode=nUs;var iUs=(0,ld._)`new RegExp`;function oUs({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,ld._)`${o.code==="new RegExp"?iUs:(0,J9s.useFunc)(t,o)}(${r}, ${n})`})}a(oUs,"usePattern");bl.usePattern=oUs;function sUs(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,ld._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:jlr.Type.Num},s),e.if((0,ld.not)(s),l)})}a(c,"validateItems")}a(sUs,"validateArray");bl.validateArray=sUs;function aUs(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,jlr.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,ld._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,ld.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(aUs,"validateUnion");bl.validateUnion=aUs});var BWn=I(Q5=>{"use strict";p();Object.defineProperty(Q5,"__esModule",{value:!0});Q5.validateKeywordUsage=Q5.validSchemaType=Q5.funcKeywordCode=Q5.macroKeywordCode=void 0;var sv=ms(),fX=t8(),cUs=Vw(),lUs=W2e();function uUs(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=OWn(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:sv.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}a(uUs,"macroKeywordCode");Q5.macroKeywordCode=uUs;function dUs(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;pUs(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=OWn(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&&MWn(t),E(()=>t.error());else{let _=e.async?g():A();e.modifying&&MWn(t),E(()=>fUs(t,_))}}a(m,"validateKeyword");function g(){let _=n.let("ruleErrs",null);return n.try(()=>y((0,sv._)`await `),v=>n.assign(h,!1).if((0,sv._)`${v} instanceof ${u.ValidationError}`,()=>n.assign(_,(0,sv._)`${v}.errors`),()=>n.throw(v))),_}a(g,"validateAsync");function A(){let _=(0,sv._)`${f}.errors`;return n.assign(_,null),y(sv.nil),_}a(A,"validateSync");function y(_=e.async?(0,sv._)`await `:sv.nil){let v=u.opts.passContext?fX.default.this:fX.default.self,b=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,sv._)`${_}${(0,cUs.callValidateCode)(t,f,v,b)}`,e.modifying)}a(y,"assignValid");function E(_){var v;n.if((0,sv.not)((v=e.valid)!==null&&v!==void 0?v:h),_)}a(E,"reportErrs")}a(dUs,"funcKeywordCode");Q5.funcKeywordCode=dUs;function MWn(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,sv._)`${n.parentData}[${n.parentDataProperty}]`))}a(MWn,"modifyData");function fUs(t,e){let{gen:r}=t;r.if((0,sv._)`Array.isArray(${e})`,()=>{r.assign(fX.default.vErrors,(0,sv._)`${fX.default.vErrors} === null ? ${e} : ${fX.default.vErrors}.concat(${e})`).assign(fX.default.errors,(0,sv._)`${fX.default.vErrors}.length`),(0,lUs.extendErrors)(t)},()=>t.error())}a(fUs,"addErrs");function pUs({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(pUs,"checkAsyncKeyword");function OWn(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,sv.stringify)(r)})}a(OWn,"useKeyword");function hUs(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(hUs,"validSchemaType");Q5.validSchemaType=hUs;function mUs({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(mUs,"validateKeywordUsage");Q5.validateKeywordUsage=mUs});var FWn=I(dH=>{"use strict";p();Object.defineProperty(dH,"__esModule",{value:!0});dH.extendSubschemaMode=dH.extendSubschemaData=dH.getSubschema=void 0;var q5=ms(),LWn=za();function gUs(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,q5._)`${t.schemaPath}${(0,q5.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,q5._)`${t.schemaPath}${(0,q5.getProperty)(e)}${(0,q5.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,LWn.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(gUs,"getSubschema");dH.getSubschema=gUs;function AUs(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,q5._)`${e.data}${(0,q5.getProperty)(r)}`,!0);u(m),t.errorPath=(0,q5.str)`${d}${(0,LWn.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,q5._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof q5.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(AUs,"extendSubschemaData");dH.extendSubschemaData=AUs;function yUs(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(yUs,"extendSubschemaMode");dH.extendSubschemaMode=yUs});var $lr=I((kvf,UWn)=>{"use strict";p();UWn.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 qWn=I((Mvf,QWn)=>{"use strict";p();var fH=QWn.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(){};lct(e,n,o,t,"",t)};fH.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};fH.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};fH.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};fH.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 lct(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 fH.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(Eb,"__esModule",{value:!0});Eb.getSchemaRefs=Eb.resolveUrl=Eb.normalizeId=Eb._getFullPath=Eb.getFullPath=Eb.inlineRef=void 0;var _Us=za(),vUs=$lr(),CUs=qWn(),bUs=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function SUs(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Vlr(t):e?jWn(t)<=e:!1}a(SUs,"inlineRef");Eb.inlineRef=SUs;var TUs=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Vlr(t){for(let e in t){if(TUs.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Vlr)||typeof r=="object"&&Vlr(r))return!0}return!1}a(Vlr,"hasRef");function jWn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!bUs.has(r)&&(typeof t[r]=="object"&&(0,_Us.eachItem)(t[r],n=>e+=jWn(n)),e===1/0))return 1/0}return e}a(jWn,"countKeys");function HWn(t,e="",r){r!==!1&&(e=Ype(e));let n=t.parse(e);return GWn(t,n)}a(HWn,"getFullPath");Eb.getFullPath=HWn;function GWn(t,e){return t.serialize(e).split("#")[0]+"#"}a(GWn,"_getFullPath");Eb._getFullPath=GWn;var IUs=/#\/?$/;function Ype(t){return t?t.replace(IUs,""):""}a(Ype,"normalizeId");Eb.normalizeId=Ype;function xUs(t,e,r){return r=Ype(r),t.resolve(e,r)}a(xUs,"resolveUrl");Eb.resolveUrl=xUs;var wUs=/^[a-z_][-a-z0-9._]*$/i;function RUs(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Ype(t[r]||e),s={"":o},c=HWn(n,o,!1),l={},u=new Set;return CUs(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=Ype(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!==Ype(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(!wUs.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!vUs(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(RUs,"getSchemaRefs");Eb.getSchemaRefs=RUs});var Z2e=I(pH=>{"use strict";p();Object.defineProperty(pH,"__esModule",{value:!0});pH.getData=pH.KeywordCxt=pH.validateFunctionCode=void 0;var YWn=SWn(),$Wn=z2e(),zlr=Flr(),uct=z2e(),PUs=kWn(),J2e=BWn(),Wlr=FWn(),oi=ms(),ho=t8(),kUs=Y2e(),r8=za(),K2e=W2e();function DUs(t){if(ZWn(t)&&(XWn(t),JWn(t))){OUs(t);return}KWn(t,()=>(0,YWn.topBoolOrEmptySchema)(t))}a(DUs,"validateFunctionCode");pH.validateFunctionCode=DUs;function KWn({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,oi._)`${ho.default.data}, ${ho.default.valCxt}`,n.$async,()=>{t.code((0,oi._)`"use strict"; ${VWn(r,o)}`),MUs(t,o),t.code(s)}):t.func(e,(0,oi._)`${ho.default.data}, ${NUs(o)}`,n.$async,()=>t.code(VWn(r,o)).code(s))}a(KWn,"validateFunction");function NUs(t){return(0,oi._)`{${ho.default.instancePath}="", ${ho.default.parentData}, ${ho.default.parentDataProperty}, ${ho.default.rootData}=${ho.default.data}${t.dynamicRef?(0,oi._)`, ${ho.default.dynamicAnchors}={}`:oi.nil}}={}`}a(NUs,"destructureValCxt");function MUs(t,e){t.if(ho.default.valCxt,()=>{t.var(ho.default.instancePath,(0,oi._)`${ho.default.valCxt}.${ho.default.instancePath}`),t.var(ho.default.parentData,(0,oi._)`${ho.default.valCxt}.${ho.default.parentData}`),t.var(ho.default.parentDataProperty,(0,oi._)`${ho.default.valCxt}.${ho.default.parentDataProperty}`),t.var(ho.default.rootData,(0,oi._)`${ho.default.valCxt}.${ho.default.rootData}`),e.dynamicRef&&t.var(ho.default.dynamicAnchors,(0,oi._)`${ho.default.valCxt}.${ho.default.dynamicAnchors}`)},()=>{t.var(ho.default.instancePath,(0,oi._)`""`),t.var(ho.default.parentData,(0,oi._)`undefined`),t.var(ho.default.parentDataProperty,(0,oi._)`undefined`),t.var(ho.default.rootData,ho.default.data),e.dynamicRef&&t.var(ho.default.dynamicAnchors,(0,oi._)`{}`)})}a(MUs,"destructureValCxtES5");function OUs(t){let{schema:e,opts:r,gen:n}=t;KWn(t,()=>{r.$comment&&e.$comment&&tzn(t),QUs(t),n.let(ho.default.vErrors,null),n.let(ho.default.errors,0),r.unevaluated&&BUs(t),ezn(t),HUs(t)})}a(OUs,"topSchemaObjCode");function BUs(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(BUs,"resetEvaluated");function VWn(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(VWn,"funcSourceUrl");function LUs(t,e){if(ZWn(t)&&(XWn(t),JWn(t))){FUs(t,e);return}(0,YWn.boolOrEmptySchema)(t,e)}a(LUs,"subschemaCode");function JWn({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(JWn,"schemaCxtHasRules");function ZWn(t){return typeof t.schema!="boolean"}a(ZWn,"isSchemaObj");function FUs(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&tzn(t),qUs(t),jUs(t);let s=n.const("_errs",ho.default.errors);ezn(t,s),n.var(e,(0,oi._)`${s} === ${ho.default.errors}`)}a(FUs,"subSchemaObjCode");function XWn(t){(0,r8.checkUnknownRules)(t),UUs(t)}a(XWn,"checkKeywords");function ezn(t,e){if(t.opts.jtd)return WWn(t,[],!1,e);let r=(0,$Wn.getSchemaTypes)(t.schema),n=(0,$Wn.coerceAndCheckDataType)(t,r);WWn(t,r,!n,e)}a(ezn,"typeAndKeywords");function UUs(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,r8.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(UUs,"checkRefsAndKeywords");function QUs(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,r8.checkStrictMode)(t,"default is ignored in the schema root")}a(QUs,"checkNoDefault");function qUs(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,kUs.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(qUs,"updateContext");function jUs(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(jUs,"checkAsyncSchema");function tzn({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,oi._)`${ho.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._)`${ho.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(tzn,"commentKeyword");function HUs(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,oi._)`${ho.default.errors} === 0`,()=>e.return(ho.default.data),()=>e.throw((0,oi._)`new ${o}(${ho.default.vErrors})`)):(e.assign((0,oi._)`${n}.errors`,ho.default.vErrors),s.unevaluated&&GUs(t),e.return((0,oi._)`${ho.default.errors} === 0`))}a(HUs,"returnResults");function GUs({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(GUs,"assignEvaluated");function WWn(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,r8.schemaHasRulesButRef)(s,f))){o.block(()=>nzn(t,"$ref",f.all.$ref.definition));return}u.jtd||$Us(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,zlr.shouldUseGroup)(s,m)&&(m.type?(o.if((0,uct.checkDataType)(m.type,c,u.strictNumbers)),zWn(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,uct.reportTypeError)(t)),o.endIf()):zWn(t,m),l||o.if((0,oi._)`${ho.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a(WWn,"schemaKeywords");function zWn(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,PUs.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,zlr.shouldUseRule)(n,s)&&nzn(t,s.keyword,s.definition,e.type)})}a(zWn,"iterateKeywords");function $Us(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(VUs(t,e),t.opts.allowUnionTypes||WUs(t,e),zUs(t,t.dataTypes))}a($Us,"checkStrictTypes");function VUs(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{rzn(t.dataTypes,r)||Ylr(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),KUs(t,e)}}a(VUs,"checkContextTypes");function WUs(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Ylr(t,"use allowUnionTypes to allow union type keyword")}a(WUs,"checkMultipleTypes");function zUs(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,zlr.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>YUs(e,c))&&Ylr(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(zUs,"checkKeywordTypes");function YUs(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(YUs,"hasApplicableType");function rzn(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(rzn,"includesType");function KUs(t,e){let r=[];for(let n of t.dataTypes)rzn(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(KUs,"narrowSchemaTypes");function Ylr(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,r8.checkStrictMode)(t,e,t.opts.strictTypes)}a(Ylr,"strictTypesError");var dct=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,J2e.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,r8.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",izn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,J2e.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",ho.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?K2e.reportExtraError:K2e.reportError)(this,this.def.error,r)}$dataError(){(0,K2e.reportError)(this,this.def.$dataError||K2e.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,K2e.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,uct.checkDataTypes)(u,r,s.opts.strictNumbers,uct.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,Wlr.getSubschema)(this.it,e);(0,Wlr.extendSubschemaData)(n,this.it,e),(0,Wlr.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return LUs(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=r8.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=r8.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}};pH.KeywordCxt=dct;function nzn(t,e,r,n){let o=new dct(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,J2e.funcKeywordCode)(o,r):"macro"in r?(0,J2e.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,J2e.funcKeywordCode)(o,r)}a(nzn,"keywordCode");var JUs=/^\/(?:[^~]|~0|~1)*$/,ZUs=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function izn(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return ho.default.rootData;if(t[0]==="/"){if(!JUs.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=ho.default.rootData}else{let d=ZUs.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,r8.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(izn,"getData");pH.getData=izn});var fct=I(Jlr=>{"use strict";p();Object.defineProperty(Jlr,"__esModule",{value:!0});var Klr=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Jlr.default=Klr});var X2e=I(eur=>{"use strict";p();Object.defineProperty(eur,"__esModule",{value:!0});var Zlr=Y2e(),Xlr=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,Zlr.resolveUrl)(e,r,n),this.missingSchema=(0,Zlr.normalizeId)((0,Zlr.getFullPath)(e,this.missingRef))}};eur.default=Xlr});var hct=I(Ww=>{"use strict";p();Object.defineProperty(Ww,"__esModule",{value:!0});Ww.resolveSchema=Ww.getCompilingSchema=Ww.resolveRef=Ww.compileSchema=Ww.SchemaEnv=void 0;var w2=ms(),XUs=fct(),pX=t8(),R2=Y2e(),ozn=za(),e7s=Z2e(),Kpe=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,R2.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Ww.SchemaEnv=Kpe;function rur(t){let e=szn.call(this,t);if(e)return e;let r=(0,R2.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,c=new w2.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),l;t.$async&&(l=c.scopeValue("Error",{ref:XUs.default,code:(0,w2._)`require("ajv/dist/runtime/validation_error").default`}));let u=c.scopeName("validate");t.validateName=u;let d={gen:c,allErrors:this.opts.allErrors,data:pX.default.data,parentData:pX.default.parentData,parentDataProperty:pX.default.parentDataProperty,dataNames:[pX.default.data],dataPathArr:[w2.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,w2.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:w2.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,w2._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,e7s.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(pX.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${pX.default.self}`,`${pX.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 w2.Name?void 0:A,items:y instanceof w2.Name?void 0:y,dynamicProps:A instanceof w2.Name,dynamicItems:y instanceof w2.Name},g.source&&(g.source.evaluated=(0,w2.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(rur,"compileSchema");Ww.compileSchema=rur;function t7s(t,e,r){var n;r=(0,R2.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=i7s.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 Kpe({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=r7s.call(this,s)}a(t7s,"resolveRef");Ww.resolveRef=t7s;function r7s(t){return(0,R2.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:rur.call(this,t)}a(r7s,"inlineOrCompile");function szn(t){for(let e of this._compilations)if(n7s(e,t))return e}a(szn,"getCompilingSchema");Ww.getCompilingSchema=szn;function n7s(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(n7s,"sameSchemaEnv");function i7s(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||pct.call(this,t,e)}a(i7s,"resolve");function pct(t,e){let r=this.opts.uriResolver.parse(e),n=(0,R2._getFullPath)(this.opts.uriResolver,r),o=(0,R2.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return tur.call(this,r,t);let s=(0,R2.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=pct.call(this,t,c);return typeof l?.schema!="object"?void 0:tur.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||rur.call(this,c),s===(0,R2.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,R2.resolveUrl)(this.opts.uriResolver,o,d)),new Kpe({schema:l,schemaId:u,root:t,baseId:o})}return tur.call(this,r,c)}}a(pct,"resolveSchema");Ww.resolveSchema=pct;var o7s=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function tur(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,ozn.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!o7s.has(l)&&d&&(e=(0,R2.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,ozn.schemaHasRulesButRef)(r,this.RULES)){let l=(0,R2.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=pct.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new Kpe({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a(tur,"getJsonPointer")});var azn=I((Zvf,s7s)=>{s7s.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 our=I((Xvf,pzn)=>{"use strict";p();var a7s=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),lzn=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),nur=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),uzn=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),c7s=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function iur(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(iur,"stringArrayToHexStripped");var l7s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function czn(t){return t.length=0,!0}a(czn,"consumeIsZone");function u7s(t,e,r){if(t.length){let n=iur(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(u7s,"consumeHextets");function d7s(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=u7s;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=czn}else{o.push(d);continue}}return o.length&&(l===czn?r.zone=o.join(""):c?n.push(o.join("")):n.push(iur(o))),r.address=n.join(""),r}a(d7s,"getIPV6");function dzn(t){if(f7s(t,":")<2)return{host:t,isIPV6:!1};let e=d7s(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(dzn,"normalizeIPv6");function f7s(t,e){let r=0;for(let n=0;nh7s[n])}a(fzn,"reescapeHostDelimiters");function A7s(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:v7s}=our(),C7s=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,b7s=["http","https","ws","wss","urn","urn:uuid"];function S7s(t){return b7s.indexOf(t)!==-1}a(S7s,"isValidSchemeName");function sur(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(sur,"wsIsSecure");function hzn(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(hzn,"httpParse");function mzn(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(mzn,"httpSerialize");function T7s(t){return t.secure=sur(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(T7s,"wsParse");function I7s(t){if((t.port===(sur(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(I7s,"wsSerialize");function x7s(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(C7s);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=aur(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(x7s,"urnParse");function w7s(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=aur(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(w7s,"urnSerialize");function R7s(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!v7s(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a(R7s,"urnuuidParse");function P7s(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(P7s,"urnuuidSerialize");var gzn={scheme:"http",domainHost:!0,parse:hzn,serialize:mzn},k7s={scheme:"https",domainHost:gzn.domainHost,parse:hzn,serialize:mzn},mct={scheme:"ws",domainHost:!0,parse:T7s,serialize:I7s},D7s={scheme:"wss",domainHost:mct.domainHost,parse:mct.parse,serialize:mct.serialize},N7s={scheme:"urn",parse:x7s,serialize:w7s,skipNormalize:!0},M7s={scheme:"urn:uuid",parse:R7s,serialize:P7s,skipNormalize:!0},gct={http:gzn,https:k7s,ws:mct,wss:D7s,urn:N7s,"urn:uuid":M7s};Object.setPrototypeOf(gct,null);function aur(t){return t&&(gct[t]||gct[t.toLowerCase()])||void 0}a(aur,"getSchemeHandler");Azn.exports={wsIsSecure:sur,SCHEMES:gct,isValidSchemeName:S7s,getSchemeHandler:aur}});var Szn=I((oCf,Act)=>{"use strict";p();var{normalizeIPv6:O7s,removeDotSegments:eDe,recomposeAuthority:B7s,normalizePercentEncoding:L7s,normalizePathEncoding:F7s,escapePreservingEscapes:U7s,reescapeHostDelimiters:Q7s,isIPv4:q7s,nonSimpleDomain:j7s}=our(),{SCHEMES:H7s,getSchemeHandler:_zn}=yzn();function G7s(t,e){return typeof t=="string"?t=Y7s(t,e):typeof t=="object"&&(t=Jpe(hX(t,e),e)),t}a(G7s,"normalize");function $7s(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=vzn(Jpe(t,n),Jpe(e,n),n,!0);return n.skipEscape=!0,hX(o,n)}a($7s,"resolve");function vzn(t,e,r,n){let o={};return n||(t=Jpe(hX(t,r),r),e=Jpe(hX(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=eDe(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=eDe(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=eDe(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=eDe(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(vzn,"resolveComponent");function V7s(t,e,r){let n=Ezn(t,r),o=Ezn(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(V7s,"equal");function hX(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=_zn(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=L7s(r.path):(r.path=U7s(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=B7s(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=eDe(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(hX,"serialize");var W7s=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function z7s(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(z7s,"getParseError");function Czn(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(W7s);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=z7s(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(q7s(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=_zn(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&s===!1&&j7s(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=Q7s(unescape(n.host),s))),n.path&&(n.path=F7s(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(Czn,"parseWithStatus");function Jpe(t,e){return Czn(t,e).parsed}a(Jpe,"parse");function Y7s(t,e){return bzn(t,e).normalized}a(Y7s,"normalizeString");function bzn(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Czn(t,e);return{normalized:n?t:hX(r,e),malformedAuthorityOrPort:n}}a(bzn,"normalizeStringWithStatus");function Ezn(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=bzn(t,e);return n?void 0:r}if(typeof t=="object")return hX(t,e)}a(Ezn,"normalizeComparableURI");var cur={SCHEMES:H7s,normalize:G7s,resolve:$7s,resolveComponent:vzn,equal:V7s,serialize:hX,parse:Jpe};Act.exports=cur;Act.exports.default=cur;Act.exports.fastUri=cur});var Izn=I(lur=>{"use strict";p();Object.defineProperty(lur,"__esModule",{value:!0});var Tzn=Szn();Tzn.code='require("ajv/dist/runtime/uri").default';lur.default=Tzn});var Mzn=I($A=>{"use strict";p();Object.defineProperty($A,"__esModule",{value:!0});$A.CodeGen=$A.Name=$A.nil=$A.stringify=$A.str=$A._=$A.KeywordCxt=void 0;var K7s=Z2e();Object.defineProperty($A,"KeywordCxt",{enumerable:!0,get:a(function(){return K7s.KeywordCxt},"get")});var Zpe=ms();Object.defineProperty($A,"_",{enumerable:!0,get:a(function(){return Zpe._},"get")});Object.defineProperty($A,"str",{enumerable:!0,get:a(function(){return Zpe.str},"get")});Object.defineProperty($A,"stringify",{enumerable:!0,get:a(function(){return Zpe.stringify},"get")});Object.defineProperty($A,"nil",{enumerable:!0,get:a(function(){return Zpe.nil},"get")});Object.defineProperty($A,"Name",{enumerable:!0,get:a(function(){return Zpe.Name},"get")});Object.defineProperty($A,"CodeGen",{enumerable:!0,get:a(function(){return Zpe.CodeGen},"get")});var J7s=fct(),kzn=X2e(),Z7s=Llr(),tDe=hct(),X7s=ms(),rDe=Y2e(),yct=z2e(),dur=za(),xzn=azn(),eQs=Izn(),Dzn=a((t,e)=>new RegExp(t,e),"defaultRegExp");Dzn.code="new RegExp";var tQs=["removeAdditional","useDefaults","coerceTypes"],rQs=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),nQs={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."},iQs={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},wzn=200;function oQs(t){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D;let N=t.strict,B=(e=t.code)===null||e===void 0?void 0:e.optimize,L=B===!0||B===void 0?1:B||0,j=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Dzn,M=(o=t.uriResolver)!==null&&o!==void 0?o:eQs.default;return{strictSchema:(c=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&c!==void 0?c:!0,strictNumbers:(u=(l=t.strictNumbers)!==null&&l!==void 0?l:N)!==null&&u!==void 0?u:!0,strictTypes:(f=(d=t.strictTypes)!==null&&d!==void 0?d:N)!==null&&f!==void 0?f:"log",strictTuples:(m=(h=t.strictTuples)!==null&&h!==void 0?h:N)!==null&&m!==void 0?m:"log",strictRequired:(A=(g=t.strictRequired)!==null&&g!==void 0?g:N)!==null&&A!==void 0?A:!1,code:t.code?{...t.code,optimize:L,regExp:j}:{optimize:L,regExp:j},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:wzn,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:wzn,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(oQs,"requiredOptions");var nDe=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,...oQs(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new X7s.ValueScope({scope:{},prefixes:rQs,es5:r,lines:n}),this.logger=dQs(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Z7s.getRules)(),Rzn.call(this,nQs,e,"NOT SUPPORTED"),Rzn.call(this,iQs,e,"DEPRECATED","warn"),this._metaOpts=lQs.call(this),e.formats&&aQs.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&cQs.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),sQs.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=xzn;n==="id"&&(o={...xzn},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 kzn.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,rDe.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 tDe.SchemaEnv({schema:{},schemaId:n});if(r=tDe.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,rDe.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(pQs.call(this,n,r),!r)return(0,dur.eachItem)(n,s=>uur.call(this,s)),this;mQs.call(this,r);let o={...r,type:(0,yct.getJSONTypes)(r.type),schemaType:(0,yct.getJSONTypes)(r.schemaType)};return(0,dur.eachItem)(n,o.type.length===0?s=>uur.call(this,s,o):s=>o.type.forEach(c=>uur.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]=Nzn(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,rDe.normalizeId)(c||n);let d=rDe.getSchemaRefs.call(this,e,n);return u=new tDe.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):tDe.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{tDe.compileSchema.call(this,e)}finally{this.opts=r}}};nDe.ValidationError=J7s.default;nDe.MissingRefError=kzn.default;$A.default=nDe;function Rzn(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(Rzn,"checkOptions");function Pzn(t){return t=(0,rDe.normalizeId)(t),this.schemas[t]||this.refs[t]}a(Pzn,"getSchEnv");function sQs(){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(sQs,"addInitialSchemas");function aQs(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(aQs,"addInitialFormats");function cQs(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(cQs,"addInitialKeywords");function lQs(){let t={...this.opts};for(let e of tQs)delete t[e];return t}a(lQs,"getMetaSchemaOptions");var uQs={log(){},warn(){},error(){}};function dQs(t){if(t===!1)return uQs;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(dQs,"getLogger");var fQs=/^[a-z_$][a-z0-9_$:-]*$/i;function pQs(t,e){let{RULES:r}=this;if((0,dur.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!fQs.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(pQs,"checkKeyword");function uur(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,yct.getJSONTypes)(e.type),schemaType:(0,yct.getJSONTypes)(e.schemaType)}};e.before?hQs.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(uur,"addRule");function hQs(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(hQs,"addBeforeRule");function mQs(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Nzn(e)),t.validateSchema=this.compile(e,!0))}a(mQs,"keywordMetaschema");var gQs={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Nzn(t){return{anyOf:[t,gQs]}}a(Nzn,"schemaOrData")});var Ozn=I(fur=>{"use strict";p();Object.defineProperty(fur,"__esModule",{value:!0});var AQs={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};fur.default=AQs});var Uzn=I(mX=>{"use strict";p();Object.defineProperty(mX,"__esModule",{value:!0});mX.callRef=mX.getValidate=void 0;var yQs=X2e(),Bzn=Vw(),_b=ms(),Xpe=t8(),Lzn=hct(),Ect=za(),EQs={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=Lzn.resolveRef.call(u,d,o,r);if(f===void 0)throw new yQs.default(n.opts.uriResolver,o,r);if(f instanceof Lzn.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return _ct(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return _ct(t,(0,_b._)`${A}.validate`,d,d.$async)}function m(A){let y=Fzn(t,A);_ct(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,_b.stringify)(A)}:{ref:A}),E=e.name("valid"),_=t.subschema({schema:A,dataTypes:[],schemaPath:_b.nil,topSchemaRef:y,errSchemaPath:r},E);t.mergeEvaluated(_),t.ok(E)}}};function Fzn(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,_b._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(Fzn,"getValidate");mX.getValidate=Fzn;function _ct(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?Xpe.default.this:_b.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,_b._)`await ${(0,Bzn.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,_b._)`!(${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,Bzn.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,_b._)`${A}.errors`;o.assign(Xpe.default.vErrors,(0,_b._)`${Xpe.default.vErrors} === null ? ${y} : ${Xpe.default.vErrors}.concat(${y})`),o.assign(Xpe.default.errors,(0,_b._)`${Xpe.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=Ect.mergeEvaluated.props(o,E.props,s.props));else{let _=o.var("props",(0,_b._)`${A}.evaluated.props`);s.props=Ect.mergeEvaluated.props(o,_,s.props,_b.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=Ect.mergeEvaluated.items(o,E.items,s.items));else{let _=o.var("items",(0,_b._)`${A}.evaluated.items`);s.items=Ect.mergeEvaluated.items(o,_,s.items,_b.Name)}}a(g,"addEvaluatedFrom")}a(_ct,"callRef");mX.callRef=_ct;mX.default=EQs});var Qzn=I(pur=>{"use strict";p();Object.defineProperty(pur,"__esModule",{value:!0});var _Qs=Ozn(),vQs=Uzn(),CQs=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",_Qs.default,vQs.default];pur.default=CQs});var qzn=I(hur=>{"use strict";p();Object.defineProperty(hur,"__esModule",{value:!0});var vct=ms(),hH=vct.operators,Cct={maximum:{okStr:"<=",ok:hH.LTE,fail:hH.GT},minimum:{okStr:">=",ok:hH.GTE,fail:hH.LT},exclusiveMaximum:{okStr:"<",ok:hH.LT,fail:hH.GTE},exclusiveMinimum:{okStr:">",ok:hH.GT,fail:hH.LTE}},bQs={message:a(({keyword:t,schemaCode:e})=>(0,vct.str)`must be ${Cct[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,vct._)`{comparison: ${Cct[t].okStr}, limit: ${e}}`,"params")},SQs={keyword:Object.keys(Cct),type:"number",schemaType:"number",$data:!0,error:bQs,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,vct._)`${r} ${Cct[e].fail} ${n} || isNaN(${r})`)}};hur.default=SQs});var jzn=I(mur=>{"use strict";p();Object.defineProperty(mur,"__esModule",{value:!0});var iDe=ms(),TQs={message:a(({schemaCode:t})=>(0,iDe.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,iDe._)`{multipleOf: ${t}}`,"params")},IQs={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:TQs,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,iDe._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,iDe._)`${c} !== parseInt(${c})`;t.fail$data((0,iDe._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};mur.default=IQs});var Gzn=I(gur=>{"use strict";p();Object.defineProperty(gur,"__esModule",{value:!0});function Hzn(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(Aur,"__esModule",{value:!0});var gX=ms(),xQs=za(),wQs=Gzn(),RQs={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,gX.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,gX._)`{limit: ${t}}`,"params")},PQs={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:RQs,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?gX.operators.GT:gX.operators.LT,c=o.opts.unicode===!1?(0,gX._)`${r}.length`:(0,gX._)`${(0,xQs.useFunc)(t.gen,wQs.default)}(${r})`;t.fail$data((0,gX._)`${c} ${s} ${n}`)}};Aur.default=PQs});var Vzn=I(yur=>{"use strict";p();Object.defineProperty(yur,"__esModule",{value:!0});var kQs=Vw(),DQs=za(),ehe=ms(),NQs={message:a(({schemaCode:t})=>(0,ehe.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,ehe._)`{pattern: ${t}}`,"params")},MQs={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,ehe._)`new RegExp`:(0,DQs.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,ehe._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,ehe._)`!${f}`)}else{let u=(0,kQs.usePattern)(t,o);t.fail$data((0,ehe._)`!${u}.test(${r})`)}}};yur.default=MQs});var Wzn=I(Eur=>{"use strict";p();Object.defineProperty(Eur,"__esModule",{value:!0});var oDe=ms(),OQs={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,oDe.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,oDe._)`{limit: ${t}}`,"params")},BQs={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:OQs,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?oDe.operators.GT:oDe.operators.LT;t.fail$data((0,oDe._)`Object.keys(${r}).length ${o} ${n}`)}};Eur.default=BQs});var zzn=I(_ur=>{"use strict";p();Object.defineProperty(_ur,"__esModule",{value:!0});var sDe=Vw(),aDe=ms(),LQs=za(),FQs={message:a(({params:{missingProperty:t}})=>(0,aDe.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,aDe._)`{missingProperty: ${t}}`,"params")},UQs={keyword:"required",type:"object",schemaType:"array",$data:!0,error:FQs,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,LQs.checkStrictMode)(c,_,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(aDe.nil,h);else for(let g of r)(0,sDe.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,sDe.checkMissingProp)(t,r,g)),(0,sDe.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,sDe.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,sDe.propertyInData)(e,o,g,l.ownProperties)),e.if((0,aDe.not)(A),()=>{t.error(),e.break()})},aDe.nil)}a(m,"loopUntilMissing")}};_ur.default=UQs});var Yzn=I(vur=>{"use strict";p();Object.defineProperty(vur,"__esModule",{value:!0});var cDe=ms(),QQs={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,cDe.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,cDe._)`{limit: ${t}}`,"params")},qQs={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:QQs,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?cDe.operators.GT:cDe.operators.LT;t.fail$data((0,cDe._)`${r}.length ${o} ${n}`)}};vur.default=qQs});var bct=I(Cur=>{"use strict";p();Object.defineProperty(Cur,"__esModule",{value:!0});var Kzn=$lr();Kzn.code='require("ajv/dist/runtime/equal").default';Cur.default=Kzn});var Jzn=I(Sur=>{"use strict";p();Object.defineProperty(Sur,"__esModule",{value:!0});var bur=z2e(),VA=ms(),jQs=za(),HQs=bct(),GQs={message:a(({params:{i:t,j:e}})=>(0,VA.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,VA._)`{i: ${t}, j: ${e}}`,"params")},$Qs={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:GQs,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,bur.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,VA._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,VA._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,VA._)`${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,bur.checkDataTypes)(d,E,l.opts.strictNumbers,bur.DataType.Wrong),v=e.const("indices",(0,VA._)`{}`);e.for((0,VA._)`;${A}--;`,()=>{e.let(E,(0,VA._)`${r}[${A}]`),e.if(_,(0,VA._)`continue`),d.length>1&&e.if((0,VA._)`typeof ${E} == "string"`,(0,VA._)`${E} += "_"`),e.if((0,VA._)`typeof ${v}[${E}] == "number"`,()=>{e.assign(y,(0,VA._)`${v}[${E}]`),t.error(),e.assign(u,!1).break()}).code((0,VA._)`${v}[${E}] = ${A}`)})}a(m,"loopN");function g(A,y){let E=(0,jQs.useFunc)(e,HQs.default),_=e.name("outer");e.label(_).for((0,VA._)`;${A}--;`,()=>e.for((0,VA._)`${y} = ${A}; ${y}--;`,()=>e.if((0,VA._)`${E}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(_)})))}a(g,"loopN2")}};Sur.default=$Qs});var Zzn=I(Iur=>{"use strict";p();Object.defineProperty(Iur,"__esModule",{value:!0});var Tur=ms(),VQs=za(),WQs=bct(),zQs={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,Tur._)`{allowedValue: ${t}}`,"params")},YQs={keyword:"const",$data:!0,error:zQs,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,Tur._)`!${(0,VQs.useFunc)(e,WQs.default)}(${r}, ${o})`):t.fail((0,Tur._)`${s} !== ${r}`)}};Iur.default=YQs});var Xzn=I(xur=>{"use strict";p();Object.defineProperty(xur,"__esModule",{value:!0});var lDe=ms(),KQs=za(),JQs=bct(),ZQs={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,lDe._)`{allowedValues: ${t}}`,"params")},XQs={keyword:"enum",schemaType:"array",$data:!0,error:ZQs,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,KQs.useFunc)(e,JQs.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,lDe.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,lDe._)`${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,lDe._)`${d()}(${r}, ${g}[${A}])`:(0,lDe._)`${r} === ${y}`}a(m,"equalCode")}};xur.default=XQs});var eYn=I(wur=>{"use strict";p();Object.defineProperty(wur,"__esModule",{value:!0});var eqs=qzn(),tqs=jzn(),rqs=$zn(),nqs=Vzn(),iqs=Wzn(),oqs=zzn(),sqs=Yzn(),aqs=Jzn(),cqs=Zzn(),lqs=Xzn(),uqs=[eqs.default,tqs.default,rqs.default,nqs.default,iqs.default,oqs.default,sqs.default,aqs.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},cqs.default,lqs.default];wur.default=uqs});var Pur=I(uDe=>{"use strict";p();Object.defineProperty(uDe,"__esModule",{value:!0});uDe.validateAdditionalItems=void 0;var AX=ms(),Rur=za(),dqs={message:a(({params:{len:t}})=>(0,AX.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,AX._)`{limit: ${t}}`,"params")},fqs={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:dqs,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Rur.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}tYn(t,n)}};function tYn(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,AX._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,AX._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Rur.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,AX._)`${l} <= ${e.length}`);r.if((0,AX.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:Rur.Type.Num},d),c.allErrors||r.if((0,AX.not)(d),()=>r.break())})}a(u,"validateItems")}a(tYn,"validateAdditionalItems");uDe.validateAdditionalItems=tYn;uDe.default=fqs});var kur=I(dDe=>{"use strict";p();Object.defineProperty(dDe,"__esModule",{value:!0});dDe.validateTuple=void 0;var rYn=ms(),Sct=za(),pqs=Vw(),hqs={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return nYn(t,"additionalItems",e);r.items=!0,!(0,Sct.alwaysValidSchema)(r,e)&&t.ok((0,pqs.validateArray)(t))}};function nYn(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=Sct.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,rYn._)`${s}.length`);r.forEach((h,m)=>{(0,Sct.alwaysValidSchema)(l,h)||(n.if((0,rYn._)`${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,Sct.checkStrictMode)(l,E,m.strictTuples)}}a(f,"checkStrictTuple")}a(nYn,"validateTuple");dDe.validateTuple=nYn;dDe.default=hqs});var iYn=I(Dur=>{"use strict";p();Object.defineProperty(Dur,"__esModule",{value:!0});var mqs=kur(),gqs={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,mqs.validateTuple)(t,"items"),"code")};Dur.default=gqs});var sYn=I(Nur=>{"use strict";p();Object.defineProperty(Nur,"__esModule",{value:!0});var oYn=ms(),Aqs=za(),yqs=Vw(),Eqs=Pur(),_qs={message:a(({params:{len:t}})=>(0,oYn.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,oYn._)`{limit: ${t}}`,"params")},vqs={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:_qs,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,Aqs.alwaysValidSchema)(n,e)&&(o?(0,Eqs.validateAdditionalItems)(t,o):t.ok((0,yqs.validateArray)(t)))}};Nur.default=vqs});var aYn=I(Mur=>{"use strict";p();Object.defineProperty(Mur,"__esModule",{value:!0});var zw=ms(),Tct=za(),Cqs={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")},bqs={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Cqs,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,Tct.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,Tct.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Tct.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:Tct.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")}};Mur.default=bqs});var uYn=I(j5=>{"use strict";p();Object.defineProperty(j5,"__esModule",{value:!0});j5.validateSchemaDeps=j5.validatePropertyDeps=j5.error=void 0;var Our=ms(),Sqs=za(),fDe=Vw();j5.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Our.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Our._)`{property: ${t}, +${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 + || (${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}, missingProperty: ${n}, depsCount: ${e}, - deps: ${r}}`,"params")};var Tqs={keyword:"dependencies",type:"object",schemaType:"object",error:j5.error,code(t){let[e,r]=Iqs(t);cYn(t,e),lYn(t,r)}};function Iqs({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(Iqs,"splitDependencies");function cYn(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,fDe.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,fDe.checkReportMissingProp)(t,d)}):(r.if((0,Our._)`${u} && (${(0,fDe.checkMissingProp)(t,l,s)})`),(0,fDe.reportMissingProp)(t,s),r.else())}}a(cYn,"validatePropertyDeps");j5.validatePropertyDeps=cYn;function lYn(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,Sqs.alwaysValidSchema)(s,e[l])||(r.if((0,fDe.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(lYn,"validateSchemaDeps");j5.validateSchemaDeps=lYn;j5.default=Tqs});var fYn=I(Bur=>{"use strict";p();Object.defineProperty(Bur,"__esModule",{value:!0});var dYn=ms(),xqs=za(),wqs={message:"property name must be valid",params:a(({params:t})=>(0,dYn._)`{propertyName: ${t.propertyName}}`,"params")},Rqs={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:wqs,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,xqs.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,dYn.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Bur.default=Rqs});var Fur=I(Lur=>{"use strict";p();Object.defineProperty(Lur,"__esModule",{value:!0});var Ict=Vw(),P2=ms(),Pqs=t8(),xct=za(),kqs={message:"must NOT have additional properties",params:a(({params:t})=>(0,P2._)`{additionalProperty: ${t.additionalProperty}}`,"params")},Dqs={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:kqs,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,xct.alwaysValidSchema)(c,r))return;let d=(0,Ict.allSchemaProperties)(n.properties),f=(0,Ict.allSchemaProperties)(n.patternProperties);h(),t.ok((0,P2._)`${s} === ${Pqs.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,xct.schemaRefOrVal)(c,n.properties,"properties");_=(0,Ict.isOwnProperty)(e,v,E)}else d.length?_=(0,P2.or)(...d.map(v=>(0,P2._)`${E} === ${v}`)):_=P2.nil;return f.length&&(_=(0,P2.or)(_,...f.map(v=>(0,P2._)`${(0,Ict.usePattern)(t,v)}.test(${E})`))),(0,P2.not)(_)}a(m,"isAdditional");function g(E){e.code((0,P2._)`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,xct.alwaysValidSchema)(c,r)){let _=e.name("valid");u.removeAdditional==="failing"?(y(E,_,!1),e.if((0,P2.not)(_),()=>{t.reset(),g(E)})):(y(E,_),l||e.if((0,P2.not)(_),()=>e.break()))}}a(A,"additionalPropertyCode");function y(E,_,v){let b={keyword:"additionalProperties",dataProp:E,dataPropType:xct.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}a(y,"applyAdditionalSchema")}};Lur.default=Dqs});var mYn=I(Qur=>{"use strict";p();Object.defineProperty(Qur,"__esModule",{value:!0});var Nqs=Z2e(),pYn=Vw(),Uur=za(),hYn=Fur(),Mqs={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&&hYn.default.code(new Nqs.KeywordCxt(s,hYn.default,"additionalProperties"));let c=(0,pYn.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=Uur.mergeEvaluated.props(e,(0,Uur.toHash)(c),s.props));let l=c.filter(h=>!(0,Uur.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,pYn.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")}};Qur.default=Mqs});var EYn=I(qur=>{"use strict";p();Object.defineProperty(qur,"__esModule",{value:!0});var gYn=Vw(),wct=ms(),AYn=za(),yYn=za(),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,gYn.allSchemaProperties)(r),u=l.filter(y=>(0,AYn.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 wct.Name)&&(s.props=(0,yYn.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,AYn.checkStrictMode)(s,`property ${E} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,E=>{e.if((0,wct._)`${(0,gYn.usePattern)(t,y)}.test(${E})`,()=>{let _=u.includes(y);_||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:E,dataPropType:yYn.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,wct._)`${h}[${E}]`,!0):!_&&!s.allErrors&&e.if((0,wct.not)(f),()=>e.break())})})}a(A,"validateProperties")}};qur.default=Oqs});var _Yn=I(jur=>{"use strict";p();Object.defineProperty(jur,"__esModule",{value:!0});var Bqs=za(),Lqs={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,Bqs.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"}};jur.default=Lqs});var vYn=I(Hur=>{"use strict";p();Object.defineProperty(Hur,"__esModule",{value:!0});var Fqs=Vw(),Uqs={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Fqs.validateUnion,error:{message:"must match a schema in anyOf"}};Hur.default=Uqs});var CYn=I(Gur=>{"use strict";p();Object.defineProperty(Gur,"__esModule",{value:!0});var Rct=ms(),Qqs=za(),qqs={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,Rct._)`{passingSchemas: ${t.passing}}`,"params")},jqs={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:qqs,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,Qqs.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,Rct._)`${u} && ${c}`).assign(c,!1).assign(l,(0,Rct._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,Rct.Name)})})}a(d,"validateOneOf")}};Gur.default=jqs});var bYn=I($ur=>{"use strict";p();Object.defineProperty($ur,"__esModule",{value:!0});var Hqs=za(),Gqs={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,Hqs.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};$ur.default=Gqs});var IYn=I(Vur=>{"use strict";p();Object.defineProperty(Vur,"__esModule",{value:!0});var Pct=ms(),TYn=za(),$qs={message:a(({params:t})=>(0,Pct.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,Pct._)`{failingKeyword: ${t.ifClause}}`,"params")},Vqs={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:$qs,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,TYn.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=SYn(n,"then"),s=SYn(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,Pct.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,Pct._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function SYn(t,e){let r=t.schema[e];return r!==void 0&&!(0,TYn.alwaysValidSchema)(t,r)}a(SYn,"hasSchema");Vur.default=Vqs});var xYn=I(Wur=>{"use strict";p();Object.defineProperty(Wur,"__esModule",{value:!0});var Wqs=za(),zqs={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Wqs.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Wur.default=zqs});var wYn=I(zur=>{"use strict";p();Object.defineProperty(zur,"__esModule",{value:!0});var Yqs=Pur(),Kqs=iYn(),Jqs=kur(),Zqs=sYn(),Xqs=aYn(),ejs=uYn(),tjs=fYn(),rjs=Fur(),njs=mYn(),ijs=EYn(),ojs=_Yn(),sjs=vYn(),ajs=CYn(),cjs=bYn(),ljs=IYn(),ujs=xYn();function djs(t=!1){let e=[ojs.default,sjs.default,ajs.default,cjs.default,ljs.default,ujs.default,tjs.default,rjs.default,ejs.default,njs.default,ijs.default];return t?e.push(Kqs.default,Zqs.default):e.push(Yqs.default,Jqs.default),e.push(Xqs.default),e}a(djs,"getApplicator");zur.default=djs});var RYn=I(Yur=>{"use strict";p();Object.defineProperty(Yur,"__esModule",{value:!0});var oh=ms(),fjs={message:a(({schemaCode:t})=>(0,oh.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,oh._)`{format: ${t}}`,"params")},pjs={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:fjs,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,oh._)`${A}[${c}]`),E=r.let("fType"),_=r.let("format");r.if((0,oh._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(E,(0,oh._)`${y}.type || "string"`).assign(_,(0,oh._)`${y}.validate`),()=>r.assign(E,(0,oh._)`"string"`).assign(_,y)),t.fail$data((0,oh.or)(v(),b()));function v(){return u.strictSchema===!1?oh.nil:(0,oh._)`${c} && !${_}`}a(v,"unknownFmt");function b(){let T=f.$async?(0,oh._)`(${y}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,oh._)`${_}(${n})`,w=(0,oh._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${n}))`;return(0,oh._)`${_} && ${_} !== 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,oh.regexpCode)(w):u.code.formats?(0,oh._)`${u.code.formats}${(0,oh.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,oh._)`${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,oh._)`await ${_}(${n})`}return typeof E=="function"?(0,oh._)`${_}(${n})`:(0,oh._)`${_}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};Yur.default=pjs});var PYn=I(Kur=>{"use strict";p();Object.defineProperty(Kur,"__esModule",{value:!0});var hjs=RYn(),mjs=[hjs.default];Kur.default=mjs});var kYn=I(the=>{"use strict";p();Object.defineProperty(the,"__esModule",{value:!0});the.contentVocabulary=the.metadataVocabulary=void 0;the.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];the.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var NYn=I(Jur=>{"use strict";p();Object.defineProperty(Jur,"__esModule",{value:!0});var gjs=Qzn(),Ajs=eYn(),yjs=wYn(),Ejs=PYn(),DYn=kYn(),_js=[gjs.default,Ajs.default,(0,yjs.default)(),Ejs.default,DYn.metadataVocabulary,DYn.contentVocabulary];Jur.default=_js});var OYn=I(kct=>{"use strict";p();Object.defineProperty(kct,"__esModule",{value:!0});kct.DiscrError=void 0;var MYn;(function(t){t.Tag="tag",t.Mapping="mapping"})(MYn||(kct.DiscrError=MYn={}))});var LYn=I(Xur=>{"use strict";p();Object.defineProperty(Xur,"__esModule",{value:!0});var rhe=ms(),Zur=OYn(),BYn=hct(),vjs=X2e(),Cjs=za(),bjs={message:a(({params:{discrError:t,tagName:e}})=>t===Zur.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,rhe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},Sjs={keyword:"discriminator",type:"object",schemaType:"object",error:bjs,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,rhe._)`${r}${(0,rhe.getProperty)(l)}`);e.if((0,rhe._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:Zur.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,rhe._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:Zur.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,rhe.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=_(o),E=!0;for(let T=0;T{Tjs.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 tdr=I((ud,edr)=>{"use strict";p();Object.defineProperty(ud,"__esModule",{value:!0});ud.MissingRefError=ud.ValidationError=ud.CodeGen=ud.Name=ud.nil=ud.stringify=ud.str=ud._=ud.KeywordCxt=ud.Ajv=void 0;var Ijs=Mzn(),xjs=NYn(),wjs=LYn(),UYn=FYn(),Rjs=["/properties"],Dct="http://json-schema.org/draft-07/schema",nhe=class extends Ijs.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),xjs.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(wjs.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(UYn,Rjs):UYn;this.addMetaSchema(e,Dct,!1),this.refs["http://json-schema.org/schema"]=Dct}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Dct)?Dct:void 0)}};ud.Ajv=nhe;edr.exports=ud=nhe;edr.exports.Ajv=nhe;Object.defineProperty(ud,"__esModule",{value:!0});ud.default=nhe;var Pjs=Z2e();Object.defineProperty(ud,"KeywordCxt",{enumerable:!0,get:a(function(){return Pjs.KeywordCxt},"get")});var ihe=ms();Object.defineProperty(ud,"_",{enumerable:!0,get:a(function(){return ihe._},"get")});Object.defineProperty(ud,"str",{enumerable:!0,get:a(function(){return ihe.str},"get")});Object.defineProperty(ud,"stringify",{enumerable:!0,get:a(function(){return ihe.stringify},"get")});Object.defineProperty(ud,"nil",{enumerable:!0,get:a(function(){return ihe.nil},"get")});Object.defineProperty(ud,"Name",{enumerable:!0,get:a(function(){return ihe.Name},"get")});Object.defineProperty(ud,"CodeGen",{enumerable:!0,get:a(function(){return ihe.CodeGen},"get")});var kjs=fct();Object.defineProperty(ud,"ValidationError",{enumerable:!0,get:a(function(){return kjs.default},"get")});var Djs=X2e();Object.defineProperty(ud,"MissingRefError",{enumerable:!0,get:a(function(){return Djs.default},"get")})});var WYn=I(G5=>{"use strict";p();Object.defineProperty(G5,"__esModule",{value:!0});G5.formatNames=G5.fastFormats=G5.fullFormats=void 0;function H5(t,e){return{validate:t,compare:e}}a(H5,"fmtDef");G5.fullFormats={date:H5(HYn,odr),time:H5(ndr(!0),sdr),"date-time":H5(QYn(!0),$Yn),"iso-time":H5(ndr(),GYn),"iso-date-time":H5(QYn(),VYn),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Fjs,"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:$js,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:Ujs,int32:{type:"number",validate:jjs},int64:{type:"number",validate:Hjs},float:{type:"number",validate:jYn},double:{type:"number",validate:jYn},password:!0,binary:!0};G5.fastFormats={...G5.fullFormats,date:H5(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,odr),time:H5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,sdr),"date-time":H5(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,$Yn),"iso-time":H5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,GYn),"iso-date-time":H5(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,VYn),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};G5.formatNames=Object.keys(G5.fullFormats);function Njs(t){return t%4===0&&(t%100!==0||t%400===0)}a(Njs,"isLeapYear");var Mjs=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Ojs=[0,31,28,31,30,31,30,31,31,30,31,30,31];function HYn(t){let e=Mjs.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(HYn,"date");function odr(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(ndr,"getTime");function sdr(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(sdr,"compareTime");function GYn(t,e){if(!(t&&e))return;let r=rdr.exec(t),n=rdr.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=Qjs}a(jjs,"validateInt32");function Hjs(t){return Number.isInteger(t)}a(Hjs,"validateInt64");function jYn(){return!0}a(jYn,"validateNumber");var Gjs=/[^\\]\\Z/;function $js(t){if(Gjs.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a($js,"regex")});var zYn=I(ohe=>{"use strict";p();Object.defineProperty(ohe,"__esModule",{value:!0});ohe.formatLimitDefinition=void 0;var Vjs=tdr(),k2=ms(),mH=k2.operators,Nct={formatMaximum:{okStr:"<=",ok:mH.LTE,fail:mH.GT},formatMinimum:{okStr:">=",ok:mH.GTE,fail:mH.LT},formatExclusiveMaximum:{okStr:"<",ok:mH.LT,fail:mH.GTE},formatExclusiveMinimum:{okStr:">",ok:mH.GT,fail:mH.LTE}},Wjs={message:a(({keyword:t,schemaCode:e})=>(0,k2.str)`should be ${Nct[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,k2._)`{comparison: ${Nct[t].okStr}, limit: ${e}}`,"params")};ohe.formatLimitDefinition={keyword:Object.keys(Nct),type:"string",schemaType:"string",$data:!0,error:Wjs,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 Vjs.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,k2._)`${m}[${u.schemaCode}]`);t.fail$data((0,k2.or)((0,k2._)`typeof ${g} != "object"`,(0,k2._)`${g} instanceof RegExp`,(0,k2._)`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,k2._)`${c.code.formats}${(0,k2.getProperty)(m)}`:void 0});t.fail$data(h(A))}a(f,"validateFormat");function h(m){return(0,k2._)`${m}.compare(${r}, ${n}) ${Nct[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var zjs=a(t=>(t.addKeyword(ohe.formatLimitDefinition),t),"formatLimitPlugin");ohe.default=zjs});var ZYn=I((pDe,JYn)=>{"use strict";p();Object.defineProperty(pDe,"__esModule",{value:!0});var she=WYn(),Yjs=zYn(),adr=ms(),YYn=new adr.Name("fullFormats"),Kjs=new adr.Name("fastFormats"),cdr=a((t,e={keywords:!0})=>{if(Array.isArray(e))return KYn(t,e,she.fullFormats,YYn),t;let[r,n]=e.mode==="fast"?[she.fastFormats,Kjs]:[she.fullFormats,YYn],o=e.formats||she.formatNames;return KYn(t,o,r,n),e.keywords&&(0,Yjs.default)(t),t},"formatsPlugin");cdr.get=(t,e="full")=>{let n=(e==="fast"?she.fastFormats:she.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function KYn(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,adr._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a(KYn,"addFormats");JYn.exports=pDe=cdr;Object.defineProperty(pDe,"__esModule",{value:!0});pDe.default=cdr});var xKn=I((qTf,IKn)=>{p();IKn.exports=TKn;TKn.sync=sHs;var bKn=require("fs");function oHs(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();kKn.exports=RKn;RKn.sync=aHs;var wKn=require("fs");function RKn(t,e,r){wKn.stat(t,function(n,o){r(n,n?!1:PKn(o,e))})}a(RKn,"isexe");function aHs(t,e){return PKn(wKn.statSync(t),e)}a(aHs,"sync");function PKn(t,e){return t.isFile()&&cHs(t,e)}a(PKn,"checkStat");function cHs(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(cHs,"checkMode")});var MKn=I((zTf,NKn)=>{p();var WTf=require("fs"),Yct;process.platform==="win32"||global.TESTING_WINDOWS?Yct=xKn():Yct=DKn();NKn.exports=Sdr;Sdr.sync=lHs;function Sdr(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){Sdr(t,e||{},function(s,c){s?o(s):n(c)})})}Yct(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(Sdr,"isexe");function lHs(t,e){try{return Yct.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(lHs,"sync")});var qKn=I((JTf,QKn)=>{p();var Ahe=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",OKn=require("path"),uHs=Ahe?";":":",BKn=MKn(),LKn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),FKn=a((t,e)=>{let r=e.colon||uHs,n=t.match(/\//)||Ahe&&t.match(/\\/)?[""]:[...Ahe?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=Ahe?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Ahe?o.split(r):[""];return Ahe&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),UKn=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=FKn(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(LKn(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=OKn.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];BKn(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"),dHs=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=FKn(t,e),s=[];for(let c=0;c{"use strict";p();var jKn=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");Tdr.exports=jKn;Tdr.exports.default=jKn});var WKn=I((nIf,VKn)=>{"use strict";p();var GKn=require("path"),fHs=qKn(),pHs=HKn();function $Kn(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=fHs.sync(t.command,{path:r[pHs({env:r})],pathExt:e?GKn.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=GKn.resolve(o?t.options.cwd:"",c)),c}a($Kn,"resolveCommandAttempt");function hHs(t){return $Kn(t)||$Kn(t,!0)}a(hHs,"resolveCommand");VKn.exports=hHs});var zKn=I((sIf,xdr)=>{"use strict";p();var Idr=/([()\][%!^"`<>&|;, *?])/g;function mHs(t){return t=t.replace(Idr,"^$1"),t}a(mHs,"escapeCommand");function gHs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Idr,"^$1"),e&&(t=t.replace(Idr,"^$1")),t}a(gHs,"escapeArgument");xdr.exports.command=mHs;xdr.exports.argument=gHs});var KKn=I((lIf,YKn)=>{"use strict";p();YKn.exports=/^#!(.*)/});var ZKn=I((dIf,JKn)=>{"use strict";p();var AHs=KKn();JKn.exports=(t="")=>{let e=t.match(AHs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var eJn=I((pIf,XKn)=>{"use strict";p();var wdr=require("fs"),yHs=ZKn();function EHs(t){let r=Buffer.alloc(150),n;try{n=wdr.openSync(t,"r"),wdr.readSync(n,r,0,150,0),wdr.closeSync(n)}catch{}return yHs(r.toString())}a(EHs,"readShebang");XKn.exports=EHs});var iJn=I((gIf,nJn)=>{"use strict";p();var _Hs=require("path"),tJn=WKn(),rJn=zKn(),vHs=eJn(),CHs=process.platform==="win32",bHs=/\.(?:com|exe)$/i,SHs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function THs(t){t.file=tJn(t);let e=t.file&&vHs(t.file);return e?(t.args.unshift(t.file),t.command=e,tJn(t)):t.file}a(THs,"detectShebang");function IHs(t){if(!CHs)return t;let e=THs(t),r=!bHs.test(e);if(t.options.forceShell||r){let n=SHs.test(e);t.command=_Hs.normalize(t.command),t.command=rJn.command(t.command),t.args=t.args.map(s=>rJn.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(IHs,"parseNonShell");function xHs(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:IHs(n)}a(xHs,"parse");nJn.exports=xHs});var aJn=I((EIf,sJn)=>{"use strict";p();var Rdr=process.platform==="win32";function Pdr(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(Pdr,"notFoundError");function wHs(t,e){if(!Rdr)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=oJn(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(wHs,"hookChildProcess");function oJn(t,e){return Rdr&&t===1&&!e.file?Pdr(e.original,"spawn"):null}a(oJn,"verifyENOENT");function RHs(t,e){return Rdr&&t===1&&!e.file?Pdr(e.original,"spawnSync"):null}a(RHs,"verifyENOENTSync");sJn.exports={hookChildProcess:wHs,verifyENOENT:oJn,verifyENOENTSync:RHs,notFoundError:Pdr}});var uJn=I((CIf,yhe)=>{"use strict";p();var cJn=require("child_process"),kdr=iJn(),Ddr=aJn();function lJn(t,e,r){let n=kdr(t,e,r),o=cJn.spawn(n.command,n.args,n.options);return Ddr.hookChildProcess(o,n),o}a(lJn,"spawn");function PHs(t,e,r){let n=kdr(t,e,r),o=cJn.spawnSync(n.command,n.args,n.options);return o.error=o.error||Ddr.verifyENOENTSync(o.status,n),o}a(PHs,"spawnSync");yhe.exports=lJn;yhe.exports.spawn=lJn;yhe.exports.sync=PHs;yhe.exports._parse=kdr;yhe.exports._enoent=Ddr});function xX(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(kDe(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(Ydr(b)){do n++,o+=String.fromCharCode(b),b=t.charCodeAt(n);while(Ydr(b));return c=15}if(kDe(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 Ydr(t){return t===32||t===9}function kDe(t){return t===10||t===13}function Che(t){return t>=48&&t<=57}var qJn,ult=_e(()=>{"use strict";p();a(xX,"createScanner");a(Ydr,"isWhiteSpace");a(kDe,"isLineBreak");a(Che,"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"})(qJn||(qJn={}))});var kT,bhe,Kdr,jJn,HJn=_e(()=>{p();kT=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),bhe=200,Kdr={" ":{"\n":new Array(bhe).fill(0).map((t,e)=>` -`+" ".repeat(e)),"\r":new Array(bhe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(bhe).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}," ":{"\n":new Array(bhe).fill(0).map((t,e)=>` -`+" ".repeat(e)),"\r":new Array(bhe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(bhe).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}},jJn=[` + 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=[` `,"\r",`\r -`]});function dlt(t,e,r){let n,o,s,c,l;if(e){for(c=e.offset,l=c+e.length,s=c;s>0&&!DDe(t,s-1);)s--;let w=l;for(;w1)return She(u,f)+She(m,n+h);let w=m.length*(n+h);return!d||w>Kdr[g][u].length?u+She(m,n+h):w<=0?u:Kdr[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(She(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?kT[m.length*n]:She(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(kT[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=kT[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=E():r.keepLines&&(x=kT[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=E():x=kT[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=E():x=kT[1];break;case 12:x=E();break;case 13:f>0?x=E():P||(x=kT[1]);break;case 6:r.keepLines&&f>0?x=E():P||(x=kT[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=kT[1]:R!==5&&R!==17&&(y=!0);break;case 16:y=!0;break}f>0&&(R===12||R===13)&&(x=E())}R===17&&(r.keepLines&&f>0?x=E():x=r.insertFinalNewline?u:"");let D=A.getTokenOffset()+s;b(x,w,D),T=R}return v}function She(t,e){let r="";for(let n=0;n0&&!$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;n{"use strict";p();ult();HJn();a(dlt,"format");a(She,"repeat");a(wGs,"computeIndentLevel");a(RGs,"getEOL");a(DDe,"isEOL")});function GJn(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{ODe(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 plt(t,e=[],r=NDe.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"),ODe(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:WJn(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 MDe(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 Zdr(t){if(!t.parent||!t.parent.children)return[];let e=Zdr(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 flt(t){switch(t.type){case"array":return t.children.map(flt);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=flt(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function kGs(t,e,r=!1){return e>=t.offset&&es===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(c,"toNoArgVisit");function l(M){return M?O=>s===0&&M(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(l,"toOneArgVisit");function u(M){return M?O=>s===0&&M(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}a(u,"toOneArgVisitWithPath");function d(M){return M?()=>{s>0?s++:M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice())===!1&&(s=1)}:()=>!0}a(d,"toBeginVisit");function f(M){return M?()=>{s>0&&s--,s===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}a(f,"toEndVisit");let h=d(e.onObjectBegin),m=u(e.onObjectProperty),g=f(e.onObjectEnd),A=d(e.onArrayBegin),y=f(e.onArrayEnd),E=u(e.onLiteralValue),_=l(e.onSeparator),v=c(e.onComment),b=l(e.onError),T=r&&r.disallowComments,w=r&&r.allowTrailingComma;function R(){for(;;){let M=n.scan();switch(n.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:T||x(11);break;case 2:x(12);break;case 6:x(16);break}switch(M){case 12:case 13:T?x(10):v();break;case 16:x(1);break;case 15:case 14:break;default:return M}}}a(R,"scanNext");function x(M,O=[],q=[]){if(b(M),O.length+q.length>0){let Q=n.getToken();for(;Q!==17;){if(O.indexOf(Q)!==-1){R();break}else if(q.indexOf(Q)!==-1)break;Q=R()}}}a(x,"handleError");function P(M){let O=n.getTokenValue();return M?E(O):(m(O),o.push(O)),R(),!0}a(P,"parseString");function D(){switch(n.getToken()){case 11:let M=n.getTokenValue(),O=Number(M);isNaN(O)&&(x(2),O=0),E(O);break;case 7:E(null);break;case 8:E(!0);break;case 9:E(!1);break;default:return!1}return R(),!0}a(D,"parseLiteral");function N(){return n.getToken()!==10?(x(3,[],[2,5]),!1):(P(!1),n.getToken()===6?(_(":"),R(),j()||x(4,[],[2,5])):x(5,[],[2,5]),o.pop(),!0)}a(N,"parseProperty");function B(){h(),R();let M=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(M||x(4,[],[]),_(","),R(),n.getToken()===2&&w)break}else M&&x(6,[],[]);N()||x(4,[],[2,5]),M=!0}return g(),n.getToken()!==2?x(7,[2],[]):R(),!0}a(B,"parseObject");function L(){A(),R();let M=!0,O=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(O||x(4,[],[]),_(","),R(),n.getToken()===4&&w)break}else O&&x(6,[],[]);M?(o.push(0),M=!1):o[o.length-1]++,j()||x(4,[],[4,5]),O=!0}return y(),M||o.pop(),n.getToken()!==4?x(8,[4],[]):R(),!0}a(L,"parseArray");function j(){switch(n.getToken()){case 3:return L();case 1:return B();case 10:return P(!0);default:return D()}}return a(j,"parseValue"),R(),n.getToken()===17?r.allowEmptyContent?!0:(x(4,[],[]),!1):j()?(n.getToken()!==17&&x(9,[],[]),!0):(x(4,[],[]),!1)}function VJn(t,e){let r=xX(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 WJn(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 NDe,efr=_e(()=>{"use strict";p();ult();(function(t){t.DEFAULT={allowTrailingComma:!1}})(NDe||(NDe={}));a(GJn,"getLocation");a($Jn,"parse");a(plt,"parseTree");a(MDe,"findNodeAtLocation");a(Zdr,"getNodePath");a(flt,"getNodeValue");a(kGs,"contains");a(Xdr,"findNodeAtOffset");a(ODe,"visit");a(VJn,"stripComments");a(WJn,"getNodeType")});function zJn(t,e,r,n){let o=e.slice(),c=plt(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=MDe(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=MDe(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 wX(t,{offset:h,length:m-h,content:""},n)}else return wX(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 wX(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 wX(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 wX(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 wX(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 wX(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function wX(t,e,r){if(!r.formattingOptions)return[e];let n=hlt(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!DDe(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=hlt(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 hlt(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var YJn=_e(()=>{"use strict";p();Jdr();efr();a(zJn,"setProperty");a(wX,"withFormatting");a(hlt,"applyEdit")});var KJn={};Ri(KJn,{ParseErrorCode:()=>nfr,ScanError:()=>tfr,SyntaxKind:()=>rfr,applyEdits:()=>VGs,createScanner:()=>MGs,findNodeAtLocation:()=>LGs,findNodeAtOffset:()=>FGs,format:()=>GGs,getLocation:()=>OGs,getNodePath:()=>UGs,getNodeValue:()=>QGs,modify:()=>$Gs,parse:()=>ifr,parseTree:()=>BGs,printParseErrorCode:()=>HGs,stripComments:()=>jGs,visit:()=>qGs});function HGs(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 dlt(t,e,r)}function $Gs(t,e,r,n){return zJn(t,e,r,n)}function VGs(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=hlt(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var MGs,tfr,rfr,OGs,ifr,BGs,LGs,FGs,UGs,QGs,qGs,jGs,nfr,ofr=_e(()=>{"use strict";p();Jdr();YJn();ult();efr();MGs=xX;(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"})(tfr||(tfr={}));(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"})(rfr||(rfr={}));OGs=GJn,ifr=$Jn,BGs=plt,LGs=MDe,FGs=Xdr,UGs=Zdr,QGs=flt,qGs=ODe,jGs=VJn;(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"})(nfr||(nfr={}));a(HGs,"printParseErrorCode");a(GGs,"format");a($Gs,"modify");a(VGs,"applyEdits")});var NT=I(QX=>{"use strict";p();Object.defineProperty(QX,"__esModule",{value:!0});QX.DebugNameData=void 0;QX.getDebugName=Nei;QX.getClassName=Mei;QX.getFunctionName=Oei;var lpr=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return Nei(e,this)}};QX.DebugNameData=lpr;var Pei=new Map,upr=new WeakMap;function Nei(t,e){let r=upr.get(t);if(r)return r;let n=Ezs(t,e);if(n){let o=Pei.get(n)??0;o++,Pei.set(n,o);let s=o===1?n:`${n}#${o}`;return upr.set(t,s),s}}a(Nei,"getDebugName");function Ezs(t,e){let r=upr.get(t);if(r)return r;let n=e.owner?vzs(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=Oei(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=_zs(e.owner,t);if(l!==void 0)return n+l}}a(Ezs,"computeDebugName");function _zs(t,e){for(let r in t)if(t[r]===e)return r}a(_zs,"findKey");var kei=new Map,Dei=new WeakMap;function vzs(t){let e=Dei.get(t);if(e)return e;let r=Mei(t)??"Object",n=kei.get(r)??0;n++,kei.set(r,n);let o=n===1?r:`${r}#${n}`;return Dei.set(t,o),o}a(vzs,"formatOwner");function Mei(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a(Mei,"getClassName");function Oei(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(Oei,"getFunctionName")});var zei=I(mp=>{"use strict";p();var Czs=mp&&mp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bzs=mp&&mp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Szs=mp&&mp.__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(Uei,"strictEqualsC");function Qei(t,e,r){return Fei.equals(t,e,r??Eut)}a(Qei,"arrayEquals");function qei(t){return(e,r)=>Fei.equals(e,r,t??Eut)}a(qei,"arrayEqualsC");function iNe(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;riNe(t,e)}a(jei,"structuralEqualsC");function Tzs(t){return JSON.stringify(dpr(t))}a(Tzs,"getStructuralKey");var Izs=0,Bei=new WeakMap;function dpr(t){if(Array.isArray(t))return t.map(dpr);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]=dpr(e[n]);return r}else{let e=Bei.get(t);return e===void 0&&(e=Izs++,Bei.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(dpr,"toNormalizedJsonStructure");function Hei(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(Hei,"jsonStringifyEquals");function Gei(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(Gei,"jsonStringifyEqualsC");function $ei(){return(t,e)=>t.equals(e)}a($ei,"thisEqualsC");function Vei(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(Vei,"equalsIfDefined");function Wei(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(Wei,"equalsIfDefinedC");var Lei;(function(t){t.strict=Eut,t.strictC=Uei,t.array=Qei,t.arrayC=qei,t.structural=iNe,t.structuralC=jei,t.jsonStringify=Hei,t.jsonStringifyC=Gei,t.thisC=$ei,t.ifDefined=Vei,t.ifDefinedC=Wei})(Lei||(mp.equals=Lei={}))});var av=I(gp=>{"use strict";p();Object.defineProperty(gp,"__esModule",{value:!0});gp.trackDisposable=gp.toDisposable=gp.markAsDisposed=gp.DisposableStore=gp.Event=gp.onUnexpectedError=gp.onBugIndicatingError=gp.BugIndicatingError=gp.strictEquals=gp.assertFn=void 0;var xzs=zu();Object.defineProperty(gp,"assertFn",{enumerable:!0,get:a(function(){return xzs.assertFn},"get")});var wzs=zei();Object.defineProperty(gp,"strictEquals",{enumerable:!0,get:a(function(){return wzs.strictEquals},"get")});var fpr=Is();Object.defineProperty(gp,"BugIndicatingError",{enumerable:!0,get:a(function(){return fpr.BugIndicatingError},"get")});Object.defineProperty(gp,"onBugIndicatingError",{enumerable:!0,get:a(function(){return fpr.onBugIndicatingError},"get")});Object.defineProperty(gp,"onUnexpectedError",{enumerable:!0,get:a(function(){return fpr.onUnexpectedError},"get")});var Rzs=bc();Object.defineProperty(gp,"Event",{enumerable:!0,get:a(function(){return Rzs.Event},"get")});var _ut=Io();Object.defineProperty(gp,"DisposableStore",{enumerable:!0,get:a(function(){return _ut.DisposableStore},"get")});Object.defineProperty(gp,"markAsDisposed",{enumerable:!0,get:a(function(){return _ut.markAsDisposed},"get")});Object.defineProperty(gp,"toDisposable",{enumerable:!0,get:a(function(){return _ut.toDisposable},"get")});Object.defineProperty(gp,"trackDisposable",{enumerable:!0,get:a(function(){return _ut.trackDisposable},"get")})});var Yei=I(ppr=>{"use strict";p();Object.defineProperty(ppr,"__esModule",{value:!0});ppr.handleBugIndicatingErrorRecovery=kzs;var Pzs=av();function kzs(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,Pzs.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(kzs,"handleBugIndicatingErrorRecovery")});var J5=I(Zhe=>{"use strict";p();Object.defineProperty(Zhe,"__esModule",{value:!0});Zhe.addLogger=Dzs;Zhe.getLogger=Nzs;Zhe.setLogObservableFn=Mzs;Zhe.logObservable=Ozs;var qX;function Dzs(t){qX?qX instanceof vut?qX.loggers.push(t):qX=new vut([qX,t]):qX=t}a(Dzs,"addLogger");function Nzs(){return qX}a(Nzs,"getLogger");var hpr;function Mzs(t){hpr=t}a(Mzs,"setLogObservableFn");function Ozs(t){hpr&&hpr(t)}a(Ozs,"logObservable");var vut=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 a8=I(wH=>{"use strict";p();Object.defineProperty(wH,"__esModule",{value:!0});wH.TransactionImpl=void 0;wH.transaction=mpr;wH.globalTransaction=Lzs;wH.asyncTransaction=Fzs;wH.subtransaction=Uzs;var Kei=Yei(),Bzs=NT(),Jei=J5();function mpr(t,e){let r=new Xhe(t,e);try{t(r)}finally{r.finish()}}a(mpr,"transaction");var Cut;function Lzs(t){if(Cut)t(Cut);else{let e=new Xhe(t,void 0);Cut=e;try{t(e)}finally{e.finish(),Cut=void 0}}}a(Lzs,"globalTransaction");async function Fzs(t,e){let r=new Xhe(t,e);try{await t(r)}finally{r.finish()}}a(Fzs,"asyncTransaction");function Uzs(t,e,r){t?e(t):mpr(e,r)}a(Uzs,"subtransaction");var Xhe=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,Jei.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,Bzs.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,Kei.handleBugIndicatingErrorRecovery)("Transaction already finished!"),mpr(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,Kei.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(but,"__esModule",{value:!0});but.DebugLocation=void 0;var Zei;(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,gpr.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(Zei||(but.DebugLocation=Zei={}));var gpr=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` -`),o=Qzs(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 Qzs(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(Qzs,"parseLine")});var F2=I(Z5=>{"use strict";p();Object.defineProperty(Z5,"__esModule",{value:!0});Z5.BaseObservable=Z5.ConvenientObservable=void 0;Z5._setDerivedOpts=jzs;Z5._setRecomputeInitiallyAndOnChange=Hzs;Z5._setKeepObserved=Gzs;Z5._setDebugGetObservableGraph=$zs;var Xei=MT(),qzs=NT(),eme=J5(),Apr;function jzs(t){Apr=t}a(jzs,"_setDerivedOpts");var eti;function Hzs(t){eti=t}a(Hzs,"_setRecomputeInitiallyAndOnChange");var tti;function Gzs(t){tti=t}a(Gzs,"_setKeepObserved");var ypr;function $zs(t){ypr=t}a($zs,"_setDebugGetObservableGraph");var Sut=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=Xei.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return Apr({owner:o,debugName:a(()=>{let c=(0,qzs.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 Apr({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(eti(this,r)),this}keepObserved(e){return e.add(tti(this)),this}get debugValue(){return this.get()}get debug(){return new Epr(this)}};Z5.ConvenientObservable=Sut;var Epr=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return ypr(this.observable,{type:"dependencies"})}getObserverGraph(){return ypr(this.observable,{type:"observers"})}},_pr=class extends Sut{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,eme.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,eme.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,eme.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,eme.getLogger)();return(0,eme.logObservable)(this),e||(0,eme.getLogger)()?.handleObservableCreated(this,Xei.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};Z5.BaseObservable=_pr});var c8=I(RH=>{"use strict";p();Object.defineProperty(RH,"__esModule",{value:!0});RH.DisposableObservableValue=RH.ObservableValue=void 0;RH.observableValue=zzs;RH.disposableObservableValue=Yzs;var Vzs=a8(),Wzs=F2(),nti=av(),Tut=NT(),rti=J5(),iti=MT();function zzs(t,e,r=iti.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Tut.DebugNameData(void 0,t,void 0):n=new Tut.DebugNameData(t,void 0,void 0),new oNe(n,e,nti.strictEquals,r)}a(zzs,"observableValue");var oNe=class extends Wzs.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,rti.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,rti.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}};RH.ObservableValue=oNe;function Yzs(t,e,r=iti.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Tut.DebugNameData(void 0,t,void 0):n=new Tut.DebugNameData(t,void 0,void 0),new Iut(n,e,nti.strictEquals,r)}a(Yzs,"disposableObservableValue");var Iut=class extends oNe{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};RH.DisposableObservableValue=Iut});var sti=I(xut=>{"use strict";p();Object.defineProperty(xut,"__esModule",{value:!0});xut.LazyObservableValue=void 0;var Kzs=a8(),oti=J5(),Jzs=F2(),vpr=class extends Jzs.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,oti.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,oti.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 Kzs.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}};xut.LazyObservableValue=vpr});var wut=I(Cpr=>{"use strict";p();Object.defineProperty(Cpr,"__esModule",{value:!0});Cpr.observableValueOpts=tYs;var ati=NT(),cti=av(),Zzs=c8(),Xzs=sti(),eYs=MT();function tYs(t,e,r=eYs.DebugLocation.ofCaller()){return t.lazy?new Xzs.LazyObservableValue(new ati.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??cti.strictEquals,r):new Zzs.ObservableValue(new ati.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??cti.strictEquals,r)}a(tYs,"observableValueOpts")});var Put=I(Rut=>{"use strict";p();Object.defineProperty(Rut,"__esModule",{value:!0});Rut.AutorunObserver=void 0;var Xw=av(),sNe=J5();function rYs(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(rYs,"autorunStateToString");var bpr=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,sNe.getLogger)()?.handleAutorunCreated(this,o),this._run(),(0,Xw.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,sNe.getLogger)()?.handleAutorunDisposed(this),(0,Xw.markAsDisposed)(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(0,sNe.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,Xw.onBugIndicatingError)(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||(0,sNe.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,Xw.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,sNe.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,Xw.onBugIndicatingError)(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new Xw.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 Xw.BugIndicatingError("Cannot access store after dispose");return this._store===void 0&&(this._store=new Xw.DisposableStore),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new Xw.BugIndicatingError("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new Xw.DisposableStore),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:rYs(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?((0,Xw.onBugIndicatingError)(new Xw.BugIndicatingError(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};Rut.AutorunObserver=bpr});var jX=I(eR=>{"use strict";p();Object.defineProperty(eR,"__esModule",{value:!0});eR.autorun=Ipr;eR.autorunOpts=aNe;eR.autorunHandleChanges=lti;eR.autorunWithStoreHandleChanges=oYs;eR.autorunWithStore=sYs;eR.autorunDelta=aYs;eR.autorunIterableDelta=cYs;eR.autorunPerKeyedItem=lYs;eR.autorunSelfDisposable=uYs;eR.registerAutorunSelfDisposable=dYs;var tme=av(),Spr=NT(),Tpr=Put(),rme=MT(),nYs=c8(),iYs=a8();function Ipr(t,e=rme.DebugLocation.ofCaller()){return new Tpr.AutorunObserver(new Spr.DebugNameData(void 0,void 0,t),t,void 0,e)}a(Ipr,"autorun");function aNe(t,e,r=rme.DebugLocation.ofCaller()){return new Tpr.AutorunObserver(new Spr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(aNe,"autorunOpts");function lti(t,e,r=rme.DebugLocation.ofCaller()){return new Tpr.AutorunObserver(new Spr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(lti,"autorunHandleChanges");function oYs(t,e){let r=new tme.DisposableStore,n=lti({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,tme.toDisposable)(()=>{n.dispose(),r.dispose()})}a(oYs,"autorunWithStoreHandleChanges");function sYs(t){let e=new tme.DisposableStore,r=aNe({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,tme.toDisposable)(()=>{r.dispose(),e.dispose()})}a(sYs,"autorunWithStore");function aYs(t,e){let r;return aNe({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(aYs,"autorunDelta");function cYs(t,e,r=n=>n){let n=new Map;return aNe({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(cYs,"autorunIterableDelta");function lYs(t,e,r,n=rme.DebugLocation.ofCaller()){let o=new Map,s=aNe({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,iYs.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 tme.DisposableStore,E={value:(0,nYs.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,tme.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(lYs,"autorunPerKeyedItem");function uYs(t,e=rme.DebugLocation.ofCaller()){let r,n=!1;return r=Ipr(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(uYs,"autorunSelfDisposable");function dYs(t,e,r=rme.DebugLocation.ofCaller()){let n,o=!1;n=Ipr(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(dYs,"registerAutorunSelfDisposable")});var ime=I(nme=>{"use strict";p();Object.defineProperty(nme,"__esModule",{value:!0});nme.DerivedWithSetter=nme.Derived=void 0;var fYs=F2(),HX=av(),xpr=J5();function pYs(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(pYs,"derivedStateToString");var kut=class extends fYs.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,xpr.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,xpr.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,HX.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 HX.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,HX.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,xpr.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,HX.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 HX.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 HX.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new HX.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:pYs(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)}};nme.Derived=kut;var wpr=class extends kut{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};nme.DerivedWithSetter=wpr});var Dut=I(PH=>{"use strict";p();Object.defineProperty(PH,"__esModule",{value:!0});PH.derived=mYs;PH.derivedWithSetter=gYs;PH.derivedOpts=uti;PH.derivedHandleChanges=AYs;PH.derivedWithStore=yYs;PH.derivedDisposable=EYs;var X5=av(),ome=MT(),GX=NT(),hYs=F2(),$X=ime();function mYs(t,e,r=ome.DebugLocation.ofCaller()){return e!==void 0?new $X.Derived(new GX.DebugNameData(t,void 0,e),e,void 0,void 0,X5.strictEquals,r):new $X.Derived(new GX.DebugNameData(void 0,void 0,t),t,void 0,void 0,X5.strictEquals,r)}a(mYs,"derived");function gYs(t,e,r,n=ome.DebugLocation.ofCaller()){return new $X.DerivedWithSetter(new GX.DebugNameData(t,void 0,e),e,void 0,void 0,X5.strictEquals,r,n)}a(gYs,"derivedWithSetter");function uti(t,e,r=ome.DebugLocation.ofCaller()){return new $X.Derived(new GX.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??X5.strictEquals,r)}a(uti,"derivedOpts");(0,hYs._setDerivedOpts)(uti);function AYs(t,e,r=ome.DebugLocation.ofCaller()){return new $X.Derived(new GX.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??X5.strictEquals,r)}a(AYs,"derivedHandleChanges");function yYs(t,e,r=ome.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new X5.DisposableStore;return new $X.Derived(new GX.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new X5.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),X5.strictEquals,r)}a(yYs,"derivedWithStore");function EYs(t,e,r=ome.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new $X.Derived(new GX.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new X5.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},X5.strictEquals,r)}a(EYs,"derivedDisposable")});var pti=I(tR=>{"use strict";p();Object.defineProperty(tR,"__esModule",{value:!0});tR.ObservableLazyPromise=tR.ObservableResolvedPromise=tR.PromiseResult=tR.ObservablePromise=tR.ObservableLazy=void 0;var _Ys=jX(),dti=a8(),fti=Dut(),Nut=c8(),Mut=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,Nut.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};tR.ObservableLazy=Mut;var Out=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,Nut.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,fti.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,dti.transaction)(n=>{this._value.set(new cNe(r,void 0),n)}),r),r=>{throw(0,dti.transaction)(n=>{this._value.set(new cNe(void 0,r),n)}),r})}};tR.ObservablePromise=Out;var cNe=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};tR.PromiseResult=cNe;var Rpr=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,Nut.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,Nut.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,_Ys.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)}))}};tR.ObservableResolvedPromise=Rpr;var Ppr=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new Mut(()=>new Out(this._computePromise())),this.cachedPromiseResult=(0,fti.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};tR.ObservableLazyPromise=Ppr});var Dpr=I(e4=>{"use strict";p();Object.defineProperty(e4,"__esModule",{value:!0});e4.cancelOnDispose=e4.CancellationTokenSource=e4.CancellationToken=e4.CancellationError=void 0;var vYs=Is();Object.defineProperty(e4,"CancellationError",{enumerable:!0,get:a(function(){return vYs.CancellationError},"get")});var kpr=wk();Object.defineProperty(e4,"CancellationToken",{enumerable:!0,get:a(function(){return kpr.CancellationToken},"get")});Object.defineProperty(e4,"CancellationTokenSource",{enumerable:!0,get:a(function(){return kpr.CancellationTokenSource},"get")});Object.defineProperty(e4,"cancelOnDispose",{enumerable:!0,get:a(function(){return kpr.cancelOnDispose},"get")})});var hti=I(But=>{"use strict";p();Object.defineProperty(But,"__esModule",{value:!0});But.waitForState=xYs;But.derivedWithCancellationToken=wYs;var CYs=NT(),Npr=Dpr(),bYs=av(),SYs=jX(),TYs=ime(),IYs=MT();function xYs(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,SYs.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 Npr.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new Npr.CancellationError);return}}c=!1,l&&d.dispose()})}a(xYs,"waitForState");function wYs(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new TYs.Derived(new CYs.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new Npr.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),bYs.strictEquals,IYs.DebugLocation.ofCaller())}a(wYs,"derivedWithCancellationToken")});var kH=I(VX=>{"use strict";p();Object.defineProperty(VX,"__esModule",{value:!0});VX.FromEventObservable=void 0;VX.observableFromEvent=Mpr;VX.observableFromEventOpts=kYs;var RYs=a8(),gti=av(),Ati=NT(),mti=J5(),PYs=F2(),yti=MT();function Mpr(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new U2(new Ati.DebugNameData(e,void 0,n),r,n,()=>U2.globalTransaction,gti.strictEquals,o??yti.DebugLocation.ofCaller())}a(Mpr,"observableFromEvent");function kYs(t,e,r,n=yti.DebugLocation.ofCaller()){return new U2(new Ati.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??U2.globalTransaction,t.equalsFn??gti.strictEquals,n)}a(kYs,"observableFromEventOpts");var U2=class extends PYs.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,RYs.subtransaction)(this._getTransaction(),m=>{(0,mti.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,mti.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}}};VX.FromEventObservable=U2;(function(t){t.Observer=U2;function e(r,n){let o=!1;U2.globalTransaction===void 0&&(U2.globalTransaction=r,o=!0);try{n()}finally{o&&(U2.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})(Mpr||(VX.observableFromEvent=Mpr={}))});var Bpr=I(Opr=>{"use strict";p();Object.defineProperty(Opr,"__esModule",{value:!0});Opr.observableSignal=BYs;var DYs=a8(),NYs=NT(),MYs=F2(),OYs=MT();function BYs(t,e=OYs.DebugLocation.ofCaller()){return typeof t=="string"?new Lut(t,void 0,e):new Lut(void 0,t,e)}a(BYs,"observableSignal");var Lut=class extends MYs.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new NYs.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,DYs.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 Uut=I(CE=>{"use strict";p();Object.defineProperty(CE,"__esModule",{value:!0});CE.KeepAliveObserver=void 0;CE.observableFromPromise=LYs;CE.signalFromObservable=FYs;CE.debouncedObservable=UYs;CE.throttledObservable=QYs;CE.debouncedObservable2=qYs;CE.wasEventTriggeredRecently=jYs;CE.keepObserved=Sti;CE.recomputeInitiallyAndOnChange=Tti;CE.derivedObservableWithCache=HYs;CE.derivedObservableWithWritableCache=GYs;CE.mapObservableArrayCached=$Ys;CE.isObservable=VYs;var Eti=jX(),_ti=c8(),Lpr=av(),uNe=Dut(),vti=kH(),Cti=Bpr(),bti=F2(),Fpr=MT();function LYs(t){let e=(0,_ti.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(LYs,"observableFromPromise");function FYs(t,e){return(0,uNe.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(FYs,"signalFromObservable");function UYs(t,e,r=Fpr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,vti.observableFromEvent)(void 0,c=>{let l=(0,Eti.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(UYs,"debouncedObservable");function QYs(t,e,r=Fpr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,vti.observableFromEvent)(void 0,c=>{let l=(0,Eti.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(QYs,"throttledObservable");function qYs(t,e,r=Fpr.DebugLocation.ofCaller()){let n=(0,Cti.observableSignal)("handleTimeout"),o,s;return(0,uNe.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(qYs,"debouncedObservable2");function jYs(t,e,r){let n=(0,_ti.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(jYs,"wasEventTriggeredRecently");function Sti(t){let e=new lNe(!1,void 0);return t.addObserver(e),(0,Lpr.toDisposable)(()=>{t.removeObserver(e)})}a(Sti,"keepObserved");(0,bti._setKeepObserved)(Sti);function Tti(t,e){let r=new lNe(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,Lpr.toDisposable)(()=>{t.removeObserver(r)})}a(Tti,"recomputeInitiallyAndOnChange");(0,bti._setRecomputeInitiallyAndOnChange)(Tti);var lNe=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){}};CE.KeepAliveObserver=lNe;function HYs(t,e){let r;return(0,uNe.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a(HYs,"derivedObservableWithCache");function GYs(t,e){let r,n=(0,Cti.observableSignal)("derivedObservableWithWritableCache"),o=(0,uNe.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(GYs,"derivedObservableWithWritableCache");function $Ys(t,e,r,n){let o=new Fut(r,n);return(0,uNe.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new Fut(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a($Ys,"mapObservableArrayCached");var Fut=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 Lpr.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 xti=I(Qut=>{"use strict";p();Object.defineProperty(Qut,"__esModule",{value:!0});Qut.recordChanges=WYs;Qut.recordChangesLazy=zYs;var Iti=av();function WYs(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 Iti.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(WYs,"recordChanges");function zYs(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 Iti.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(zYs,"recordChangesLazy")});var wti=I(Qpr=>{"use strict";p();Object.defineProperty(Qpr,"__esModule",{value:!0});Qpr.constObservable=KYs;var YYs=F2();function KYs(t){return new Upr(t)}a(KYs,"constObservable");var Upr=class extends YYs.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 Rti=I(jpr=>{"use strict";p();Object.defineProperty(jpr,"__esModule",{value:!0});jpr.observableSignalFromEvent=tKs;var JYs=a8(),ZYs=NT(),XYs=F2(),eKs=MT();function tKs(t,e,r=eKs.DebugLocation.ofCaller()){return new qpr(typeof t=="string"?t:new ZYs.DebugNameData(t,void 0,void 0),e,r)}a(tKs,"observableSignalFromEvent");var qpr=class extends XYs.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,JYs.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 Pti=I(dNe=>{"use strict";p();Object.defineProperty(dNe,"__esModule",{value:!0});dNe.ValueWithChangeEventFromObservable=void 0;dNe.observableFromValueWithChangeEvent=iKs;var rKs=av(),nKs=kH(),qut=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return rKs.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};dNe.ValueWithChangeEventFromObservable=qut;function iKs(t,e){return e instanceof qut?e.observable:(0,nKs.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(iKs,"observableFromValueWithChangeEvent")});var Nti=I(fNe=>{"use strict";p();Object.defineProperty(fNe,"__esModule",{value:!0});fNe.runOnChange=kti;fNe.runOnChangeWithStore=Dti;fNe.runOnChangeWithCancellationToken=cKs;var oKs=Dpr(),sKs=av(),aKs=jX();function kti(t,e){let r,n=!0;return(0,aKs.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(kti,"runOnChange");function Dti(t,e){let r=new sKs.DisposableStore,n=kti(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(Dti,"runOnChangeWithStore");function cKs(t,e){return Dti(t,(r,n,o,s)=>{e(r,n,o,(0,oKs.cancelOnDispose)(s))})}a(cKs,"runOnChangeWithCancellationToken")});var Bti=I(jut=>{"use strict";p();Object.defineProperty(jut,"__esModule",{value:!0});jut.latestChangedValue=fKs;jut.derivedConstOnceDefined=pKs;var Mti=av(),Oti=NT(),lKs=kH(),uKs=jX(),dKs=Uut();function fKs(t,e){if(e.length===0)throw new Mti.BugIndicatingError;let r=!1,n,o=(0,lKs.observableFromEvent)(t,s=>{let c=new Mti.DisposableStore;for(let l of e)c.add((0,uKs.autorunOpts)({debugName:a(()=>(0,Oti.getDebugName)(o,new Oti.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(fKs,"latestChangedValue");function pKs(t,e){return(0,dKs.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(pKs,"derivedConstOnceDefined")});var Lti=I(Hut=>{"use strict";p();Object.defineProperty(Hut,"__esModule",{value:!0});Hut.ObservableSet=void 0;var hKs=wut(),Hpr=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,hKs.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"}};Hut.ObservableSet=Hpr});var Fti=I(Gut=>{"use strict";p();Object.defineProperty(Gut,"__esModule",{value:!0});Gut.ObservableMap=void 0;var mKs=wut(),Gpr=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,mKs.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"}};Gut.ObservableMap=Gpr});var Wut=I(lme=>{"use strict";p();Object.defineProperty(lme,"__esModule",{value:!0});lme.ConsoleObservableLogger=void 0;lme.logObservableToConsole=yKs;lme.formatValue=cme;var gKs=J5(),AKs=NT(),Uti=ime(),$ut;function yKs(t){$ut||($ut=new Vut,(0,gKs.addLogger)($ut)),$ut.addFilteredObj(t)}a(yKs,"logObservableToConsole");var Vut=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 EKs([sme(CKs("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[sme(" "),rR(cme(e.oldValue,70),{color:"red",strikeThrough:!0}),sme(" "),rR(cme(e.newValue,60),{color:"green"})]:[sme(" (unchanged)")]:[sme(" "),rR(cme(e.newValue,60),{color:"green"}),sme(" (initial)")]}handleObservableCreated(e){if(e instanceof Uti.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 Uti.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([ame("observable value changed"),rR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return rR(" (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"),rR(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"),rR(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([ame("observable from event triggered"),rR(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"),rR(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"),rR(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};lme.ConsoleObservableLogger=Vut;function EKs(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(EKs,"consoleTextToArgs");function sme(t){return rR(t,{color:"black"})}a(sme,"normalText");function ame(t){return rR(bKs(`${t}: `,10),{color:"black",bold:!0})}a(ame,"formatKind");function rR(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(rR,"styled");function cme(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)?_Ks(t,e):vKs(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a(cme,"formatValue");function _Ks(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${cme(o,e-r.length)}`}return r+=" ]",r}a(_Ks,"formatArray");function vKs(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,AKs.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}: ${cme(c,e-n.length)}`}return n+=r?")":" }",n}a(vKs,"formatObject");function CKs(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(CKs,"repeat");function bKs(t,e){for(;t.length{"use strict";p();Object.defineProperty(zut,"__esModule",{value:!0});zut.SimpleTypedRpcConnection=void 0;var $pr=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}}};zut.SimpleTypedRpcConnection=$pr});var qti=I(Vpr=>{"use strict";p();Object.defineProperty(Vpr,"__esModule",{value:!0});Vpr.registerDebugChannel=TKs;var SKs=Qti();function TKs(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=IKs({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},SKs.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(TKs,"registerDebugChannel");function IKs(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(IKs,"createChannelFactoryFromDebugChannel")});var Gti=I(DH=>{"use strict";p();Object.defineProperty(DH,"__esModule",{value:!0});DH.Throttler=DH.Debouncer=void 0;DH.deepAssign=jti;DH.deepAssignDeleteNulls=Hti;var Wpr=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)}};DH.Debouncer=Wpr;var zpr=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)}};DH.Throttler=zpr;function jti(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?jti(t[r],e[r]):t[r]=e[r]}a(jti,"deepAssign");function Hti(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"?Hti(t[r],e[r]):t[r]=e[r]}a(Hti,"deepAssignDeleteNulls")});var Wti=I(Kut=>{"use strict";p();Object.defineProperty(Kut,"__esModule",{value:!0});Kut.DevToolsLogger=void 0;var $ti=Put(),Yut=Wut(),xKs=qti(),Ypr=Gti(),pNe=SS(),wKs=kH(),WX=Is(),zX=ime(),Vti=c8(),RKs=MT(),Kpr=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,WX.onUnexpectedError)(new WX.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,WX.onUnexpectedError)(new WX.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof zX.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(pNe.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 $ti.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 zX.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,xKs.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(pNe.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(pNe.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(pNe.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(pNe.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof zX.Derived)n.debugSetValue(r);else if(n instanceof Vti.ObservableValue)n.debugSetValue(r);else if(n instanceof wKs.FromEventObservable)n.debugSetValue(r);else throw new WX.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 zX.Derived)return(0,Yut.formatValue)(r.debugGetState().value,200);if(r instanceof Vti.ObservableValue)return(0,Yut.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 WX.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof zX.Derived)r.debugRecompute();else if(r instanceof $ti.AutorunObserver)r.debugRerun();else throw new WX.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new Ypr.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},RKs.DebugLocation.enable()}_handleChange(e){(0,Ypr.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,Ypr.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 zX.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 zX.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,Yut.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,Yut.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)}};Kut.DevToolsLogger=Kpr});var Jti=I(Jpr=>{"use strict";p();Object.defineProperty(Jpr,"__esModule",{value:!0});Jpr.debugGetObservableGraph=MKs;var PKs=ime(),kKs=kH(),DKs=c8(),NKs=Put(),zti=Wut();function MKs(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=YX.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?Kti(n,0,o,e).trim():Yti(n,0,o,e).trim()}a(MKs,"debugGetObservableGraph");function Yti(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,zti.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=YX.from(l,n.debugNamePostProcessor??(d=>d))??YX.unknown(l);s.push(Yti(u,e+1,r,n))}}return s.join(` -`)}a(Yti,"formatObservableInfoWithDependencies");function Kti(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,zti.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=YX.from(l,n.debugNamePostProcessor??(d=>d))??YX.unknown(l);s.push(Kti(u,e+1,r,n))}}return s.join(` -`)}a(Kti,"formatObservableInfoWithObservers");var YX=class t{static{a(this,"Info")}static from(e,r){if(e instanceof NKs.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 PKs.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 DKs.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof kKs.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 l8=I(Lt=>{"use strict";p();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.ValueWithChangeEventFromObservable=Lt.observableFromValueWithChangeEvent=Lt.TransactionImpl=Lt.transaction=Lt.subtransaction=Lt.globalTransaction=Lt.asyncTransaction=Lt.observableSignalFromEvent=Lt.observableFromEventOpts=Lt.observableSignal=Lt.constObservable=Lt.recordChangesLazy=Lt.recordChanges=Lt.isObservable=Lt.wasEventTriggeredRecently=Lt.throttledObservable=Lt.signalFromObservable=Lt.recomputeInitiallyAndOnChange=Lt.observableFromPromise=Lt.mapObservableArrayCached=Lt.keepObserved=Lt.derivedObservableWithWritableCache=Lt.derivedObservableWithCache=Lt.debouncedObservable2=Lt.debouncedObservable=Lt.waitForState=Lt.derivedWithCancellationToken=Lt.PromiseResult=Lt.ObservableResolvedPromise=Lt.ObservablePromise=Lt.ObservableLazyPromise=Lt.ObservableLazy=Lt.derivedWithStore=Lt.derivedWithSetter=Lt.derivedOpts=Lt.derivedHandleChanges=Lt.derivedDisposable=Lt.derived=Lt.disposableObservableValue=Lt.registerAutorunSelfDisposable=Lt.autorunSelfDisposable=Lt.autorunPerKeyedItem=Lt.autorunIterableDelta=Lt.autorunWithStoreHandleChanges=Lt.autorunWithStore=Lt.autorunOpts=Lt.autorunHandleChanges=Lt.autorunDelta=Lt.autorun=Lt.observableValueOpts=void 0;Lt.DebugLocation=Lt.ObservableMap=Lt.ObservableSet=Lt.observableValue=Lt.observableFromEvent=Lt.latestChangedValue=Lt.derivedConstOnceDefined=Lt.runOnChangeWithStore=Lt.runOnChangeWithCancellationToken=Lt.runOnChange=void 0;var OKs=wut();Object.defineProperty(Lt,"observableValueOpts",{enumerable:!0,get:a(function(){return OKs.observableValueOpts},"get")});var t4=jX();Object.defineProperty(Lt,"autorun",{enumerable:!0,get:a(function(){return t4.autorun},"get")});Object.defineProperty(Lt,"autorunDelta",{enumerable:!0,get:a(function(){return t4.autorunDelta},"get")});Object.defineProperty(Lt,"autorunHandleChanges",{enumerable:!0,get:a(function(){return t4.autorunHandleChanges},"get")});Object.defineProperty(Lt,"autorunOpts",{enumerable:!0,get:a(function(){return t4.autorunOpts},"get")});Object.defineProperty(Lt,"autorunWithStore",{enumerable:!0,get:a(function(){return t4.autorunWithStore},"get")});Object.defineProperty(Lt,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return t4.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Lt,"autorunIterableDelta",{enumerable:!0,get:a(function(){return t4.autorunIterableDelta},"get")});Object.defineProperty(Lt,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return t4.autorunPerKeyedItem},"get")});Object.defineProperty(Lt,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return t4.autorunSelfDisposable},"get")});Object.defineProperty(Lt,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return t4.registerAutorunSelfDisposable},"get")});var BKs=c8();Object.defineProperty(Lt,"disposableObservableValue",{enumerable:!0,get:a(function(){return BKs.disposableObservableValue},"get")});var ume=Dut();Object.defineProperty(Lt,"derived",{enumerable:!0,get:a(function(){return ume.derived},"get")});Object.defineProperty(Lt,"derivedDisposable",{enumerable:!0,get:a(function(){return ume.derivedDisposable},"get")});Object.defineProperty(Lt,"derivedHandleChanges",{enumerable:!0,get:a(function(){return ume.derivedHandleChanges},"get")});Object.defineProperty(Lt,"derivedOpts",{enumerable:!0,get:a(function(){return ume.derivedOpts},"get")});Object.defineProperty(Lt,"derivedWithSetter",{enumerable:!0,get:a(function(){return ume.derivedWithSetter},"get")});Object.defineProperty(Lt,"derivedWithStore",{enumerable:!0,get:a(function(){return ume.derivedWithStore},"get")});var hNe=pti();Object.defineProperty(Lt,"ObservableLazy",{enumerable:!0,get:a(function(){return hNe.ObservableLazy},"get")});Object.defineProperty(Lt,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return hNe.ObservableLazyPromise},"get")});Object.defineProperty(Lt,"ObservablePromise",{enumerable:!0,get:a(function(){return hNe.ObservablePromise},"get")});Object.defineProperty(Lt,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return hNe.ObservableResolvedPromise},"get")});Object.defineProperty(Lt,"PromiseResult",{enumerable:!0,get:a(function(){return hNe.PromiseResult},"get")});var Xti=hti();Object.defineProperty(Lt,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return Xti.derivedWithCancellationToken},"get")});Object.defineProperty(Lt,"waitForState",{enumerable:!0,get:a(function(){return Xti.waitForState},"get")});var nR=Uut();Object.defineProperty(Lt,"debouncedObservable",{enumerable:!0,get:a(function(){return nR.debouncedObservable},"get")});Object.defineProperty(Lt,"debouncedObservable2",{enumerable:!0,get:a(function(){return nR.debouncedObservable2},"get")});Object.defineProperty(Lt,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return nR.derivedObservableWithCache},"get")});Object.defineProperty(Lt,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return nR.derivedObservableWithWritableCache},"get")});Object.defineProperty(Lt,"keepObserved",{enumerable:!0,get:a(function(){return nR.keepObserved},"get")});Object.defineProperty(Lt,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return nR.mapObservableArrayCached},"get")});Object.defineProperty(Lt,"observableFromPromise",{enumerable:!0,get:a(function(){return nR.observableFromPromise},"get")});Object.defineProperty(Lt,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return nR.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Lt,"signalFromObservable",{enumerable:!0,get:a(function(){return nR.signalFromObservable},"get")});Object.defineProperty(Lt,"throttledObservable",{enumerable:!0,get:a(function(){return nR.throttledObservable},"get")});Object.defineProperty(Lt,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return nR.wasEventTriggeredRecently},"get")});Object.defineProperty(Lt,"isObservable",{enumerable:!0,get:a(function(){return nR.isObservable},"get")});var eri=xti();Object.defineProperty(Lt,"recordChanges",{enumerable:!0,get:a(function(){return eri.recordChanges},"get")});Object.defineProperty(Lt,"recordChangesLazy",{enumerable:!0,get:a(function(){return eri.recordChangesLazy},"get")});var LKs=wti();Object.defineProperty(Lt,"constObservable",{enumerable:!0,get:a(function(){return LKs.constObservable},"get")});var FKs=Bpr();Object.defineProperty(Lt,"observableSignal",{enumerable:!0,get:a(function(){return FKs.observableSignal},"get")});var UKs=kH();Object.defineProperty(Lt,"observableFromEventOpts",{enumerable:!0,get:a(function(){return UKs.observableFromEventOpts},"get")});var QKs=Rti();Object.defineProperty(Lt,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return QKs.observableSignalFromEvent},"get")});var mNe=a8();Object.defineProperty(Lt,"asyncTransaction",{enumerable:!0,get:a(function(){return mNe.asyncTransaction},"get")});Object.defineProperty(Lt,"globalTransaction",{enumerable:!0,get:a(function(){return mNe.globalTransaction},"get")});Object.defineProperty(Lt,"subtransaction",{enumerable:!0,get:a(function(){return mNe.subtransaction},"get")});Object.defineProperty(Lt,"transaction",{enumerable:!0,get:a(function(){return mNe.transaction},"get")});Object.defineProperty(Lt,"TransactionImpl",{enumerable:!0,get:a(function(){return mNe.TransactionImpl},"get")});var tri=Pti();Object.defineProperty(Lt,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return tri.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Lt,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return tri.ValueWithChangeEventFromObservable},"get")});var Zpr=Nti();Object.defineProperty(Lt,"runOnChange",{enumerable:!0,get:a(function(){return Zpr.runOnChange},"get")});Object.defineProperty(Lt,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return Zpr.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Lt,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return Zpr.runOnChangeWithStore},"get")});var rri=Bti();Object.defineProperty(Lt,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return rri.derivedConstOnceDefined},"get")});Object.defineProperty(Lt,"latestChangedValue",{enumerable:!0,get:a(function(){return rri.latestChangedValue},"get")});var qKs=kH();Object.defineProperty(Lt,"observableFromEvent",{enumerable:!0,get:a(function(){return qKs.observableFromEvent},"get")});var jKs=c8();Object.defineProperty(Lt,"observableValue",{enumerable:!0,get:a(function(){return jKs.observableValue},"get")});var HKs=Lti();Object.defineProperty(Lt,"ObservableSet",{enumerable:!0,get:a(function(){return HKs.ObservableSet},"get")});var GKs=Fti();Object.defineProperty(Lt,"ObservableMap",{enumerable:!0,get:a(function(){return GKs.ObservableMap},"get")});var $Ks=MT();Object.defineProperty(Lt,"DebugLocation",{enumerable:!0,get:a(function(){return $Ks.DebugLocation},"get")});var Xpr=J5(),nri=Wut(),VKs=Wti(),Zti=mIe(),WKs=F2(),zKs=Jti();(0,WKs._setDebugGetObservableGraph)(zKs.debugGetObservableGraph);(0,Xpr.setLogObservableFn)(nri.logObservableToConsole);var YKs=!1;YKs&&(0,Xpr.addLogger)(new nri.ConsoleObservableLogger);Zti.env&&Zti.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,Xpr.addLogger)(VKs.DevToolsLogger.getInstance())});var dd=I(dme=>{"use strict";p();Object.defineProperty(dme,"__esModule",{value:!0});dme.OffsetRangeSet=dme.OffsetRange=void 0;var Jut=Is(),Zut=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 Jut.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 Jut.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Jut.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)}};dme.OffsetRangeSet=ehr});var Q2=I(hme=>{"use strict";p();Object.defineProperty(hme,"__esModule",{value:!0});hme.LineRangeSet=hme.LineRange=void 0;var iri=Is(),KKs=dd(),ori=zp(),fme=aQ(),sri=Al(),pme=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,sri.compareBy)(e=>e.startLineNumber,sri.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new iri.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,fme.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,fme.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,fme.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 pme(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,fme.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,fme.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 pme(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};hme.LineRangeSet=gNe});var mme=I(edt=>{"use strict";p();Object.defineProperty(edt,"__esModule",{value:!0});edt.TextLength=void 0;var JKs=Q2(),ari=O_(),Xut=zp(),thr=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 Xut.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Xut.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Xut.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return JKs.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new ari.Position(e.lineNumber,e.column+this.columnCount):new ari.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Xut.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};edt.TextLength=thr});var rdt=I(KX=>{"use strict";p();Object.defineProperty(KX,"__esModule",{value:!0});KX.PositionOffsetTransformer=KX.PositionOffsetTransformerBase=void 0;KX._setPositionOffsetTransformerDependencies=tJs;var ZKs=aQ(),XKs=dd(),ANe=O_(),eJs=zp(),tdt=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new XKs.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return eJs.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new u8.deps.StringEdit(r)}getStringReplacement(e){return new u8.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new u8.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new u8.deps.TextEdit(r)}};KX.PositionOffsetTransformerBase=tdt;var u8=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 tJs(t){u8._deps=t}a(tJs,"_setPositionOffsetTransformerDependencies");var rhr=class extends tdt{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 ANe.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new ANe.Position(r,o+1)}if(e.column<1)return new ANe.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new ANe.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,ZKs.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new ANe.Position(n,o)}getTextLength(e){return u8.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new u8.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};KX.PositionOffsetTransformer=rhr});var OT=I(r4=>{"use strict";p();Object.defineProperty(r4,"__esModule",{value:!0});r4.StringText=r4.ArrayText=r4.LineBasedText=r4.AbstractText=void 0;var rJs=zu(),nJs=Qh(),iJs=O_(),cri=zp(),oJs=mme(),lri=rdt(),yNe=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new iJs.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 cri.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new lri.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new cri.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,nJs.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};r4.AbstractText=yNe;var ndt=class extends yNe{static{a(this,"LineBasedText")}constructor(e,r){(0,rJs.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();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;ne[r-1],e.length)}};r4.ArrayText=nhr;var ihr=class extends yNe{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new lri.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};r4.StringText=ihr});var dri=I(n4=>{"use strict";p();Object.defineProperty(n4,"__esModule",{value:!0});n4.AnnotationReplacement=n4.Edit=n4.BaseReplacement=n4.BaseEdit=void 0;var sJs=Al(),uri=Is(),iR=dd(),idt=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 uri.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(iR.OffsetRange.emptyAt(h),new iR.OffsetRange(0,m));s.push(E)}if(!f)throw new uri.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(iR.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new iR.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new iR.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new iR.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 iR.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(iR.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,sJs.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 iR.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};n4.BaseReplacement=odt;var ohr=class t extends idt{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)}};n4.Edit=ohr;var shr=class t extends odt{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)}};n4.AnnotationReplacement=shr});var bE=I(JA=>{"use strict";p();Object.defineProperty(JA,"__esModule",{value:!0});JA.AnnotatedStringReplacement=JA.AnnotatedStringEdit=JA.VoidEditData=JA.StringReplacement=JA.StringEdit=JA.BaseStringReplacement=JA.BaseStringEdit=void 0;JA.applyEditsToRanges=cJs;var sdt=Qh(),q2=dd(),aJs=OT(),pri=dri(),ENe=class extends pri.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(cv.replace(q2.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 i4(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 i4(r)}normalizeEOL(e){return new i4(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=cv.replace(q2.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?i4.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new aJs.StringText(this.apply(e.value))}mapData(e){return new adt(this.replacements.map(r=>new JX(r.replaceRange,r.newText,e(r))))}};JA.BaseStringEdit=ENe;var _Ne=class extends pri.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,sdt.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,sdt.commonSuffixLength)(r,this.newText)),s=new q2.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new cv(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new cv(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,sdt.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new q2.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,sdt.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new q2.OffsetRange(0,this.newText.length-n))}toEdit(){return new i4([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};JA.BaseStringReplacement=_Ne;var i4=class t extends ENe{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 cv(new q2.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 cv(e,r)])}static insert(e,r){return new t([new cv(q2.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new cv(e,"")])}static fromJson(e){return new t(e.map(cv.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(cJs,"applyEditsToRanges");var ahr=class{static{a(this,"VoidEditData")}join(e){return this}};JA.VoidEditData=ahr;var adt=class t extends ENe{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 JX(e,r,n)])}static insert(e,r,n){return new t([new JX(q2.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new JX(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(cdt,"__esModule",{value:!0});cdt.LanguageId=void 0;var hri;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(hri||(cdt.LanguageId=hri={}))});var gri=I(NH=>{"use strict";p();Object.defineProperty(NH,"__esModule",{value:!0});NH.EditReasons=NH.TextModelEditReason=NH.EditReason=void 0;var chr=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 vNe(this.metadata,mri).toKey(e)}};NH.EditReason=chr;var mri=Symbol("TextModelEditReason"),vNe=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("-")}};NH.TextModelEditReason=vNe;function oR(t){return new vNe(t,mri)}a(oR,"createEditReason");NH.EditReasons={unknown(t){return oR({source:"unknown",name:t.name})},chatApplyEdits(t){return oR({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return oR({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return oR({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return oR({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>oR({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return oR({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>oR({source:"setValue"}),"setValue"),eolChange:a(()=>oR({source:"eolChange"}),"eolChange"),applyEdits:a(()=>oR({source:"applyEdits"}),"applyEdits"),snippet:a(()=>oR({source:"snippet"}),"snippet"),suggest:a(t=>oR({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var ZX=I(o4=>{"use strict";p();Object.defineProperty(o4,"__esModule",{value:!0});o4.MutableObservableDocument=o4.MutableObservableWorkspace=o4.StringEditWithReason=o4.ObservableWorkspace=void 0;var uJs=zu(),Ari=Io(),lv=l8(),Eri=bE(),dJs=dd(),fJs=OT(),pJs=ldt(),yri=gri(),udt=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,lv.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,lv.derivedWithStore)((e,r)=>{let n=(0,lv.observableValue)("lastActiveDocument",void 0);return r.add((0,lv.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,lv.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)}};o4.ObservableWorkspace=udt;var gme=class extends Eri.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};o4.StringEditWithReason=gme;var lhr=class extends udt{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,lv.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,uJs.assert)(!this._documents.has(e.id));let n=new ddt(e.id,new fJs.StringText(e.initialValue??""),[],e.languageId??pJs.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}};o4.MutableObservableWorkspace=lhr;var ddt=class extends Ari.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,lv.observableValue)(this,r),this._selection=(0,lv.observableValue)(this,n),this._primarySelectionLine=(0,lv.observableValue)(this,void 0),this._visibleRanges=(0,lv.observableValue)(this,[]),this._languageId=(0,lv.observableValue)(this,o),this._version=(0,lv.observableValue)(this,c),this._diagnostics=(0,lv.observableValue)(this,[]),this._register((0,Ari.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 gme?e:new gme(e.replacements,yri.EditReason.unknown);(0,lv.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=yri.EditReason.unknown,s=new gme([Eri.StringReplacement.replace(new dJs.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,lv.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)}};o4.MutableObservableDocument=ddt});var j2=I(eee=>{"use strict";p();var hJs=eee&&eee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mJs=eee&&eee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hJs(e,t,r)};Object.defineProperty(eee,"__esModule",{value:!0});mJs(l8(),eee)});var s4=I(uhr=>{"use strict";p();Object.defineProperty(uhr,"__esModule",{value:!0});uhr.autorunWithChanges=AJs;var gJs=j2();function AJs(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,gJs.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(AJs,"autorunWithChanges")});var Ka=I(XA=>{"use strict";p();var Uhr=Symbol.for("yaml.alias"),Pni=Symbol.for("yaml.document"),Zdt=Symbol.for("yaml.map"),kni=Symbol.for("yaml.pair"),Qhr=Symbol.for("yaml.scalar"),Xdt=Symbol.for("yaml.seq"),h8=Symbol.for("yaml.node.type"),ZZs=a(t=>!!t&&typeof t=="object"&&t[h8]===Uhr,"isAlias"),XZs=a(t=>!!t&&typeof t=="object"&&t[h8]===Pni,"isDocument"),eXs=a(t=>!!t&&typeof t=="object"&&t[h8]===Zdt,"isMap"),tXs=a(t=>!!t&&typeof t=="object"&&t[h8]===kni,"isPair"),Dni=a(t=>!!t&&typeof t=="object"&&t[h8]===Qhr,"isScalar"),rXs=a(t=>!!t&&typeof t=="object"&&t[h8]===Xdt,"isSeq");function Nni(t){if(t&&typeof t=="object")switch(t[h8]){case Zdt:case Xdt:return!0}return!1}a(Nni,"isCollection");function nXs(t){if(t&&typeof t=="object")switch(t[h8]){case Uhr:case Zdt:case Qhr:case Xdt:return!0}return!1}a(nXs,"isNode");var iXs=a(t=>(Dni(t)||Nni(t))&&!!t.anchor,"hasAnchor");XA.ALIAS=Uhr;XA.DOC=Pni;XA.MAP=Zdt;XA.NODE_TYPE=h8;XA.PAIR=kni;XA.SCALAR=Qhr;XA.SEQ=Xdt;XA.hasAnchor=iXs;XA.isAlias=ZZs;XA.isCollection=Nni;XA.isDocument=XZs;XA.isMap=eXs;XA.isNode=nXs;XA.isPair=tXs;XA.isScalar=Dni;XA.isSeq=rXs});var DNe=I(qhr=>{"use strict";p();var m0=Ka(),Pb=Symbol("break visit"),Mni=Symbol("skip children"),u4=Symbol("remove node");function eft(t,e){let r=Oni(e);m0.isDocument(t)?Sme(null,t.contents,r,Object.freeze([t]))===u4&&(t.contents=null):Sme(null,t,r,Object.freeze([]))}a(eft,"visit");eft.BREAK=Pb;eft.SKIP=Mni;eft.REMOVE=u4;function Sme(t,e,r,n){let o=Bni(t,e,r,n);if(m0.isNode(o)||m0.isPair(o))return Lni(t,n,o),Sme(t,o,r,n);if(typeof o!="symbol"){if(m0.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var Fni=Ka(),oXs=DNe(),sXs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},aXs=a(t=>t.replace(/[!,[\]{}]/g,e=>sXs[e]),"escapeTagName"),NNe=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+aXs(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&&Fni.isNode(e.contents)){let s={};oXs.visit(e.contents,(c,l)=>{Fni.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(` -`)}};NNe.defaultYaml={explicit:!1,version:"1.2"};NNe.defaultTags={"!!":"tag:yaml.org,2002:"};Uni.Directives=NNe});var rft=I(MNe=>{"use strict";p();var Qni=Ka(),cXs=DNe();function lXs(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(lXs,"anchorIsValid");function qni(t){let e=new Set;return cXs.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(qni,"anchorNames");function jni(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(jni,"findNewAnchor");function uXs(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=qni(t));let c=jni(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&&(Qni.isScalar(c.node)||Qni.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(uXs,"createNodeAnchors");MNe.anchorIsValid=lXs;MNe.anchorNames=qni;MNe.createNodeAnchors=uXs;MNe.findNewAnchor=jni});var Hhr=I(Hni=>{"use strict";p();function ONe(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 dXs=Ka();function Gni(t,e,r){if(Array.isArray(t))return t.map((n,o)=>Gni(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!dXs.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(Gni,"toJS");$ni.toJS=Gni});var nft=I(Wni=>{"use strict";p();var fXs=Hhr(),Vni=Ka(),pXs=LH(),Ghr=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,Vni.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(!Vni.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=pXs.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?fXs.applyReviver(s,{"":l},"",l):l}};Wni.NodeBase=Ghr});var BNe=I(zni=>{"use strict";p();var hXs=rft(),mXs=DNe(),Ime=Ka(),gXs=nft(),AXs=LH(),$hr=class extends gXs.NodeBase{static{a(this,"Alias")}constructor(e){super(Ime.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=[],mXs.visit(e,{Node:a((s,c)=>{(Ime.isAlias(c)||Ime.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||(AXs.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=ift(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(hXs.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 ift(t,e,r){if(Ime.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(Ime.isCollection(e)){let n=0;for(let o of e.items){let s=ift(t,o,r);s>n&&(n=s)}return n}else if(Ime.isPair(e)){let n=ift(t,e.key,r),o=ift(t,e.value,r);return Math.max(n,o)}return 1}a(ift,"getAliasCount");zni.Alias=$hr});var fm=I(Vhr=>{"use strict";p();var yXs=Ka(),EXs=nft(),_Xs=LH(),vXs=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),FH=class extends EXs.NodeBase{static{a(this,"Scalar")}constructor(e){super(yXs.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:_Xs.toJS(this.value,e,r)}toString(){return String(this.value)}};FH.BLOCK_FOLDED="BLOCK_FOLDED";FH.BLOCK_LITERAL="BLOCK_LITERAL";FH.PLAIN="PLAIN";FH.QUOTE_DOUBLE="QUOTE_DOUBLE";FH.QUOTE_SINGLE="QUOTE_SINGLE";Vhr.Scalar=FH;Vhr.isScalarValue=vXs});var LNe=I(Kni=>{"use strict";p();var CXs=BNe(),see=Ka(),Yni=fm(),bXs="tag:yaml.org,2002:";function SXs(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(SXs,"findTagObject");function TXs(t,e,r){if(see.isDocument(t)&&(t=t.contents),see.isNode(t))return t;if(see.isPair(t)){let h=r.schema[see.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 CXs.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=bXs+e.slice(2));let d=SXs(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new Yni.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[see.MAP]:Symbol.iterator in Object(t)?c[see.SEQ]:c[see.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 Yni.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(TXs,"createNode");Kni.createNode=TXs});var sft=I(oft=>{"use strict";p();var IXs=LNe(),d4=Ka(),xXs=nft();function Whr(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 IXs.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(Whr,"collectionFromPath");var Jni=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),zhr=class extends xXs.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=>d4.isNode(n)||d4.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(Jni(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(d4.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,Whr(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(d4.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&&d4.isScalar(s)?s.value:s:d4.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!d4.isPair(r))return!1;let n=r.value;return n==null||e&&d4.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 d4.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(d4.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,Whr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};oft.Collection=zhr;oft.collectionFromPath=Whr;oft.isEmptyPath=Jni});var FNe=I(aft=>{"use strict";p();var wXs=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function Yhr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(Yhr,"indentComment");var RXs=a((t,e,r)=>t.endsWith(` -`)?Yhr(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 yKs.TextLength(this._lineCount-1,e.length)}};u4.LineBasedText=Kut;var Ypr=class extends Kut{static{a(this,"ArrayText")}constructor(e){super(r=>e[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(` `)?` -`+Yhr(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");aft.indentComment=Yhr;aft.lineComment=RXs;aft.stringifyComment=wXs});var Xni=I(UNe=>{"use strict";p();var PXs="flow",Khr="block",cft="quoted";function kXs(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===Khr&&(y=Zni(t,y,e.length),y!==-1&&(h=y+u));for(let b;b=t[y+=1];){if(r===cft&&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===Khr&&(y=Zni(t,y,e.length)),h=y+e.length+u,m=void 0;else{if(b===" "&&g&&g!==" "&&g!==` +`+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!==` `&&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===cft){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 W2=fm(),UH=Xni(),uft=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),dft=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function DXs(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(DXs,"lineLengthOverLimit");function QNe(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(dft(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===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 `;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(Zhr,`$&${d}`));let y=!1,E,_=-1;for(E=0;E{R=!0});let P=UH.foldFlowLines(`${v}${w}${g}`,d,UH.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=nft(n,!0);c!=="folded"&&e!==J2.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{R=!0});let P=HH.foldFlowLines(`${v}${w}${g}`,d,HH.FOLD_BLOCK,x);if(!R)return`>${T} ${d}${P}`}return r=r.replace(/\n+/g,`$&${d}`),`|${T} -${d}${v}${r}${g}`}a(lft,"blockString");function NXs(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 xme(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` -`)?xme(s,e):lft(t,e,r,n);if(!l&&!f&&o!==W2.Scalar.PLAIN&&s.includes(` -`))return lft(t,e,r,n);if(dft(s)){if(u==="")return e.forceBlockIndent=!0,lft(t,e,r,n);if(l&&u===d)return xme(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 xme(s,e)}return l?h:UH.foldFlowLines(h,u,UH.FOLD_FLOW,uft(e,!1))}a(NXs,"plainString");function MXs(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!==W2.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=W2.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case W2.Scalar.BLOCK_FOLDED:case W2.Scalar.BLOCK_LITERAL:return o||s?xme(c.value,e):lft(c,e,r,n);case W2.Scalar.QUOTE_DOUBLE:return QNe(c.value,e);case W2.Scalar.QUOTE_SINGLE:return Jhr(c.value,e);case W2.Scalar.PLAIN:return NXs(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(MXs,"stringifyString");eii.stringifyString=MXs});var jNe=I(Xhr=>{"use strict";p();var OXs=rft(),QH=Ka(),BXs=FNe(),LXs=qNe();function FXs(t,e){let r=Object.assign({blockQuote:!0,commentString:BXs.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(FXs,"createStringifyContext");function UXs(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(QH.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(UXs,"getTagObject");function QXs(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=(QH.isScalar(t)||QH.isCollection(t))&&t.anchor;s&&OXs.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(QXs,"stringifyProps");function qXs(t,e,r,n){if(QH.isPair(t))return t.toString(e,r,n);if(QH.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=QH.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=UXs(e.doc.schema.tags,s));let c=QXs(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):QH.isScalar(s)?LXs.stringifyString(s,e,r,n):s.toString(e,r,n);return c?QH.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} -${e.indent}${l}`:l}a(qXs,"stringify");Xhr.createStringifyContext=FXs;Xhr.stringify=qXs});var iii=I(nii=>{"use strict";p();var m8=Ka(),tii=fm(),rii=jNe(),HNe=FNe();function jXs({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=m8.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(m8.isCollection(t)||!m8.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||m8.isCollection(t)||(m8.isScalar(t)?t.type===tii.Scalar.BLOCK_FOLDED||t.type===tii.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=rii.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+=HNe.lineComment(E,r.indent,d(m)):y&&o&&o(),E;A&&(m=null),g?(m&&(E+=HNe.lineComment(E,r.indent,d(m))),E=`? ${E} -${l}:`):(E=`${E}:`,m&&(E+=HNe.lineComment(E,r.indent,d(m))));let _,v,b;m8.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&&m8.isScalar(e)&&(r.indentAtStart=E.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&m8.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=rii.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||_||v){if(R=_?` +${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=_?` `:"",v){let x=d(v);R+=` -${HNe.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` +${eMe.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` `&&b&&(R=` `):R+=` -${r.indent}`}else if(!g&&m8.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 B=!1;if(D&&(x==="&"||x==="!")){let L=w.indexOf(" ");x==="&"&&L!==-1&&L{"use strict";p();var oii=require("process");function HXs(t,...e){t==="debug"&&console.log(...e)}a(HXs,"debug");function GXs(t,e){(t==="debug"||t==="warn")&&(typeof oii.emitWarning=="function"?oii.emitWarning(e):console.warn(e))}a(GXs,"warn");emr.debug=HXs;emr.warn=GXs});var mft=I(hft=>{"use strict";p();var GNe=Ka(),sii=fm(),fft="<<",pft={identify:a(t=>t===fft||typeof t=="symbol"&&t.description===fft,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new sii.Scalar(Symbol(fft)),{addToJSMap:aii}),"resolve"),stringify:a(()=>fft,"stringify")},$Xs=a((t,e)=>(pft.identify(e)||GNe.isScalar(e)&&(!e.type||e.type===sii.Scalar.PLAIN)&&pft.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===pft.tag&&r.default),"isMergeKey");function aii(t,e,r){if(r=t&&GNe.isAlias(r)?r.resolve(t.doc):r,GNe.isSeq(r))for(let n of r.items)rmr(t,e,n);else if(Array.isArray(r))for(let n of r)rmr(t,e,n);else rmr(t,e,r)}a(aii,"addMergeToJSMap");function rmr(t,e,r){let n=t&&GNe.isAlias(r)?r.resolve(t.doc):r;if(!GNe.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(rmr,"mergeValue");hft.addMergeToJSMap=aii;hft.isMergeKey=$Xs;hft.merge=pft});var imr=I(uii=>{"use strict";p();var VXs=tmr(),cii=mft(),WXs=jNe(),lii=Ka(),nmr=LH();function zXs(t,e,{key:r,value:n}){if(lii.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(cii.isMergeKey(t,r))cii.addMergeToJSMap(t,e,n);else{let o=nmr.toJS(r,"",t);if(e instanceof Map)e.set(o,nmr.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=YXs(r,o,t),c=nmr.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(zXs,"addPairToJSMap");function YXs(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(lii.isNode(t)&&r?.doc){let n=WXs.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(YXs,"stringifyKey");uii.addPairToJSMap=zXs});var qH=I(omr=>{"use strict";p();var dii=LNe(),KXs=iii(),JXs=imr(),gft=Ka();function ZXs(t,e,r){let n=dii.createNode(t,void 0,r),o=dii.createNode(e,void 0,r);return new Aft(n,o)}a(ZXs,"createPair");var Aft=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,gft.NODE_TYPE,{value:gft.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return gft.isNode(r)&&(r=r.clone(e)),gft.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return JXs.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?KXs.stringifyPair(this,e,r,n):JSON.stringify(this)}};omr.Pair=Aft;omr.createPair=ZXs});var smr=I(pii=>{"use strict";p();var aee=Ka(),fii=jNe(),yft=FNe();function XXs(t,e,r){return(e.inFlow??t.flow?tea:eea)(t,e,r)}a(XXs,"stringifyCollection");function eea({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&&(_+=yft.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 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;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&&(_+=yft.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?` +`+dft.indentComment(d(t),u),l&&l()):h&&c&&c(),g}a(pXs,"stringifyBlockCollection");function hXs({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&&(_+=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?` ${s}${o}${y}`:` `;return`${A} -${o}${g}`}else return`${m}${c}${h.join(" ")}${c}${g}`}a(tea,"stringifyFlowCollection");function Eft({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=yft.indentComment(e(n),t);r.push(s.trimStart())}}a(Eft,"addCommentBefore");pii.stringifyCollection=XXs});var HH=I(cmr=>{"use strict";p();var rea=smr(),nea=imr(),iea=sft(),jH=Ka(),_ft=qH(),oea=fm();function $Ne(t,e){let r=jH.isScalar(e)?e.value:e;for(let n of t)if(jH.isPair(n)&&(n.key===e||n.key===r||jH.isScalar(n.key)&&n.key.value===r))return n}a($Ne,"findPair");var amr=class extends iea.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(jH.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(_ft.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;jH.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new _ft.Pair(e,e?.value):n=new _ft.Pair(e.key,e.value);let o=$Ne(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);jH.isScalar(o.value)&&oea.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=$Ne(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=$Ne(this.items,e)?.value;return(!r&&jH.isScalar(o)?o.value:o)??void 0}has(e){return!!$Ne(this.items,e)}set(e,r){this.add(new _ft.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)nea.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!jH.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})),rea.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};cmr.YAMLMap=amr;cmr.findPair=$Ne});var wme=I(mii=>{"use strict";p();var sea=Ka(),hii=HH(),aea={collection:"map",default:!0,nodeClass:hii.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return sea.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>hii.YAMLMap.from(t,e,r),"createNode")};mii.map=aea});var GH=I(gii=>{"use strict";p();var cea=LNe(),lea=smr(),uea=sft(),Cft=Ka(),dea=fm(),fea=LH(),lmr=class extends uea.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Cft.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=vft(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=vft(e);if(typeof n!="number")return;let o=this.items[n];return!r&&Cft.isScalar(o)?o.value:o}has(e){let r=vft(e);return typeof r=="number"&&r=0?e:null}a(vft,"asItemIndex");gii.YAMLSeq=lmr});var Rme=I(yii=>{"use strict";p();var pea=Ka(),Aii=GH(),hea={collection:"seq",default:!0,nodeClass:Aii.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return pea.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>Aii.YAMLSeq.from(t,e,r),"createNode")};yii.seq=hea});var VNe=I(Eii=>{"use strict";p();var mea=qNe(),gea={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),mea.stringifyString(t,e,r,n)}};Eii.string=gea});var bft=I(Cii=>{"use strict";p();var _ii=fm(),vii={identify:a(t=>t==null,"identify"),createNode:a(()=>new _ii.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new _ii.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&vii.test.test(t)?t:e.options.nullStr,"stringify")};Cii.nullTag=vii});var umr=I(Sii=>{"use strict";p();var Aea=fm(),bii={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 Aea.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&bii.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};Sii.boolTag=bii});var Pme=I(Tii=>{"use strict";p();function yea({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(yea,"stringifyNumber");Tii.stringifyNumber=yea});var fmr=I(Sft=>{"use strict";p();var Eea=fm(),dmr=Pme(),_ea={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:dmr.stringifyNumber},vea={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():dmr.stringifyNumber(t)}},Cea={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 Eea.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:dmr.stringifyNumber};Sft.float=Cea;Sft.floatExp=vea;Sft.floatNaN=_ea});var hmr=I(Ift=>{"use strict";p();var Iii=Pme(),Tft=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),pmr=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function xii(t,e,r){let{value:n}=t;return Tft(n)&&n>=0?r+n.toString(e):Iii.stringifyNumber(t)}a(xii,"intStringify");var bea={identify:a(t=>Tft(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>pmr(t,2,8,r),"resolve"),stringify:a(t=>xii(t,8,"0o"),"stringify")},Sea={identify:Tft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>pmr(t,0,10,r),"resolve"),stringify:Iii.stringifyNumber},Tea={identify:a(t=>Tft(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)=>pmr(t,2,16,r),"resolve"),stringify:a(t=>xii(t,16,"0x"),"stringify")};Ift.int=Sea;Ift.intHex=Tea;Ift.intOct=bea});var Rii=I(wii=>{"use strict";p();var Iea=wme(),xea=bft(),wea=Rme(),Rea=VNe(),Pea=umr(),mmr=fmr(),gmr=hmr(),kea=[Iea.map,wea.seq,Rea.string,xea.nullTag,Pea.boolTag,gmr.intOct,gmr.int,gmr.intHex,mmr.floatNaN,mmr.floatExp,mmr.float];wii.schema=kea});var Dii=I(kii=>{"use strict";p();var Dea=fm(),Nea=wme(),Mea=Rme();function Pii(t){return typeof t=="bigint"||Number.isInteger(t)}a(Pii,"intIdentify");var xft=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),Oea=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:xft},{identify:a(t=>t==null,"identify"),createNode:a(()=>new Dea.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:xft},{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:xft},{identify:Pii,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})=>Pii(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:xft}],Bea={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Lea=[Nea.map,Mea.seq].concat(Oea,Bea);kii.schema=Lea});var ymr=I(Nii=>{"use strict";p();var WNe=require("buffer"),Amr=fm(),Fea=qNe(),Uea={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof WNe.Buffer=="function")return WNe.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 wft=Ka(),Emr=qH(),Qea=fm(),qea=GH();function Mii(t,e){if(wft.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new Emr.Pair(new Qea.Scalar(null));if(n.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${n.commentBefore} +${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.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]=wft.isPair(n)?n:new Emr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(Mii,"resolvePairs");function Oii(t,e,r){let{replacer:n}=r,o=new qea.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(Emr.createPair(l,u,r))}return o}a(Oii,"createPairs");var jea={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Mii,createNode:Oii};Rft.createPairs=Oii;Rft.pairs=jea;Rft.resolvePairs=Mii});var Cmr=I(vmr=>{"use strict";p();var Bii=Ka(),_mr=LH(),zNe=HH(),Hea=GH(),Lii=Pft(),cee=class t extends Hea.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=zNe.YAMLMap.prototype.add.bind(this),this.delete=zNe.YAMLMap.prototype.delete.bind(this),this.get=zNe.YAMLMap.prototype.get.bind(this),this.has=zNe.YAMLMap.prototype.has.bind(this),this.set=zNe.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(Bii.isPair(o)?(s=_mr.toJS(o.key,"",r),c=_mr.toJS(o.value,s,r)):s=_mr.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=Lii.createPairs(e,r,n),s=new this;return s.items=o.items,s}};cee.tag="tag:yaml.org,2002:omap";var Gea={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:cee,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Lii.resolvePairs(t,e),n=[];for(let{key:o}of r.items)Bii.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new cee,r)},createNode:a((t,e,r)=>cee.from(t,e,r),"createNode")};vmr.YAMLOMap=cee;vmr.omap=Gea});var jii=I(bmr=>{"use strict";p();var Fii=fm();function Uii({value:t,source:e},r){return e&&(t?Qii:qii).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(Uii,"boolStringify");var Qii={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 Fii.Scalar(!0),"resolve"),stringify:Uii},qii={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 Fii.Scalar(!1),"resolve"),stringify:Uii};bmr.falseTag=qii;bmr.trueTag=Qii});var Hii=I(kft=>{"use strict";p();var $ea=fm(),Smr=Pme(),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:Smr.stringifyNumber},Wea={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():Smr.stringifyNumber(t)}},zea={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:Smr.stringifyNumber};kft.float=zea;kft.floatExp=Wea;kft.floatNaN=Vea});var $ii=I(KNe=>{"use strict";p();var Gii=Pme(),YNe=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function Dft(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(Dft,"intResolve");function Tmr(t,e,r){let{value:n}=t;if(YNe(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return Gii.stringifyNumber(t)}a(Tmr,"intStringify");var Yea={identify:YNe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>Dft(t,2,2,r),"resolve"),stringify:a(t=>Tmr(t,2,"0b"),"stringify")},Kea={identify:YNe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>Dft(t,1,8,r),"resolve"),stringify:a(t=>Tmr(t,8,"0"),"stringify")},Jea={identify:YNe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>Dft(t,0,10,r),"resolve"),stringify:Gii.stringifyNumber},Zea={identify:YNe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>Dft(t,2,16,r),"resolve"),stringify:a(t=>Tmr(t,16,"0x"),"stringify")};KNe.int=Jea;KNe.intBin=Yea;KNe.intHex=Zea;KNe.intOct=Kea});var xmr=I(Imr=>{"use strict";p();var Oft=Ka(),Nft=qH(),Mft=HH(),lee=class t extends Mft.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;Oft.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Nft.Pair(e.key,null):r=new Nft.Pair(e,null),Mft.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Mft.findPair(this.items,e);return!r&&Oft.isPair(n)?Oft.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=Mft.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Nft.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(Nft.createPair(c,null,n));return s}};lee.tag="tag:yaml.org,2002:set";var Xea={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:lee,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>lee.from(t,e,r),"createNode"),resolve(t,e){if(Oft.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new lee,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Imr.YAMLSet=lee;Imr.set=Xea});var Rmr=I(Bft=>{"use strict";p();var eta=Pme();function wmr(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(wmr,"parseSexagesimal");function Vii(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 eta.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(Vii,"stringifySexagesimal");var tta={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})=>wmr(t,r),"resolve"),stringify:Vii},rta={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=>wmr(t,!1),"resolve"),stringify:Vii},Wii={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(Wii.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=wmr(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")};Bft.floatTime=rta;Bft.intTime=tta;Bft.timestamp=Wii});var Kii=I(Yii=>{"use strict";p();var nta=wme(),ita=bft(),ota=Rme(),sta=VNe(),ata=ymr(),zii=jii(),Pmr=Hii(),Lft=$ii(),cta=mft(),lta=Cmr(),uta=Pft(),dta=xmr(),kmr=Rmr(),fta=[nta.map,ota.seq,sta.string,ita.nullTag,zii.trueTag,zii.falseTag,Lft.intBin,Lft.intOct,Lft.int,Lft.intHex,Pmr.floatNaN,Pmr.floatExp,Pmr.float,ata.binary,cta.merge,lta.omap,uta.pairs,dta.set,kmr.intTime,kmr.floatTime,kmr.timestamp];Yii.schema=fta});var soi=I(Mmr=>{"use strict";p();var eoi=wme(),pta=bft(),toi=Rme(),hta=VNe(),mta=umr(),Dmr=fmr(),Nmr=hmr(),gta=Rii(),Ata=Dii(),roi=ymr(),JNe=mft(),noi=Cmr(),ioi=Pft(),Jii=Kii(),ooi=xmr(),Fft=Rmr(),Zii=new Map([["core",gta.schema],["failsafe",[eoi.map,toi.seq,hta.string]],["json",Ata.schema],["yaml11",Jii.schema],["yaml-1.1",Jii.schema]]),Xii={binary:roi.binary,bool:mta.boolTag,float:Dmr.float,floatExp:Dmr.floatExp,floatNaN:Dmr.floatNaN,floatTime:Fft.floatTime,int:Nmr.int,intHex:Nmr.intHex,intOct:Nmr.intOct,intTime:Fft.intTime,map:eoi.map,merge:JNe.merge,null:pta.nullTag,omap:noi.omap,pairs:ioi.pairs,seq:toi.seq,set:ooi.set,timestamp:Fft.timestamp},yta={"tag:yaml.org,2002:binary":roi.binary,"tag:yaml.org,2002:merge":JNe.merge,"tag:yaml.org,2002:omap":noi.omap,"tag:yaml.org,2002:pairs":ioi.pairs,"tag:yaml.org,2002:set":ooi.set,"tag:yaml.org,2002:timestamp":Fft.timestamp};function Eta(t,e,r){let n=Zii.get(e);if(n&&!t)return r&&!n.includes(JNe.merge)?n.concat(JNe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(Zii.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(JNe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?Xii[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys(Xii).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(Eta,"getTags");Mmr.coreKnownTags=yta;Mmr.getTags=Eta});var Lmr=I(aoi=>{"use strict";p();var Omr=Ka(),_ta=wme(),vta=Rme(),Cta=VNe(),Uft=soi(),bta=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),Bmr=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)?Uft.getTags(e,"compat"):e?Uft.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?Uft.coreKnownTags:{},this.tags=Uft.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Omr.MAP,{value:_ta.map}),Object.defineProperty(this,Omr.SCALAR,{value:Cta.string}),Object.defineProperty(this,Omr.SEQ,{value:vta.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?bta:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};aoi.Schema=Bmr});var loi=I(coi=>{"use strict";p();var Sta=Ka(),Fmr=jNe(),ZNe=FNe();function Tta(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=Fmr.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(ZNe.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(Sta.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(ZNe.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=Fmr.stringify(t.contents,o,()=>l=null,u);l&&(d+=ZNe.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(Fmr.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` -`)?(r.push("..."),r.push(ZNe.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(ZNe.indentComment(s(u),"")))}return r.join(` +${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(` `)+` -`}a(Tta,"stringifyDocument");coi.stringifyDocument=Tta});var XNe=I(uoi=>{"use strict";p();var Ita=BNe(),kme=sft(),aR=Ka(),xta=qH(),wta=LH(),Rta=Lmr(),Pta=loi(),Umr=rft(),kta=Hhr(),Dta=LNe(),Qmr=jhr(),qmr=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,aR.NODE_TYPE,{value:aR.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 Qmr.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,{[aR.NODE_TYPE]:{value:aR.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=aR.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Dme(this.contents)&&this.contents.add(e)}addIn(e,r){Dme(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Umr.anchorNames(this);e.anchor=!r||n.has(r)?Umr.findNewAnchor(r||"a",n):r}return new Ita.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}=Umr.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=Dta.createNode(e,f,A);return l&&aR.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 xta.Pair(o,s)}delete(e){return Dme(this.contents)?this.contents.delete(e):!1}deleteIn(e){return kme.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Dme(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return aR.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return kme.isEmptyPath(e)?!r&&aR.isScalar(this.contents)?this.contents.value:this.contents:aR.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return aR.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return kme.isEmptyPath(e)?this.contents!==void 0:aR.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=kme.collectionFromPath(this.schema,[e],r):Dme(this.contents)&&this.contents.set(e,r)}setIn(e,r){kme.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=kme.collectionFromPath(this.schema,Array.from(e),r):Dme(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 Qmr.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 Qmr.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 Rta.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=wta.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"?kta.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 Pta.stringifyDocument(this,e)}};function Dme(t){if(aR.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(Dme,"assertCollection");uoi.Document=qmr});var rMe=I(tMe=>{"use strict";p();var eMe=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}},jmr=class extends eMe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},Hmr=class extends eMe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},Nta=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(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 `),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");tMe.YAMLError=eMe;tMe.YAMLParseError=jmr;tMe.YAMLWarning=Hmr;tMe.prettifyError=Nta});var nMe=I(doi=>{"use strict";p();function Mta(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(Mta,"resolveProps");doi.resolveProps=Mta});var Qft=I(foi=>{"use strict";p();function Gmr(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(Gmr(e.key)||Gmr(e.value))return!0}return!1;default:return!0}}a(Gmr,"containsNewline");foi.containsNewline=Gmr});var $mr=I(poi=>{"use strict";p();var Ota=Qft();function Bta(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Ota.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(Bta,"flowIndentCheck");poi.flowIndentCheck=Bta});var Vmr=I(moi=>{"use strict";p();var hoi=Ka();function Lta(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||hoi.isScalar(s)&&hoi.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(Lta,"mapIncludes");moi.mapIncludes=Lta});var voi=I(_oi=>{"use strict";p();var goi=qH(),Fta=HH(),Aoi=nMe(),Uta=Qft(),yoi=$mr(),Qta=Vmr(),Eoi="All mapping items must start at the same column";function qta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??Fta.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=Aoi.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",Eoi)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` -`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||Uta.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",Eoi);r.atKey=!0;let _=y.end,v=m?t(r,m,y,o):e(r,_,h,null,y,o);r.schema.compat&&yoi.flowIndentCheck(n.indent,m,o),r.atKey=!1,Qta.mapIncludes(r,l.items,v)&&o(_,"DUPLICATE_KEY","Map keys must be unique");let b=Aoi.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 jta=GH(),Hta=nMe(),Gta=$mr();function $ta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??jta.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=Hta.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&&Gta.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");Coi.resolveBlockSeq=$ta});var Nme=I(Soi=>{"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");Soi.resolveEnd=Vta});var woi=I(xoi=>{"use strict";p();var Wta=Ka(),zta=qH(),Toi=HH(),Yta=GH(),Kta=Nme(),Ioi=nMe(),Jta=Qft(),Zta=Vmr(),Wmr="Block collections are not allowed within flow collections",zmr=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function Xta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?Toi.YAMLMap:Yta.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=Kta.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(Xta,"resolveFlowCollection");xoi.resolveFlowCollection=Xta});var Poi=I(Roi=>{"use strict";p();var era=Ka(),tra=fm(),rra=HH(),nra=GH(),ira=voi(),ora=boi(),sra=woi();function Ymr(t,e,r,n,o,s){let c=r.type==="block-map"?ira.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?ora.resolveBlockSeq(t,e,r,n,s):sra.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(Ymr,"resolveCollection");function ara(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),Ymr(t,e,r,o,c)}let d=Ymr(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=era.isNode(f)?f:new tra.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(ara,"composeCollection");Roi.composeCollection=ara});var Jmr=I(koi=>{"use strict";p();var Kmr=fm();function cra(t,e,r){let n=e.offset,o=lra(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?Kmr.Scalar.BLOCK_FOLDED:Kmr.Scalar.BLOCK_LITERAL,c=e.source?ura(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");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?` `.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=` @@ -432,75 +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(cra,"resolveBlockScalar");function lra({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 Zmr=fm(),dra=Nme();function fra(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=pra(s,d);break;case"single-quoted-scalar":l=Zmr.Scalar.QUOTE_SINGLE,u=hra(s,d);break;case"double-quoted-scalar":l=Zmr.Scalar.QUOTE_DOUBLE,u=mra(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=dra.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(fra,"resolveFlowScalar");function pra(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}`),Doi(t)}a(pra,"plainValue");function hra(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Doi(t.slice(1,-1)).replace(/''/g,"'")}a(hra,"singleQuotedValue");function Doi(t){let e,r;try{e=new RegExp(`(.*?)(?{"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(`(.*?)(?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(mra,"doubleQuotedValue");function gra(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(wta,"doubleQuotedValue");function Rta(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(gra,"foldNewline");var Ara={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function yra(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(yra,"parseCharCode");Noi.resolveFlowScalar=fra});var Boi=I(Ooi=>{"use strict";p();var uee=Ka(),Moi=fm(),Era=Jmr(),_ra=Xmr();function vra(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?Era.resolveBlockScalar(t,e,n):_ra.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[uee.SCALAR]:u?d=Cra(t.schema,o,u,r,n):e.type==="scalar"?d=bra(t,o,e,n):d=t.schema[uee.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=uee.isScalar(h)?h:new Moi.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new Moi.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(vra,"composeScalar");function Cra(t,e,r,n,o){if(r==="!")return t[uee.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[uee.SCALAR])}a(Cra,"findScalarTagByName");function bra({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[uee.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[uee.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(bra,"findScalarTagByTest");Ooi.composeScalar=vra});var Foi=I(Loi=>{"use strict";p();function Sra(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(Sra,"emptyScalarPosition");Loi.emptyScalarPosition=Sra});var qoi=I(t0r=>{"use strict";p();var Tra=BNe(),Ira=Ka(),xra=Poi(),Uoi=Boi(),wra=Nme(),Rra=Foi(),Pra={composeNode:Qoi,composeEmptyNode:e0r};function Qoi(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=kra(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=Uoi.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=xra.composeCollection(Pra,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=e0r(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&&(!Ira.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(Qoi,"composeNode");function e0r(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:Rra.emptyScalarPosition(e,r,n),indent:-1,source:""},h=Uoi.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(e0r,"composeEmptyNode");function kra({options:t},{offset:e,source:r,end:n},o){let s=new Tra.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=wra.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(kra,"composeAlias");t0r.composeEmptyNode=e0r;t0r.composeNode=Qoi});var Goi=I(Hoi=>{"use strict";p();var Dra=XNe(),joi=qoi(),Nra=Nme(),Mra=nMe();function Ora(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new Dra.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=Mra.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?joi.composeNode(d,o,f,c):joi.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=Nra.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(Ora,"composeDoc");Hoi.composeDoc=Ora});var n0r=I(Woi=>{"use strict";p();var Bra=require("process"),Lra=jhr(),Fra=XNe(),iMe=rMe(),$oi=Ka(),Ura=Goi(),Qra=Nme();function oMe(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(oMe,"getErrorPos");function Voi(t){let e="",r=!1,n=!1;for(let o=0;o{"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{let c=oMe(r);s?this.warnings.push(new iMe.YAMLWarning(c,n,o)):this.errors.push(new iMe.YAMLParseError(c,n,o))},this.directives=new Lra.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=Voi(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($oi.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];$oi.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(koi,"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=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} ${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:Voi(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(Bra.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=oMe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Ura.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 iMe.YAMLParseError(oMe(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 iMe.YAMLParseError(oMe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Qra.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 iMe.YAMLParseError(oMe(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 Fra.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}}};Woi.Composer=r0r});var Koi=I(qft=>{"use strict";p();var qra=Jmr(),jra=Xmr(),Hra=rMe(),zoi=qNe();function Gra(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 Hra.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return jra.resolveFlowScalar(t,e,n);case"block-scalar":return qra.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(Gra,"resolveAsScalar");function $ra(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=zoi.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: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:` `}];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 Yoi(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=zoi.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">":Wra(t,u);break;case'"':i0r(t,u,"double-quoted-scalar");break;case"'":i0r(t,u,"single-quoted-scalar");break;default:i0r(t,u,"scalar")}}a(Vra,"setScalarValue");function Wra(t,e){let r=e.indexOf(` +`,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(` `),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}];Yoi(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(Wra,"setBlockScalarValue");function Yoi(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(Yoi,"addEndtoBlockProps");function i0r(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(i0r,"setFlowScalarValue");qft.createScalarToken=$ra;qft.resolveAsScalar=Gra;qft.setScalarValue=Vra});var Zoi=I(Joi=>{"use strict";p();var zra=a(t=>"type"in t?Hft(t):jft(t),"stringify");function Hft(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Hft(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=jft(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=jft(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=jft(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(Hft,"stringifyToken");function jft({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=Hft(e)),r)for(let s of r)o+=s.source;return n&&(o+=Hft(n)),o}a(jft,"stringifyItem");Joi.stringify=zra});var rsi=I(tsi=>{"use strict";p();var o0r=Symbol("break visit"),Yra=Symbol("skip children"),Xoi=Symbol("remove item");function dee(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),esi(Object.freeze([]),t,e)}a(dee,"visit");dee.BREAK=o0r;dee.SKIP=Yra;dee.REMOVE=Xoi;dee.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};dee.parentCollection=(t,e)=>{let r=dee.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 esi(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 s0r=Koi(),Kra=Zoi(),Jra=rsi(),a0r="\uFEFF",c0r="",l0r="",u0r="",Zra=a(t=>!!t&&"items"in t,"isCollection"),Xra=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function ena(t){switch(t){case a0r:return"";case c0r:return"";case l0r:return"";case u0r:return"";default:return JSON.stringify(t)}}a(ena,"prettyToken");function tna(t){switch(t){case a0r:return"byte-order-mark";case c0r:return"doc-mode";case l0r:return"flow-error-end";case u0r: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}];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` `: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(tna,"tokenType");kb.createScalarToken=s0r.createScalarToken;kb.resolveAsScalar=s0r.resolveAsScalar;kb.setScalarValue=s0r.setScalarValue;kb.stringify=Kra.stringify;kb.visit=Jra.visit;kb.BOM=a0r;kb.DOCUMENT=c0r;kb.FLOW_END=l0r;kb.SCALAR=u0r;kb.isCollection=Zra;kb.isScalar=Xra;kb.prettyToken=ena;kb.tokenType=tna});var p0r=I(isi=>{"use strict";p();var sMe=Gft();function z2(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}a(z2,"isEmpty");var nsi=new Set("0123456789ABCDEFabcdef"),rna=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),$ft=new Set(",[]{}"),nna=new Set(` ,[]{} -\r `),d0r=a(t=>!t||nna.has(t),"isNotAnchorChar"),f0r=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(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===` `?!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(d0r),"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==="...")&&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"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=>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` `: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 sMe.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&&$ft.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 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===` `?(n+=1,o=` -`,s=this.buffer[n+1]):r=n),s==="#"||e&&$ft.has(s))break;if(o===` -`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&$ft.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield sMe.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(d0r))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(z2(r)||e&&$ft.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(rna.has(r))r=this.buffer[++e];else if(r==="%"&&nsi.has(this.buffer[e+1])&&nsi.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&&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===` `?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)}};isi.Lexer=f0r});var m0r=I(osi=>{"use strict";p();var h0r=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 ina=require("process"),ssi=Gft(),ona=p0r();function $H(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(Mme,"getFirstKeyStartProps");function csi(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!$H(e.start,"explicit-key-ind")&&!$H(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,lsi(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(csi,"fixFlowSeqItems");var g0r=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 ona.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,ina.env.LOG_TOKENS&&console.log("|",ssi.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=ssi.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"&&csi(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&&asi(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)}};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.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($H(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(lsi(r.key)&&!$H(r.sep,"newline")){let c=Mme(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($H(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=Mme(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]}):$H(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&&!$H(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||$H(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=Vft(n),s=Mme(o);csi(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(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(` `)+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=Vft(e),n=Mme(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=Vft(e),n=Mme(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())}}};usi.Parser=g0r});var msi=I(cMe=>{"use strict";p();var dsi=n0r(),sna=XNe(),aMe=rMe(),ana=tmr(),cna=Ka(),lna=m0r(),fsi=A0r();function psi(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new lna.LineCounter||null,prettyErrors:e}}a(psi,"parseOptions");function una(t,e={}){let{lineCounter:r,prettyErrors:n}=psi(e),o=new fsi.Parser(r?.addNewLine),s=new dsi.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(aMe.prettifyError(t,r)),l.warnings.forEach(aMe.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(una,"parseAllDocuments");function hsi(t,e={}){let{lineCounter:r,prettyErrors:n}=psi(e),o=new fsi.Parser(r?.addNewLine),s=new dsi.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 aMe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(aMe.prettifyError(t,r)),c.warnings.forEach(aMe.prettifyError(t,r))),c}a(hsi,"parseDocument");function dna(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=hsi(t,r);if(!o)return null;if(o.warnings.forEach(s=>ana.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(dna,"parse");function fna(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 cna.isDocument(t)&&!n?t.toString(r):new sna.Document(t,n,r).toString(r)}a(fna,"stringify");cMe.parse=dna;cMe.parseAllDocuments=una;cMe.parseDocument=hsi;cMe.stringify=fna});var Asi=I(Uc=>{"use strict";p();var pna=n0r(),hna=XNe(),mna=Lmr(),y0r=rMe(),gna=BNe(),VH=Ka(),Ana=qH(),yna=fm(),Ena=HH(),_na=GH(),vna=Gft(),Cna=p0r(),bna=m0r(),Sna=A0r(),Wft=msi(),gsi=DNe();Uc.Composer=pna.Composer;Uc.Document=hna.Document;Uc.Schema=mna.Schema;Uc.YAMLError=y0r.YAMLError;Uc.YAMLParseError=y0r.YAMLParseError;Uc.YAMLWarning=y0r.YAMLWarning;Uc.Alias=gna.Alias;Uc.isAlias=VH.isAlias;Uc.isCollection=VH.isCollection;Uc.isDocument=VH.isDocument;Uc.isMap=VH.isMap;Uc.isNode=VH.isNode;Uc.isPair=VH.isPair;Uc.isScalar=VH.isScalar;Uc.isSeq=VH.isSeq;Uc.Pair=Ana.Pair;Uc.Scalar=yna.Scalar;Uc.YAMLMap=Ena.YAMLMap;Uc.YAMLSeq=_na.YAMLSeq;Uc.CST=vna;Uc.Lexer=Cna.Lexer;Uc.LineCounter=bna.LineCounter;Uc.Parser=Sna.Parser;Uc.parse=Wft.parse;Uc.parseAllDocuments=Wft.parseAllDocuments;Uc.parseDocument=Wft.parseDocument;Uc.stringify=Wft.stringify;Uc.visit=gsi.visit;Uc.visitAsync=gsi.visitAsync});var ysi=I(zft=>{"use strict";p();Object.defineProperty(zft,"__esModule",{value:!0});zft.FetchCancellationError=void 0;var Tna=Is(),E0r=class extends Tna.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};zft.FetchCancellationError=E0r});var lMe=I(cR=>{"use strict";p();Object.defineProperty(cR,"__esModule",{value:!0});cR.NullLanguageContextService=cR.TriggerKind=cR.KnownSources=cR.ContextKind=cR.ILanguageContextService=void 0;var Ina=rn();cR.ILanguageContextService=(0,Ina.createServiceIdentifier)("ILanguageContextService");var Esi;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(Esi||(cR.ContextKind=Esi={}));var _si;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(_si||(cR.KnownSources=_si={}));var vsi;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(vsi||(cR.TriggerKind=vsi={}));var _0r=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};cR.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new _0r,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var bsi=I(Yft=>{"use strict";p();Object.defineProperty(Yft,"__esModule",{value:!0});Yft.serializeLanguageContext=wna;Yft.serializeFileDiagnostics=Nna;var xna=zp(),v0r=lMe();function wna(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:Rna(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(wna,"serializeLanguageContext");function Rna(t){switch(t.kind){case v0r.ContextKind.Snippet:return Pna(t);case v0r.ContextKind.Trait:return kna(t);case v0r.ContextKind.DiagnosticBag:return Dna(t)}}a(Rna,"serializeLanguageContextItem");function Pna(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(Pna,"serializeSnippetContext");function kna(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(kna,"serializeTraitContext");function Dna(t){let e=t.values.map(r=>Csi(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(Dna,"serializeDiagnosticBagContext");function Csi(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 xna.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(Csi,"serializeDiagnostic");function Nna(t){return t.flatMap(([e,r])=>r.map(n=>Csi(n,e)))}a(Nna,"serializeFileDiagnostics")});var b0r=I(C0r=>{"use strict";p();Object.defineProperty(C0r,"__esModule",{value:!0});C0r.stringifyChatMessages=Mna;var Kft=xo();function Mna(t){return t.map(Ona).join(` -`)}a(Mna,"stringifyChatMessages");function Ona({role:t,content:e}){if(t!==Kft.Raw.ChatRole.User&&t!==Kft.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===Kft.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==Kft.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} +`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=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} + (-> 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(` +`).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} ------ ${n.text} -==================`}a(Ona,"stringifyMessage")});var T0r=I(Jft=>{"use strict";p();Object.defineProperty(Jft,"__esModule",{value:!0});Jft.register=Lna;Jft.getCodiconFontCharacters=Fna;var Bna=SS(),S0r=Object.create(null);function Lna(t,e){if((0,Bna.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(Lna,"register");function Fna(){return S0r}a(Fna,"getCodiconFontCharacters")});var Ssi=I(Zft=>{"use strict";p();Object.defineProperty(Zft,"__esModule",{value:!0});Zft.codiconsLibrary=void 0;var V=T0r();Zft.codiconsLibrary={add:(0,V.register)("add",6e4),plus:(0,V.register)("plus",6e4),gistNew:(0,V.register)("gist-new",6e4),repoCreate:(0,V.register)("repo-create",6e4),lightbulb:(0,V.register)("lightbulb",60001),lightBulb:(0,V.register)("light-bulb",60001),repo:(0,V.register)("repo",60002),repoDelete:(0,V.register)("repo-delete",60002),gistFork:(0,V.register)("gist-fork",60003),repoForked:(0,V.register)("repo-forked",60003),gitPullRequest:(0,V.register)("git-pull-request",60004),gitPullRequestAbandoned:(0,V.register)("git-pull-request-abandoned",60004),recordKeys:(0,V.register)("record-keys",60005),keyboard:(0,V.register)("keyboard",60005),tag:(0,V.register)("tag",60006),gitPullRequestLabel:(0,V.register)("git-pull-request-label",60006),tagAdd:(0,V.register)("tag-add",60006),tagRemove:(0,V.register)("tag-remove",60006),person:(0,V.register)("person",60007),personFollow:(0,V.register)("person-follow",60007),personOutline:(0,V.register)("person-outline",60007),personFilled:(0,V.register)("person-filled",60007),sourceControl:(0,V.register)("source-control",60008),mirror:(0,V.register)("mirror",60009),mirrorPublic:(0,V.register)("mirror-public",60009),star:(0,V.register)("star",60010),starAdd:(0,V.register)("star-add",60010),starDelete:(0,V.register)("star-delete",60010),starEmpty:(0,V.register)("star-empty",60010),comment:(0,V.register)("comment",60011),commentAdd:(0,V.register)("comment-add",60011),alert:(0,V.register)("alert",60012),warning:(0,V.register)("warning",60012),search:(0,V.register)("search",60013),searchSave:(0,V.register)("search-save",60013),logOut:(0,V.register)("log-out",60014),signOut:(0,V.register)("sign-out",60014),logIn:(0,V.register)("log-in",60015),signIn:(0,V.register)("sign-in",60015),eye:(0,V.register)("eye",60016),eyeUnwatch:(0,V.register)("eye-unwatch",60016),eyeWatch:(0,V.register)("eye-watch",60016),circleFilled:(0,V.register)("circle-filled",60017),primitiveDot:(0,V.register)("primitive-dot",60017),closeDirty:(0,V.register)("close-dirty",60017),debugBreakpoint:(0,V.register)("debug-breakpoint",60017),debugBreakpointDisabled:(0,V.register)("debug-breakpoint-disabled",60017),debugHint:(0,V.register)("debug-hint",60017),terminalDecorationSuccess:(0,V.register)("terminal-decoration-success",60017),primitiveSquare:(0,V.register)("primitive-square",60018),edit:(0,V.register)("edit",60019),pencil:(0,V.register)("pencil",60019),info:(0,V.register)("info",60020),issueOpened:(0,V.register)("issue-opened",60020),gistPrivate:(0,V.register)("gist-private",60021),gitForkPrivate:(0,V.register)("git-fork-private",60021),lock:(0,V.register)("lock",60021),mirrorPrivate:(0,V.register)("mirror-private",60021),close:(0,V.register)("close",60022),removeClose:(0,V.register)("remove-close",60022),x:(0,V.register)("x",60022),repoSync:(0,V.register)("repo-sync",60023),sync:(0,V.register)("sync",60023),clone:(0,V.register)("clone",60024),desktopDownload:(0,V.register)("desktop-download",60024),beaker:(0,V.register)("beaker",60025),microscope:(0,V.register)("microscope",60025),vm:(0,V.register)("vm",60026),deviceDesktop:(0,V.register)("device-desktop",60026),file:(0,V.register)("file",60027),more:(0,V.register)("more",60028),ellipsis:(0,V.register)("ellipsis",60028),kebabHorizontal:(0,V.register)("kebab-horizontal",60028),mailReply:(0,V.register)("mail-reply",60029),reply:(0,V.register)("reply",60029),organization:(0,V.register)("organization",60030),organizationFilled:(0,V.register)("organization-filled",60030),organizationOutline:(0,V.register)("organization-outline",60030),newFile:(0,V.register)("new-file",60031),fileAdd:(0,V.register)("file-add",60031),newFolder:(0,V.register)("new-folder",60032),fileDirectoryCreate:(0,V.register)("file-directory-create",60032),trash:(0,V.register)("trash",60033),trashcan:(0,V.register)("trashcan",60033),history:(0,V.register)("history",60034),clock:(0,V.register)("clock",60034),folder:(0,V.register)("folder",60035),fileDirectory:(0,V.register)("file-directory",60035),symbolFolder:(0,V.register)("symbol-folder",60035),logoGithub:(0,V.register)("logo-github",60036),markGithub:(0,V.register)("mark-github",60036),github:(0,V.register)("github",60036),terminal:(0,V.register)("terminal",60037),console:(0,V.register)("console",60037),repl:(0,V.register)("repl",60037),zap:(0,V.register)("zap",60038),symbolEvent:(0,V.register)("symbol-event",60038),error:(0,V.register)("error",60039),stop:(0,V.register)("stop",60039),variable:(0,V.register)("variable",60040),symbolVariable:(0,V.register)("symbol-variable",60040),array:(0,V.register)("array",60042),symbolArray:(0,V.register)("symbol-array",60042),symbolModule:(0,V.register)("symbol-module",60043),symbolPackage:(0,V.register)("symbol-package",60043),symbolNamespace:(0,V.register)("symbol-namespace",60043),symbolObject:(0,V.register)("symbol-object",60043),symbolMethod:(0,V.register)("symbol-method",60044),symbolFunction:(0,V.register)("symbol-function",60044),symbolConstructor:(0,V.register)("symbol-constructor",60044),symbolBoolean:(0,V.register)("symbol-boolean",60047),symbolNull:(0,V.register)("symbol-null",60047),symbolNumeric:(0,V.register)("symbol-numeric",60048),symbolNumber:(0,V.register)("symbol-number",60048),symbolStructure:(0,V.register)("symbol-structure",60049),symbolStruct:(0,V.register)("symbol-struct",60049),symbolParameter:(0,V.register)("symbol-parameter",60050),symbolTypeParameter:(0,V.register)("symbol-type-parameter",60050),symbolKey:(0,V.register)("symbol-key",60051),symbolText:(0,V.register)("symbol-text",60051),symbolReference:(0,V.register)("symbol-reference",60052),goToFile:(0,V.register)("go-to-file",60052),symbolEnum:(0,V.register)("symbol-enum",60053),symbolValue:(0,V.register)("symbol-value",60053),symbolRuler:(0,V.register)("symbol-ruler",60054),symbolUnit:(0,V.register)("symbol-unit",60054),activateBreakpoints:(0,V.register)("activate-breakpoints",60055),archive:(0,V.register)("archive",60056),arrowBoth:(0,V.register)("arrow-both",60057),arrowDown:(0,V.register)("arrow-down",60058),arrowLeft:(0,V.register)("arrow-left",60059),arrowRight:(0,V.register)("arrow-right",60060),arrowSmallDown:(0,V.register)("arrow-small-down",60061),arrowSmallLeft:(0,V.register)("arrow-small-left",60062),arrowSmallRight:(0,V.register)("arrow-small-right",60063),arrowSmallUp:(0,V.register)("arrow-small-up",60064),arrowUp:(0,V.register)("arrow-up",60065),bell:(0,V.register)("bell",60066),bold:(0,V.register)("bold",60067),book:(0,V.register)("book",60068),bookmark:(0,V.register)("bookmark",60069),debugBreakpointConditionalUnverified:(0,V.register)("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:(0,V.register)("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:(0,V.register)("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:(0,V.register)("debug-breakpoint-data-unverified",60072),debugBreakpointData:(0,V.register)("debug-breakpoint-data",60073),debugBreakpointDataDisabled:(0,V.register)("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:(0,V.register)("debug-breakpoint-log-unverified",60074),debugBreakpointLog:(0,V.register)("debug-breakpoint-log",60075),debugBreakpointLogDisabled:(0,V.register)("debug-breakpoint-log-disabled",60075),briefcase:(0,V.register)("briefcase",60076),broadcast:(0,V.register)("broadcast",60077),browser:(0,V.register)("browser",60078),bug:(0,V.register)("bug",60079),calendar:(0,V.register)("calendar",60080),caseSensitive:(0,V.register)("case-sensitive",60081),check:(0,V.register)("check",60082),checklist:(0,V.register)("checklist",60083),chevronDown:(0,V.register)("chevron-down",60084),chevronLeft:(0,V.register)("chevron-left",60085),chevronRight:(0,V.register)("chevron-right",60086),chevronUp:(0,V.register)("chevron-up",60087),chromeClose:(0,V.register)("chrome-close",60088),chromeMaximize:(0,V.register)("chrome-maximize",60089),chromeMinimize:(0,V.register)("chrome-minimize",60090),chromeRestore:(0,V.register)("chrome-restore",60091),circleOutline:(0,V.register)("circle-outline",60092),circle:(0,V.register)("circle",60092),debugBreakpointUnverified:(0,V.register)("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:(0,V.register)("terminal-decoration-incomplete",60092),circleSlash:(0,V.register)("circle-slash",60093),circuitBoard:(0,V.register)("circuit-board",60094),clearAll:(0,V.register)("clear-all",60095),clippy:(0,V.register)("clippy",60096),closeAll:(0,V.register)("close-all",60097),cloudDownload:(0,V.register)("cloud-download",60098),cloudUpload:(0,V.register)("cloud-upload",60099),code:(0,V.register)("code",60100),collapseAll:(0,V.register)("collapse-all",60101),colorMode:(0,V.register)("color-mode",60102),commentDiscussion:(0,V.register)("comment-discussion",60103),creditCard:(0,V.register)("credit-card",60105),dash:(0,V.register)("dash",60108),dashboard:(0,V.register)("dashboard",60109),database:(0,V.register)("database",60110),debugContinue:(0,V.register)("debug-continue",60111),debugDisconnect:(0,V.register)("debug-disconnect",60112),debugPause:(0,V.register)("debug-pause",60113),debugRestart:(0,V.register)("debug-restart",60114),debugStart:(0,V.register)("debug-start",60115),debugStepInto:(0,V.register)("debug-step-into",60116),debugStepOut:(0,V.register)("debug-step-out",60117),debugStepOver:(0,V.register)("debug-step-over",60118),debugStop:(0,V.register)("debug-stop",60119),debug:(0,V.register)("debug",60120),deviceCameraVideo:(0,V.register)("device-camera-video",60121),deviceCamera:(0,V.register)("device-camera",60122),deviceMobile:(0,V.register)("device-mobile",60123),diffAdded:(0,V.register)("diff-added",60124),diffIgnored:(0,V.register)("diff-ignored",60125),diffModified:(0,V.register)("diff-modified",60126),diffRemoved:(0,V.register)("diff-removed",60127),diffRenamed:(0,V.register)("diff-renamed",60128),diff:(0,V.register)("diff",60129),diffSidebyside:(0,V.register)("diff-sidebyside",60129),discard:(0,V.register)("discard",60130),editorLayout:(0,V.register)("editor-layout",60131),emptyWindow:(0,V.register)("empty-window",60132),exclude:(0,V.register)("exclude",60133),extensions:(0,V.register)("extensions",60134),eyeClosed:(0,V.register)("eye-closed",60135),fileBinary:(0,V.register)("file-binary",60136),fileCode:(0,V.register)("file-code",60137),fileMedia:(0,V.register)("file-media",60138),filePdf:(0,V.register)("file-pdf",60139),fileSubmodule:(0,V.register)("file-submodule",60140),fileSymlinkDirectory:(0,V.register)("file-symlink-directory",60141),fileSymlinkFile:(0,V.register)("file-symlink-file",60142),fileZip:(0,V.register)("file-zip",60143),files:(0,V.register)("files",60144),filter:(0,V.register)("filter",60145),flame:(0,V.register)("flame",60146),foldDown:(0,V.register)("fold-down",60147),foldUp:(0,V.register)("fold-up",60148),fold:(0,V.register)("fold",60149),folderActive:(0,V.register)("folder-active",60150),folderOpened:(0,V.register)("folder-opened",60151),gear:(0,V.register)("gear",60152),gift:(0,V.register)("gift",60153),gistSecret:(0,V.register)("gist-secret",60154),gist:(0,V.register)("gist",60155),gitCommit:(0,V.register)("git-commit",60156),gitCompare:(0,V.register)("git-compare",60157),compareChanges:(0,V.register)("compare-changes",60157),gitMerge:(0,V.register)("git-merge",60158),githubAction:(0,V.register)("github-action",60159),githubAlt:(0,V.register)("github-alt",60160),globe:(0,V.register)("globe",60161),grabber:(0,V.register)("grabber",60162),graph:(0,V.register)("graph",60163),gripper:(0,V.register)("gripper",60164),heart:(0,V.register)("heart",60165),home:(0,V.register)("home",60166),horizontalRule:(0,V.register)("horizontal-rule",60167),hubot:(0,V.register)("hubot",60168),inbox:(0,V.register)("inbox",60169),issueReopened:(0,V.register)("issue-reopened",60171),issues:(0,V.register)("issues",60172),italic:(0,V.register)("italic",60173),jersey:(0,V.register)("jersey",60174),json:(0,V.register)("json",60175),bracket:(0,V.register)("bracket",60175),kebabVertical:(0,V.register)("kebab-vertical",60176),key:(0,V.register)("key",60177),law:(0,V.register)("law",60178),lightbulbAutofix:(0,V.register)("lightbulb-autofix",60179),linkExternal:(0,V.register)("link-external",60180),link:(0,V.register)("link",60181),listOrdered:(0,V.register)("list-ordered",60182),listUnordered:(0,V.register)("list-unordered",60183),liveShare:(0,V.register)("live-share",60184),loading:(0,V.register)("loading",60185),location:(0,V.register)("location",60186),mailRead:(0,V.register)("mail-read",60187),mail:(0,V.register)("mail",60188),markdown:(0,V.register)("markdown",60189),megaphone:(0,V.register)("megaphone",60190),mention:(0,V.register)("mention",60191),milestone:(0,V.register)("milestone",60192),gitPullRequestMilestone:(0,V.register)("git-pull-request-milestone",60192),mortarBoard:(0,V.register)("mortar-board",60193),move:(0,V.register)("move",60194),multipleWindows:(0,V.register)("multiple-windows",60195),mute:(0,V.register)("mute",60196),noNewline:(0,V.register)("no-newline",60197),note:(0,V.register)("note",60198),octoface:(0,V.register)("octoface",60199),openPreview:(0,V.register)("open-preview",60200),package:(0,V.register)("package",60201),paintcan:(0,V.register)("paintcan",60202),pin:(0,V.register)("pin",60203),play:(0,V.register)("play",60204),run:(0,V.register)("run",60204),plug:(0,V.register)("plug",60205),preserveCase:(0,V.register)("preserve-case",60206),preview:(0,V.register)("preview",60207),project:(0,V.register)("project",60208),pulse:(0,V.register)("pulse",60209),question:(0,V.register)("question",60210),quote:(0,V.register)("quote",60211),radioTower:(0,V.register)("radio-tower",60212),reactions:(0,V.register)("reactions",60213),references:(0,V.register)("references",60214),refresh:(0,V.register)("refresh",60215),regex:(0,V.register)("regex",60216),remoteExplorer:(0,V.register)("remote-explorer",60217),remote:(0,V.register)("remote",60218),remove:(0,V.register)("remove",60219),replaceAll:(0,V.register)("replace-all",60220),replace:(0,V.register)("replace",60221),repoClone:(0,V.register)("repo-clone",60222),repoForcePush:(0,V.register)("repo-force-push",60223),repoPull:(0,V.register)("repo-pull",60224),repoPush:(0,V.register)("repo-push",60225),report:(0,V.register)("report",60226),requestChanges:(0,V.register)("request-changes",60227),rocket:(0,V.register)("rocket",60228),rootFolderOpened:(0,V.register)("root-folder-opened",60229),rootFolder:(0,V.register)("root-folder",60230),rss:(0,V.register)("rss",60231),ruby:(0,V.register)("ruby",60232),saveAll:(0,V.register)("save-all",60233),saveAs:(0,V.register)("save-as",60234),save:(0,V.register)("save",60235),screenFull:(0,V.register)("screen-full",60236),screenNormal:(0,V.register)("screen-normal",60237),searchStop:(0,V.register)("search-stop",60238),server:(0,V.register)("server",60240),settingsGear:(0,V.register)("settings-gear",60241),settings:(0,V.register)("settings",60242),shield:(0,V.register)("shield",60243),smiley:(0,V.register)("smiley",60244),sortPrecedence:(0,V.register)("sort-precedence",60245),splitHorizontal:(0,V.register)("split-horizontal",60246),splitVertical:(0,V.register)("split-vertical",60247),squirrel:(0,V.register)("squirrel",60248),starFull:(0,V.register)("star-full",60249),starHalf:(0,V.register)("star-half",60250),symbolClass:(0,V.register)("symbol-class",60251),symbolColor:(0,V.register)("symbol-color",60252),symbolConstant:(0,V.register)("symbol-constant",60253),symbolEnumMember:(0,V.register)("symbol-enum-member",60254),symbolField:(0,V.register)("symbol-field",60255),symbolFile:(0,V.register)("symbol-file",60256),symbolInterface:(0,V.register)("symbol-interface",60257),symbolKeyword:(0,V.register)("symbol-keyword",60258),symbolMisc:(0,V.register)("symbol-misc",60259),symbolOperator:(0,V.register)("symbol-operator",60260),symbolProperty:(0,V.register)("symbol-property",60261),wrench:(0,V.register)("wrench",60261),wrenchSubaction:(0,V.register)("wrench-subaction",60261),symbolSnippet:(0,V.register)("symbol-snippet",60262),tasklist:(0,V.register)("tasklist",60263),telescope:(0,V.register)("telescope",60264),textSize:(0,V.register)("text-size",60265),threeBars:(0,V.register)("three-bars",60266),thumbsdown:(0,V.register)("thumbsdown",60267),thumbsup:(0,V.register)("thumbsup",60268),tools:(0,V.register)("tools",60269),triangleDown:(0,V.register)("triangle-down",60270),triangleLeft:(0,V.register)("triangle-left",60271),triangleRight:(0,V.register)("triangle-right",60272),triangleUp:(0,V.register)("triangle-up",60273),twitter:(0,V.register)("twitter",60274),unfold:(0,V.register)("unfold",60275),unlock:(0,V.register)("unlock",60276),unmute:(0,V.register)("unmute",60277),unverified:(0,V.register)("unverified",60278),verified:(0,V.register)("verified",60279),versions:(0,V.register)("versions",60280),vmActive:(0,V.register)("vm-active",60281),vmOutline:(0,V.register)("vm-outline",60282),vmRunning:(0,V.register)("vm-running",60283),watch:(0,V.register)("watch",60284),whitespace:(0,V.register)("whitespace",60285),wholeWord:(0,V.register)("whole-word",60286),window:(0,V.register)("window",60287),wordWrap:(0,V.register)("word-wrap",60288),zoomIn:(0,V.register)("zoom-in",60289),zoomOut:(0,V.register)("zoom-out",60290),listFilter:(0,V.register)("list-filter",60291),listFlat:(0,V.register)("list-flat",60292),listSelection:(0,V.register)("list-selection",60293),selection:(0,V.register)("selection",60293),listTree:(0,V.register)("list-tree",60294),debugBreakpointFunctionUnverified:(0,V.register)("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:(0,V.register)("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:(0,V.register)("debug-breakpoint-function-disabled",60296),debugStackframeActive:(0,V.register)("debug-stackframe-active",60297),circleSmallFilled:(0,V.register)("circle-small-filled",60298),debugStackframeDot:(0,V.register)("debug-stackframe-dot",60298),terminalDecorationMark:(0,V.register)("terminal-decoration-mark",60298),debugStackframe:(0,V.register)("debug-stackframe",60299),debugStackframeFocused:(0,V.register)("debug-stackframe-focused",60299),debugBreakpointUnsupported:(0,V.register)("debug-breakpoint-unsupported",60300),symbolString:(0,V.register)("symbol-string",60301),debugReverseContinue:(0,V.register)("debug-reverse-continue",60302),debugStepBack:(0,V.register)("debug-step-back",60303),debugRestartFrame:(0,V.register)("debug-restart-frame",60304),debugAlt:(0,V.register)("debug-alt",60305),callIncoming:(0,V.register)("call-incoming",60306),callOutgoing:(0,V.register)("call-outgoing",60307),menu:(0,V.register)("menu",60308),expandAll:(0,V.register)("expand-all",60309),feedback:(0,V.register)("feedback",60310),gitPullRequestReviewer:(0,V.register)("git-pull-request-reviewer",60310),groupByRefType:(0,V.register)("group-by-ref-type",60311),ungroupByRefType:(0,V.register)("ungroup-by-ref-type",60312),account:(0,V.register)("account",60313),gitPullRequestAssignee:(0,V.register)("git-pull-request-assignee",60313),bellDot:(0,V.register)("bell-dot",60314),debugConsole:(0,V.register)("debug-console",60315),library:(0,V.register)("library",60316),output:(0,V.register)("output",60317),runAll:(0,V.register)("run-all",60318),syncIgnored:(0,V.register)("sync-ignored",60319),pinned:(0,V.register)("pinned",60320),githubInverted:(0,V.register)("github-inverted",60321),serverProcess:(0,V.register)("server-process",60322),serverEnvironment:(0,V.register)("server-environment",60323),pass:(0,V.register)("pass",60324),issueClosed:(0,V.register)("issue-closed",60324),stopCircle:(0,V.register)("stop-circle",60325),playCircle:(0,V.register)("play-circle",60326),record:(0,V.register)("record",60327),debugAltSmall:(0,V.register)("debug-alt-small",60328),vmConnect:(0,V.register)("vm-connect",60329),cloud:(0,V.register)("cloud",60330),merge:(0,V.register)("merge",60331),export:(0,V.register)("export",60332),graphLeft:(0,V.register)("graph-left",60333),magnet:(0,V.register)("magnet",60334),notebook:(0,V.register)("notebook",60335),redo:(0,V.register)("redo",60336),checkAll:(0,V.register)("check-all",60337),pinnedDirty:(0,V.register)("pinned-dirty",60338),passFilled:(0,V.register)("pass-filled",60339),circleLargeFilled:(0,V.register)("circle-large-filled",60340),circleLarge:(0,V.register)("circle-large",60341),circleLargeOutline:(0,V.register)("circle-large-outline",60341),combine:(0,V.register)("combine",60342),gather:(0,V.register)("gather",60342),table:(0,V.register)("table",60343),variableGroup:(0,V.register)("variable-group",60344),typeHierarchy:(0,V.register)("type-hierarchy",60345),typeHierarchySub:(0,V.register)("type-hierarchy-sub",60346),typeHierarchySuper:(0,V.register)("type-hierarchy-super",60347),gitPullRequestCreate:(0,V.register)("git-pull-request-create",60348),runAbove:(0,V.register)("run-above",60349),runBelow:(0,V.register)("run-below",60350),notebookTemplate:(0,V.register)("notebook-template",60351),debugRerun:(0,V.register)("debug-rerun",60352),workspaceTrusted:(0,V.register)("workspace-trusted",60353),workspaceUntrusted:(0,V.register)("workspace-untrusted",60354),workspaceUnknown:(0,V.register)("workspace-unknown",60355),terminalCmd:(0,V.register)("terminal-cmd",60356),terminalDebian:(0,V.register)("terminal-debian",60357),terminalLinux:(0,V.register)("terminal-linux",60358),terminalPowershell:(0,V.register)("terminal-powershell",60359),terminalTmux:(0,V.register)("terminal-tmux",60360),terminalUbuntu:(0,V.register)("terminal-ubuntu",60361),terminalBash:(0,V.register)("terminal-bash",60362),arrowSwap:(0,V.register)("arrow-swap",60363),copy:(0,V.register)("copy",60364),personAdd:(0,V.register)("person-add",60365),filterFilled:(0,V.register)("filter-filled",60366),wand:(0,V.register)("wand",60367),debugLineByLine:(0,V.register)("debug-line-by-line",60368),inspect:(0,V.register)("inspect",60369),layers:(0,V.register)("layers",60370),layersDot:(0,V.register)("layers-dot",60371),layersActive:(0,V.register)("layers-active",60372),compass:(0,V.register)("compass",60373),compassDot:(0,V.register)("compass-dot",60374),compassActive:(0,V.register)("compass-active",60375),azure:(0,V.register)("azure",60376),issueDraft:(0,V.register)("issue-draft",60377),gitPullRequestClosed:(0,V.register)("git-pull-request-closed",60378),gitPullRequestDraft:(0,V.register)("git-pull-request-draft",60379),debugAll:(0,V.register)("debug-all",60380),debugCoverage:(0,V.register)("debug-coverage",60381),runErrors:(0,V.register)("run-errors",60382),folderLibrary:(0,V.register)("folder-library",60383),debugContinueSmall:(0,V.register)("debug-continue-small",60384),beakerStop:(0,V.register)("beaker-stop",60385),graphLine:(0,V.register)("graph-line",60386),graphScatter:(0,V.register)("graph-scatter",60387),pieChart:(0,V.register)("pie-chart",60388),bracketDot:(0,V.register)("bracket-dot",60389),bracketError:(0,V.register)("bracket-error",60390),lockSmall:(0,V.register)("lock-small",60391),azureDevops:(0,V.register)("azure-devops",60392),verifiedFilled:(0,V.register)("verified-filled",60393),newline:(0,V.register)("newline",60394),layout:(0,V.register)("layout",60395),layoutActivitybarLeft:(0,V.register)("layout-activitybar-left",60396),layoutActivitybarRight:(0,V.register)("layout-activitybar-right",60397),layoutPanelLeft:(0,V.register)("layout-panel-left",60398),layoutPanelCenter:(0,V.register)("layout-panel-center",60399),layoutPanelJustify:(0,V.register)("layout-panel-justify",60400),layoutPanelRight:(0,V.register)("layout-panel-right",60401),layoutPanel:(0,V.register)("layout-panel",60402),layoutSidebarLeft:(0,V.register)("layout-sidebar-left",60403),layoutSidebarRight:(0,V.register)("layout-sidebar-right",60404),layoutStatusbar:(0,V.register)("layout-statusbar",60405),layoutMenubar:(0,V.register)("layout-menubar",60406),layoutCentered:(0,V.register)("layout-centered",60407),target:(0,V.register)("target",60408),indent:(0,V.register)("indent",60409),recordSmall:(0,V.register)("record-small",60410),errorSmall:(0,V.register)("error-small",60411),terminalDecorationError:(0,V.register)("terminal-decoration-error",60411),arrowCircleDown:(0,V.register)("arrow-circle-down",60412),arrowCircleLeft:(0,V.register)("arrow-circle-left",60413),arrowCircleRight:(0,V.register)("arrow-circle-right",60414),arrowCircleUp:(0,V.register)("arrow-circle-up",60415),layoutSidebarRightOff:(0,V.register)("layout-sidebar-right-off",60416),layoutPanelOff:(0,V.register)("layout-panel-off",60417),layoutSidebarLeftOff:(0,V.register)("layout-sidebar-left-off",60418),blank:(0,V.register)("blank",60419),heartFilled:(0,V.register)("heart-filled",60420),map:(0,V.register)("map",60421),mapHorizontal:(0,V.register)("map-horizontal",60421),foldHorizontal:(0,V.register)("fold-horizontal",60421),mapFilled:(0,V.register)("map-filled",60422),mapHorizontalFilled:(0,V.register)("map-horizontal-filled",60422),foldHorizontalFilled:(0,V.register)("fold-horizontal-filled",60422),circleSmall:(0,V.register)("circle-small",60423),bellSlash:(0,V.register)("bell-slash",60424),bellSlashDot:(0,V.register)("bell-slash-dot",60425),commentUnresolved:(0,V.register)("comment-unresolved",60426),gitPullRequestGoToChanges:(0,V.register)("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:(0,V.register)("git-pull-request-new-changes",60428),searchFuzzy:(0,V.register)("search-fuzzy",60429),commentDraft:(0,V.register)("comment-draft",60430),send:(0,V.register)("send",60431),sparkle:(0,V.register)("sparkle",60432),insert:(0,V.register)("insert",60433),mic:(0,V.register)("mic",60434),thumbsdownFilled:(0,V.register)("thumbsdown-filled",60435),thumbsupFilled:(0,V.register)("thumbsup-filled",60436),coffee:(0,V.register)("coffee",60437),snake:(0,V.register)("snake",60438),game:(0,V.register)("game",60439),vr:(0,V.register)("vr",60440),chip:(0,V.register)("chip",60441),piano:(0,V.register)("piano",60442),music:(0,V.register)("music",60443),micFilled:(0,V.register)("mic-filled",60444),repoFetch:(0,V.register)("repo-fetch",60445),copilot:(0,V.register)("copilot",60446),lightbulbSparkle:(0,V.register)("lightbulb-sparkle",60447),robot:(0,V.register)("robot",60448),sparkleFilled:(0,V.register)("sparkle-filled",60449),diffSingle:(0,V.register)("diff-single",60450),diffMultiple:(0,V.register)("diff-multiple",60451),surroundWith:(0,V.register)("surround-with",60452),share:(0,V.register)("share",60453),gitStash:(0,V.register)("git-stash",60454),gitStashApply:(0,V.register)("git-stash-apply",60455),gitStashPop:(0,V.register)("git-stash-pop",60456),vscode:(0,V.register)("vscode",60457),vscodeInsiders:(0,V.register)("vscode-insiders",60458),codeOss:(0,V.register)("code-oss",60459),runCoverage:(0,V.register)("run-coverage",60460),runAllCoverage:(0,V.register)("run-all-coverage",60461),coverage:(0,V.register)("coverage",60462),githubProject:(0,V.register)("github-project",60463),mapVertical:(0,V.register)("map-vertical",60464),foldVertical:(0,V.register)("fold-vertical",60464),mapVerticalFilled:(0,V.register)("map-vertical-filled",60465),foldVerticalFilled:(0,V.register)("fold-vertical-filled",60465),goToSearch:(0,V.register)("go-to-search",60466),percentage:(0,V.register)("percentage",60467),sortPercentage:(0,V.register)("sort-percentage",60467),attach:(0,V.register)("attach",60468),goToEditingSession:(0,V.register)("go-to-editing-session",60469),editSession:(0,V.register)("edit-session",60470),codeReview:(0,V.register)("code-review",60471),copilotWarning:(0,V.register)("copilot-warning",60472),python:(0,V.register)("python",60473),copilotLarge:(0,V.register)("copilot-large",60474),copilotWarningLarge:(0,V.register)("copilot-warning-large",60475),keyboardTab:(0,V.register)("keyboard-tab",60476),copilotBlocked:(0,V.register)("copilot-blocked",60477),copilotNotConnected:(0,V.register)("copilot-not-connected",60478),flag:(0,V.register)("flag",60479),lightbulbEmpty:(0,V.register)("lightbulb-empty",60480),symbolMethodArrow:(0,V.register)("symbol-method-arrow",60481),copilotUnavailable:(0,V.register)("copilot-unavailable",60482),repoPinned:(0,V.register)("repo-pinned",60483),keyboardTabAbove:(0,V.register)("keyboard-tab-above",60484),keyboardTabBelow:(0,V.register)("keyboard-tab-below",60485),gitPullRequestDone:(0,V.register)("git-pull-request-done",60486),mcp:(0,V.register)("mcp",60487),extensionsLarge:(0,V.register)("extensions-large",60488),layoutPanelDock:(0,V.register)("layout-panel-dock",60489),layoutSidebarLeftDock:(0,V.register)("layout-sidebar-left-dock",60490),layoutSidebarRightDock:(0,V.register)("layout-sidebar-right-dock",60491),copilotInProgress:(0,V.register)("copilot-in-progress",60492),copilotError:(0,V.register)("copilot-error",60493),copilotSuccess:(0,V.register)("copilot-success",60494),chatSparkle:(0,V.register)("chat-sparkle",60495),searchSparkle:(0,V.register)("search-sparkle",60496),editSparkle:(0,V.register)("edit-sparkle",60497),copilotSnooze:(0,V.register)("copilot-snooze",60498),sendToRemoteAgent:(0,V.register)("send-to-remote-agent",60499),commentDiscussionSparkle:(0,V.register)("comment-discussion-sparkle",60500),chatSparkleWarning:(0,V.register)("chat-sparkle-warning",60501),chatSparkleError:(0,V.register)("chat-sparkle-error",60502),collection:(0,V.register)("collection",60503),newCollection:(0,V.register)("new-collection",60504),thinking:(0,V.register)("thinking",60505),build:(0,V.register)("build",60506),commentDiscussionQuote:(0,V.register)("comment-discussion-quote",60507),cursor:(0,V.register)("cursor",60508),eraser:(0,V.register)("eraser",60509),fileText:(0,V.register)("file-text",60510),quotes:(0,V.register)("quotes",60512),rename:(0,V.register)("rename",60513),runWithDeps:(0,V.register)("run-with-deps",60514),debugConnected:(0,V.register)("debug-connected",60515),strikethrough:(0,V.register)("strikethrough",60516),openInProduct:(0,V.register)("open-in-product",60517),indexZero:(0,V.register)("index-zero",60518),agent:(0,V.register)("agent",60519),editCode:(0,V.register)("edit-code",60520),repoSelected:(0,V.register)("repo-selected",60521),skip:(0,V.register)("skip",60522),mergeInto:(0,V.register)("merge-into",60523),gitBranchChanges:(0,V.register)("git-branch-changes",60524),gitBranchStagedChanges:(0,V.register)("git-branch-staged-changes",60525),gitBranchConflicts:(0,V.register)("git-branch-conflicts",60526),gitBranch:(0,V.register)("git-branch",60527),gitBranchCreate:(0,V.register)("git-branch-create",60527),gitBranchDelete:(0,V.register)("git-branch-delete",60527),searchLarge:(0,V.register)("search-large",60528),terminalGitBash:(0,V.register)("terminal-git-bash",60529),windowActive:(0,V.register)("window-active",60530),forward:(0,V.register)("forward",60531),download:(0,V.register)("download",60532),clockface:(0,V.register)("clockface",60533),unarchive:(0,V.register)("unarchive",60534),sessionInProgress:(0,V.register)("session-in-progress",60535),collectionSmall:(0,V.register)("collection-small",60536),vmSmall:(0,V.register)("vm-small",60537),cloudSmall:(0,V.register)("cloud-small",60538),addSmall:(0,V.register)("add-small",60539),removeSmall:(0,V.register)("remove-small",60540),worktreeSmall:(0,V.register)("worktree-small",60541),worktree:(0,V.register)("worktree",60542),screenCut:(0,V.register)("screen-cut",60543),ask:(0,V.register)("ask",60544),openai:(0,V.register)("openai",60545),claude:(0,V.register)("claude",60546),openInWindow:(0,V.register)("open-in-window",60547),newSession:(0,V.register)("new-session",60548),terminalSecure:(0,V.register)("terminal-secure",60549),chatImport:(0,V.register)("chat-import",60550),chatExport:(0,V.register)("chat-export",60551),shareWindow:(0,V.register)("share-window",60552)}});var I0r=I(g8=>{"use strict";p();Object.defineProperty(g8,"__esModule",{value:!0});g8.Codicon=g8.codiconsDerived=void 0;g8.getAllCodicons=Qna;var Qc=T0r(),Una=Ssi();function Qna(){return Object.values(g8.Codicon)}a(Qna,"getAllCodicons");g8.codiconsDerived={dialogError:(0,Qc.register)("dialog-error","error"),dialogWarning:(0,Qc.register)("dialog-warning","warning"),dialogInfo:(0,Qc.register)("dialog-info","info"),dialogClose:(0,Qc.register)("dialog-close","close"),treeItemExpanded:(0,Qc.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,Qc.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,Qc.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,Qc.register)("tree-filter-clear","close"),treeItemLoading:(0,Qc.register)("tree-item-loading","loading"),menuSelection:(0,Qc.register)("menu-selection","check"),menuSubmenu:(0,Qc.register)("menu-submenu","chevron-right"),menuBarMore:(0,Qc.register)("menubar-more","more"),scrollbarButtonLeft:(0,Qc.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,Qc.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,Qc.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,Qc.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,Qc.register)("toolbar-more","more"),quickInputBack:(0,Qc.register)("quick-input-back","arrow-left"),dropDownButton:(0,Qc.register)("drop-down-button",60084),symbolCustomColor:(0,Qc.register)("symbol-customcolor",60252),exportIcon:(0,Qc.register)("export",60332),workspaceUnspecified:(0,Qc.register)("workspace-unspecified",60355),newLine:(0,Qc.register)("newline",60394),thumbsDownFilled:(0,Qc.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,Qc.register)("thumbsup-filled",60436),gitFetch:(0,Qc.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,Qc.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,Qc.register)("debug-breakpoint-pending",60377),chatImport:(0,Qc.register)("chat-import",60550),chatExport:(0,Qc.register)("chat-export",60551)};g8.Codicon={...Una.codiconsLibrary,...g8.codiconsDerived}});var R0r=I(fee=>{"use strict";p();Object.defineProperty(fee,"__esModule",{value:!0});fee.ThemeIcon=fee.ThemeColor=void 0;fee.themeColorFromId=qna;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||(fee.ThemeColor=w0r={}));function qna(t){return{id:t}}a(qna,"themeColorFromId");var Tsi;(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})(Tsi||(fee.ThemeIcon=Tsi={}))});var uMe=I(WH=>{"use strict";p();Object.defineProperty(WH,"__esModule",{value:!0});WH.Icon=void 0;WH.overrideNowValue=jna;WH.now=Hna;WH.shortenOpportunityId=Gna;WH.checkIfCursorAtEndOfLine=$na;var A8=R0r(),P0r=-1;function jna(t){P0r=t}a(jna,"overrideNowValue");function Hna(){return P0r!==-1?P0r:Date.now()}a(Hna,"now");var Isi;(function(t){t.circleSlash={themeIcon:A8.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:A8.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:A8.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:A8.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:A8.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:A8.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:A8.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:A8.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:A8.ThemeIcon.fromId("thumbsdown"),svg:''}})(Isi||(WH.Icon=Isi={}));function Gna(t){return t.substring(4,8)}a(Gna,"shortenOpportunityId");function $na(t,e){return t.substring(e).match(/^\s*$/)!==null}a($na,"checkIfCursorAtEndOfLine")});var ept=I(f4=>{"use strict";p();var Vna=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]})),Wna=f4&&f4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zna=f4&&f4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(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;oExplanation for icons -`),e.push(`- ${SE.Icon.lightbulbFull.svg} - model had suggestions -`),e.push(`- ${SE.Icon.circleSlash.svg} - model had NO suggestions -`),e.push(`- ${SE.Icon.database.svg} - response is from cache -`),e.push(`- ${SE.Icon.gitMerge.svg} - joined an in-flight request (async or speculative reuse) -`),e.push(`- ${SE.Icon.error.svg} - error happened -`),e.push(`- ${SE.Icon.skipped.svg} - fetching started but got cancelled +`),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(` `),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 @@ -516,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(Xft.ErrorUtils.toString(Xft.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(Jft.ErrorUtils.toString(Jft.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(xsi.stringify(this._responseResults,null," ")),e.push("```"),e.push(` +`),e.push("```"),e.push(gsi.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(` @@ -532,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(Xft.ErrorUtils.toString(Xft.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,Xna.stringifyChatMessages)(e)),this.fireDidChange()}_setOutcome(e){this._outcome!=="pending"&&this._outcome!=="reusedInFlight"&&console.warn(`[InlineEditRequestLogContext] outcome transition from '${this._outcome}' to '${e}' (request #${this.requestId})`),this._outcome=e}_resolveIcon(){switch(this._outcome){case"pending":return this._isCompleted?SE.Icon.check:SE.Icon.loading;case"succeeded":return SE.Icon.lightbulbFull;case"noSuggestions":return SE.Icon.circleSlash;case"cached":case"cachedFromGhostText":return SE.Icon.database;case"reusedInFlight":return SE.Icon.gitMerge;case"skipped":case"cancelled":return SE.Icon.skipped;case"errored":return SE.Icon.error;case"previouslyRejected":return SE.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 Jna.FetchCancellationError?this._setOutcome("skipped"):(0,Yna.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 | ${eia(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(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 `),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:xsi.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,Zna.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};f4.InlineEditRequestLogContext=k0r;function eia(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(eia,"basename")});var wsi=I(tpt=>{"use strict";p();Object.defineProperty(tpt,"__esModule",{value:!0});tpt.GhostTextLogContext=void 0;var tia=ept(),ria=EA(),D0r=class extends tia.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,ria.basename)(this.filePath)} (v${this.version})`}};tpt.GhostTextLogContext=D0r});var B0r=I(Uo=>{"use strict";p();var nia=Uo&&Uo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),iia=Uo&&Uo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oia=Uo&&Uo.__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)&&nia(e,t,r);return iia(e,t),e},N0r=Uo&&Uo.__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())})},M0r=Uo&&Uo.__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 L0r=hee&&hee.__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())})},F0r=hee&&hee.__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,p4.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 L0r(this,void 0,void 0,function(){var r,n,o;return F0r(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,p4.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=pee.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,p4.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 p4.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return L0r(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return F0r(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,p4.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return pee.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 Nsi=Dsi(),pia="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",hia="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",mia=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{gia.exports={}});var npt=I(Ome=>{"use strict";p();var Aia=Ome&&Ome.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ome,"__esModule",{value:!0});Ome.JsonConfig=void 0;var yia=require("fs"),rpt=require("path"),U0r=Vl(),Eia=Aia(Osi()),_ia="APPLICATIONINSIGHTS_CONFIGURATION_FILE",via="APPLICATIONINSIGHTS_CONNECTION_STRING",Bsi="APPSETTING_",Lsi="APPINSIGHTS_INSTRUMENTATIONKEY",Fsi="APPINSIGHTS_INSTRUMENTATION_KEY",Cia="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",bia="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",Sia="http_proxy",Tia="https_proxy",Iia="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",xia="APPLICATION_INSIGHTS_NO_STATSBEAT",wia="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",Ria="APPLICATION_INSIGHTS_NO_PATCH_MODULES",Pia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",kia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",Dia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",Nia="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",Mia="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",Oia=(function(){function t(){this.connectionString=process.env[via],this.instrumentationKey=process.env[Lsi]||process.env[Bsi+Lsi]||process.env[Fsi]||process.env[Bsi+Fsi],!this.connectionString&&this.instrumentationKey&&U0r.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[bia],this.extendedMetricDisablers=process.env[Cia],this.proxyHttpUrl=process.env[Sia],this.proxyHttpsUrl=process.env[Tia],this.noDiagnosticChannel=!!process.env[Iia],this.disableStatsbeat=!!process.env[xia],this.noHttpAgentKeepAlive=!!process.env[wia],this.noPatchModules=process.env[Ria]||"",this.enableWebInstrumentation=!!process.env[Pia]||!!process.env[Nia],this.webInstrumentationSrc=process.env[Dia]||"",this.webInstrumentationConnectionString=process.env[kia]||process.env[Mia]||"",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=rpt.join(__dirname,"../../");this._tempDir=rpt.join(o,n);var s=process.env[_ia];if(s){rpt.isAbsolute(s)?this._tempDir=s:this._tempDir=rpt.join(o,s);try{e=yia.readFileSync(this._tempDir,"utf8")}catch(l){U0r.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(Eia.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){U0r.warn("Invalid JSON config file: ",l)}},t})();Ome.JsonConfig=Oia});var Q0r=I(ipt=>{"use strict";p();Object.defineProperty(ipt,"__esModule",{value:!0});ipt.makePatchingRequire=void 0;var Bia=require("path"),Lia=fk(),Usi=Ap(),qsi=require("module"),Fia=Object.keys(process.binding("natives")),Qsi=qsi.prototype.require;function Uia(t){var e={};return a(function(n){var o=Qsi.apply(this,arguments);if(t[n]){var s=qsi._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(Fia.indexOf(n)<0)try{c=Qsi.call(this,Bia.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{Qia.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 Ap=I(lR=>{"use strict";p();Object.defineProperty(lR,"__esModule",{value:!0});lR.channel=lR.ContextPreservingEventEmitter=lR.trueFilter=lR.makePatchingRequire=void 0;var qia=Q0r(),jia=Q0r();Object.defineProperty(lR,"makePatchingRequire",{enumerable:!0,get:a(function(){return jia.makePatchingRequire},"get")});var Hia=a(function(t){return!0},"trueFilter");lR.trueFilter=Hia;var Gsi=(function(){function t(){this.version=jsi().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=lR.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=lR.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();lo();q0r=hb("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(Bme,"suppressTracing");a($si,"unsuppressTracing");a(zH,"isTracingSuppressed")});var Vsi,opt,Lme,spt,Wsi,zsi,Ysi,j0r=_e(()=>{p();Vsi="=",opt=";",Lme=",",spt="baggage",Wsi=180,zsi=4096,Ysi=8192});function apt(t){return t.reduce(function(e,r){var n=""+e+(e!==""?Lme:"")+r;return n.length>Ysi?e:n},"")}function cpt(t){return t.getAllEntries().map(function(e){var r=Gia(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=opt+o.metadata.toString()),s})}function fMe(t){var e=t.split(opt);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(Vsi);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=Ope(e.join(opt))),{key:o,value:s,metadata:c}}}}}function Ksi(t){return typeof t!="string"||t.length===0?{}:t.split(Lme).map(function(e){return fMe(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var Gia,H0r=_e(()=>{p();lo();j0r();Gia=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(apt,"serializeKeyPairs");a(cpt,"getKeyPairs");a(fMe,"parsePairKeyValue");a(Ksi,"parseKeyPairsIntoRecord")});var lpt,Jsi=_e(()=>{p();lo();dMe();j0r();H0r();lpt=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=ST.getBaggage(e);if(!(!o||zH(e))){var s=cpt(o).filter(function(l){return l.length<=zsi}).slice(0,Wsi),c=apt(s);c.length>0&&n.set(r,spt,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,spt),s=Array.isArray(o)?o.join(Lme):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(Lme);return l.forEach(function(u){var d=fMe(u);if(d){var f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0?e:ST.setBaggage(e,ST.createBaggage(c))},t.prototype.fields=function(){return[spt]},t})()});var Zsi,Xsi=_e(()=>{p();Zsi=(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 YH(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=eai(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=$ia(s.value,2),l=c[0],u=c[1];if(!G0r(l)){Dn.warn("Invalid attribute key: "+l);continue}if(!pMe(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 G0r(t){return typeof t=="string"&&t.length>0}function pMe(t){return t==null?!0:Array.isArray(t)?Via(t):tai(t)}function Via(t){var e,r,n;try{for(var o=eai(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if(tai(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 tai(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var eai,$ia,rai=_e(()=>{p();lo();eai=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.")},$ia=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(YH,"sanitizeAttributes");a(G0r,"isAttributeKey");a(pMe,"isAttributeValue");a(Via,"isHomogeneousAttributeValueArray");a(tai,"isValidPrimitiveAttributeValue")});function upt(){return function(t){Dn.error(Wia(t))}}function Wia(t){return typeof t=="string"?t:JSON.stringify(zia(t))}function zia(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 $0r=_e(()=>{p();lo();a(upt,"loggingErrorHandler");a(Wia,"stringifyException");a(zia,"flattenException")});function iai(t){nai=t}function uv(t){try{nai(t)}catch{}}var nai,V0r=_e(()=>{p();$0r();nai=upt();a(iai,"setGlobalErrorHandler");a(uv,"globalErrorHandler")});var Db,W0r=_e(()=>{p();(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(Db||(Db={}))});function Jia(t){return Kia.indexOf(t)>-1}function Xia(t){return Zia.indexOf(t)>-1}function toa(t){return eoa.indexOf(t)>-1}function roa(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function noa(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 ioa(t,e,r,n){n===void 0&&(n=Yia);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function soa(t,e,r){var n=r[t];if(typeof n=="string"){var o=ooa[n.toUpperCase()];o!=null&&(e[t]=o)}}function mMe(t){var e={};for(var r in hMe){var n=r;switch(n){case"OTEL_LOG_LEVEL":soa(n,e,t);break;default:if(Jia(n))roa(n,e,t);else if(Xia(n))noa(n,e,t);else if(toa(n))ioa(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var Yia,Kia,Zia,eoa,mee,gee,z0r,Y0r,hMe,ooa,K0r=_e(()=>{p();lo();W0r();Yia=",",Kia=["OTEL_SDK_DISABLED"];a(Jia,"isEnvVarABoolean");Zia=["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(Xia,"isEnvVarANumber");eoa=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(toa,"isEnvVarAList");mee=1/0,gee=128,z0r=128,Y0r=128,hMe={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:Pa.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:mee,OTEL_ATTRIBUTE_COUNT_LIMIT:gee,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:mee,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:gee,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:mee,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:gee,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:z0r,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:Y0r,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Db.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(roa,"parseBoolean");a(noa,"parseNumber");a(ioa,"parseStringList");ooa={ALL:Pa.ALL,VERBOSE:Pa.VERBOSE,DEBUG:Pa.DEBUG,INFO:Pa.INFO,WARN:Pa.WARN,ERROR:Pa.ERROR,NONE:Pa.NONE};a(soa,"setLogLevelFromEnv");a(mMe,"parseEnvironment")});function uR(){var t=mMe(process.env);return Object.assign({},hMe,t)}function Fme(){return mMe(process.env)}var oai=_e(()=>{p();K0r();a(uR,"getEnv");a(Fme,"getEnvWithoutDefaults")});var dpt,sai=_e(()=>{p();dpt=typeof globalThis=="object"?globalThis:global});function aai(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function fpt(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(aai,"intValue");a(fpt,"hexToBinary")});function ppt(t){return Buffer.from(fpt(t)).toString("base64")}var cai=_e(()=>{p();J0r();a(ppt,"hexToBase64")});function lai(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(hpt[t-1]=1);return hpt.toString("hex",0,t)},"generateId")}var aoa,uai,mpt,hpt,dai=_e(()=>{p();aoa=8,uai=16,mpt=(function(){function t(){this.generateTraceId=lai(uai),this.generateSpanId=lai(aoa)}return a(t,"RandomIdGenerator"),t})(),hpt=Buffer.allocUnsafe(uai);a(lai,"getIdGenerator")});var fai,dR,pai=_e(()=>{p();fai=require("perf_hooks"),dR=fai.performance});var gpt,Z0r=_e(()=>{p();gpt="1.30.1"});var hai=_e(()=>{p()});var mai=_e(()=>{p();hai()});var coa,loa,uoa,doa,gai,Aai,yai,Eai,foa,_ai,vai=_e(()=>{p();coa="process.runtime.name",loa="telemetry.sdk.name",uoa="telemetry.sdk.language",doa="telemetry.sdk.version",gai=coa,Aai=loa,yai=uoa,Eai=doa,foa="nodejs",_ai=foa});var Cai=_e(()=>{p();vai()});var bai=_e(()=>{p()});var Sai=_e(()=>{p()});var Tai=_e(()=>{p();mai();Cai();bai();Sai()});var Ume,KH,Iai=_e(()=>{p();Z0r();Tai();KH=(Ume={},Ume[Aai]="opentelemetry",Ume[gai]="node",Ume[yai]=_ai,Ume[Eai]=gpt,Ume)});function Qme(t){t.unref()}var xai=_e(()=>{p();a(Qme,"unrefTimer")});var wai=_e(()=>{p();oai();sai();cai();dai();pai();Iai();xai()});var X0r=_e(()=>{p();wai()});function K2(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*hoa);return[r,n]}function qme(){var t=dR.timeOrigin;if(typeof t!="number"){var e=dR;t=e.timing&&e.timing.fetchStart}return t}function gMe(t){var e=K2(qme()),r=K2(typeof t=="number"?t:dR.now());return EMe(e,r)}function Pai(t){if(jme(t))return t;if(typeof t=="number")return t=Apt&&(r[1]-=Apt,r[0]+=1),r}var Rai,poa,hoa,Apt,Mai=_e(()=>{p();X0r();Rai=9,poa=6,hoa=Math.pow(10,poa),Apt=Math.pow(10,Rai);a(K2,"millisToHrTime");a(qme,"getTimeOrigin");a(gMe,"hrTime");a(Pai,"timeInputToHrTime");a(ypt,"hrTimeDuration");a(kai,"hrTimeToTimeStamp");a(Dai,"hrTimeToNanoseconds");a(Nai,"hrTimeToMilliseconds");a(AMe,"hrTimeToMicroseconds");a(jme,"isTimeInputHrTime");a(yMe,"isTimeInput");a(EMe,"addHrTimes")});var FT,Oai=_e(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(FT||(FT={}))});var moa,Ept,Bai=_e(()=>{p();lo();moa=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.")},Ept=(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=moa(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 Lai(t){return yoa.test(t)}function Fai(t){return Eoa.test(t)&&!_oa.test(t)}var egr,goa,Aoa,yoa,Eoa,_oa,Uai=_e(()=>{p();egr="[_0-9a-z-*/]",goa="[a-z]"+egr+"{0,255}",Aoa="[a-z0-9]"+egr+"{0,240}@[a-z]"+egr+"{0,13}",yoa=new RegExp("^(?:"+goa+"|"+Aoa+")$"),Eoa=/^[ -~]{0,255}[!-~]$/,_oa=/,|=/;a(Lai,"validateKey");a(Fai,"validateValue")});var Qai,voa,qai,jai,_pt,tgr=_e(()=>{p();Uai();Qai=32,voa=512,qai=",",jai="=",_pt=(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+jai+e.get(n)),r},[]).join(qai)},t.prototype._parse=function(e){e.length>voa||(this._internalState=e.split(qai).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(jai);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);Lai(c)&&Fai(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Qai&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Qai))))},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 rgr(t){var e=xoa.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var _Me,vMe,Coa,boa,Soa,Toa,Ioa,xoa,vpt,Hai=_e(()=>{p();lo();dMe();tgr();_Me="traceparent",vMe="tracestate",Coa="00",boa="(?!ff)[\\da-f]{2}",Soa="(?![0]{32})[\\da-f]{32}",Toa="(?![0]{16})[\\da-f]{16}",Ioa="[\\da-f]{2}",xoa=new RegExp("^\\s?("+boa+")-("+Soa+")-("+Toa+")-("+Ioa+")(-.*)?\\s?$");a(rgr,"parseTraceParent");vpt=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=Su.getSpanContext(e);if(!(!o||zH(e)||!mb(o))){var s=Coa+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||Sf.NONE).toString(16);n.set(r,_Me,s),o.traceState&&n.set(r,vMe,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,_Me);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=rgr(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,vMe);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new _pt(typeof u=="string"?u:void 0)}return Su.setSpanContext(e,c)},t.prototype.fields=function(){return[_Me,vMe]},t})()});function Gai(t,e){return t.setValue(ngr,e)}function $ai(t){return t.deleteValue(ngr)}function Vai(t){return t.getValue(ngr)}var ngr,Cpt,Wai=_e(()=>{p();lo();ngr=hb("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(Cpt||(Cpt={}));a(Gai,"setRPCMetadata");a($ai,"deleteRPCMetadata");a(Vai,"getRPCMetadata")});var CMe,igr=_e(()=>{p();lo();CMe=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:gb.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var Hme,ogr=_e(()=>{p();lo();Hme=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:gb.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var zai,Yai=_e(()=>{p();lo();V0r();igr();ogr();zai=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(uv(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Hme),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new Hme,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new CMe,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new Hme,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new CMe}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=Su.getSpanContext(e);return!l||!mb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&Sf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&Sf.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 Kai,Jai=_e(()=>{p();lo();Kai=(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:JZ(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 Moa(t,e){return function(r){return t(e(r))}}function sgr(t){if(!Ooa(t)||Boa(t)!==woa)return!1;var e=Noa(t);if(e===null)return!0;var r=eci.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Zai.call(r)===Doa}function Ooa(t){return t!=null&&typeof t=="object"}function Boa(t){return t==null?t===void 0?Poa:Roa:Aee&&Aee in Object(t)?Loa(t):Foa(t)}function Loa(t){var e=eci.call(t,Aee),r=t[Aee],n=!1;try{t[Aee]=void 0,n=!0}catch{}var o=tci.call(t);return n&&(e?t[Aee]=r:delete t[Aee]),o}function Foa(t){return tci.call(t)}var woa,Roa,Poa,koa,Zai,Doa,Noa,Xai,eci,Aee,tci,rci=_e(()=>{p();woa="[object Object]",Roa="[object Null]",Poa="[object Undefined]",koa=Function.prototype,Zai=koa.toString,Doa=Zai.call(Object),Noa=Moa(Object.getPrototypeOf,Object),Xai=Object.prototype,eci=Xai.hasOwnProperty,Aee=Symbol?Symbol.toStringTag:void 0,tci=Xai.toString;a(Moa,"overArg");a(sgr,"isPlainObject");a(Ooa,"isObjectLike");a(Boa,"baseGetTag");a(Loa,"getRawTag");a(Foa,"objectToString")});function Tpt(){for(var t=[],e=0;e0;)r=ici(r,t.shift(),0,n);return r}function agr(t){return Spt(t)?t.slice():t}function ici(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>Uoa)){if(r++,bpt(t)||bpt(e)||oci(e))o=agr(e);else if(Spt(t)){if(o=t.slice(),Spt(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(nci(t,u,n)||nci(e,u,n))delete o[u];else{if(bMe(f)&&bMe(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]=ici(o[u],d,r,n)}}}}else o=e;return o}}function nci(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 Qoa(t,e){return!(!sgr(t)||!sgr(e))}var Uoa,sci=_e(()=>{p();rci();Uoa=20;a(Tpt,"merge");a(agr,"takeValue");a(ici,"mergeTwoObjects");a(nci,"wasObjectReferenced");a(Spt,"isArray");a(oci,"isFunction");a(bMe,"isObject");a(bpt,"isPrimitive");a(Qoa,"shouldMerge")});function aci(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new cgr("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 qoa,cgr,cci=_e(()=>{p();qoa=(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)}})(),cgr=(function(t){qoa(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(aci,"callWithTimeout")});function lgr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function lci(t,e){var r,n;if(!e)return!1;try{for(var o=joa(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(lgr(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 joa,uci=_e(()=>{p();joa=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(lgr,"urlMatches");a(lci,"isUrlIgnored")});function dci(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var fci=_e(()=>{p();a(dci,"isWrapped")});var pci,hci=_e(()=>{p();pci=(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 Hoa,Goa,Gme,mci=_e(()=>{p();hci();Hoa=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},Goa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();lo();dMe();a(gci,"_export")});var yci={};Ri(yci,{AlwaysOffSampler:()=>CMe,AlwaysOnSampler:()=>Hme,AnchoredClock:()=>Zsi,BindOnceFuture:()=>Gme,CompositePropagator:()=>Ept,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>gee,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>mee,DEFAULT_ENVIRONMENT:()=>hMe,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>z0r,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>Y0r,ExportResultCode:()=>FT,ParentBasedSampler:()=>zai,RPCType:()=>Cpt,RandomIdGenerator:()=>mpt,SDK_INFO:()=>KH,TRACE_PARENT_HEADER:()=>_Me,TRACE_STATE_HEADER:()=>vMe,TimeoutError:()=>cgr,TraceIdRatioBasedSampler:()=>Kai,TraceState:()=>_pt,TracesSamplerValues:()=>Db,VERSION:()=>gpt,W3CBaggagePropagator:()=>lpt,W3CTraceContextPropagator:()=>vpt,_globalThis:()=>dpt,addHrTimes:()=>EMe,baggageUtils:()=>$oa,callWithTimeout:()=>aci,deleteRPCMetadata:()=>$ai,getEnv:()=>uR,getEnvWithoutDefaults:()=>Fme,getRPCMetadata:()=>Vai,getTimeOrigin:()=>qme,globalErrorHandler:()=>uv,hexToBase64:()=>ppt,hexToBinary:()=>fpt,hrTime:()=>gMe,hrTimeDuration:()=>ypt,hrTimeToMicroseconds:()=>AMe,hrTimeToMilliseconds:()=>Nai,hrTimeToNanoseconds:()=>Dai,hrTimeToTimeStamp:()=>kai,internal:()=>ugr,isAttributeKey:()=>G0r,isAttributeValue:()=>pMe,isTimeInput:()=>yMe,isTimeInputHrTime:()=>jme,isTracingSuppressed:()=>zH,isUrlIgnored:()=>lci,isWrapped:()=>dci,loggingErrorHandler:()=>upt,merge:()=>Tpt,millisToHrTime:()=>K2,otperformance:()=>dR,parseEnvironment:()=>mMe,parseTraceParent:()=>rgr,sanitizeAttributes:()=>YH,setGlobalErrorHandler:()=>iai,setRPCMetadata:()=>Gai,suppressTracing:()=>Bme,timeInputToHrTime:()=>Pai,unrefTimer:()=>Qme,unsuppressTracing:()=>$si,urlMatches:()=>lgr});var $oa,ugr,Nb=_e(()=>{p();Jsi();Xsi();rai();V0r();$0r();Mai();J0r();Oai();H0r();X0r();Bai();Hai();Wai();igr();ogr();Yai();Jai();dMe();tgr();K0r();sci();W0r();cci();uci();fci();mci();Z0r();Aci();$oa={getKeyPairs:cpt,serializeKeyPairs:apt,parseKeyPairsIntoRecord:Ksi,parsePairKeyValue:fMe},ugr={_export:gci}});var Voa,Woa,zoa,Ipt,xpt,Eci,_ci=_e(()=>{p();Voa="exception.type",Woa="exception.message",zoa="exception.stacktrace",Ipt=Voa,xpt=Woa,Eci=zoa});var vci=_e(()=>{p();_ci()});var Cci=_e(()=>{p()});var bci=_e(()=>{p();Cci()});var Sci=_e(()=>{p()});var Tci=_e(()=>{p()});var Ici=_e(()=>{p();vci();bci();Sci();Tci()});var xci,wci=_e(()=>{p();xci="exception"});var dgr,Yoa,Rci,Koa,wpt,fgr=_e(()=>{p();lo();Nb();Ici();wci();dgr=function(){return dgr=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.")},Rci=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},Koa=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=Yoa(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=Rci(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++),yMe(r)&&(yMe(n)||(n=r),r=void 0);var o=YH(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,Koa([],Rci(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=dgr({},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=ypt(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<=dR.now())return gMe(e+this._performanceOffset);if(typeof e=="number")return K2(e);if(e instanceof Date)return K2(e.getTime());if(jme(e))return e;if(this._startTimeProvided)return K2(Date.now());var r=dR.now()-this._performanceStartTime;return EMe(this.startTime,K2(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[xpt]=e:e&&(e.code?n[Ipt]=e.code.toString():e.name&&(n[Ipt]=e.name),e.message&&(n[xpt]=e.message),e.stack&&(n[Eci]=e.stack)),n[Ipt]||n[xpt]?this.addEvent(xci,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 J2,SMe=_e(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(J2||(J2={}))});var JH,Rpt=_e(()=>{p();SMe();JH=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:J2.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var h4,Ppt=_e(()=>{p();SMe();h4=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:J2.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var $me,pgr=_e(()=>{p();lo();Nb();Rpt();Ppt();$me=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(uv(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new h4),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new h4,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new JH,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new h4,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new JH}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=Su.getSpanContext(e);return!l||!mb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&Sf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&Sf.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 TMe,hgr=_e(()=>{p();lo();SMe();TMe=(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:JZ(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 kpt(){var t=uR();return{sampler:mgr(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 mgr(t){switch(t===void 0&&(t=uR()),t.OTEL_TRACES_SAMPLER){case Db.AlwaysOn:return new h4;case Db.AlwaysOff:return new JH;case Db.ParentBasedAlwaysOn:return new $me({root:new h4});case Db.ParentBasedAlwaysOff:return new $me({root:new JH});case Db.TraceIdRatio:return new TMe(Pci(t));case Db.ParentBasedTraceIdRatio:return new $me({root:new TMe(Pci(t))});default:return Dn.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+Joa+'".'),new h4}}function Pci(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 "+Vme+"."),Vme;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 "+Vme+"."),Vme):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 "+Vme+"."),Vme):e}var Joa,Vme,ggr=_e(()=>{p();lo();Nb();Rpt();Ppt();pgr();hgr();Joa=Db.AlwaysOn,Vme=1;a(kpt,"loadDefaultConfig");a(mgr,"buildSamplerFromEnv");a(Pci,"getSamplerProbabilityFromEnv")});function kci(t){var e={sampler:mgr()},r=kpt(),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 Dci(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=Fme();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:gee,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:mee,Object.assign({},t,{spanLimits:g})}var Agr=_e(()=>{p();ggr();Nb();a(kci,"mergeConfig");a(Dci,"reconfigureLimits")});var Nci,Mci=_e(()=>{p();lo();Nb();Nci=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=uR();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 Gme(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&Sf.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,uv(n)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),Qme(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var Zoa,Wme,Oci=_e(()=>{p();Mci();Zoa=(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)}})(),Wme=(function(t){Zoa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(Nci)});function Bci(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(Dpt[t-1]=1);return Dpt.toString("hex",0,t)},"generateId")}var Xoa,Lci,zme,Dpt,Fci=_e(()=>{p();Xoa=8,Lci=16,zme=(function(){function t(){this.generateTraceId=Bci(Lci),this.generateSpanId=Bci(Xoa)}return a(t,"RandomIdGenerator"),t})(),Dpt=Buffer.allocUnsafe(Lci);a(Bci,"getIdGenerator")});var Uci=_e(()=>{p();Oci();Fci()});var Npt=_e(()=>{p();Uci()});var Mpt,ygr=_e(()=>{p();lo();Nb();fgr();Agr();Npt();Mpt=(function(){function t(e,r,n){this._tracerProvider=n;var o=kci(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new zme,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=Tg.active()),r.root&&(n=Su.deleteSpan(n));var l=Su.getSpan(n);if(zH(n)){Dn.debug("Instrumentation suppressed, returning Noop Span");var u=Su.wrapSpanContext(Bpe);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!Su.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:Lpe.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:YH(R.attributes)}}),E=YH(r.attributes),_=this._sampler.shouldSample(n,h,e,A,E,y);m=(c=_.traceState)!==null&&c!==void 0?c:m;var v=_.decision===gb.RECORD_AND_SAMPLED?Sf.SAMPLED:Sf.NONE,b={traceId:h,spanId:f,traceFlags:v,traceState:m};if(_.decision===gb.NOT_RECORD){Dn.debug("Recording is off, propagating context in a non-recording span");var u=Su.wrapSpanContext(b);return u}var T=YH(Object.assign(E,_.attributes)),w=new wpt(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??Tg.active(),d=this.startSpan(e,s,u),f=Su.setSpan(u,d);return Tg.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 Qci=_e(()=>{p()});var qci=_e(()=>{p();Qci()});var esa,tsa,rsa,nsa,jci,Egr,_gr,vgr,Hci=_e(()=>{p();esa="service.name",tsa="telemetry.sdk.name",rsa="telemetry.sdk.language",nsa="telemetry.sdk.version",jci=esa,Egr=tsa,_gr=rsa,vgr=nsa});var Gci=_e(()=>{p();Hci()});var $ci=_e(()=>{p()});var Vci=_e(()=>{p()});var Wci=_e(()=>{p();qci();Gci();$ci();Vci()});function Opt(){return"unknown_service:"+process.argv0}var zci=_e(()=>{p();a(Opt,"defaultServiceName")});var Yci=_e(()=>{p();zci()});var Kci=_e(()=>{p();Yci()});var ZH,isa,osa,ssa,Bpt,Jci=_e(()=>{p();lo();Wci();Nb();Kci();ZH=function(){return ZH=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},Bpt=(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[jci]=Opt(),e[_gr]=KH[_gr],e[Egr]=KH[Egr],e[vgr]=KH[vgr],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 isa(this,void 0,void 0,function(){return osa(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=ZH(ZH({},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=ssa(c,2),d=u[0],f=u[1];return ZH(ZH(ZH(ZH({},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 Zci=_e(()=>{p();Jci()});var Lpt,Cgr,Xci=_e(()=>{p();Nb();Lpt=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.")},Cgr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=Lpt(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){uv(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},t.prototype.onStart=function(e,r){var n,o;try{for(var s=Lpt(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=Lpt(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=Lpt(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 Fpt,bgr=_e(()=>{p();Fpt=(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 asa,csa,E8,eli,tli=_e(()=>{p();lo();Nb();Zci();ygr();ggr();Xci();bgr();Npt();Agr();asa=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},csa=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(uR().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 Ept({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=uR().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 vpt}],["baggage",function(){return new lpt}]]),t._registeredExporters=new Map,t})()});var lsa,rli,nli=_e(()=>{p();Nb();lsa=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.")},rli=(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:AMe(e.startTime),duration:AMe(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=lsa(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:FT.SUCCESS})},t})()});var usa,dsa,ili,oli=_e(()=>{p();Nb();usa=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},dsa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();lo();Nb();fsa=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())})},psa=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]JH,AlwaysOnSampler:()=>h4,BasicTracerProvider:()=>eli,BatchSpanProcessor:()=>Wme,ConsoleSpanExporter:()=>rli,ForceFlushState:()=>E8,InMemorySpanExporter:()=>ili,NoopSpanProcessor:()=>Fpt,ParentBasedSampler:()=>$me,RandomIdGenerator:()=>zme,SamplingDecision:()=>J2,SimpleSpanProcessor:()=>sli,Span:()=>wpt,TraceIdRatioBasedSampler:()=>TMe,Tracer:()=>Mpt});var lli=_e(()=>{p();ygr();tli();Npt();nli();oli();ali();bgr();Rpt();Ppt();pgr();hgr();SMe();fgr()});var IMe,uli,Sgr=_e(()=>{p();IMe=class{static{a(this,"NoopLogger")}emit(e){}},uli=new IMe});var Tgr,Upt,Igr=_e(()=>{p();Sgr();Tgr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new IMe}},Upt=new Tgr});var Qpt,dli=_e(()=>{p();Sgr();Qpt=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):uli}}});var xMe,fli=_e(()=>{p();Igr();dli();xMe=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new Qpt(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Upt}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 qpt,pli=_e(()=>{p();qpt=typeof globalThis=="object"?globalThis:global});var hli=_e(()=>{p();pli()});var mli=_e(()=>{p();hli()});function gli(t,e,r){return n=>n===t?e:r}var wMe,Yme,xgr,Ali=_e(()=>{p();mli();wMe=Symbol.for("io.opentelemetry.js.api.logs"),Yme=qpt;a(gli,"makeGetter");xgr=1});var jpt,yli=_e(()=>{p();Ali();Igr();fli();jpt=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new xMe}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Yme[wMe]?this.getLoggerProvider():(Yme[wMe]=gli(xgr,e,Upt),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Yme[wMe])===null||e===void 0?void 0:e.call(Yme,xgr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Yme[wMe],this._proxyLoggerProvider=new xMe}}});var Hpt,wgr=_e(()=>{p();yli();Hpt=jpt.getInstance()});function Eli(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var vli=_e(()=>{p();a(Eli,"enableInstrumentations");a(_li,"disableInstrumentations")});function Cli(t){let e=t.tracerProvider||Su.getTracerProvider(),r=t.meterProvider||ZZ.getMeterProvider(),n=t.loggerProvider||Hpt.getLoggerProvider(),o=t.instrumentations?.flat()??[];return Eli(o,e,r,n),()=>{_li(o)}}var bli=_e(()=>{p();lo();wgr();vli();a(Cli,"registerInstrumentations")});function Rli(t,e,r){if(!gsa(t))return Dn.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=_sa(t);if(!n)return!1;let o=[],s=Pli(n,e,o,r);return s&&!r?.includePrerelease?ysa(n,o):s}function gsa(t){return typeof t=="string"&&wli.test(t)}function Pli(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(Rgr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=qsa(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!Rgr(t,s,r,n))return!1;return!0}return Rgr(t,e,r,n)}function Rgr(t,e,r,n){if(e=Esa(e,n),e.includes(" "))return Pli(t,e,r,n);{let o=vsa(e);return r.push(o),Asa(t,o)}}function Asa(t,e){if(e.invalid)return!1;if(!e.version||kgr(e.version))return!0;let r=Tli(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=Tli(n,o)}return msa[e.op]?.includes(r)}function ysa(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function Esa(t,e){return t=t.trim(),t=Usa(t,e),t=Fsa(t),t=Qsa(t,e),t=t.trim(),t}function dv(t){return!t||t.toLowerCase()==="x"||t==="*"}function _sa(t){let e=t.match(wli);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 vsa(t){if(!t)return{};let e=t.match(hsa);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 kgr(t){return t==="*"||t==="x"||t==="X"}function Sli(t){let e=parseInt(t,10);return isNaN(e)?t:e}function Csa(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 bsa(t,e){if(kgr(t)||kgr(e))return 0;let[r,n]=Csa(Sli(t),Sli(e));return r>n?1:r{let l;return dv(n)?l="":dv(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:dv(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 Usa(t,e){let r=Lsa,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return dv(s)?d="":dv(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:dv(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 Qsa(t,e){let r=Rsa;return t.replace(r,(n,o,s,c,l,u)=>{let d=dv(s),f=d||dv(c),h=f||dv(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 qsa(t,e){let r=ksa;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(dv(s)?o="":dv(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:dv(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,dv(h)?f="":dv(m)?f=`<${+h+1}.0.0-0`:dv(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 wli,hsa,msa,kli,Dli,Ssa,Tsa,Ili,Isa,xli,xsa,Pgr,RMe,wsa,Rsa,Psa,ksa,Dsa,Nsa,Msa,Osa,Bsa,Lsa,Nli=_e(()=>{p();lo();wli=/^(?: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-]+)*))?$/,hsa=/^(?<|>|=|==|<=|>=|~|\^|~>)?\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-]+)*))?$/,msa={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(Rli,"satisfies");a(gsa,"_validateVersion");a(Pli,"_doSatisfies");a(Rgr,"_checkRange");a(Asa,"_satisfies");a(ysa,"_doPreleaseCheck");a(Esa,"_normalizeRange");a(dv,"isX");a(_sa,"_parseVersion");a(vsa,"_parseRange");a(kgr,"_isWildcard");a(Sli,"_parseVersionString");a(Csa,"_normalizeVersionType");a(bsa,"_compareVersionStrings");a(Tli,"_compareVersionSegments");kli="[a-zA-Z0-9-]",Dli="0|[1-9]\\d*",Ssa=`\\d*[a-zA-Z-]${kli}*`,Tsa="((?:<|>)?=?)",Ili=`(?:${Dli}|${Ssa})`,Isa=`(?:-(${Ili}(?:\\.${Ili})*))`,xli=`${kli}+`,xsa=`(?:\\+(${xli}(?:\\.${xli})*))`,Pgr=`${Dli}|x|X|\\*`,RMe=`[v=\\s]*(${Pgr})(?:\\.(${Pgr})(?:\\.(${Pgr})(?:${Isa})?${xsa}?)?)?`,wsa=`^${Tsa}\\s*${RMe}$`,Rsa=new RegExp(wsa),Psa=`^\\s*(${RMe})\\s+-\\s+(${RMe})\\s*$`,ksa=new RegExp(Psa),Dsa="(?:~>?)",Nsa=`^${Dsa}${RMe}$`,Msa=new RegExp(Nsa),Osa="(?:\\^)",Bsa=`^${Osa}${RMe}$`,Lsa=new RegExp(Bsa);a(Fsa,"replaceTilde");a(Usa,"replaceCaret");a(Qsa,"replaceXRange");a(qsa,"replaceHyphen")});var Kme=I((csp,Bli)=>{"use strict";p();function Dgr(t){return typeof t=="function"}a(Dgr,"isFunction");var fv=console.error.bind(console);function PMe(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(PMe,"defineProperty");function kMe(t){t&&t.logger&&(Dgr(t.logger)?fv=t.logger:fv("new logger isn't a function, not replacing"))}a(kMe,"shimmer");function Mli(t,e,r){if(!t||!t[e]){fv("no original function "+e+" to wrap");return}if(!r){fv("no wrapper function"),fv(new Error().stack);return}if(!Dgr(t[e])||!Dgr(r)){fv("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return PMe(o,"__original",n),PMe(o,"__unwrap",function(){t[e]===o&&PMe(t,e,n)}),PMe(o,"__wrapped",!0),PMe(t,e,o),o}a(Mli,"wrap");function jsa(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{fv("must provide one or more modules to patch"),fv(new Error().stack);return}if(!(e&&Array.isArray(e))){fv("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){Mli(n,o,r)})})}a(jsa,"massWrap");function Oli(t,e){if(!t||!t[e]){fv("no function to unwrap."),fv(new Error().stack);return}if(!t[e].__unwrap)fv("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(Oli,"unwrap");function Hsa(t,e){if(t)Array.isArray(t)||(t=[t]);else{fv("must provide one or more modules to patch"),fv(new Error().stack);return}if(!(e&&Array.isArray(e))){fv("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){Oli(r,n)})})}a(Hsa,"massUnwrap");kMe.wrap=Mli;kMe.massWrap=jsa;kMe.unwrap=Oli;kMe.massUnwrap=Hsa;Bli.exports=kMe});var XH,Gpt,Lli=_e(()=>{p();lo();wgr();XH=de(Kme()),Gpt=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=Su.getTracer(e,r),this._meter=ZZ.getMeter(e,r),this._logger=Hpt.getLogger(e,r),this._updateMetricInstruments()}_wrap=XH.wrap;_unwrap=XH.unwrap;_massWrap=XH.massWrap;_massUnwrap=XH.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 Uli=I((gsp,Fli)=>{p();var Jme=1e3,Zme=Jme*60,Xme=Zme*60,yee=Xme*24,Gsa=yee*7,$sa=yee*365.25;Fli.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Vsa(t);if(r==="number"&&isFinite(t))return e.long?zsa(t):Wsa(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Vsa(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*$sa;case"weeks":case"week":case"w":return r*Gsa;case"days":case"day":case"d":return r*yee;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Xme;case"minutes":case"minute":case"mins":case"min":case"m":return r*Zme;case"seconds":case"second":case"secs":case"sec":case"s":return r*Jme;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(Vsa,"parse");function Wsa(t){var e=Math.abs(t);return e>=yee?Math.round(t/yee)+"d":e>=Xme?Math.round(t/Xme)+"h":e>=Zme?Math.round(t/Zme)+"m":e>=Jme?Math.round(t/Jme)+"s":t+"ms"}a(Wsa,"fmtShort");function zsa(t){var e=Math.abs(t);return e>=yee?$pt(t,e,yee,"day"):e>=Xme?$pt(t,e,Xme,"hour"):e>=Zme?$pt(t,e,Zme,"minute"):e>=Jme?$pt(t,e,Jme,"second"):t+" ms"}a(zsa,"fmtLong");function $pt(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a($pt,"plural")});var Ngr=I((Esp,Qli)=>{p();function Ysa(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=Uli(),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(Ysa,"setup");Qli.exports=Ysa});var qli=I((Mb,Vpt)=>{p();Mb.formatArgs=Jsa;Mb.save=Zsa;Mb.load=Xsa;Mb.useColors=Ksa;Mb.storage=eaa();Mb.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`."))}})();Mb.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 Ksa(){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(Ksa,"useColors");function Jsa(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Vpt.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(Jsa,"formatArgs");Mb.log=console.debug||console.log||(()=>{});function Zsa(t){try{t?Mb.storage.setItem("debug",t):Mb.storage.removeItem("debug")}catch{}}a(Zsa,"save");function Xsa(){let t;try{t=Mb.storage.getItem("debug")||Mb.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(Xsa,"load");function eaa(){try{return localStorage}catch{}}a(eaa,"localstorage");Vpt.exports=Ngr()(Mb);var{formatters:taa}=Vpt.exports;taa.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Hli=I((Dg,zpt)=>{p();var raa=require("tty"),Wpt=require("util");Dg.init=laa;Dg.log=saa;Dg.formatArgs=iaa;Dg.save=aaa;Dg.load=caa;Dg.useColors=naa;Dg.destroy=Wpt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Dg.colors=[6,2,3,4,5,1];try{let t=EGe();t&&(t.stderr||t).level>=2&&(Dg.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{}Dg.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 naa(){return"colors"in Dg.inspectOpts?!!Dg.inspectOpts.colors:raa.isatty(process.stderr.fd)}a(naa,"useColors");function iaa(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: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(` `).join(` -`+s),t.push(o+"m+"+zpt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=oaa()+e+" "+t[0]}a(iaa,"formatArgs");function oaa(){return Dg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(oaa,"getDate");function saa(...t){return process.stderr.write(Wpt.formatWithOptions(Dg.inspectOpts,...t)+` -`)}a(saa,"log");function aaa(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(aaa,"save");function caa(){return process.env.DEBUG}a(caa,"load");function laa(t){t.inspectOpts={};let e=Object.keys(Dg.inspectOpts);for(let r=0;re.trim()).join(" ")};jli.O=function(t){return this.inspectOpts.colors=this.useColors,Wpt.inspect(t,this.inspectOpts)}});var Gli=I((Isp,Mgr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Mgr.exports=qli():Mgr.exports=Hli()});var Bgr=I((wsp,$li)=>{"use strict";p();var Ogr=require("path").sep;$li.exports=function(t){var e=t.split(Ogr),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]+Ogr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+Ogr;return{name:o,basedir:c,path:d}}}});var Lgr=I((Psp,Vli)=>{"use strict";p();var uaa=require("os");Vli.exports=uaa.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 Fgr=I((Nsp,Wli)=>{p();Wli.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 zli=I((Osp,DMe)=>{"use strict";p();var daa=process.platform==="win32",faa=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Ugr={};function paa(t){return faa.exec(t).slice(1)}a(paa,"win32SplitPath");Ugr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=paa(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 haa=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Qgr={};function maa(t){return haa.exec(t).slice(1)}a(maa,"posixSplitPath");Qgr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=maa(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]}};daa?DMe.exports=Ugr.parse:DMe.exports=Qgr.parse;DMe.exports.posix=Qgr.parse;DMe.exports.win32=Ugr.parse});var qgr=I((Fsp,Zli)=>{p();var Jli=require("path"),Yli=Jli.parse||zli(),Kli=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=Yli(e);s.dir!==o[o.length-1];)o.push(s.dir),s=Yli(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return Jli.resolve(n,l,u)}))},[])},"getNodeModulesDirs");Zli.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 Kli(e,o)},r);var s=Kli(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var jgr=I((qsp,Xli)=>{p();Xli.exports=function(t,e){return e||{}}});var rui=I((Hsp,tui)=>{"use strict";p();var gaa="Function.prototype.bind called on incompatible ",Aaa=Object.prototype.toString,yaa=Math.max,Eaa="[object Function]",eui=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var Caa=rui();nui.exports=Function.prototype.bind||Caa});var sui=I((zsp,oui)=>{"use strict";p();var baa=Function.prototype.call,Saa=Object.prototype.hasOwnProperty,Taa=iui();oui.exports=Taa.call(baa,Saa)});var aui=I((Ksp,Iaa)=>{Iaa.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 NMe=I((Jsp,uui)=>{"use strict";p();var xaa=sui();function waa(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(waa,"specifierIncluded");function cui(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 Eee=require("fs"),Paa=Lgr(),pm=require("path"),kaa=Fgr(),Daa=qgr(),Naa=jgr(),Maa=NMe(),Oaa=process.platform!=="win32"&&Eee.realpath&&typeof Eee.realpath.native=="function"?Eee.realpath.native:Eee.realpath,dui=Paa(),Baa=a(function(){return[pm.join(dui,".node_modules"),pm.join(dui,".node_libraries")]},"defaultPaths"),Laa=a(function(e,r){Eee.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"),Faa=a(function(e,r){Eee.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),Uaa=a(function(e,r){Oaa(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),MMe=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),Qaa=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"),qaa=a(function(e,r,n){for(var o=Daa(r,n,e),s=0;s{jaa.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 yui=I((iap,Aui)=>{"use strict";p();var Haa=NMe(),mui=hui(),gui={};for(Ypt in mui)Object.prototype.hasOwnProperty.call(mui,Ypt)&&(gui[Ypt]=Haa(Ypt));var Ypt;Aui.exports=gui});var _ui=I((sap,Eui)=>{p();var Gaa=NMe();Eui.exports=a(function(e){return Gaa(e)},"isCore")});var bui=I((lap,Cui)=>{p();var $aa=NMe(),_ee=require("fs"),TE=require("path"),Vaa=Lgr(),Waa=Fgr(),zaa=qgr(),Yaa=jgr(),Kaa=process.platform!=="win32"&&_ee.realpathSync&&typeof _ee.realpathSync.native=="function"?_ee.realpathSync.native:_ee.realpathSync,vui=Vaa(),Jaa=a(function(){return[TE.join(vui,".node_modules"),TE.join(vui,".node_libraries")]},"defaultPaths"),Zaa=a(function(e){try{var r=_ee.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"),Xaa=a(function(e){try{var r=_ee.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),eca=a(function(e){try{return Kaa(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),OMe=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),tca=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),rca=a(function(e,r,n){for(var o=zaa(r,n,e),s=0;s{p();var Kpt=pui();Kpt.core=yui();Kpt.isCore=_ui();Kpt.sync=bui();Sui.exports=Kpt});var Tui=I((hap,nca)=>{nca.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 Wgr=I((map,Vgr)=>{"use strict";p();var t0e=require("path"),Z2=require("module"),ah=Gli()("require-in-the-middle"),ica=Bgr();Vgr.exports=BMe;Vgr.exports.Hook=BMe;var Ggr,e0e;if(Z2.isBuiltin)e0e=Z2.isBuiltin;else if(Z2.builtinModules)e0e=a(t=>t.startsWith("node:")?!0:(Ggr===void 0&&(Ggr=new Set(Z2.builtinModules)),Ggr.has(t)),"isCore");else{let t=Hgr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?e0e=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):e0e=a(n=>!!t.core[n],"isCore")}var Jpt;function oca(t,e){if(!Jpt)if(require.resolve&&require.resolve.paths)Jpt=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=Hgr();Jpt=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return Jpt(t,e)}a(oca,"resolve");var sca=/([/\\]index)?(\.js)?$/,$gr=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:(ah('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function BMe(t,e,r){if(!(this instanceof BMe))return new BMe(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof Z2._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof Z2._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,Tui().bugs.url);return}this._cache=new $gr,this._unhooked=!1,this._origRequire=Z2.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);ah("registering require hook"),this._require=Z2.prototype.require=function(u){return n._unhooked===!0?(ah("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?(ah("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=e0e(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);e0e(v)&&(m=v)}}else{if(d)return ah("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=Z2._resolveFilename(f,this)}catch(v){return ah('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(ah("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return ah("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 ah("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 ah("ignoring core module not on whitelist: %s",m),E;g=m}else if(c===!0&&t.includes(m)){let v=t0e.parse(m);g=v.name,A=v.dir}else{let v=ica(m);if(v===void 0)return ah("could not parse filename: %s",m),E;g=v.name,A=v.basedir;let b=aca(v);ah("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=oca(g,A)}catch{return ah("could not resolve module: %s",g),n._cache.set(m,E,h),E}if(w!==m)if(s===!0)g=g+t0e.sep+t0e.relative(A,m),ah("preparing to process require of internal file: %s",g);else return ah("ignoring require of non-main module file: %s",w),n._cache.set(m,E,h),E}}n._cache.set(m,E,h),ah("calling require hook: %s",g);let _=r(E,g,A);return n._cache.set(m,_,h),ah("returning module: %s",g),_}a(l,"patchedRequire")}a(BMe,"Hook");BMe.prototype.unhook=function(){this._unhooked=!0,this._require===Z2.prototype.require?(Z2.prototype.require=this._origRequire,ah("require unhook successful")):ah("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,ah("process.getBuiltinModule unhook successful")):ah("process.getBuiltinModule unhook unsuccessful"))};function aca(t){let e=t0e.sep!=="/"?t.path.split(t0e.sep).join("/"):t.path;return t0e.posix.join(t.name,e).replace(sca,"")}a(aca,"resolveModuleName")});var Zpt,Xpt,Iui=_e(()=>{p();Zpt=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},Xpt=class{static{a(this,"ModuleNameTrie")}_trie=new Zpt;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new Zpt,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 lca(t){return zgr.sep!=="/"?t.split(zgr.sep).join("/"):t}var wui,zgr,cca,eht,Rui=_e(()=>{p();wui=de(Wgr()),zgr=de(require("path"));Iui();cca=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),eht=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new Xpt;static _instance;constructor(){this._initialize()}_initialize(){new wui.Hook(null,{internals:!0},(e,r,n)=>{let o=lca(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 cca?new t:this._instance=this._instance??new t}};a(lca,"normalizePathSeparators")});var Oui=I(vee=>{p();var Pui=[],Ygr=new WeakMap,kui=new WeakMap,Dui=new Map,Nui=[],uca={set(t,e,r){return Ygr.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=kui.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 Ygr.get(t)[e](r.value)}};function dca(t,e,r,n,o){Dui.set(t,o),Ygr.set(e,r),kui.set(e,n);let s=new Proxy(e,uca);Pui.forEach(c=>c(t,s)),Nui.push([t,s])}a(dca,"register");var Mui=!1;function fca(){return Mui}a(fca,"getExperimentalPatchInternals");function pca(t){Mui=t}a(pca,"setExperimentalPatchInternals");vee.register=dca;vee.importHooks=Pui;vee.specifiers=Dui;vee.toHook=Nui;vee.getExperimentalPatchInternals=fca;vee.setExperimentalPatchInternals=pca});var qui=I((wap,r0e)=>{p();var Bui=require("path"),hca=Bgr(),{fileURLToPath:Lui}=require("url"),{MessageChannel:mca}=require("worker_threads"),{importHooks:Kgr,specifiers:gca,toHook:Aca,getExperimentalPatchInternals:yca}=Oui();function Uui(t){Kgr.push(t),Aca.forEach(([e,r])=>t(e,r))}a(Uui,"addHook");function Qui(t){let e=Kgr.indexOf(t);e>-1&&Kgr.splice(e,1)}a(Qui,"removeHook");function Fui(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(Fui,"callHookFn");var Jgr;function Eca(){let{port1:t,port2:e}=new mca,r=0,n;Jgr=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(Eca,"createAddHookMessageChannel");function LMe(t,e,r){if(!(this instanceof LMe))return new LMe(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;Jgr&&Array.isArray(t)&&Jgr(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=Lui(o)}catch{}let d=hca(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+Bui.sep+Bui.relative(u,Lui(c));else if(!yca()&&!u.endsWith(gca.get(c)))continue}Fui(r,s,o,u)}}else Fui(r,s,o,u)},Uui(this._iitmHook)}a(LMe,"Hook");LMe.prototype.unhook=function(){Qui(this._iitmHook)};r0e.exports=LMe;r0e.exports.Hook=LMe;r0e.exports.addHook=Uui;r0e.exports.removeHook=Qui;r0e.exports.createAddHookMessageChannel=Eca});function jui(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 Hui(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 tht(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var Zgr=_e(()=>{p();a(jui,"safeExecuteInTheMiddle");a(Hui,"safeExecuteInTheMiddleAsync");a(tht,"isWrapped")});function Gui(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>Rli(e,n,{includePrerelease:r}))}var _8,Xgr,FMe,$ui,Vui,Wui,n0e,zui=_e(()=>{p();_8=de(require("path")),Xgr=require("util");Nli();FMe=de(Kme());Lli();Rui();$ui=de(qui());lo();Vui=de(Wgr()),Wui=require("fs");Zgr();n0e=class extends Gpt{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=eht.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(tht(e[r])&&this._unwrap(e,r),Xgr.types.isProxy(e)){let o=(0,FMe.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,FMe.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>Xgr.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,FMe.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,Wui.readFileSync)(_8.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 Gui(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=_8.normalize(n);return c.filter(d=>d.name===l).filter(d=>Gui(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&&_8.isAbsolute(l)){let d=_8.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=_8.isAbsolute(e.name)?new Vui.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new $ui.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(Gui,"isSupported")});var UMe,Yui=_e(()=>{p();UMe=require("path")});var Kui=_e(()=>{p();zui();Yui()});var eAr=_e(()=>{p();Kui()});var rht,Jui=_e(()=>{p();rht=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 nht,Zui=_e(()=>{p();eAr();nht=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,UMe.normalize)(e)}}});var tAr={};Ri(tAr,{InstrumentationBase:()=>n0e,InstrumentationNodeModuleDefinition:()=>rht,InstrumentationNodeModuleFile:()=>nht,isWrapped:()=>tht,registerInstrumentations:()=>Cli,safeExecuteInTheMiddle:()=>jui,safeExecuteInTheMiddleAsync:()=>Hui});var rAr=_e(()=>{p();bli();eAr();Jui();Zui();Zgr()});var edi=I(nAr=>{"use strict";p();Object.defineProperty(nAr,"__esModule",{value:!0});nAr.log=bca;var Xui=(n3(),_a(G7)),_ca=require("node:os"),vca=Xui.__importDefault(require("node:util")),Cca=Xui.__importStar(require("node:process"));function bca(t,...e){Cca.stderr.write(`${vca.default.format(t,...e)}${_ca.EOL}`)}a(bca,"log")});var odi=I(cAr=>{"use strict";p();Object.defineProperty(cAr,"__esModule",{value:!0});var Sca=edi(),tdi=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,rdi,iAr=[],oAr=[],iht=[];tdi&&sAr(tdi);var ndi=Object.assign(t=>idi(t),{enable:sAr,enabled:aAr,disable:Tca,log:Sca.log});function sAr(t){rdi=t,iAr=[],oAr=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?oAr.push(new RegExp(`^${n.substr(1)}$`)):iAr.push(new RegExp(`^${n}$`));for(let n of iht)n.enabled=aAr(n.namespace)}a(sAr,"enable");function aAr(t){if(t.endsWith("*"))return!0;for(let e of oAr)if(e.test(t))return!1;for(let e of iAr)if(e.test(t))return!0;return!1}a(aAr,"enabled");function Tca(){let t=rdi||"";return sAr(""),t}a(Tca,"disable");function idi(t){let e=Object.assign(r,{enabled:aAr(t),destroy:Ica,log:ndi.log,namespace:t,extend:xca});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),iht.push(e),e}a(idi,"createDebugger");function Ica(){let t=iht.indexOf(this);return t>=0?(iht.splice(t,1),!0):!1}a(Ica,"destroy");function xca(t){let e=idi(`${this.namespace}:${t}`);return e.log=this.log,e}a(xca,"extend");cAr.default=ndi});var cht=I(m4=>{"use strict";p();Object.defineProperty(m4,"__esModule",{value:!0});m4.AzureLogger=void 0;m4.setLogLevel=cdi;m4.getLogLevel=Rca;m4.createClientLogger=Pca;var wca=(n3(),_a(G7)),QMe=wca.__importDefault(odi()),adi=new Set,oht=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,aht;m4.AzureLogger=(0,QMe.default)("azure");m4.AzureLogger.log=(...t)=>{QMe.default.log(...t)};var lAr=["verbose","info","warning","error"];oht&&(ddi(oht)?cdi(oht):console.error(`AZURE_LOG_LEVEL set to unknown log level '${oht}'; logging is not enabled. Acceptable values: ${lAr.join(", ")}.`));function cdi(t){if(t&&!ddi(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${lAr.join(",")}`);aht=t;let e=[];for(let r of adi)udi(r)&&e.push(r.namespace);QMe.default.enable(e.join(","))}a(cdi,"setLogLevel");function Rca(){return aht}a(Rca,"getLogLevel");var sdi={verbose:400,info:300,warning:200,error:100};function Pca(t){let e=m4.AzureLogger.extend(t);return ldi(m4.AzureLogger,e),{error:sht(e,"error"),warning:sht(e,"warning"),info:sht(e,"info"),verbose:sht(e,"verbose")}}a(Pca,"createClientLogger");function ldi(t,e){e.log=(...r)=>{t.log(...r)}}a(ldi,"patchLogMethod");function sht(t,e){let r=Object.assign(t.extend(e),{level:e});if(ldi(t,r),udi(r)){let n=QMe.default.disable();QMe.default.enable(n+","+r.namespace)}return adi.add(r),r}a(sht,"createLogger");function udi(t){return!!(aht&&sdi[t.level]<=sdi[aht])}a(udi,"shouldEnable");function ddi(t){return lAr.includes(t)}a(ddi,"isAzureLogLevel")});var uAr=I(lht=>{"use strict";p();Object.defineProperty(lht,"__esModule",{value:!0});lht.logger=void 0;var kca=cht();lht.logger=(0,kca.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function uht(t){return t.setValue(dAr,!0)}function fdi(t){return t.deleteValue(dAr)}function i0e(t){return t.getValue(dAr)===!0}var dAr,qMe=_e(()=>{p();lo();dAr=hb("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(uht,"suppressTracing");a(fdi,"unsuppressTracing");a(i0e,"isTracingSuppressed")});var dht,pdi=_e(()=>{p();dht="baggage"});function mdi(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function gdi(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 fAr(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=Ope(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=fAr(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var pAr=_e(()=>{p();lo();a(mdi,"serializeKeyPairs");a(gdi,"getKeyPairs");a(fAr,"parsePairKeyValue");a(Adi,"parseKeyPairsIntoRecord")});var pht,ydi=_e(()=>{p();lo();qMe();pdi();pAr();pht=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=ST.getBaggage(e);if(!o||i0e(e))return;let s=gdi(o).filter(l=>l.length<=4096).slice(0,180),c=mdi(s);c.length>0&&n.set(r,dht,c)}extract(e,r,n){let o=n.get(r,dht),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=fAr(u);if(d){let f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0)?e:ST.setBaggage(e,ST.createBaggage(c))}fields(){return[dht]}}});var hht,Edi=_e(()=>{p();hht=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 _di(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(!Mca(r)){Dn.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!hAr(n)){Dn.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function Mca(t){return typeof t=="string"&&t!==""}function hAr(t){return t==null?!0:Array.isArray(t)?Oca(t):vdi(typeof t)}function Oca(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(vdi(n)){e=n;continue}return!1}return!1}}return!0}function vdi(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var Cdi=_e(()=>{p();lo();a(_di,"sanitizeAttributes");a(Mca,"isAttributeKey");a(hAr,"isAttributeValue");a(Oca,"isHomogeneousAttributeValueArray");a(vdi,"isValidPrimitiveAttributeValueType")});function mht(){return t=>{Dn.error(Bca(t))}}function Bca(t){return typeof t=="string"?t:JSON.stringify(Lca(t))}function Lca(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 mAr=_e(()=>{p();lo();a(mht,"loggingErrorHandler");a(Bca,"stringifyException");a(Lca,"flattenException")});function Sdi(t){bdi=t}function Tdi(t){try{bdi(t)}catch{}}var bdi,Idi=_e(()=>{p();mAr();bdi=mht();a(Sdi,"setGlobalErrorHandler");a(Tdi,"globalErrorHandler")});function ght(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Dn.warn(`Unknown value ${(0,gAr.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function jMe(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function Aht(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Dn.warn(`Unknown value ${(0,gAr.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function yht(t){return jMe(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var gAr,xdi=_e(()=>{p();lo();gAr=require("util");a(ght,"getNumberFromEnv");a(jMe,"getStringFromEnv");a(Aht,"getBooleanFromEnv");a(yht,"getStringListFromEnv")});var Eht,wdi=_e(()=>{p();Eht=typeof globalThis=="object"?globalThis:global});var Rdi,eG,Pdi=_e(()=>{p();Rdi=require("perf_hooks"),eG=Rdi.performance});var kdi,Ddi=_e(()=>{p();kdi="2.2.0"});function ch(t){let e={},r=t.length;for(let n=0;n{p();a(ch,"createConstMap")});var Ndi,Mdi,Odi,Bdi,Ldi,Fdi,Udi,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi,efi,tfi,rfi,nfi,ifi,ofi,sfi,afi,cfi,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,_fi,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,Pfi,kfi,Dfi,Nfi,Mfi,Ofi,Bfi,Lfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi,npi,ipi,opi,spi,api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,vpi,Cpi,bpi,Spi,Tpi,Ipi,xpi,wpi,Rpi,Ppi,kpi,Dpi,Npi,Mpi,Opi,Bpi,Lpi,Fpi,Upi,Qpi,qpi,jpi,Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,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,Pla,kla,Dla,Nla,Mla,Ola,Bla,Lla,Fla,Ula,Qla,qla,jla,Hla,Gla,$la,Vla,Wla,zla,Yla,Kla,Jla,Zla,Xla,eua,tua,rua,nua,iua,oua,sua,aua,cua,lua,uua,dua,fua,pua,hua,mua,gua,Aua,yua,Eua,_ua,vua,Cua,bua,Sua,Tua,Iua,xua,wua,Rua,Pua,kua,Dua,Nua,Mua,Oua,Bua,Lua,Fua,Uua,Qua,qua,jua,Hua,Gua,$ua,Vua,Wua,zua,Yua,Kua,Jua,Zua,Xua,eda,tda,rda,nda,ida,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,Phi,khi,Dhi,Nhi,Mhi,Ohi,Bhi,Lhi,Fhi,Uhi,Qhi,qhi,jhi,Hhi,Ghi,$hi,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,Pda,kda,Dda,Nda,Mda,Oda,Bda,Lda,Fda,Uda,Qda,qda,jda,Hda,Gda,$da,Vda,Wda,zda,Yda,Kda,Jda,Zda,Vhi,Whi,zhi,Yhi,Khi,Jhi,Zhi,Xhi,emi,tmi,rmi,Xda,efa,tfa,rfa,nfa,ifa,ofa,sfa,afa,cfa,lfa,ufa,nmi,imi,omi,smi,ami,dfa,ffa,pfa,hfa,mfa,gfa,cmi,lmi,umi,Afa,yfa,Efa,_fa,dmi,fmi,pmi,hmi,vfa,Cfa,bfa,Sfa,Tfa,mmi,gmi,Ami,ymi,Emi,_mi,vmi,Ifa,xfa,wfa,Rfa,Pfa,kfa,Dfa,Nfa,Cmi,bmi,Smi,Tmi,Imi,Mfa,Ofa,Bfa,Lfa,Ffa,Ufa,xmi,wmi,Rmi,Pmi,kmi,Dmi,Nmi,Mmi,Omi,Bmi,Lmi,Fmi,Umi,Qmi,qmi,jmi,Hmi,Gmi,$mi,Vmi,Wmi,Qfa,qfa,jfa,Hfa,Gfa,$fa,Vfa,Wfa,zfa,Yfa,Kfa,Jfa,Zfa,Xfa,epa,tpa,rpa,npa,ipa,opa,spa,apa,zmi,Ymi,Kmi,Jmi,Zmi,cpa,lpa,upa,dpa,fpa,ppa,Xmi,e0i,hpa,mpa,gpa,t0i,r0i,Apa,ypa,Epa,n0i,i0i,o0i,s0i,a0i,c0i,l0i,u0i,d0i,f0i,p0i,h0i,m0i,g0i,A0i,y0i,E0i,_pa,vpa,Cpa,bpa,Spa,Tpa,Ipa,xpa,wpa,Rpa,Ppa,kpa,Dpa,Npa,Mpa,Opa,Bpa,Lpa,_0i,v0i,Fpa,Upa,Qpa,C0i=_e(()=>{p();AAr();Ndi="aws.lambda.invoked_arn",Mdi="db.system",Odi="db.connection_string",Bdi="db.user",Ldi="db.jdbc.driver_classname",Fdi="db.name",Udi="db.statement",Qdi="db.operation",qdi="db.mssql.instance_name",jdi="db.cassandra.keyspace",Hdi="db.cassandra.page_size",Gdi="db.cassandra.consistency_level",$di="db.cassandra.table",Vdi="db.cassandra.idempotence",Wdi="db.cassandra.speculative_execution_count",zdi="db.cassandra.coordinator.id",Ydi="db.cassandra.coordinator.dc",Kdi="db.hbase.namespace",Jdi="db.redis.database_index",Zdi="db.mongodb.collection",Xdi="db.sql.table",efi="exception.type",tfi="exception.message",rfi="exception.stacktrace",nfi="exception.escaped",ifi="faas.trigger",ofi="faas.execution",sfi="faas.document.collection",afi="faas.document.operation",cfi="faas.document.time",lfi="faas.document.name",ufi="faas.time",dfi="faas.cron",ffi="faas.coldstart",pfi="faas.invoked_name",hfi="faas.invoked_provider",mfi="faas.invoked_region",gfi="net.transport",Afi="net.peer.ip",yfi="net.peer.port",Efi="net.peer.name",_fi="net.host.ip",vfi="net.host.port",Cfi="net.host.name",bfi="net.host.connection.type",Sfi="net.host.connection.subtype",Tfi="net.host.carrier.name",Ifi="net.host.carrier.mcc",xfi="net.host.carrier.mnc",wfi="net.host.carrier.icc",Rfi="peer.service",Pfi="enduser.id",kfi="enduser.role",Dfi="enduser.scope",Nfi="thread.id",Mfi="thread.name",Ofi="code.function",Bfi="code.namespace",Lfi="code.filepath",Ffi="code.lineno",Ufi="http.method",Qfi="http.url",qfi="http.target",jfi="http.host",Hfi="http.scheme",Gfi="http.status_code",$fi="http.flavor",Vfi="http.user_agent",Wfi="http.request_content_length",zfi="http.request_content_length_uncompressed",Yfi="http.response_content_length",Kfi="http.response_content_length_uncompressed",Jfi="http.server_name",Zfi="http.route",Xfi="http.client_ip",epi="aws.dynamodb.table_names",tpi="aws.dynamodb.consumed_capacity",rpi="aws.dynamodb.item_collection_metrics",npi="aws.dynamodb.provisioned_read_capacity",ipi="aws.dynamodb.provisioned_write_capacity",opi="aws.dynamodb.consistent_read",spi="aws.dynamodb.projection",api="aws.dynamodb.limit",cpi="aws.dynamodb.attributes_to_get",lpi="aws.dynamodb.index_name",upi="aws.dynamodb.select",dpi="aws.dynamodb.global_secondary_indexes",fpi="aws.dynamodb.local_secondary_indexes",ppi="aws.dynamodb.exclusive_start_table",hpi="aws.dynamodb.table_count",mpi="aws.dynamodb.scan_forward",gpi="aws.dynamodb.segment",Api="aws.dynamodb.total_segments",ypi="aws.dynamodb.count",Epi="aws.dynamodb.scanned_count",_pi="aws.dynamodb.attribute_definitions",vpi="aws.dynamodb.global_secondary_index_updates",Cpi="messaging.system",bpi="messaging.destination",Spi="messaging.destination_kind",Tpi="messaging.temp_destination",Ipi="messaging.protocol",xpi="messaging.protocol_version",wpi="messaging.url",Rpi="messaging.message_id",Ppi="messaging.conversation_id",kpi="messaging.message_payload_size_bytes",Dpi="messaging.message_payload_compressed_size_bytes",Npi="messaging.operation",Mpi="messaging.consumer_id",Opi="messaging.rabbitmq.routing_key",Bpi="messaging.kafka.message_key",Lpi="messaging.kafka.consumer_group",Fpi="messaging.kafka.client_id",Upi="messaging.kafka.partition",Qpi="messaging.kafka.tombstone",qpi="rpc.system",jpi="rpc.service",Hpi="rpc.method",Gpi="rpc.grpc.status_code",$pi="rpc.jsonrpc.version",Vpi="rpc.jsonrpc.request_id",Wpi="rpc.jsonrpc.error_code",zpi="rpc.jsonrpc.error_message",Ypi="message.type",Kpi="message.id",Jpi="message.compressed_size",Zpi="message.uncompressed_size",Fca=Ndi,Uca=Mdi,Qca=Odi,qca=Bdi,jca=Ldi,Hca=Fdi,Gca=Udi,$ca=Qdi,Vca=qdi,Wca=jdi,zca=Hdi,Yca=Gdi,Kca=$di,Jca=Vdi,Zca=Wdi,Xca=zdi,ela=Ydi,tla=Kdi,rla=Jdi,nla=Zdi,ila=Xdi,ola=efi,sla=tfi,ala=rfi,cla=nfi,lla=ifi,ula=ofi,dla=sfi,fla=afi,pla=cfi,hla=lfi,mla=ufi,gla=dfi,Ala=ffi,yla=pfi,Ela=hfi,_la=mfi,vla=gfi,Cla=Afi,bla=yfi,Sla=Efi,Tla=_fi,Ila=vfi,xla=Cfi,wla=bfi,Rla=Sfi,Pla=Tfi,kla=Ifi,Dla=xfi,Nla=wfi,Mla=Rfi,Ola=Pfi,Bla=kfi,Lla=Dfi,Fla=Nfi,Ula=Mfi,Qla=Ofi,qla=Bfi,jla=Lfi,Hla=Ffi,Gla=Ufi,$la=Qfi,Vla=qfi,Wla=jfi,zla=Hfi,Yla=Gfi,Kla=$fi,Jla=Vfi,Zla=Wfi,Xla=zfi,eua=Yfi,tua=Kfi,rua=Jfi,nua=Zfi,iua=Xfi,oua=epi,sua=tpi,aua=rpi,cua=npi,lua=ipi,uua=opi,dua=spi,fua=api,pua=cpi,hua=lpi,mua=upi,gua=dpi,Aua=fpi,yua=ppi,Eua=hpi,_ua=mpi,vua=gpi,Cua=Api,bua=ypi,Sua=Epi,Tua=_pi,Iua=vpi,xua=Cpi,wua=bpi,Rua=Spi,Pua=Tpi,kua=Ipi,Dua=xpi,Nua=wpi,Mua=Rpi,Oua=Ppi,Bua=kpi,Lua=Dpi,Fua=Npi,Uua=Mpi,Qua=Opi,qua=Bpi,jua=Lpi,Hua=Fpi,Gua=Upi,$ua=Qpi,Vua=qpi,Wua=jpi,zua=Hpi,Yua=Gpi,Kua=$pi,Jua=Vpi,Zua=Wpi,Xua=zpi,eda=Ypi,tda=Kpi,rda=Jpi,nda=Zpi,ida=ch([Ndi,Mdi,Odi,Bdi,Ldi,Fdi,Udi,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi,efi,tfi,rfi,nfi,ifi,ofi,sfi,afi,cfi,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,_fi,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,Pfi,kfi,Dfi,Nfi,Mfi,Ofi,Bfi,Lfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi,npi,ipi,opi,spi,api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,vpi,Cpi,bpi,Spi,Tpi,Ipi,xpi,wpi,Rpi,Ppi,kpi,Dpi,Npi,Mpi,Opi,Bpi,Lpi,Fpi,Upi,Qpi,qpi,jpi,Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi]),Xpi="other_sql",ehi="mssql",thi="mysql",rhi="oracle",nhi="db2",ihi="postgresql",ohi="redshift",shi="hive",ahi="cloudscape",chi="hsqldb",lhi="progress",uhi="maxdb",dhi="hanadb",fhi="ingres",phi="firstsql",hhi="edb",mhi="cache",ghi="adabas",Ahi="firebird",yhi="derby",Ehi="filemaker",_hi="informix",vhi="instantdb",Chi="interbase",bhi="mariadb",Shi="netezza",Thi="pervasive",Ihi="pointbase",xhi="sqlite",whi="sybase",Rhi="teradata",Phi="vertica",khi="h2",Dhi="coldfusion",Nhi="cassandra",Mhi="hbase",Ohi="mongodb",Bhi="redis",Lhi="couchbase",Fhi="couchdb",Uhi="cosmosdb",Qhi="dynamodb",qhi="neo4j",jhi="geode",Hhi="elasticsearch",Ghi="memcached",$hi="cockroachdb",oda=Xpi,sda=ehi,ada=thi,cda=rhi,lda=nhi,uda=ihi,dda=ohi,fda=shi,pda=ahi,hda=chi,mda=lhi,gda=uhi,Ada=dhi,yda=fhi,Eda=phi,_da=hhi,vda=mhi,Cda=ghi,bda=Ahi,Sda=yhi,Tda=Ehi,Ida=_hi,xda=vhi,wda=Chi,Rda=bhi,Pda=Shi,kda=Thi,Dda=Ihi,Nda=xhi,Mda=whi,Oda=Rhi,Bda=Phi,Lda=khi,Fda=Dhi,Uda=Nhi,Qda=Mhi,qda=Ohi,jda=Bhi,Hda=Lhi,Gda=Fhi,$da=Uhi,Vda=Qhi,Wda=qhi,zda=jhi,Yda=Hhi,Kda=Ghi,Jda=$hi,Zda=ch([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,Phi,khi,Dhi,Nhi,Mhi,Ohi,Bhi,Lhi,Fhi,Uhi,Qhi,qhi,jhi,Hhi,Ghi,$hi]),Vhi="all",Whi="each_quorum",zhi="quorum",Yhi="local_quorum",Khi="one",Jhi="two",Zhi="three",Xhi="local_one",emi="any",tmi="serial",rmi="local_serial",Xda=Vhi,efa=Whi,tfa=zhi,rfa=Yhi,nfa=Khi,ifa=Jhi,ofa=Zhi,sfa=Xhi,afa=emi,cfa=tmi,lfa=rmi,ufa=ch([Vhi,Whi,zhi,Yhi,Khi,Jhi,Zhi,Xhi,emi,tmi,rmi]),nmi="datasource",imi="http",omi="pubsub",smi="timer",ami="other",dfa=nmi,ffa=imi,pfa=omi,hfa=smi,mfa=ami,gfa=ch([nmi,imi,omi,smi,ami]),cmi="insert",lmi="edit",umi="delete",Afa=cmi,yfa=lmi,Efa=umi,_fa=ch([cmi,lmi,umi]),dmi="alibaba_cloud",fmi="aws",pmi="azure",hmi="gcp",vfa=dmi,Cfa=fmi,bfa=pmi,Sfa=hmi,Tfa=ch([dmi,fmi,pmi,hmi]),mmi="ip_tcp",gmi="ip_udp",Ami="ip",ymi="unix",Emi="pipe",_mi="inproc",vmi="other",Ifa=mmi,xfa=gmi,wfa=Ami,Rfa=ymi,Pfa=Emi,kfa=_mi,Dfa=vmi,Nfa=ch([mmi,gmi,Ami,ymi,Emi,_mi,vmi]),Cmi="wifi",bmi="wired",Smi="cell",Tmi="unavailable",Imi="unknown",Mfa=Cmi,Ofa=bmi,Bfa=Smi,Lfa=Tmi,Ffa=Imi,Ufa=ch([Cmi,bmi,Smi,Tmi,Imi]),xmi="gprs",wmi="edge",Rmi="umts",Pmi="cdma",kmi="evdo_0",Dmi="evdo_a",Nmi="cdma2000_1xrtt",Mmi="hsdpa",Omi="hsupa",Bmi="hspa",Lmi="iden",Fmi="evdo_b",Umi="lte",Qmi="ehrpd",qmi="hspap",jmi="gsm",Hmi="td_scdma",Gmi="iwlan",$mi="nr",Vmi="nrnsa",Wmi="lte_ca",Qfa=xmi,qfa=wmi,jfa=Rmi,Hfa=Pmi,Gfa=kmi,$fa=Dmi,Vfa=Nmi,Wfa=Mmi,zfa=Omi,Yfa=Bmi,Kfa=Lmi,Jfa=Fmi,Zfa=Umi,Xfa=Qmi,epa=qmi,tpa=jmi,rpa=Hmi,npa=Gmi,ipa=$mi,opa=Vmi,spa=Wmi,apa=ch([xmi,wmi,Rmi,Pmi,kmi,Dmi,Nmi,Mmi,Omi,Bmi,Lmi,Fmi,Umi,Qmi,qmi,jmi,Hmi,Gmi,$mi,Vmi,Wmi]),zmi="1.0",Ymi="1.1",Kmi="2.0",Jmi="SPDY",Zmi="QUIC",cpa=zmi,lpa=Ymi,upa=Kmi,dpa=Jmi,fpa=Zmi,ppa={HTTP_1_0:zmi,HTTP_1_1:Ymi,HTTP_2_0:Kmi,SPDY:Jmi,QUIC:Zmi},Xmi="queue",e0i="topic",hpa=Xmi,mpa=e0i,gpa=ch([Xmi,e0i]),t0i="receive",r0i="process",Apa=t0i,ypa=r0i,Epa=ch([t0i,r0i]),n0i=0,i0i=1,o0i=2,s0i=3,a0i=4,c0i=5,l0i=6,u0i=7,d0i=8,f0i=9,p0i=10,h0i=11,m0i=12,g0i=13,A0i=14,y0i=15,E0i=16,_pa=n0i,vpa=i0i,Cpa=o0i,bpa=s0i,Spa=a0i,Tpa=c0i,Ipa=l0i,xpa=u0i,wpa=d0i,Rpa=f0i,Ppa=p0i,kpa=h0i,Dpa=m0i,Npa=g0i,Mpa=A0i,Opa=y0i,Bpa=E0i,Lpa={OK:n0i,CANCELLED:i0i,UNKNOWN:o0i,INVALID_ARGUMENT:s0i,DEADLINE_EXCEEDED:a0i,NOT_FOUND:c0i,ALREADY_EXISTS:l0i,PERMISSION_DENIED:u0i,RESOURCE_EXHAUSTED:d0i,FAILED_PRECONDITION:f0i,ABORTED:p0i,OUT_OF_RANGE:h0i,UNIMPLEMENTED:m0i,INTERNAL:g0i,UNAVAILABLE:A0i,DATA_LOSS:y0i,UNAUTHENTICATED:E0i},_0i="SENT",v0i="RECEIVED",Fpa=_0i,Upa=v0i,Qpa=ch([_0i,v0i])});var b0i=_e(()=>{p();C0i()});var S0i,T0i,I0i,x0i,w0i,R0i,P0i,k0i,D0i,N0i,M0i,O0i,B0i,L0i,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,Pgi,kgi,Dgi,Ngi,Mgi,Ogi,Bgi,Lgi,Fgi,Ugi,Qgi,qgi,jgi,Hgi,Ggi,$gi,Vgi,Wgi,zgi,Ygi,Kgi,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,Pha,kha,Dha,Nha,Mha,Oha,Bha,Lha,Fha,Uha,Qha,qha,jha,Hha,Gha,$ha,Vha,Wha,zha,Yha,Kha,Jha,Zha,Xha,ema,tma,rma,nma,ima,oma,sma,ama,cma,lma,uma,dma,fma,pma,hma,Jgi,Zgi,Xgi,eAi,mma,gma,Ama,yma,Ema,tAi,rAi,nAi,iAi,oAi,sAi,aAi,cAi,lAi,uAi,dAi,fAi,pAi,hAi,mAi,gAi,AAi,_ma,vma,Cma,bma,Sma,Tma,Ima,xma,wma,Rma,Pma,kma,Dma,Nma,Mma,Oma,Bma,Lma,yAi,EAi,Fma,Uma,Qma,_Ai,vAi,CAi,bAi,SAi,TAi,IAi,qma,jma,Hma,Gma,$ma,Vma,Wma,zma,xAi,wAi,RAi,PAi,kAi,DAi,NAi,MAi,OAi,BAi,LAi,Yma,Kma,Jma,Zma,Xma,e0a,t0a,r0a,n0a,i0a,o0a,s0a,FAi,UAi,QAi,qAi,jAi,HAi,GAi,$Ai,VAi,WAi,a0a,c0a,l0a,u0a,d0a,f0a,p0a,h0a,m0a,g0a,A0a,zAi=_e(()=>{p();AAr();S0i="cloud.provider",T0i="cloud.account.id",I0i="cloud.region",x0i="cloud.availability_zone",w0i="cloud.platform",R0i="aws.ecs.container.arn",P0i="aws.ecs.cluster.arn",k0i="aws.ecs.launchtype",D0i="aws.ecs.task.arn",N0i="aws.ecs.task.family",M0i="aws.ecs.task.revision",O0i="aws.eks.cluster.arn",B0i="aws.log.group.names",L0i="aws.log.group.arns",F0i="aws.log.stream.names",U0i="aws.log.stream.arns",Q0i="container.name",q0i="container.id",j0i="container.runtime",H0i="container.image.name",G0i="container.image.tag",$0i="deployment.environment",V0i="device.id",W0i="device.model.identifier",z0i="device.model.name",Y0i="faas.name",K0i="faas.id",J0i="faas.version",Z0i="faas.instance",X0i="faas.max_memory",egi="host.id",tgi="host.name",rgi="host.type",ngi="host.arch",igi="host.image.name",ogi="host.image.id",sgi="host.image.version",agi="k8s.cluster.name",cgi="k8s.node.name",lgi="k8s.node.uid",ugi="k8s.namespace.name",dgi="k8s.pod.uid",fgi="k8s.pod.name",pgi="k8s.container.name",hgi="k8s.replicaset.uid",mgi="k8s.replicaset.name",ggi="k8s.deployment.uid",Agi="k8s.deployment.name",ygi="k8s.statefulset.uid",Egi="k8s.statefulset.name",_gi="k8s.daemonset.uid",vgi="k8s.daemonset.name",Cgi="k8s.job.uid",bgi="k8s.job.name",Sgi="k8s.cronjob.uid",Tgi="k8s.cronjob.name",Igi="os.type",xgi="os.description",wgi="os.name",Rgi="os.version",Pgi="process.pid",kgi="process.executable.name",Dgi="process.executable.path",Ngi="process.command",Mgi="process.command_line",Ogi="process.command_args",Bgi="process.owner",Lgi="process.runtime.name",Fgi="process.runtime.version",Ugi="process.runtime.description",Qgi="service.name",qgi="service.namespace",jgi="service.instance.id",Hgi="service.version",Ggi="telemetry.sdk.name",$gi="telemetry.sdk.language",Vgi="telemetry.sdk.version",Wgi="telemetry.auto.version",zgi="webengine.name",Ygi="webengine.version",Kgi="webengine.description",qpa=S0i,jpa=T0i,Hpa=I0i,Gpa=x0i,$pa=w0i,Vpa=R0i,Wpa=P0i,zpa=k0i,Ypa=D0i,Kpa=N0i,Jpa=M0i,Zpa=O0i,Xpa=B0i,eha=L0i,tha=F0i,rha=U0i,nha=Q0i,iha=q0i,oha=j0i,sha=H0i,aha=G0i,cha=$0i,lha=V0i,uha=W0i,dha=z0i,fha=Y0i,pha=K0i,hha=J0i,mha=Z0i,gha=X0i,Aha=egi,yha=tgi,Eha=rgi,_ha=ngi,vha=igi,Cha=ogi,bha=sgi,Sha=agi,Tha=cgi,Iha=lgi,xha=ugi,wha=dgi,Rha=fgi,Pha=pgi,kha=hgi,Dha=mgi,Nha=ggi,Mha=Agi,Oha=ygi,Bha=Egi,Lha=_gi,Fha=vgi,Uha=Cgi,Qha=bgi,qha=Sgi,jha=Tgi,Hha=Igi,Gha=xgi,$ha=wgi,Vha=Rgi,Wha=Pgi,zha=kgi,Yha=Dgi,Kha=Ngi,Jha=Mgi,Zha=Ogi,Xha=Bgi,ema=Lgi,tma=Fgi,rma=Ugi,nma=Qgi,ima=qgi,oma=jgi,sma=Hgi,ama=Ggi,cma=$gi,lma=Vgi,uma=Wgi,dma=zgi,fma=Ygi,pma=Kgi,hma=ch([S0i,T0i,I0i,x0i,w0i,R0i,P0i,k0i,D0i,N0i,M0i,O0i,B0i,L0i,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,Pgi,kgi,Dgi,Ngi,Mgi,Ogi,Bgi,Lgi,Fgi,Ugi,Qgi,qgi,jgi,Hgi,Ggi,$gi,Vgi,Wgi,zgi,Ygi,Kgi]),Jgi="alibaba_cloud",Zgi="aws",Xgi="azure",eAi="gcp",mma=Jgi,gma=Zgi,Ama=Xgi,yma=eAi,Ema=ch([Jgi,Zgi,Xgi,eAi]),tAi="alibaba_cloud_ecs",rAi="alibaba_cloud_fc",nAi="aws_ec2",iAi="aws_ecs",oAi="aws_eks",sAi="aws_lambda",aAi="aws_elastic_beanstalk",cAi="azure_vm",lAi="azure_container_instances",uAi="azure_aks",dAi="azure_functions",fAi="azure_app_service",pAi="gcp_compute_engine",hAi="gcp_cloud_run",mAi="gcp_kubernetes_engine",gAi="gcp_cloud_functions",AAi="gcp_app_engine",_ma=tAi,vma=rAi,Cma=nAi,bma=iAi,Sma=oAi,Tma=sAi,Ima=aAi,xma=cAi,wma=lAi,Rma=uAi,Pma=dAi,kma=fAi,Dma=pAi,Nma=hAi,Mma=mAi,Oma=gAi,Bma=AAi,Lma=ch([tAi,rAi,nAi,iAi,oAi,sAi,aAi,cAi,lAi,uAi,dAi,fAi,pAi,hAi,mAi,gAi,AAi]),yAi="ec2",EAi="fargate",Fma=yAi,Uma=EAi,Qma=ch([yAi,EAi]),_Ai="amd64",vAi="arm32",CAi="arm64",bAi="ia64",SAi="ppc32",TAi="ppc64",IAi="x86",qma=_Ai,jma=vAi,Hma=CAi,Gma=bAi,$ma=SAi,Vma=TAi,Wma=IAi,zma=ch([_Ai,vAi,CAi,bAi,SAi,TAi,IAi]),xAi="windows",wAi="linux",RAi="darwin",PAi="freebsd",kAi="netbsd",DAi="openbsd",NAi="dragonflybsd",MAi="hpux",OAi="aix",BAi="solaris",LAi="z_os",Yma=xAi,Kma=wAi,Jma=RAi,Zma=PAi,Xma=kAi,e0a=DAi,t0a=NAi,r0a=MAi,n0a=OAi,i0a=BAi,o0a=LAi,s0a=ch([xAi,wAi,RAi,PAi,kAi,DAi,NAi,MAi,OAi,BAi,LAi]),FAi="cpp",UAi="dotnet",QAi="erlang",qAi="go",jAi="java",HAi="nodejs",GAi="php",$Ai="python",VAi="ruby",WAi="webjs",a0a=FAi,c0a=UAi,l0a=QAi,u0a=qAi,d0a=jAi,f0a=HAi,p0a=GAi,h0a=$Ai,m0a=VAi,g0a=WAi,A0a=ch([FAi,UAi,QAi,qAi,jAi,HAi,GAi,$Ai,VAi,WAi])});var YAi=_e(()=>{p();zAi()});var y0a,E0a,_0a,v0a,C0a,b0a,S0a,T0a,I0a,x0a,w0a,R0a,P0a,k0a,D0a,N0a,M0a,O0a,B0a,L0a,F0a,U0a,Q0a,q0a,j0a,H0a,G0a,$0a,V0a,W0a,z0a,Y0a,K0a,J0a,Z0a,X0a,ega,tga,rga,nga,iga,oga,xlp,wlp,sga,aga,cga,lga,uga,dga,fga,pga,hga,mga,gga,Aga,yga,Ega,_ga,vga,Cga,bga,Sga,Tga,Iga,xga,wga,Rga,Pga,kga,Dga,Nga,Mga,Oga,Bga,Lga,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,mAa,gAa,AAa,yAa,EAa,_Aa,vAa,yAr,CAa,bAa,SAa,TAa,IAa,EAr,xAa,wAa,RAa,PAa,kAa,DAa,_Ar,vAr,NAa,MAa,OAa,BAa,LAa,FAa,KAi=_e(()=>{p();y0a="aspnetcore.diagnostics.exception.result",E0a="aborted",_0a="handled",v0a="skipped",C0a="unhandled",b0a="aspnetcore.diagnostics.handler.type",S0a="aspnetcore.rate_limiting.policy",T0a="aspnetcore.rate_limiting.result",I0a="acquired",x0a="endpoint_limiter",w0a="global_limiter",R0a="request_canceled",P0a="aspnetcore.request.is_unhandled",k0a="aspnetcore.routing.is_fallback",D0a="aspnetcore.routing.match_status",N0a="failure",M0a="success",O0a="aspnetcore.user.is_authenticated",B0a="client.address",L0a="client.port",F0a="code.column.number",U0a="code.file.path",Q0a="code.function.name",q0a="code.line.number",j0a="code.stacktrace",H0a="db.collection.name",G0a="db.namespace",$0a="db.operation.batch.size",V0a="db.operation.name",W0a="db.query.summary",z0a="db.query.text",Y0a="db.response.status_code",K0a="db.stored_procedure.name",J0a="db.system.name",Z0a="mariadb",X0a="microsoft.sql_server",ega="mysql",tga="postgresql",rga="dotnet.gc.heap.generation",nga="gen0",iga="gen1",oga="gen2",xlp="loh",wlp="poh",sga="error.type",aga="_OTHER",cga="exception.escaped",lga="exception.message",uga="exception.stacktrace",dga="exception.type",fga=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),pga="http.request.method",hga="_OTHER",mga="CONNECT",gga="DELETE",Aga="GET",yga="HEAD",Ega="OPTIONS",_ga="PATCH",vga="POST",Cga="PUT",bga="TRACE",Sga="http.request.method_original",Tga="http.request.resend_count",Iga=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),xga="http.response.status_code",wga="http.route",Rga="jvm.gc.action",Pga="jvm.gc.name",kga="jvm.memory.pool.name",Dga="jvm.memory.type",Nga="heap",Mga="non_heap",Oga="jvm.thread.daemon",Bga="jvm.thread.state",Lga="blocked",Fga="new",Uga="runnable",Qga="terminated",qga="timed_waiting",jga="waiting",Hga="network.local.address",Gga="network.local.port",$ga="network.peer.address",Vga="network.peer.port",Wga="network.protocol.name",zga="network.protocol.version",Yga="network.transport",Kga="pipe",Jga="quic",Zga="tcp",Xga="udp",eAa="unix",tAa="network.type",rAa="ipv4",nAa="ipv6",iAa="otel.scope.name",oAa="otel.scope.version",sAa="otel.status_code",aAa="ERROR",cAa="OK",lAa="otel.status_description",uAa="server.address",dAa="server.port",fAa="service.name",pAa="service.version",hAa="signalr.connection.status",mAa="app_shutdown",gAa="normal_closure",AAa="timeout",yAa="signalr.transport",EAa="long_polling",_Aa="server_sent_events",vAa="web_sockets",yAr="telemetry.sdk.language",CAa="cpp",bAa="dotnet",SAa="erlang",TAa="go",IAa="java",EAr="nodejs",xAa="php",wAa="python",RAa="ruby",PAa="rust",kAa="swift",DAa="webjs",_Ar="telemetry.sdk.name",vAr="telemetry.sdk.version",NAa="url.fragment",MAa="url.full",OAa="url.path",BAa="url.query",LAa="url.scheme",FAa="user_agent.original"});var 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,Rya,Pya,kya,Dya,Nya,Mya,Oya,JAi=_e(()=>{p();UAa="aspnetcore.diagnostics.exceptions",QAa="aspnetcore.rate_limiting.active_request_leases",qAa="aspnetcore.rate_limiting.queued_requests",jAa="aspnetcore.rate_limiting.request.time_in_queue",HAa="aspnetcore.rate_limiting.request_lease.duration",GAa="aspnetcore.rate_limiting.requests",$Aa="aspnetcore.routing.match_attempts",VAa="db.client.operation.duration",WAa="dotnet.assembly.count",zAa="dotnet.exceptions",YAa="dotnet.gc.collections",KAa="dotnet.gc.heap.total_allocated",JAa="dotnet.gc.last_collection.heap.fragmentation.size",ZAa="dotnet.gc.last_collection.heap.size",XAa="dotnet.gc.last_collection.memory.committed_size",eya="dotnet.gc.pause.time",tya="dotnet.jit.compilation.time",rya="dotnet.jit.compiled_il.size",nya="dotnet.jit.compiled_methods",iya="dotnet.monitor.lock_contentions",oya="dotnet.process.cpu.count",sya="dotnet.process.cpu.time",aya="dotnet.process.memory.working_set",cya="dotnet.thread_pool.queue.length",lya="dotnet.thread_pool.thread.count",uya="dotnet.thread_pool.work_item.count",dya="dotnet.timer.count",fya="http.client.request.duration",pya="http.server.request.duration",hya="jvm.class.count",mya="jvm.class.loaded",gya="jvm.class.unloaded",Aya="jvm.cpu.count",yya="jvm.cpu.recent_utilization",Eya="jvm.cpu.time",_ya="jvm.gc.duration",vya="jvm.memory.committed",Cya="jvm.memory.limit",bya="jvm.memory.used",Sya="jvm.memory.used_after_last_gc",Tya="jvm.thread.count",Iya="kestrel.active_connections",xya="kestrel.active_tls_handshakes",wya="kestrel.connection.duration",Rya="kestrel.queued_connections",Pya="kestrel.queued_requests",kya="kestrel.rejected_connections",Dya="kestrel.tls_handshake.duration",Nya="kestrel.upgraded_connections",Mya="signalr.server.active_connections",Oya="signalr.server.connection.duration"});var Bya,ZAi=_e(()=>{p();Bya="exception"});var CAr={};Ri(CAr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>E0a,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>_0a,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>v0a,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>C0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>I0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>x0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>w0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>R0a,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>N0a,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>M0a,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>y0a,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>b0a,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>S0a,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>T0a,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>P0a,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>k0a,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>D0a,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>O0a,ATTR_CLIENT_ADDRESS:()=>B0a,ATTR_CLIENT_PORT:()=>L0a,ATTR_CODE_COLUMN_NUMBER:()=>F0a,ATTR_CODE_FILE_PATH:()=>U0a,ATTR_CODE_FUNCTION_NAME:()=>Q0a,ATTR_CODE_LINE_NUMBER:()=>q0a,ATTR_CODE_STACKTRACE:()=>j0a,ATTR_DB_COLLECTION_NAME:()=>H0a,ATTR_DB_NAMESPACE:()=>G0a,ATTR_DB_OPERATION_BATCH_SIZE:()=>$0a,ATTR_DB_OPERATION_NAME:()=>V0a,ATTR_DB_QUERY_SUMMARY:()=>W0a,ATTR_DB_QUERY_TEXT:()=>z0a,ATTR_DB_RESPONSE_STATUS_CODE:()=>Y0a,ATTR_DB_STORED_PROCEDURE_NAME:()=>K0a,ATTR_DB_SYSTEM_NAME:()=>J0a,ATTR_DOTNET_GC_HEAP_GENERATION:()=>rga,ATTR_ERROR_TYPE:()=>sga,ATTR_EXCEPTION_ESCAPED:()=>cga,ATTR_EXCEPTION_MESSAGE:()=>lga,ATTR_EXCEPTION_STACKTRACE:()=>uga,ATTR_EXCEPTION_TYPE:()=>dga,ATTR_HTTP_REQUEST_HEADER:()=>fga,ATTR_HTTP_REQUEST_METHOD:()=>pga,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>Sga,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Tga,ATTR_HTTP_RESPONSE_HEADER:()=>Iga,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>xga,ATTR_HTTP_ROUTE:()=>wga,ATTR_JVM_GC_ACTION:()=>Rga,ATTR_JVM_GC_NAME:()=>Pga,ATTR_JVM_MEMORY_POOL_NAME:()=>kga,ATTR_JVM_MEMORY_TYPE:()=>Dga,ATTR_JVM_THREAD_DAEMON:()=>Oga,ATTR_JVM_THREAD_STATE:()=>Bga,ATTR_NETWORK_LOCAL_ADDRESS:()=>Hga,ATTR_NETWORK_LOCAL_PORT:()=>Gga,ATTR_NETWORK_PEER_ADDRESS:()=>$ga,ATTR_NETWORK_PEER_PORT:()=>Vga,ATTR_NETWORK_PROTOCOL_NAME:()=>Wga,ATTR_NETWORK_PROTOCOL_VERSION:()=>zga,ATTR_NETWORK_TRANSPORT:()=>Yga,ATTR_NETWORK_TYPE:()=>tAa,ATTR_OTEL_SCOPE_NAME:()=>iAa,ATTR_OTEL_SCOPE_VERSION:()=>oAa,ATTR_OTEL_STATUS_CODE:()=>sAa,ATTR_OTEL_STATUS_DESCRIPTION:()=>lAa,ATTR_SERVER_ADDRESS:()=>uAa,ATTR_SERVER_PORT:()=>dAa,ATTR_SERVICE_NAME:()=>fAa,ATTR_SERVICE_VERSION:()=>pAa,ATTR_SIGNALR_CONNECTION_STATUS:()=>hAa,ATTR_SIGNALR_TRANSPORT:()=>yAa,ATTR_TELEMETRY_SDK_LANGUAGE:()=>yAr,ATTR_TELEMETRY_SDK_NAME:()=>_Ar,ATTR_TELEMETRY_SDK_VERSION:()=>vAr,ATTR_URL_FRAGMENT:()=>NAa,ATTR_URL_FULL:()=>MAa,ATTR_URL_PATH:()=>OAa,ATTR_URL_QUERY:()=>BAa,ATTR_URL_SCHEME:()=>LAa,ATTR_USER_AGENT_ORIGINAL:()=>FAa,AWSECSLAUNCHTYPEVALUES_EC2:()=>Fma,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Uma,AwsEcsLaunchtypeValues:()=>Qma,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>_ma,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>vma,CLOUDPLATFORMVALUES_AWS_EC2:()=>Cma,CLOUDPLATFORMVALUES_AWS_ECS:()=>bma,CLOUDPLATFORMVALUES_AWS_EKS:()=>Sma,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>Ima,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Tma,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Rma,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>kma,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>wma,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>Pma,CLOUDPLATFORMVALUES_AZURE_VM:()=>xma,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Bma,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Oma,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>Nma,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Dma,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Mma,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>mma,CLOUDPROVIDERVALUES_AWS:()=>gma,CLOUDPROVIDERVALUES_AZURE:()=>Ama,CLOUDPROVIDERVALUES_GCP:()=>yma,CloudPlatformValues:()=>Lma,CloudProviderValues:()=>Ema,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>Xda,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>afa,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>efa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>sfa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>rfa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>lfa,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>nfa,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>tfa,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>cfa,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>ofa,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>ifa,DBSYSTEMVALUES_ADABAS:()=>Cda,DBSYSTEMVALUES_CACHE:()=>vda,DBSYSTEMVALUES_CASSANDRA:()=>Uda,DBSYSTEMVALUES_CLOUDSCAPE:()=>pda,DBSYSTEMVALUES_COCKROACHDB:()=>Jda,DBSYSTEMVALUES_COLDFUSION:()=>Fda,DBSYSTEMVALUES_COSMOSDB:()=>$da,DBSYSTEMVALUES_COUCHBASE:()=>Hda,DBSYSTEMVALUES_COUCHDB:()=>Gda,DBSYSTEMVALUES_DB2:()=>lda,DBSYSTEMVALUES_DERBY:()=>Sda,DBSYSTEMVALUES_DYNAMODB:()=>Vda,DBSYSTEMVALUES_EDB:()=>_da,DBSYSTEMVALUES_ELASTICSEARCH:()=>Yda,DBSYSTEMVALUES_FILEMAKER:()=>Tda,DBSYSTEMVALUES_FIREBIRD:()=>bda,DBSYSTEMVALUES_FIRSTSQL:()=>Eda,DBSYSTEMVALUES_GEODE:()=>zda,DBSYSTEMVALUES_H2:()=>Lda,DBSYSTEMVALUES_HANADB:()=>Ada,DBSYSTEMVALUES_HBASE:()=>Qda,DBSYSTEMVALUES_HIVE:()=>fda,DBSYSTEMVALUES_HSQLDB:()=>hda,DBSYSTEMVALUES_INFORMIX:()=>Ida,DBSYSTEMVALUES_INGRES:()=>yda,DBSYSTEMVALUES_INSTANTDB:()=>xda,DBSYSTEMVALUES_INTERBASE:()=>wda,DBSYSTEMVALUES_MARIADB:()=>Rda,DBSYSTEMVALUES_MAXDB:()=>gda,DBSYSTEMVALUES_MEMCACHED:()=>Kda,DBSYSTEMVALUES_MONGODB:()=>qda,DBSYSTEMVALUES_MSSQL:()=>sda,DBSYSTEMVALUES_MYSQL:()=>ada,DBSYSTEMVALUES_NEO4J:()=>Wda,DBSYSTEMVALUES_NETEZZA:()=>Pda,DBSYSTEMVALUES_ORACLE:()=>cda,DBSYSTEMVALUES_OTHER_SQL:()=>oda,DBSYSTEMVALUES_PERVASIVE:()=>kda,DBSYSTEMVALUES_POINTBASE:()=>Dda,DBSYSTEMVALUES_POSTGRESQL:()=>uda,DBSYSTEMVALUES_PROGRESS:()=>mda,DBSYSTEMVALUES_REDIS:()=>jda,DBSYSTEMVALUES_REDSHIFT:()=>dda,DBSYSTEMVALUES_SQLITE:()=>Nda,DBSYSTEMVALUES_SYBASE:()=>Mda,DBSYSTEMVALUES_TERADATA:()=>Oda,DBSYSTEMVALUES_VERTICA:()=>Bda,DB_SYSTEM_NAME_VALUE_MARIADB:()=>Z0a,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>X0a,DB_SYSTEM_NAME_VALUE_MYSQL:()=>ega,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>tga,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>nga,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>iga,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>oga,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>xlp,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>wlp,DbCassandraConsistencyLevelValues:()=>ufa,DbSystemValues:()=>Zda,ERROR_TYPE_VALUE_OTHER:()=>aga,EVENT_EXCEPTION:()=>Bya,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Efa,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>yfa,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Afa,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>vfa,FAASINVOKEDPROVIDERVALUES_AWS:()=>Cfa,FAASINVOKEDPROVIDERVALUES_AZURE:()=>bfa,FAASINVOKEDPROVIDERVALUES_GCP:()=>Sfa,FAASTRIGGERVALUES_DATASOURCE:()=>dfa,FAASTRIGGERVALUES_HTTP:()=>ffa,FAASTRIGGERVALUES_OTHER:()=>mfa,FAASTRIGGERVALUES_PUBSUB:()=>pfa,FAASTRIGGERVALUES_TIMER:()=>hfa,FaasDocumentOperationValues:()=>_fa,FaasInvokedProviderValues:()=>Tfa,FaasTriggerValues:()=>gfa,HOSTARCHVALUES_AMD64:()=>qma,HOSTARCHVALUES_ARM32:()=>jma,HOSTARCHVALUES_ARM64:()=>Hma,HOSTARCHVALUES_IA64:()=>Gma,HOSTARCHVALUES_PPC32:()=>$ma,HOSTARCHVALUES_PPC64:()=>Vma,HOSTARCHVALUES_X86:()=>Wma,HTTPFLAVORVALUES_HTTP_1_0:()=>cpa,HTTPFLAVORVALUES_HTTP_1_1:()=>lpa,HTTPFLAVORVALUES_HTTP_2_0:()=>upa,HTTPFLAVORVALUES_QUIC:()=>fpa,HTTPFLAVORVALUES_SPDY:()=>dpa,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>mga,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>gga,HTTP_REQUEST_METHOD_VALUE_GET:()=>Aga,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>yga,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Ega,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>hga,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>_ga,HTTP_REQUEST_METHOD_VALUE_POST:()=>vga,HTTP_REQUEST_METHOD_VALUE_PUT:()=>Cga,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>bga,HostArchValues:()=>zma,HttpFlavorValues:()=>ppa,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Nga,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>Mga,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Lga,JVM_THREAD_STATE_VALUE_NEW:()=>Fga,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Uga,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Qga,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>qga,JVM_THREAD_STATE_VALUE_WAITING:()=>jga,MESSAGETYPEVALUES_RECEIVED:()=>Upa,MESSAGETYPEVALUES_SENT:()=>Fpa,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>hpa,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>mpa,MESSAGINGOPERATIONVALUES_PROCESS:()=>ypa,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Apa,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>UAa,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>QAa,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>qAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>GAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>HAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>jAa,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>$Aa,METRIC_DB_CLIENT_OPERATION_DURATION:()=>VAa,METRIC_DOTNET_ASSEMBLY_COUNT:()=>WAa,METRIC_DOTNET_EXCEPTIONS:()=>zAa,METRIC_DOTNET_GC_COLLECTIONS:()=>YAa,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>KAa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>JAa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>ZAa,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>XAa,METRIC_DOTNET_GC_PAUSE_TIME:()=>eya,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>tya,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>rya,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>nya,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>iya,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>oya,METRIC_DOTNET_PROCESS_CPU_TIME:()=>sya,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>aya,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>cya,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>lya,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>uya,METRIC_DOTNET_TIMER_COUNT:()=>dya,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>fya,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>pya,METRIC_JVM_CLASS_COUNT:()=>hya,METRIC_JVM_CLASS_LOADED:()=>mya,METRIC_JVM_CLASS_UNLOADED:()=>gya,METRIC_JVM_CPU_COUNT:()=>Aya,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>yya,METRIC_JVM_CPU_TIME:()=>Eya,METRIC_JVM_GC_DURATION:()=>_ya,METRIC_JVM_MEMORY_COMMITTED:()=>vya,METRIC_JVM_MEMORY_LIMIT:()=>Cya,METRIC_JVM_MEMORY_USED:()=>bya,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Sya,METRIC_JVM_THREAD_COUNT:()=>Tya,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Iya,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>xya,METRIC_KESTREL_CONNECTION_DURATION:()=>wya,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Rya,METRIC_KESTREL_QUEUED_REQUESTS:()=>Pya,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>kya,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Dya,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Nya,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Mya,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>Oya,MessageTypeValues:()=>Qpa,MessagingDestinationKindValues:()=>gpa,MessagingOperationValues:()=>Epa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Hfa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Vfa,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>qfa,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>Xfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>Gfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>$fa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Jfa,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Qfa,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>tpa,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>Wfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>Yfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>epa,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>zfa,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>Kfa,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>npa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>Zfa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>spa,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>ipa,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>opa,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>rpa,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>jfa,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>Bfa,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>Lfa,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>Ffa,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>Mfa,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>Ofa,NETTRANSPORTVALUES_INPROC:()=>kfa,NETTRANSPORTVALUES_IP:()=>wfa,NETTRANSPORTVALUES_IP_TCP:()=>Ifa,NETTRANSPORTVALUES_IP_UDP:()=>xfa,NETTRANSPORTVALUES_OTHER:()=>Dfa,NETTRANSPORTVALUES_PIPE:()=>Pfa,NETTRANSPORTVALUES_UNIX:()=>Rfa,NETWORK_TRANSPORT_VALUE_PIPE:()=>Kga,NETWORK_TRANSPORT_VALUE_QUIC:()=>Jga,NETWORK_TRANSPORT_VALUE_TCP:()=>Zga,NETWORK_TRANSPORT_VALUE_UDP:()=>Xga,NETWORK_TRANSPORT_VALUE_UNIX:()=>eAa,NETWORK_TYPE_VALUE_IPV4:()=>rAa,NETWORK_TYPE_VALUE_IPV6:()=>nAa,NetHostConnectionSubtypeValues:()=>apa,NetHostConnectionTypeValues:()=>Ufa,NetTransportValues:()=>Nfa,OSTYPEVALUES_AIX:()=>n0a,OSTYPEVALUES_DARWIN:()=>Jma,OSTYPEVALUES_DRAGONFLYBSD:()=>t0a,OSTYPEVALUES_FREEBSD:()=>Zma,OSTYPEVALUES_HPUX:()=>r0a,OSTYPEVALUES_LINUX:()=>Kma,OSTYPEVALUES_NETBSD:()=>Xma,OSTYPEVALUES_OPENBSD:()=>e0a,OSTYPEVALUES_SOLARIS:()=>i0a,OSTYPEVALUES_WINDOWS:()=>Yma,OSTYPEVALUES_Z_OS:()=>o0a,OTEL_STATUS_CODE_VALUE_ERROR:()=>aAa,OTEL_STATUS_CODE_VALUE_OK:()=>cAa,OsTypeValues:()=>s0a,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>Ppa,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>Ipa,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>vpa,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>Opa,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>Spa,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Rpa,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>Npa,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>bpa,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>Tpa,RPCGRPCSTATUSCODEVALUES_OK:()=>_pa,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>kpa,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>xpa,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>wpa,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Bpa,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>Mpa,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>Dpa,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Cpa,RpcGrpcStatusCodeValues:()=>Lpa,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>pua,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>Tua,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>uua,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>sua,SEMATTRS_AWS_DYNAMODB_COUNT:()=>bua,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>yua,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>gua,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>Iua,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>hua,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>aua,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>fua,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>Aua,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>dua,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>cua,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>lua,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>Sua,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>_ua,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>vua,SEMATTRS_AWS_DYNAMODB_SELECT:()=>mua,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Eua,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>oua,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Cua,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Fca,SEMATTRS_CODE_FILEPATH:()=>jla,SEMATTRS_CODE_FUNCTION:()=>Qla,SEMATTRS_CODE_LINENO:()=>Hla,SEMATTRS_CODE_NAMESPACE:()=>qla,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Yca,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>ela,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>Xca,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>Jca,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Wca,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>zca,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Zca,SEMATTRS_DB_CASSANDRA_TABLE:()=>Kca,SEMATTRS_DB_CONNECTION_STRING:()=>Qca,SEMATTRS_DB_HBASE_NAMESPACE:()=>tla,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>jca,SEMATTRS_DB_MONGODB_COLLECTION:()=>nla,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Vca,SEMATTRS_DB_NAME:()=>Hca,SEMATTRS_DB_OPERATION:()=>$ca,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>rla,SEMATTRS_DB_SQL_TABLE:()=>ila,SEMATTRS_DB_STATEMENT:()=>Gca,SEMATTRS_DB_SYSTEM:()=>Uca,SEMATTRS_DB_USER:()=>qca,SEMATTRS_ENDUSER_ID:()=>Ola,SEMATTRS_ENDUSER_ROLE:()=>Bla,SEMATTRS_ENDUSER_SCOPE:()=>Lla,SEMATTRS_EXCEPTION_ESCAPED:()=>cla,SEMATTRS_EXCEPTION_MESSAGE:()=>sla,SEMATTRS_EXCEPTION_STACKTRACE:()=>ala,SEMATTRS_EXCEPTION_TYPE:()=>ola,SEMATTRS_FAAS_COLDSTART:()=>Ala,SEMATTRS_FAAS_CRON:()=>gla,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>dla,SEMATTRS_FAAS_DOCUMENT_NAME:()=>hla,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>fla,SEMATTRS_FAAS_DOCUMENT_TIME:()=>pla,SEMATTRS_FAAS_EXECUTION:()=>ula,SEMATTRS_FAAS_INVOKED_NAME:()=>yla,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>Ela,SEMATTRS_FAAS_INVOKED_REGION:()=>_la,SEMATTRS_FAAS_TIME:()=>mla,SEMATTRS_FAAS_TRIGGER:()=>lla,SEMATTRS_HTTP_CLIENT_IP:()=>iua,SEMATTRS_HTTP_FLAVOR:()=>Kla,SEMATTRS_HTTP_HOST:()=>Wla,SEMATTRS_HTTP_METHOD:()=>Gla,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Zla,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>Xla,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>eua,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>tua,SEMATTRS_HTTP_ROUTE:()=>nua,SEMATTRS_HTTP_SCHEME:()=>zla,SEMATTRS_HTTP_SERVER_NAME:()=>rua,SEMATTRS_HTTP_STATUS_CODE:()=>Yla,SEMATTRS_HTTP_TARGET:()=>Vla,SEMATTRS_HTTP_URL:()=>$la,SEMATTRS_HTTP_USER_AGENT:()=>Jla,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>rda,SEMATTRS_MESSAGE_ID:()=>tda,SEMATTRS_MESSAGE_TYPE:()=>eda,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>nda,SEMATTRS_MESSAGING_CONSUMER_ID:()=>Uua,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>Oua,SEMATTRS_MESSAGING_DESTINATION:()=>wua,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>Rua,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Hua,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>jua,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>qua,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>Gua,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>$ua,SEMATTRS_MESSAGING_MESSAGE_ID:()=>Mua,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Lua,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Bua,SEMATTRS_MESSAGING_OPERATION:()=>Fua,SEMATTRS_MESSAGING_PROTOCOL:()=>kua,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Dua,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Qua,SEMATTRS_MESSAGING_SYSTEM:()=>xua,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Pua,SEMATTRS_MESSAGING_URL:()=>Nua,SEMATTRS_NET_HOST_CARRIER_ICC:()=>Nla,SEMATTRS_NET_HOST_CARRIER_MCC:()=>kla,SEMATTRS_NET_HOST_CARRIER_MNC:()=>Dla,SEMATTRS_NET_HOST_CARRIER_NAME:()=>Pla,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>Rla,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>wla,SEMATTRS_NET_HOST_IP:()=>Tla,SEMATTRS_NET_HOST_NAME:()=>xla,SEMATTRS_NET_HOST_PORT:()=>Ila,SEMATTRS_NET_PEER_IP:()=>Cla,SEMATTRS_NET_PEER_NAME:()=>Sla,SEMATTRS_NET_PEER_PORT:()=>bla,SEMATTRS_NET_TRANSPORT:()=>vla,SEMATTRS_PEER_SERVICE:()=>Mla,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>Yua,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Zua,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>Xua,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Jua,SEMATTRS_RPC_JSONRPC_VERSION:()=>Kua,SEMATTRS_RPC_METHOD:()=>zua,SEMATTRS_RPC_SERVICE:()=>Wua,SEMATTRS_RPC_SYSTEM:()=>Vua,SEMATTRS_THREAD_ID:()=>Fla,SEMATTRS_THREAD_NAME:()=>Ula,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>Wpa,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Vpa,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>zpa,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Ypa,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>Kpa,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>Jpa,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>Zpa,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>eha,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Xpa,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>rha,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>tha,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>jpa,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>Gpa,SEMRESATTRS_CLOUD_PLATFORM:()=>$pa,SEMRESATTRS_CLOUD_PROVIDER:()=>qpa,SEMRESATTRS_CLOUD_REGION:()=>Hpa,SEMRESATTRS_CONTAINER_ID:()=>iha,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>sha,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>aha,SEMRESATTRS_CONTAINER_NAME:()=>nha,SEMRESATTRS_CONTAINER_RUNTIME:()=>oha,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>cha,SEMRESATTRS_DEVICE_ID:()=>lha,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>uha,SEMRESATTRS_DEVICE_MODEL_NAME:()=>dha,SEMRESATTRS_FAAS_ID:()=>pha,SEMRESATTRS_FAAS_INSTANCE:()=>mha,SEMRESATTRS_FAAS_MAX_MEMORY:()=>gha,SEMRESATTRS_FAAS_NAME:()=>fha,SEMRESATTRS_FAAS_VERSION:()=>hha,SEMRESATTRS_HOST_ARCH:()=>_ha,SEMRESATTRS_HOST_ID:()=>Aha,SEMRESATTRS_HOST_IMAGE_ID:()=>Cha,SEMRESATTRS_HOST_IMAGE_NAME:()=>vha,SEMRESATTRS_HOST_IMAGE_VERSION:()=>bha,SEMRESATTRS_HOST_NAME:()=>yha,SEMRESATTRS_HOST_TYPE:()=>Eha,SEMRESATTRS_K8S_CLUSTER_NAME:()=>Sha,SEMRESATTRS_K8S_CONTAINER_NAME:()=>Pha,SEMRESATTRS_K8S_CRONJOB_NAME:()=>jha,SEMRESATTRS_K8S_CRONJOB_UID:()=>qha,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>Fha,SEMRESATTRS_K8S_DAEMONSET_UID:()=>Lha,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>Mha,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>Nha,SEMRESATTRS_K8S_JOB_NAME:()=>Qha,SEMRESATTRS_K8S_JOB_UID:()=>Uha,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>xha,SEMRESATTRS_K8S_NODE_NAME:()=>Tha,SEMRESATTRS_K8S_NODE_UID:()=>Iha,SEMRESATTRS_K8S_POD_NAME:()=>Rha,SEMRESATTRS_K8S_POD_UID:()=>wha,SEMRESATTRS_K8S_REPLICASET_NAME:()=>Dha,SEMRESATTRS_K8S_REPLICASET_UID:()=>kha,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Bha,SEMRESATTRS_K8S_STATEFULSET_UID:()=>Oha,SEMRESATTRS_OS_DESCRIPTION:()=>Gha,SEMRESATTRS_OS_NAME:()=>$ha,SEMRESATTRS_OS_TYPE:()=>Hha,SEMRESATTRS_OS_VERSION:()=>Vha,SEMRESATTRS_PROCESS_COMMAND:()=>Kha,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Zha,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Jha,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>zha,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Yha,SEMRESATTRS_PROCESS_OWNER:()=>Xha,SEMRESATTRS_PROCESS_PID:()=>Wha,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>rma,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>ema,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>tma,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>oma,SEMRESATTRS_SERVICE_NAME:()=>nma,SEMRESATTRS_SERVICE_NAMESPACE:()=>ima,SEMRESATTRS_SERVICE_VERSION:()=>sma,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>uma,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>cma,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>ama,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>lma,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>pma,SEMRESATTRS_WEBENGINE_NAME:()=>dma,SEMRESATTRS_WEBENGINE_VERSION:()=>fma,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>mAa,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>gAa,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>AAa,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>EAa,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>_Aa,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>vAa,SemanticAttributes:()=>ida,SemanticResourceAttributes:()=>hma,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>a0a,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>c0a,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>l0a,TELEMETRYSDKLANGUAGEVALUES_GO:()=>u0a,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>d0a,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>f0a,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>p0a,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>h0a,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>m0a,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>g0a,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>CAa,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>bAa,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>SAa,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>TAa,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>IAa,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>EAr,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>xAa,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>wAa,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>RAa,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>PAa,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>kAa,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>DAa,TelemetrySdkLanguageValues:()=>A0a});var _ht=_e(()=>{p();b0i();YAi();KAi();JAi();ZAi()});var XAi,eyi=_e(()=>{p();XAi="process.runtime.name"});var vht,tyi=_e(()=>{p();Ddi();_ht();eyi();vht={[_Ar]:"opentelemetry",[XAi]:"node",[yAr]:EAr,[vAr]:kdi}});var ryi=_e(()=>{p();xdi();wdi();Pdi();tyi()});var bAr=_e(()=>{p();ryi()});function o0e(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*Fya);return[r,n]}function bht(){let t=eG.timeOrigin;if(typeof t!="number"){let e=eG;t=e.timing&&e.timing.fetchStart}return t}function SAr(t){let e=o0e(bht()),r=o0e(typeof t=="number"?t:eG.now());return TAr(e,r)}function iyi(t){if(Sht(t))return t;if(typeof t=="number")return t=Cht&&(r[1]-=Cht,r[0]+=1),r}var nyi,Lya,Fya,Cht,dyi=_e(()=>{p();bAr();nyi=9,Lya=6,Fya=Math.pow(10,Lya),Cht=Math.pow(10,nyi);a(o0e,"millisToHrTime");a(bht,"getTimeOrigin");a(SAr,"hrTime");a(iyi,"timeInputToHrTime");a(oyi,"hrTimeDuration");a(syi,"hrTimeToTimeStamp");a(ayi,"hrTimeToNanoseconds");a(cyi,"hrTimeToMilliseconds");a(lyi,"hrTimeToMicroseconds");a(Sht,"isTimeInputHrTime");a(uyi,"isTimeInput");a(TAr,"addHrTimes")});function fyi(t){typeof t!="number"&&t.unref()}var pyi=_e(()=>{p();a(fyi,"unrefTimer")});var Tht,hyi=_e(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Tht||(Tht={}))});var Iht,myi=_e(()=>{p();lo();Iht=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 gyi(t){return qya.test(t)}function Ayi(t){return jya.test(t)&&!Hya.test(t)}var IAr,Uya,Qya,qya,jya,Hya,yyi=_e(()=>{p();IAr="[_0-9a-z-*/]",Uya=`[a-z]${IAr}{0,255}`,Qya=`[a-z0-9]${IAr}{0,240}@[a-z]${IAr}{0,13}`,qya=new RegExp(`^(?:${Uya}|${Qya})$`),jya=/^[ -~]{0,255}[!-~]$/,Hya=/,|=/;a(gyi,"validateKey");a(Ayi,"validateValue")});var Eyi,Gya,_yi,vyi,s0e,xAr=_e(()=>{p();yyi();Eyi=32,Gya=512,_yi=",",vyi="=",s0e=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+vyi+this.get(r)),e),[]).join(_yi)}_parse(e){e.length>Gya||(this._internalState=e.split(_yi).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(vyi);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);gyi(c)&&Ayi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Eyi&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Eyi))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function wAr(t){let e=Kya.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var HMe,GMe,$ya,Vya,Wya,zya,Yya,Kya,xht,Cyi=_e(()=>{p();lo();qMe();xAr();HMe="traceparent",GMe="tracestate",$ya="00",Vya="(?!ff)[\\da-f]{2}",Wya="(?![0]{32})[\\da-f]{32}",zya="(?![0]{16})[\\da-f]{16}",Yya="[\\da-f]{2}",Kya=new RegExp(`^\\s?(${Vya})-(${Wya})-(${zya})-(${Yya})(-.*)?\\s?$`);a(wAr,"parseTraceParent");xht=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=Su.getSpanContext(e);if(!o||i0e(e)||!mb(o))return;let s=`${$ya}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||Sf.NONE).toString(16)}`;n.set(r,HMe,s),o.traceState&&n.set(r,GMe,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,HMe);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=wAr(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,GMe);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new s0e(typeof u=="string"?u:void 0)}return Su.setSpanContext(e,c)}fields(){return[HMe,GMe]}}});function byi(t,e){return t.setValue(RAr,e)}function Syi(t){return t.deleteValue(RAr)}function Tyi(t){return t.getValue(RAr)}var RAr,wht,Iyi=_e(()=>{p();lo();RAr=hb("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(wht||(wht={}));a(byi,"setRPCMetadata");a(Syi,"deleteRPCMetadata");a(Tyi,"getRPCMetadata")});function PAr(t){if(!nEa(t)||iEa(t)!==Jya)return!1;let e=rEa(t);if(e===null)return!0;let r=Ryi.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&xyi.call(r)===tEa}function nEa(t){return t!=null&&typeof t=="object"}function iEa(t){return t==null?t===void 0?Xya:Zya:Cee&&Cee in Object(t)?oEa(t):sEa(t)}function oEa(t){let e=Ryi.call(t,Cee),r=t[Cee],n=!1;try{t[Cee]=void 0,n=!0}catch{}let o=Pyi.call(t);return n&&(e?t[Cee]=r:delete t[Cee]),o}function sEa(t){return Pyi.call(t)}var Jya,Zya,Xya,eEa,xyi,tEa,rEa,wyi,Ryi,Cee,Pyi,kyi=_e(()=>{p();Jya="[object Object]",Zya="[object Null]",Xya="[object Undefined]",eEa=Function.prototype,xyi=eEa.toString,tEa=xyi.call(Object),rEa=Object.getPrototypeOf,wyi=Object.prototype,Ryi=wyi.hasOwnProperty,Cee=Symbol?Symbol.toStringTag:void 0,Pyi=wyi.toString;a(PAr,"isPlainObject");a(nEa,"isObjectLike");a(iEa,"baseGetTag");a(oEa,"getRawTag");a(sEa,"objectToString")});function Nyi(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=Myi(e,t.shift(),0,r);return e}function kAr(t){return Pht(t)?t.slice():t}function Myi(t,e,r=0,n){let o;if(!(r>aEa)){if(r++,Rht(t)||Rht(e)||Oyi(e))o=kAr(e);else if(Pht(t)){if(o=t.slice(),Pht(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(Dyi(t,u,n)||Dyi(e,u,n))delete o[u];else{if($Me(f)&&$Me(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]=Myi(o[u],d,r,n)}}}}else o=e;return o}}function Dyi(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 cEa(t,e){return!(!PAr(t)||!PAr(e))}var aEa,Byi=_e(()=>{p();kyi();aEa=20;a(Nyi,"merge");a(kAr,"takeValue");a(Myi,"mergeTwoObjects");a(Dyi,"wasObjectReferenced");a(Pht,"isArray");a(Oyi,"isFunction");a($Me,"isObject");a(Rht,"isPrimitive");a(cEa,"shouldMerge")});function Lyi(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new VMe("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var VMe,Fyi=_e(()=>{p();VMe=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(Lyi,"callWithTimeout")});function DAr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function Uyi(t,e){if(!e)return!1;for(let r of e)if(DAr(t,r))return!0;return!1}var Qyi=_e(()=>{p();a(DAr,"urlMatches");a(Uyi,"isUrlIgnored")});var kht,qyi=_e(()=>{p();kht=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 Dht,jyi=_e(()=>{p();qyi();Dht=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new kht;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 Gyi(t){if(t==null)return;let e=Hyi[t.toUpperCase()];return e??(Dn.warn(`Unknown log level "${t}", expected one of ${Object.keys(Hyi)}, using default`),Pa.INFO)}var Hyi,$yi=_e(()=>{p();lo();Hyi={ALL:Pa.ALL,VERBOSE:Pa.VERBOSE,DEBUG:Pa.DEBUG,INFO:Pa.INFO,WARN:Pa.WARN,ERROR:Pa.ERROR,NONE:Pa.NONE};a(Gyi,"diagLogLevelFromString")});function Vyi(t,e){return new Promise(r=>{Tg.with(uht(Tg.active()),()=>{t.export(e,n=>{r(n)})})})}var Wyi=_e(()=>{p();lo();qMe();a(Vyi,"_export")});var Nht={};Ri(Nht,{AnchoredClock:()=>hht,BindOnceFuture:()=>Dht,CompositePropagator:()=>Iht,ExportResultCode:()=>Tht,RPCType:()=>wht,SDK_INFO:()=>vht,TRACE_PARENT_HEADER:()=>HMe,TRACE_STATE_HEADER:()=>GMe,TimeoutError:()=>VMe,TraceState:()=>s0e,W3CBaggagePropagator:()=>pht,W3CTraceContextPropagator:()=>xht,_globalThis:()=>Eht,addHrTimes:()=>TAr,callWithTimeout:()=>Lyi,deleteRPCMetadata:()=>Syi,diagLogLevelFromString:()=>Gyi,getBooleanFromEnv:()=>Aht,getNumberFromEnv:()=>ght,getRPCMetadata:()=>Tyi,getStringFromEnv:()=>jMe,getStringListFromEnv:()=>yht,getTimeOrigin:()=>bht,globalErrorHandler:()=>Tdi,hrTime:()=>SAr,hrTimeDuration:()=>oyi,hrTimeToMicroseconds:()=>lyi,hrTimeToMilliseconds:()=>cyi,hrTimeToNanoseconds:()=>ayi,hrTimeToTimeStamp:()=>syi,internal:()=>lEa,isAttributeValue:()=>hAr,isTimeInput:()=>uyi,isTimeInputHrTime:()=>Sht,isTracingSuppressed:()=>i0e,isUrlIgnored:()=>Uyi,loggingErrorHandler:()=>mht,merge:()=>Nyi,millisToHrTime:()=>o0e,otperformance:()=>eG,parseKeyPairsIntoRecord:()=>Adi,parseTraceParent:()=>wAr,sanitizeAttributes:()=>_di,setGlobalErrorHandler:()=>Sdi,setRPCMetadata:()=>byi,suppressTracing:()=>uht,timeInputToHrTime:()=>iyi,unrefTimer:()=>fyi,unsuppressTracing:()=>fdi,urlMatches:()=>DAr});var lEa,Mht=_e(()=>{p();ydi();Edi();Cdi();Idi();mAr();dyi();pyi();hyi();pAr();bAr();myi();Cyi();Iyi();qMe();xAr();Byi();Fyi();Qyi();jyi();$yi();Wyi();lEa={_export:Vyi}});var Kyi=I(Oht=>{"use strict";p();Object.defineProperty(Oht,"__esModule",{value:!0});Oht.OpenTelemetrySpanWrapper=void 0;var zyi=(lo(),_a(F5)),Yyi=(Mht(),_a(Nht)),uEa=uAr(),NAr=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&dEa(e.error)?e.error?(this._span.setStatus({code:zyi.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:zyi.SpanStatusCode.ERROR}):e.status==="success"&&uEa.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,Yyi.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,Yyi.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};Oht.OpenTelemetrySpanWrapper=NAr;function dEa(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(dEa,"isRecordableError")});var MAr=I(g4=>{"use strict";p();Object.defineProperty(g4,"__esModule",{value:!0});g4.environmentCache=g4.SDK_VERSION=void 0;g4.envVarToBoolean=fEa;g4.SDK_VERSION="1.0.0-beta.9";g4.environmentCache=new Map;function fEa(t){var e;g4.environmentCache.has(t)||pEa(t);let r=((e=g4.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a(fEa,"envVarToBoolean");function pEa(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];g4.environmentCache.set(t,r)}}a(pEa,"loadEnvironmentVariable")});var eEi=I(Bht=>{"use strict";p();Object.defineProperty(Bht,"__esModule",{value:!0});Bht.toOpenTelemetrySpanKind=Xyi;Bht.toSpanOptions=mEa;var Jyi=(lo(),_a(F5)),Zyi=(Mht(),_a(Nht));function Xyi(t){let e=(t||"internal").toUpperCase();return Jyi.SpanKind[e]}a(Xyi,"toOpenTelemetrySpanKind");function hEa(t=[]){return t.reduce((e,r)=>{let n=Jyi.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,Zyi.sanitizeAttributes)(r.attributes)}),e},[])}a(hEa,"toOpenTelemetryLinks");function mEa(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,Zyi.sanitizeAttributes)(e),s=Xyi(n),c=hEa(r);return{attributes:o,kind:s,links:c}}a(mEa,"toSpanOptions")});var nEi=I(tG=>{"use strict";p();Object.defineProperty(tG,"__esModule",{value:!0});tG.OpenTelemetryInstrumenter=tG.propagator=void 0;var A4=(lo(),_a(F5)),rEi=(Mht(),_a(Nht)),gEa=Kyi(),tEi=MAr(),AEa=eEi();tG.propagator=new rEi.W3CTraceContextPropagator;var OAr=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||A4.context.active(),o;return(0,tEi.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=A4.trace.wrapSpanContext(A4.INVALID_SPAN_CONTEXT):(o=A4.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,AEa.toSpanOptions)(r),n),(0,tEi.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,rEi.suppressTracing)(n))),{span:new gEa.OpenTelemetrySpanWrapper(o),tracingContext:A4.trace.setSpan(n,o)}}withContext(e,r,...n){return A4.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return tG.propagator.extract(A4.context.active(),{traceparent:e},A4.defaultTextMapGetter)}createRequestHeaders(e){let r={};return tG.propagator.inject(e||A4.context.active(),r,A4.defaultTextMapSetter),r}};tG.OpenTelemetryInstrumenter=OAr});var oEi=I(WMe=>{"use strict";p();Object.defineProperty(WMe,"__esModule",{value:!0});WMe.AzureSdkInstrumentation=void 0;WMe.createAzureSdkInstrumentation=_Ea;var iEi=(rAr(),_a(tAr)),yEa=nEi(),EEa=MAr(),Lht=class extends iEi.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",EEa.SDK_VERSION,Object.assign({},e))}init(){let e=new iEi.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new yEa.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};WMe.AzureSdkInstrumentation=Lht;function _Ea(t={}){return new Lht(t)}a(_Ea,"createAzureSdkInstrumentation")});var aEi=I(Fht=>{"use strict";p();Object.defineProperty(Fht,"__esModule",{value:!0});var sEi=(n3(),_a(G7));sEi.__exportStar(uAr(),Fht);sEi.__exportStar(oEi(),Fht)});var lEi=I(fR=>{"use strict";p();Object.defineProperty(fR,"__esModule",{value:!0});fR.enable=fR.azureCoreTracing=fR.AzureMonitorSymbol=void 0;var BAr=Ap();fR.AzureMonitorSymbol="Azure_Monitor_Tracer";var LAr="azure-coretracing",cEi=!1,vEa=a(function(t){if(cEi)return t;try{var e=(lli(),_a(cli)),r=(lo(),_a(F5)),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 BAr.channel.publish(LAr,A),E},A},d[fR.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[fR.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 BAr.channel.publish(LAr,v),T},v},g[fR.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=(rAr(),_a(tAr)),u=aEi();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}cEi=!0}catch{}return t},"azureCoreTracingPatchFunction");fR.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:vEa,publisherName:LAr};function CEa(){BAr.channel.registerMonkeyPatch("@azure/core-tracing",fR.azureCoreTracing)}a(CEa,"enable");fR.enable=CEa});var dEi=I(bee=>{"use strict";p();Object.defineProperty(bee,"__esModule",{value:!0});bee.enable=bee.bunyan=void 0;var uEi=Ap(),bEa=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)),uEi.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");bee.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:bEa};function SEa(){uEi.channel.registerMonkeyPatch("bunyan",bee.bunyan)}a(SEa,"enable");bee.enable=SEa});var pEi=I(See=>{"use strict";p();Object.defineProperty(See,"__esModule",{value:!0});See.enable=See.console=void 0;var FAr=Ap(),fEi=require("stream"),TEa=a(function(t){var e=new fEi.Writable,r=new fEi.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return FAr.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return FAr.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:TEa};function IEa(){FAr.channel.registerMonkeyPatch("console",See.console),require("console")}a(IEa,"enable");See.enable=IEa});var hEi=I(Tee=>{"use strict";p();Object.defineProperty(Tee,"__esModule",{value:!0});Tee.enable=Tee.mongoCore=void 0;var UAr=Ap(),xEa=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]=UAr.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]=UAr.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");Tee.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:xEa};function wEa(){UAr.channel.registerMonkeyPatch("mongodb-core",Tee.mongoCore)}a(wEa,"enable");Tee.enable=wEa});var mEi=I(pv=>{"use strict";p();var a0e=pv&&pv.__assign||function(){return a0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:REa};pv.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:PEa};pv.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:DEa};function NEa(){IE.channel.registerMonkeyPatch("mongodb",pv.mongo2),IE.channel.registerMonkeyPatch("mongodb",pv.mongo3),IE.channel.registerMonkeyPatch("mongodb",pv.mongo330)}a(NEa,"enable");pv.enable=NEa});var AEi=I(Iee=>{"use strict";p();Object.defineProperty(Iee,"__esModule",{value:!0});Iee.enable=Iee.mysql=void 0;var Uht=Ap(),gEi=require("path"),MEa=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]=Uht.channel.bindToContext(h(_,E))):arguments[A]=Uht.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(gEi.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;Uht.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(gEi.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");Iee.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:MEa};function OEa(){Uht.channel.registerMonkeyPatch("mysql",Iee.mysql)}a(OEa,"enable");Iee.enable=OEa});var EEi=I(xee=>{"use strict";p();Object.defineProperty(xee,"__esModule",{value:!0});xee.enable=xee.postgresPool1=void 0;var yEi=Ap();function BEa(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=yEi.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a(BEa,"postgresPool1PatchFunction");xee.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:BEa};function LEa(){yEi.channel.registerMonkeyPatch("pg-pool",xee.postgresPool1)}a(LEa,"enable");xee.enable=LEa});var vEi=I(y4=>{"use strict";p();Object.defineProperty(y4,"__esModule",{value:!0});y4.enable=y4.postgres=y4.postgres6=void 0;var c0e=Ap(),_Ei=require("events"),QAr="postgres";function FEa(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=c0e.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),c0e.channel.publish(QAr,u),A){if(m)return m.apply(this,arguments);f&&f instanceof _Ei.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(FEa,"postgres6PatchFunction");function UEa(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=c0e.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),c0e.channel.publish(QAr,m),T){if(v)return v.apply(this,arguments);g&&g instanceof _Ei.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(UEa,"postgresLatestPatchFunction");y4.postgres6={versionSpecifier:"6.*",patch:FEa};y4.postgres={versionSpecifier:">=7.* <=8.*",patch:UEa,publisherName:QAr};function QEa(){c0e.channel.registerMonkeyPatch("pg",y4.postgres6),c0e.channel.registerMonkeyPatch("pg",y4.postgres)}a(QEa,"enable");y4.enable=QEa});var CEi=I(wee=>{"use strict";p();Object.defineProperty(wee,"__esModule",{value:!0});wee.enable=wee.redis=void 0;var qAr=Ap(),qEa=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=qAr.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;qAr.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");wee.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:qEa};function jEa(){qAr.channel.registerMonkeyPatch("redis",wee.redis)}a(jEa,"enable");wee.enable=jEa});var bEi=I(v8=>{"use strict";p();var Qht=v8&&v8.__assign||function(){return Qht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:HEa};function GEa(){jAr.channel.registerMonkeyPatch("tedious",v8.tedious)}a(GEa,"enable");v8.enable=GEa});var SEi=I(Ob=>{"use strict";p();var $Ea=Ob&&Ob.__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)}})(),VEa=Ob&&Ob.__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");Ob.winston3={versionSpecifier:"3.x",patch:zEa};Ob.winston2={versionSpecifier:"2.x",patch:WEa};function YEa(){qht.channel.registerMonkeyPatch("winston",Ob.winston2),qht.channel.registerMonkeyPatch("winston",Ob.winston3)}a(YEa,"enable");Ob.enable=YEa});var BEi=I(Iu=>{"use strict";p();Object.defineProperty(Iu,"__esModule",{value:!0});Iu.enable=Iu.tedious=Iu.pgPool=Iu.pg=Iu.winston=Iu.redis=Iu.mysql=Iu.mongodb=Iu.mongodbCore=Iu.console=Iu.bunyan=Iu.azuresdk=void 0;var TEi=lEi();Iu.azuresdk=TEi;var IEi=dEi();Iu.bunyan=IEi;var xEi=pEi();Iu.console=xEi;var wEi=hEi();Iu.mongodbCore=wEi;var REi=mEi();Iu.mongodb=REi;var PEi=AEi();Iu.mysql=PEi;var kEi=EEi();Iu.pgPool=kEi;var DEi=vEi();Iu.pg=DEi;var NEi=CEi();Iu.redis=NEi;var MEi=bEi();Iu.tedious=MEi;var OEi=SEi();Iu.winston=OEi;function KEa(){IEi.enable(),xEi.enable(),wEi.enable(),REi.enable(),PEi.enable(),DEi.enable(),kEi.enable(),NEi.enable(),OEi.enable(),TEi.enable(),MEi.enable()}a(KEa,"enable");Iu.enable=KEa});var Ght=I(Ree=>{"use strict";p();Object.defineProperty(Ree,"__esModule",{value:!0});Ree.IsInitialized=void 0;Ree.registerContextPreservation=JEa;var HAr=Vl(),FEi=npt();Ree.IsInitialized=!FEi.JsonConfig.getInstance().noDiagnosticChannel;var GAr="DiagnosticChannel";if(Ree.IsInitialized){X2=BEi(),LEi=FEi.JsonConfig.getInstance().noPatchModules,jht=LEi.split(","),$Ar={bunyan:X2.bunyan,console:X2.console,mongodb:X2.mongodb,mongodbCore:X2.mongodbCore,mysql:X2.mysql,redis:X2.redis,pg:X2.pg,pgPool:X2.pgPool,winston:X2.winston,azuresdk:X2.azuresdk};for(Hht in $Ar)jht.indexOf(Hht)===-1&&($Ar[Hht].enable(),HAr.info(GAr,"Subscribed to ".concat(Hht," events")));jht.length>0&&HAr.info(GAr,"Some modules will not be patched",jht)}else HAr.info(GAr,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var X2,LEi,jht,$Ar,Hht;function JEa(t){if(Ree.IsInitialized){var e=Ap();e.channel.addContextPreservation(t)}}a(JEa,"registerContextPreservation")});var l0e=I((Nfp,UEi)=>{"use strict";p();UEi.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 ey=I((zAr,QEi)=>{"use strict";p();var nG=zAr&&zAr.__assign||function(){return nG=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"){Pee.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"){Pee.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+")",Pee.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 YAr=ey(),t_a=(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"|"+YAr.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=YAr.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=YAr.randomu32(),t})();qEi.exports=t_a});var $ht=I((Qfp,jEi)=>{"use strict";p();var ty=ey(),r_a=kee(),n_a=(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=ty.w3cTraceId(),this.spanId=ty.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=ty.w3cTraceId(),this.spanId=ty.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=ty.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=ty.w3cTraceId(),this.spanId=ty.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=ty.w3cTraceId(),this.spanId=ty.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=ty.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=ty.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=ty.w3cTraceId().substr(0,16),this.traceId=ty.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=r_a.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=ty.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=ty.w3cTraceId(),this.spanId=ty.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=ty.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();jEi.exports=n_a});var KAr=I((Hfp,HEi)=>{"use strict";p();var i_a=(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 o_a=(function(){function t(){}return a(t,"Domain"),t})();GEi.exports=o_a});var VEi=I((JAr,$Ei)=>{"use strict";p();var s_a=JAr&&JAr.__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)}})(),a_a=C8(),c_a=(function(t){s_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(a_a);$Ei.exports=c_a});var ZAr=I((Jfp,WEi)=>{"use strict";p();var l_a=(function(){function t(){}return a(t,"Base"),t})();WEi.exports=l_a});var YEi=I((epp,zEi)=>{"use strict";p();var u_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})();zEi.exports=u_a});var JEi=I((XAr,KEi)=>{"use strict";p();var d_a=XAr&&XAr.__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)}})(),f_a=ZAr(),p_a=(function(t){d_a(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})(f_a);KEi.exports=p_a});var tyr=I((opp,ZEi)=>{"use strict";p();var eyr;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(eyr||(eyr={}));ZEi.exports=eyr});var e_i=I((app,XEi)=>{"use strict";p();var h_a=tyr(),m_a=(function(){function t(){this.kind=h_a.Measurement}return a(t,"DataPoint"),t})();XEi.exports=m_a});var r_i=I((upp,t_i)=>{"use strict";p();var g_a=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();t_i.exports=g_a});var nyr=I((ryr,n_i)=>{"use strict";p();var A_a=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)}})(),y_a=C8(),E_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,"EventData"),e})(y_a);n_i.exports=E_a});var o_i=I((iyr,i_i)=>{"use strict";p();var __a=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)}})(),v_a=C8(),C_a=(function(t){__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})(v_a);i_i.exports=C_a});var a_i=I((App,s_i)=>{"use strict";p();var b_a=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();s_i.exports=b_a});var l_i=I((oyr,c_i)=>{"use strict";p();var S_a=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)}})(),T_a=C8(),I_a=(function(t){S_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(T_a);c_i.exports=I_a});var d_i=I((syr,u_i)=>{"use strict";p();var x_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)}})(),w_a=C8(),R_a=(function(t){x_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})(w_a);u_i.exports=R_a});var p_i=I((ayr,f_i)=>{"use strict";p();var P_a=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)}})(),k_a=nyr(),D_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,"PageViewData"),e})(k_a);f_i.exports=D_a});var m_i=I((cyr,h_i)=>{"use strict";p();var N_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)}})(),M_a=C8(),O_a=(function(t){N_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})(M_a);h_i.exports=O_a});var A_i=I((lyr,g_i)=>{"use strict";p();var B_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)}})(),L_a=C8(),F_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,"RequestData"),e})(L_a);g_i.exports=F_a});var E_i=I((Ppp,y_i)=>{"use strict";p();var uyr;(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"})(uyr||(uyr={}));y_i.exports=uyr});var v_i=I((Dpp,__i)=>{"use strict";p();var U_a=(function(){function t(){}return a(t,"StackFrame"),t})();__i.exports=U_a});var dyr=I(hm=>{"use strict";p();Object.defineProperty(hm,"__esModule",{value:!0});hm.AvailabilityData=VEi();hm.Base=ZAr();hm.ContextTagKeys=YEi();hm.Data=JEi();hm.DataPoint=e_i();hm.DataPointType=tyr();hm.Domain=C8();hm.Envelope=r_i();hm.EventData=nyr();hm.ExceptionData=o_i();hm.ExceptionDetails=a_i();hm.MessageData=l_i();hm.MetricData=d_i();hm.PageViewData=p_i();hm.RemoteDependencyData=m_i();hm.RequestData=A_i();hm.SeverityLevel=E_i();hm.StackFrame=v_i()});var C_i=I(zMe=>{"use strict";p();Object.defineProperty(zMe,"__esModule",{value:!0});zMe.RemoteDependencyDataConstants=void 0;zMe.domainSupportsProperties=q_a;var Dee=dyr(),Q_a=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();zMe.RemoteDependencyDataConstants=Q_a;function q_a(t){return"properties"in t||t instanceof Dee.EventData||t instanceof Dee.ExceptionData||t instanceof Dee.MessageData||t instanceof Dee.MetricData||t instanceof Dee.PageViewData||t instanceof Dee.RemoteDependencyData||t instanceof Dee.RequestData}a(q_a,"domainSupportsProperties")});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 P_i=I(R_i=>{"use strict";p();Object.defineProperty(R_i,"__esModule",{value:!0})});var D_i=I(k_i=>{"use strict";p();Object.defineProperty(k_i,"__esModule",{value:!0})});var M_i=I(N_i=>{"use strict";p();Object.defineProperty(N_i,"__esModule",{value:!0})});var B_i=I(O_i=>{"use strict";p();Object.defineProperty(O_i,"__esModule",{value:!0})});var F_i=I(L_i=>{"use strict";p();Object.defineProperty(L_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 V_i=I($_i=>{"use strict";p();Object.defineProperty($_i,"__esModule",{value:!0})});var W_i=I(iG=>{"use strict";p();Object.defineProperty(iG,"__esModule",{value:!0});iG.TelemetryType=iG.TelemetryTypeString=void 0;iG.telemetryTypeToBaseType=j_a;iG.baseTypeToTelemetryType=H_a;function j_a(t){switch(t){case Ng.Event:return"EventData";case Ng.Exception:return"ExceptionData";case Ng.Trace:return"MessageData";case Ng.Metric:return"MetricData";case Ng.Request:return"RequestData";case Ng.Dependency:return"RemoteDependencyData";case Ng.Availability:return"AvailabilityData";case Ng.PageView:return"PageViewData"}}a(j_a,"telemetryTypeToBaseType");function H_a(t){switch(t){case"EventData":return Ng.Event;case"ExceptionData":return Ng.Exception;case"MessageData":return Ng.Trace;case"MetricData":return Ng.Metric;case"RequestData":return Ng.Request;case"RemoteDependencyData":return Ng.Dependency;case"AvailabilityData":return Ng.Availability;case"PageViewData":return Ng.PageView}}a(H_a,"baseTypeToTelemetryType");iG.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var Ng;(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"})(Ng||(iG.TelemetryType=Ng={}))});var z_i=I(g0=>{"use strict";p();var G_a=g0&&g0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UT=g0&&g0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&G_a(e,t,r)};Object.defineProperty(g0,"__esModule",{value:!0});UT(S_i(),g0);UT(I_i(),g0);UT(w_i(),g0);UT(P_i(),g0);UT(D_i(),g0);UT(M_i(),g0);UT(B_i(),g0);UT(F_i(),g0);UT(Q_i(),g0);UT(j_i(),g0);UT(G_i(),g0);UT(V_i(),g0);UT(W_i(),g0)});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 uvi=I(lvi=>{"use strict";p();Object.defineProperty(lvi,"__esModule",{value:!0})});var dvi=I(Bb=>{"use strict";p();var $_a=Bb&&Bb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oG=Bb&&Bb.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$_a(e,t,r)};Object.defineProperty(Bb,"__esModule",{value:!0});oG(K_i(),Bb);oG(Z_i(),Bb);oG(evi(),Bb);oG(rvi(),Bb);oG(ivi(),Bb);oG(svi(),Bb);oG(cvi(),Bb);oG(uvi(),Bb)});var xE=I(E4=>{"use strict";p();var V_a=E4&&E4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vht=E4&&E4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&V_a(e,t,r)};Object.defineProperty(E4,"__esModule",{value:!0});Vht(C_i(),E4);Vht(dyr(),E4);Vht(z_i(),E4);Vht(dvi(),E4)});var fyr=I((Fhp,fvi)=>{"use strict";p();var W_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 eD;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 ry;(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"})(ry||(jr.QuickPulseCounter=ry={}));var YMe;(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"})(YMe||(jr.PerformanceCounter=YMe={}));var pvi;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(pvi||(jr.MetricId=pvi={}));jr.PerformanceToQuickPulseCounter=(eD={},eD[YMe.PROCESSOR_TIME]=ry.PROCESSOR_TIME,eD[YMe.REQUEST_RATE]=ry.REQUEST_RATE,eD[YMe.REQUEST_DURATION]=ry.REQUEST_DURATION,eD[ry.COMMITTED_BYTES]=ry.COMMITTED_BYTES,eD[ry.REQUEST_FAILURE_RATE]=ry.REQUEST_FAILURE_RATE,eD[ry.DEPENDENCY_RATE]=ry.DEPENDENCY_RATE,eD[ry.DEPENDENCY_FAILURE_RATE]=ry.DEPENDENCY_FAILURE_RATE,eD[ry.DEPENDENCY_DURATION]=ry.DEPENDENCY_DURATION,eD[ry.EXCEPTION_RATE]=ry.EXCEPTION_RATE,eD);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 hvi;(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"})(hvi||(jr.StatsbeatFeature=hvi={}));var mvi;(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"})(mvi||(jr.StatsbeatInstrumentation=mvi={}));var gvi;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(gvi||(jr.StatsbeatFeatureType=gvi={}));var Avi;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(Avi||(jr.StatsbeatNetworkCategory=Avi={}));var yvi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(yvi||(jr.HttpRequestCookieNames=yvi={}));var Evi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(Evi||(jr.AttachTypePrefix=Evi={}));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 gyr=I((myr,_vi)=>{"use strict";p();var z_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)}})(),Wht=require("url"),Y_a=xE(),pyr=ey(),QT=l0e(),K_a=fyr(),sG=kee(),J_a=KAr(),hyr=$ht(),Z_a=Vl(),zht=fd(),X_a=(function(t){z_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 Wht.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(zht.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(zht.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(zht.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 Wht.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 Wht.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=Wht.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===zht.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",Z_a.warn("Could not decode the auth cookie with error: ",pyr.dumpObj(s))}var o=e.parseId(pyr.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=pyr.getCorrelationContextTarget(r,QT.requestContextSourceKey),r.headers){var o=r.headers[QT.traceStateHeader]?r.headers[QT.traceStateHeader].toString():null,s=r.headers[QT.traceparentHeader]?r.headers[QT.traceparentHeader].toString():null,c=r.headers[QT.requestIdHeader]?r.headers[QT.requestIdHeader].toString():null,l=r.headers[QT.parentIdHeader]?r.headers[QT.parentIdHeader].toString():null,u=r.headers[QT.rootIdHeader]?r.headers[QT.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[QT.correlationContextHeader]?r.headers[QT.correlationContextHeader].toString():null,sG.w3cEnabled&&(s||o)?(this.traceparent=new hyr(s?s.toString():null),this.tracestate=s&&o&&new J_a(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?sG.w3cEnabled?(this.traceparent=new hyr(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=sG.generateRequestId(this.parentId),this.operationId=sG.getRootId(this.requestId)):sG.w3cEnabled?(this.traceparent=new hyr,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=sG.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=sG.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=sG.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new Y_a.ContextTagKeys,e})(K_a);_vi.exports=X_a});var Lvi=I((yo,Bvi)=>{p();yo=Bvi.exports=Da;var al;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?al=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):al=a(function(){},"debug");yo.SEMVER_SPEC_VERSION="2.0.0";var KMe=256,Yht=Number.MAX_SAFE_INTEGER||9007199254740991,Ayr=16,eva=KMe-6,JMe=yo.re=[],xu=yo.safeRe=[],rr=yo.src=[],fa=0,Cyr="[a-zA-Z0-9-]",yyr=[["\\s",1],["\\d",KMe],[Cyr,eva]];function tmt(t){for(var e=0;e)?=?)";var Kht=fa++;rr[Kht]=rr[f0e]+"|x|X|\\*";var Jht=fa++;rr[Jht]=rr[d0e]+"|x|X|\\*";var Nee=fa++;rr[Nee]="[v=\\s]*("+rr[Jht]+")(?:\\.("+rr[Jht]+")(?:\\.("+rr[Jht]+")(?:"+rr[Syr]+")?"+rr[XMe]+"?)?)?";var h0e=fa++;rr[h0e]="[v=\\s]*("+rr[Kht]+")(?:\\.("+rr[Kht]+")(?:\\.("+rr[Kht]+")(?:"+rr[Tyr]+")?"+rr[XMe]+"?)?)?";var Tvi=fa++;rr[Tvi]="^"+rr[A0e]+"\\s*"+rr[Nee]+"$";var Ivi=fa++;rr[Ivi]="^"+rr[A0e]+"\\s*"+rr[h0e]+"$";var xvi=fa++;rr[xvi]="(?:^|[^\\d])(\\d{1,"+Ayr+"})(?:\\.(\\d{1,"+Ayr+"}))?(?:\\.(\\d{1,"+Ayr+"}))?(?:$|[^\\d])";var rmt=fa++;rr[rmt]="(?:~>?)";var m0e=fa++;rr[m0e]="(\\s*)"+rr[rmt]+"\\s+";JMe[m0e]=new RegExp(rr[m0e],"g");xu[m0e]=new RegExp(tmt(rr[m0e]),"g");var tva="$1~",wvi=fa++;rr[wvi]="^"+rr[rmt]+rr[Nee]+"$";var Rvi=fa++;rr[Rvi]="^"+rr[rmt]+rr[h0e]+"$";var nmt=fa++;rr[nmt]="(?:\\^)";var g0e=fa++;rr[g0e]="(\\s*)"+rr[nmt]+"\\s+";JMe[g0e]=new RegExp(rr[g0e],"g");xu[g0e]=new RegExp(tmt(rr[g0e]),"g");var rva="$1^",Pvi=fa++;rr[Pvi]="^"+rr[nmt]+rr[Nee]+"$";var kvi=fa++;rr[kvi]="^"+rr[nmt]+rr[h0e]+"$";var Ryr=fa++;rr[Ryr]="^"+rr[A0e]+"\\s*("+xyr+")$|^$";var Pyr=fa++;rr[Pyr]="^"+rr[A0e]+"\\s*("+Svi+")$|^$";var Mee=fa++;rr[Mee]="(\\s*)"+rr[A0e]+"\\s*("+xyr+"|"+rr[Nee]+")";JMe[Mee]=new RegExp(rr[Mee],"g");xu[Mee]=new RegExp(tmt(rr[Mee]),"g");var nva="$1$2$3",Dvi=fa++;rr[Dvi]="^\\s*("+rr[Nee]+")\\s+-\\s+("+rr[Nee]+")\\s*$";var Nvi=fa++;rr[Nvi]="^\\s*("+rr[h0e]+")\\s+-\\s+("+rr[h0e]+")\\s*$";var Mvi=fa++;rr[Mvi]="(<|>)?=?\\s*\\*";for(_4=0;_4KMe)return null;var r=e.loose?xu[wyr]:xu[Iyr];if(!r.test(t))return null;try{return new Da(t,e)}catch{return null}}a(Oee,"parse");yo.valid=iva;function iva(t,e){var r=Oee(t,e);return r?r.version:null}a(iva,"valid");yo.clean=ova;function ova(t,e){var r=Oee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(ova,"clean");yo.SemVer=Da;function Da(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Da){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>KMe)throw new TypeError("version is longer than "+KMe+" characters");if(!(this instanceof Da))return new Da(t,e);al("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?xu[wyr]:xu[Iyr]);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>Yht||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Yht||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Yht||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=sva;function sva(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Da(t,r).inc(e,n).version}catch{return null}}a(sva,"inc");yo.diff=ava;function ava(t,e){if(kyr(t,e))return null;var r=Oee(t),n=Oee(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(ava,"diff");yo.compareIdentifiers=p0e;var vvi=/^[0-9]+$/;function p0e(t,e){var r=vvi.test(t),n=vvi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(ZMe,"gt");yo.lt=Zht;function Zht(t,e,r){return b8(t,e,r)<0}a(Zht,"lt");yo.eq=kyr;function kyr(t,e,r){return b8(t,e,r)===0}a(kyr,"eq");yo.neq=Ovi;function Ovi(t,e,r){return b8(t,e,r)!==0}a(Ovi,"neq");yo.gte=Dyr;function Dyr(t,e,r){return b8(t,e,r)>=0}a(Dyr,"gte");yo.lte=Nyr;function Nyr(t,e,r){return b8(t,e,r)<=0}a(Nyr,"lte");yo.cmp=Xht;function Xht(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 kyr(t,r,n);case"!=":return Ovi(t,r,n);case">":return ZMe(t,r,n);case">=":return Dyr(t,r,n);case"<":return Zht(t,r,n);case"<=":return Nyr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(Xht,"cmp");yo.Comparator=pR;function pR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof pR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof pR))return new pR(t,e);t=t.trim().split(/\s+/).join(" "),al("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===eOe?this.value="":this.value=this.operator+this.semver.version,al("comp",this)}a(pR,"Comparator");var eOe={};pR.prototype.parse=function(t){var e=this.options.loose?xu[Ryr]:xu[Pyr],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 Da(r[2],this.options.loose):this.semver=eOe};pR.prototype.toString=function(){return this.value};pR.prototype.test=function(t){return al("Comparator.test",t,this.options.loose),this.semver===eOe?!0:(typeof t=="string"&&(t=new Da(t,this.options)),Xht(t,this.operator,this.semver,this.options))};pR.prototype.intersects=function(t,e){if(!(t instanceof pR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Tf(t.value,e),emt(this.value,r,e);if(t.operator==="")return r=new Tf(this.value,e),emt(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=Xht(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=Xht(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};yo.Range=Tf;function Tf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Tf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Tf(t.raw,e);if(t instanceof pR)return new Tf(t.value,e);if(!(this instanceof Tf))return new Tf(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(Tf,"Range");Tf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Tf.prototype.toString=function(){return this.range};Tf.prototype.parseRange=function(t){var e=this.options.loose,r=e?xu[Nvi]:xu[Dvi];t=t.replace(r,Tva),al("hyphen replace",t),t=t.replace(xu[Mee],nva),al("comparator trim",t,xu[Mee]),t=t.replace(xu[m0e],tva),t=t.replace(xu[g0e],rva);var n=e?xu[Ryr]:xu[Pyr],o=t.split(" ").map(function(s){return Ava(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 pR(s,this.options)},this),o};Tf.prototype.intersects=function(t,e){if(!(t instanceof Tf))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=gva;function gva(t,e){return new Tf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(gva,"toComparators");function Ava(t,e){return al("comp",t,e),t=_va(t,e),al("caret",t),t=yva(t,e),al("tildes",t),t=Cva(t,e),al("xrange",t),t=Sva(t,e),al("stars",t),t}a(Ava,"parseComparator");function hv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(hv,"isX");function yva(t,e){return t.trim().split(/\s+/).map(function(r){return Eva(r,e)}).join(" ")}a(yva,"replaceTildes");function Eva(t,e){var r=e.loose?xu[Rvi]:xu[wvi];return t.replace(r,function(n,o,s,c,l){al("tilde",t,n,o,s,c,l);var u;return hv(o)?u="":hv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":hv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(al("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",al("tilde return",u),u})}a(Eva,"replaceTilde");function _va(t,e){return t.trim().split(/\s+/).map(function(r){return vva(r,e)}).join(" ")}a(_va,"replaceCarets");function vva(t,e){al("caret",t,e);var r=e.loose?xu[kvi]:xu[Pvi];return t.replace(r,function(n,o,s,c,l){al("caret",t,n,o,s,c,l);var u;return hv(o)?u="":hv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":hv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(al("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(al("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),al("caret return",u),u})}a(vva,"replaceCaret");function Cva(t,e){return al("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return bva(r,e)}).join(" ")}a(Cva,"replaceXRanges");function bva(t,e){t=t.trim();var r=e.loose?xu[Ivi]:xu[Tvi];return t.replace(r,function(n,o,s,c,l,u){al("xRange",t,n,o,s,c,l,u);var d=hv(s),f=d||hv(c),h=f||hv(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),al("xRange return",n),n})}a(bva,"replaceXRange");function Sva(t,e){return al("replaceStars",t,e),t.trim().replace(xu[Mvi],"")}a(Sva,"replaceStars");function Tva(t,e,r,n,o,s,c,l,u,d,f,h,m){return hv(r)?e="":hv(n)?e=">="+r+".0.0":hv(o)?e=">="+r+"."+n+".0":e=">="+e,hv(u)?l="":hv(d)?l="<"+(+u+1)+".0.0":hv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(Tva,"hyphenReplace");Tf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Da(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(Iva,"testSet");yo.satisfies=emt;function emt(t,e,r){try{e=new Tf(e,r)}catch{return!1}return e.test(t)}a(emt,"satisfies");yo.maxSatisfying=xva;function xva(t,e,r){var n=null,o=null;try{var s=new Tf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Da(n,r))}),n}a(xva,"maxSatisfying");yo.minSatisfying=wva;function wva(t,e,r){var n=null,o=null;try{var s=new Tf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Da(n,r))}),n}a(wva,"minSatisfying");yo.minVersion=Rva;function Rva(t,e){t=new Tf(t,e);var r=new Da("0.0.0");if(t.test(r)||(r=new Da("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||ZMe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(Rva,"minVersion");yo.validRange=Pva;function Pva(t,e){try{return new Tf(t,e).range||"*"}catch{return null}}a(Pva,"validRange");yo.ltr=kva;function kva(t,e,r){return Myr(t,e,"<",r)}a(kva,"ltr");yo.gtr=Dva;function Dva(t,e,r){return Myr(t,e,">",r)}a(Dva,"gtr");yo.outside=Myr;function Myr(t,e,r,n){t=new Da(t,n),e=new Tf(e,n);var o,s,c,l,u;switch(r){case">":o=ZMe,s=Nyr,c=Zht,l=">",u=">=";break;case"<":o=Zht,s=Dyr,c=ZMe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(emt(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(Myr,"outside");yo.prerelease=Nva;function Nva(t,e){var r=Oee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(Nva,"prerelease");yo.intersects=Mva;function Mva(t,e,r){return t=new Tf(t,r),e=new Tf(e,r),t.intersects(e)}a(Mva,"intersects");yo.coerce=Ova;function Ova(t){if(t instanceof Da)return t;if(typeof t!="string")return null;var e=t.match(xu[xvi]);return e==null?null:Oee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(Ova,"coerce")});var smt=I((Whp,qvi)=>{"use strict";p();var Uvi=Kme(),y0e=Uvi.wrap,imt=Uvi.unwrap,S8="wrap@before";function omt(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(omt,"defineProperty");function Bva(t,e){for(var r=e.length,n=0;n0&&Bva(t,o)}a(Lva,"_findAndProcess");function Fvi(t,e){if(t){var r=t;if(typeof t=="function")r=e(t);else if(Array.isArray(t)){r=[];for(var n=0;n{"use strict";p();var Rc=require("util"),T8=require("assert"),Fva=smt(),pd=require("async_hooks"),tOe="cls@contexts",rOe="error@context",If=process.env.DEBUG_CLS_HOOKED,wc=-1;Gvi.exports={getNamespace:jvi,createNamespace:Uva,destroyNamespace:Hvi,reset:Qva,ERROR_SYMBOL:rOe};function hR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}a(hR,"Namespace");hR.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,If){let n=" ".repeat(this._indent<0?0:this._indent);Gd(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+wc+" active:"+Rc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");hR.prototype.get=a(function(e){if(!this.active){if(If){let r=pd.currentId(),n=pd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Gd(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${wc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(If){let r=pd.executionAsyncId(),n=pd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Gd(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+wc+" active:"+Rc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),Gd(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${wc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${Rc.inspect(this.active)}`)}return this.active[e]},"get");hR.prototype.createContext=a(function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=wc,If){let r=pd.executionAsyncId(),n=pd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Gd(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${wc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${Rc.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},"createContext");hR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{if(If){let n=pd.triggerAsyncId(),o=pd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Gd(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${wc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${Rc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[rOe]=r),n}finally{if(If){let n=pd.triggerAsyncId(),o=pd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Gd(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${wc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${Rc.inspect(r)}`)}this.exit(r)}},"run");hR.prototype.runAndReturn=a(function(e){let r;return this.run(function(n){r=e(n)}),r},"runAndReturn");hR.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 If&&Gd("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+wc+" len:"+this._set.length+" "+Rc.inspect(r)),n.then(o=>(If&&Gd("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+wc+" len:"+this._set.length+" "+Rc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[rOe]=r,If&&Gd("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+wc+" len:"+this._set.length+" "+Rc.inspect(r)),this.exit(r),o})},"runPromise");hR.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[rOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");hR.prototype.enter=a(function(e){if(T8.ok(e,"context must be provided for entering"),If){let r=pd.executionAsyncId(),n=pd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Gd(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${wc} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${Rc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");hR.prototype.exit=a(function(e){if(T8.ok(e,"context must be provided for exiting"),If){let n=pd.executionAsyncId(),o=pd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Gd(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${wc} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${Rc.inspect(e)}`)}if(this.active===e){T8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(If&&Gd("??ERROR?? context exiting but not entered - ignoring: "+Rc.inspect(e)),T8.ok(r>=0,`context not currently entered; can't exit. -`+Rc.inspect(this)+` -`+Rc.inspect(e))):(T8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");hR.prototype.bindEmitter=a(function(e){T8.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"),Fva(e,o,s)},"bindEmitter");hR.prototype.fromException=a(function(e){return e[rOe]},"fromException");function jvi(t){return process.namespaces[t]}a(jvi,"getNamespace");function Uva(t){T8.ok(t,"namespace must be given a name."),If&&Gd(`NS-CREATING NAMESPACE (${t})`);let e=new hR(t);return e.id=wc,pd.createHook({init(n,o,s,c){if(wc=pd.executionAsyncId(),e.active){if(e._contexts.set(n,e.active),If){let l=" ".repeat(e._indent<0?0:e._indent);Gd(`${l}INIT [${o}] (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(wc===0){let l=pd.triggerAsyncId(),u=e._contexts.get(l);if(u){if(e._contexts.set(n,u),If){let d=" ".repeat(e._indent<0?0:e._indent);Gd(`${d}INIT USING CONTEXT FROM TRIGGERID [${o}] (${t}) asyncId:${n} currentUid:${wc} triggerId:${l} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(If){let d=" ".repeat(e._indent<0?0:e._indent);Gd(`${d}INIT MISSING CONTEXT [${o}] (${t}) asyncId:${n} currentUid:${wc} triggerId:${l} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}if(If&&o==="PROMISE"){Gd(Rc.inspect(c,{showHidden:!0}));let l=c.parentId,u=" ".repeat(e._indent<0?0:e._indent);Gd(`${u}INIT RESOURCE-PROMISE [${o}] (${t}) parentId:${l} asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}},before(n){wc=pd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(wc),o){if(If){let s=pd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);Gd(`${c}BEFORE (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Rc.inspect(o)}`),e._indent+=2}e.enter(o)}else if(If){let s=pd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);Gd(`${c}BEFORE MISSING CONTEXT (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${Rc.inspect(e._contexts,{showHidden:!0,depth:2,colors:!0})}`),e._indent+=2}},after(n){wc=pd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(wc),o){if(If){let s=pd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);Gd(`${c}AFTER (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Rc.inspect(o)}`)}e.exit(o)}else if(If){let s=pd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);Gd(`${c}AFTER MISSING CONTEXT (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Rc.inspect(o)}`)}},destroy(n){if(wc=pd.executionAsyncId(),If){let o=pd.triggerAsyncId(),s=" ".repeat(e._indent<0?0:e._indent);Gd(`${s}DESTROY (${t}) currentUid:${wc} asyncId:${n} triggerId:${o} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Rc.inspect(e._contexts.get(wc))}`)}e._contexts.delete(n)}}).enable(),process.namespaces[t]=e,e}a(Uva,"createNamespace");function Hvi(t){let e=jvi(t);T8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),T8.ok(e.id,"don't assign to process.namespaces directly! "+Rc.inspect(e)),process.namespaces[t]=null}a(Hvi,"destroyNamespace");function Qva(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){Hvi(t)}),process.namespaces=Object.create(null)}a(Qva,"reset");process.namespaces={};function Gd(...t){If&&process._rawDebug(`${Rc.format(...t)}`)}a(Gd,"debug2")});var Wvi=I((Xhp,Vvi)=>{"use strict";p();function qva(){}a(qva,"NextTickWrap");Vvi.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 Yvi=I((rmp,zvi)=>{"use strict";p();function jva(){}a(jva,"PromiseWrap");zvi.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 jva,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 Jvi=I((omp,Kvi)=>{"use strict";p();var qT=require("timers");function Hva(){}a(Hva,"TimeoutWrap");function Gva(){}a(Gva,"IntervalWrap");function $va(){}a($va,"ImmediateWrap");var Vva=new Map,Wva=new Map,zva=new Map,Oyr=null,Byr=!1;Kvi.exports=a(function(){Lyr(this._hooks,this._state,"setTimeout","clearTimeout",Hva,Vva,!0),Lyr(this._hooks,this._state,"setInterval","clearInterval",Gva,Wva,!1),Lyr(this._hooks,this._state,"setImmediate","clearImmediate",$va,zva,!0),global.setTimeout=qT.setTimeout,global.setInterval=qT.setInterval,global.setImmediate=qT.setImmediate,global.clearTimeout=qT.clearTimeout,global.clearInterval=qT.clearInterval,global.clearImmediate=qT.clearImmediate},"patch");function Lyr(t,e,r,n,o,s,c){let l=qT[r],u=qT[n];qT[r]=function(){if(!e.enabled)return l.apply(qT,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),Oyr=null,(c||Byr)&&(Byr=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(qT,d),s.set(g,m),g},qT[n]=function(d){if(Oyr===d&&d!==null)Byr=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(qT,arguments)}}a(Lyr,"patchTimer")});var Fyr=I((cmp,Yva)=>{Yva.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 eCi=I((lmp,Xvi)=>{"use strict";p();var iOe=process.binding("async_wrap"),Kva=iOe.Providers.TIMERWRAP,Zvi={nextTick:Wvi(),promise:Yvi(),timers:Jvi()},nOe=new Set;function Jva(){this.enabled=!1,this.counter=0}a(Jva,"State");function Uyr(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===Kva){nOe.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!nOe.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!nOe.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(nOe.has(o)){nOe.delete(o);return}for(let s of n)s(o)}}a(Uyr,"Hooks");Uyr.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 amt(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(amt,"removeElement");Uyr.prototype.remove=function(t){t.init&&amt(this.initFns,t.init),t.pre&&amt(this.preFns,t.pre),t.post&&amt(this.postFns,t.post),t.destroy&&amt(this.destroyFns,t.destroy)};function oOe(){this._state=new Jva,this._hooks=new Uyr,this.version=Fyr().version,this.providers=iOe.Providers;for(let t of Object.keys(Zvi))Zvi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),iOe.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(oOe,"AsyncHook");Xvi.exports=oOe;oOe.prototype.addHooks=function(t){this._hooks.add(t)};oOe.prototype.removeHooks=function(t){this._hooks.remove(t)};oOe.prototype.enable=function(){this._state.enabled=!0,iOe.enable()};oOe.prototype.disable=function(){this._state.enabled=!1,iOe.disable()}});var Qyr=I((fmp,Zva)=>{Zva.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 rCi=I((pmp,tCi)=>{p();function Xva(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(Xva,"FormatErrorString");tCi.exports=a(function(e,r){var n=[];n.push(Xva(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` -`)},"FormatStackTrace")});var sCi=I((gmp,oCi)=>{p();var cmt=rCi();function iCi(){this.extend=new sOe,this.filter=new sOe,this.format=new aOe,this.version=Qyr().version}a(iCi,"stackChain");var jyr=!1;iCi.prototype.callSite=a(function t(e){e||(e={}),jyr=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return jyr=!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 iCi;function sOe(){this._modifiers=[]}a(sOe,"TraceModifier");sOe.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===Qyr().version)Hyr.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else Hyr.exports=global._stackChain=sCi()});var aCi=I((vmp,$yr)=>{"use strict";p();var tCa=eCi();if(global._asyncHook)if(global._asyncHook.version===Fyr().version)$yr.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else Gyr().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),$yr.exports=global._asyncHook=new tCa});var pCi=I((bmp,fCi)=>{"use strict";p();var uh=require("util"),I8=require("assert"),rCa=smt(),E0e=aCi(),cOe="cls@contexts",lOe="error@context",lCi=[];for(let t in E0e.providers)lCi[E0e.providers[t]]=t;var yp=process.env.DEBUG_CLS_HOOKED,mm=-1;fCi.exports={getNamespace:uCi,createNamespace:nCa,destroyNamespace:dCi,reset:iCa,ERROR_SYMBOL:lOe};function mR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a(mR,"Namespace");mR.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 yp&&lh(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+mm+" active:"+uh.inspect(this.active,!0)),this.active[e]=r,r},"set");mR.prototype.get=a(function(e){if(!this.active){yp&&lh(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+mm+" active:"+uh.inspect(this.active,!0));return}return yp&&lh(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+mm+" active:"+uh.inspect(this.active,!0)),this.active[e]},"get");mR.prototype.createContext=a(function(){yp&&lh(" CREATING Context: "+this.name+" uid:"+mm+" len:"+this._set.length+" active:"+uh.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=mm,yp&&lh(" CREATED Context: "+this.name+" uid:"+mm+" len:"+this._set.length+" context:"+uh.inspect(e,!0,2,!0)),e},"createContext");mR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return yp&&lh(" BEFORE RUN: "+this.name+" uid:"+mm+" len:"+this._set.length+" "+uh.inspect(r)),e(r),r}catch(n){throw n&&(n[lOe]=r),n}finally{yp&&lh(" AFTER RUN: "+this.name+" uid:"+mm+" len:"+this._set.length+" "+uh.inspect(r)),this.exit(r)}},"run");mR.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");mR.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 yp&&lh(" BEFORE runPromise: "+this.name+" uid:"+mm+" len:"+this._set.length+" "+uh.inspect(r)),n.then(o=>(yp&&lh(" AFTER runPromise: "+this.name+" uid:"+mm+" len:"+this._set.length+" "+uh.inspect(r)),this.exit(r),o)).catch(o=>{throw o[lOe]=r,yp&&lh(" AFTER runPromise: "+this.name+" uid:"+mm+" len:"+this._set.length+" "+uh.inspect(r)),this.exit(r),o})},"runPromise");mR.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[lOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");mR.prototype.enter=a(function(e){I8.ok(e,"context must be provided for entering"),yp&&lh(" ENTER "+this.name+" uid:"+mm+" len:"+this._set.length+" context: "+uh.inspect(e)),this._set.push(this.active),this.active=e},"enter");mR.prototype.exit=a(function(e){if(I8.ok(e,"context must be provided for exiting"),yp&&lh(" EXIT "+this.name+" uid:"+mm+" len:"+this._set.length+" context: "+uh.inspect(e)),this.active===e){I8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(yp&&lh("??ERROR?? context exiting but not entered - ignoring: "+uh.inspect(e)),I8.ok(r>=0,`context not currently entered; can't exit. -`+uh.inspect(this)+` -`+uh.inspect(e))):(I8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");mR.prototype.bindEmitter=a(function(e){I8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[cOe]||(c[cOe]=Object.create(null)),c[cOe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[cOe]))return c;let l=c,u=c[cOe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),rCa(e,o,s)},"bindEmitter");mR.prototype.fromException=a(function(e){return e[lOe]},"fromException");function uCi(t){return process.namespaces[t]}a(uCi,"getNamespace");function nCa(t){I8.ok(t,"namespace must be given a name."),yp&&lh("CREATING NAMESPACE "+t);let e=new mR(t);return e.id=mm,E0e.addHooks({init(r,n,o,s,c){mm=r,s?(e._contexts.set(r,e._contexts.get(s)),yp&&lh("PARENTID: "+t+" uid:"+r+" parent:"+s+" provider:"+o)):e._contexts.set(mm,e.active),yp&&lh("INIT "+t+" uid:"+r+" parent:"+s+" provider:"+lCi[o]+" active:"+uh.inspect(e.active,!0))},pre(r,n){mm=r;let o=e._contexts.get(r);o?(yp&&lh(" PRE "+t+" uid:"+r+" handle:"+lmt(n)+" context:"+uh.inspect(o)),e.enter(o)):yp&&lh(" PRE MISSING CONTEXT "+t+" uid:"+r+" handle:"+lmt(n))},post(r,n){mm=r;let o=e._contexts.get(r);o?(yp&&lh(" POST "+t+" uid:"+r+" handle:"+lmt(n)+" context:"+uh.inspect(o)),e.exit(o)):yp&&lh(" POST MISSING CONTEXT "+t+" uid:"+r+" handle:"+lmt(n))},destroy(r){mm=r,yp&&lh("DESTROY "+t+" uid:"+r+" context:"+uh.inspect(e._contexts.get(mm))+" active:"+uh.inspect(e.active,!0)),e._contexts.delete(r)}}),process.namespaces[t]=e,e}a(nCa,"createNamespace");function dCi(t){let e=uCi(t);I8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),I8.ok(e.id,"don't assign to process.namespaces directly! "+uh.inspect(e)),process.namespaces[t]=null}a(dCi,"destroyNamespace");function iCa(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){dCi(t)}),process.namespaces=Object.create(null)}a(iCa,"reset");process.namespaces={};E0e._state&&!E0e._state.enabled&&E0e.enable();function lh(t){process.env.DEBUG&&process._rawDebug(t)}a(lh,"debug2");function lmt(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(lmt,"getFunctionName");if(yp){Vyr=Gyr();for(cCi in Vyr.filter._modifiers)Vyr.filter.deattach(cCi)}var Vyr,cCi});var hCi=I((Imp,Wyr)=>{"use strict";p();var oCa=Lvi();process&&oCa.gte(process.versions.node,"8.0.0")?Wyr.exports=$vi():Wyr.exports=pCi()});var kCi=I((Eo,PCi)=>{p();Eo=PCi.exports=Na;var cl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?cl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):cl=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var uOe=256,umt=Number.MAX_SAFE_INTEGER||9007199254740991,zyr=16,sCa=uOe-6,dOe=Eo.re=[],wu=Eo.safeRe=[],nr=Eo.src=[],pa=0,Xyr="[a-zA-Z0-9-]",Yyr=[["\\s",1],["\\d",uOe],[Xyr,sCa]];function gmt(t){for(var e=0;e)?=?)";var dmt=pa++;nr[dmt]=nr[v0e]+"|x|X|\\*";var fmt=pa++;nr[fmt]=nr[_0e]+"|x|X|\\*";var Bee=pa++;nr[Bee]="[v=\\s]*("+nr[fmt]+")(?:\\.("+nr[fmt]+")(?:\\.("+nr[fmt]+")(?:"+nr[tEr]+")?"+nr[pOe]+"?)?)?";var b0e=pa++;nr[b0e]="[v=\\s]*("+nr[dmt]+")(?:\\.("+nr[dmt]+")(?:\\.("+nr[dmt]+")(?:"+nr[rEr]+")?"+nr[pOe]+"?)?)?";var ECi=pa++;nr[ECi]="^"+nr[I0e]+"\\s*"+nr[Bee]+"$";var _Ci=pa++;nr[_Ci]="^"+nr[I0e]+"\\s*"+nr[b0e]+"$";var vCi=pa++;nr[vCi]="(?:^|[^\\d])(\\d{1,"+zyr+"})(?:\\.(\\d{1,"+zyr+"}))?(?:\\.(\\d{1,"+zyr+"}))?(?:$|[^\\d])";var Amt=pa++;nr[Amt]="(?:~>?)";var S0e=pa++;nr[S0e]="(\\s*)"+nr[Amt]+"\\s+";dOe[S0e]=new RegExp(nr[S0e],"g");wu[S0e]=new RegExp(gmt(nr[S0e]),"g");var aCa="$1~",CCi=pa++;nr[CCi]="^"+nr[Amt]+nr[Bee]+"$";var bCi=pa++;nr[bCi]="^"+nr[Amt]+nr[b0e]+"$";var ymt=pa++;nr[ymt]="(?:\\^)";var T0e=pa++;nr[T0e]="(\\s*)"+nr[ymt]+"\\s+";dOe[T0e]=new RegExp(nr[T0e],"g");wu[T0e]=new RegExp(gmt(nr[T0e]),"g");var cCa="$1^",SCi=pa++;nr[SCi]="^"+nr[ymt]+nr[Bee]+"$";var TCi=pa++;nr[TCi]="^"+nr[ymt]+nr[b0e]+"$";var sEr=pa++;nr[sEr]="^"+nr[I0e]+"\\s*("+iEr+")$|^$";var aEr=pa++;nr[aEr]="^"+nr[I0e]+"\\s*("+yCi+")$|^$";var Lee=pa++;nr[Lee]="(\\s*)"+nr[I0e]+"\\s*("+iEr+"|"+nr[Bee]+")";dOe[Lee]=new RegExp(nr[Lee],"g");wu[Lee]=new RegExp(gmt(nr[Lee]),"g");var lCa="$1$2$3",ICi=pa++;nr[ICi]="^\\s*("+nr[Bee]+")\\s+-\\s+("+nr[Bee]+")\\s*$";var xCi=pa++;nr[xCi]="^\\s*("+nr[b0e]+")\\s+-\\s+("+nr[b0e]+")\\s*$";var wCi=pa++;nr[wCi]="(<|>)?=?\\s*\\*";for(v4=0;v4uOe)return null;var r=e.loose?wu[oEr]:wu[nEr];if(!r.test(t))return null;try{return new Na(t,e)}catch{return null}}a(Fee,"parse");Eo.valid=uCa;function uCa(t,e){var r=Fee(t,e);return r?r.version:null}a(uCa,"valid");Eo.clean=dCa;function dCa(t,e){var r=Fee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(dCa,"clean");Eo.SemVer=Na;function Na(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Na){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>uOe)throw new TypeError("version is longer than "+uOe+" characters");if(!(this instanceof Na))return new Na(t,e);cl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?wu[oEr]:wu[nEr]);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>umt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>umt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>umt||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=fCa;function fCa(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Na(t,r).inc(e,n).version}catch{return null}}a(fCa,"inc");Eo.diff=pCa;function pCa(t,e){if(cEr(t,e))return null;var r=Fee(t),n=Fee(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(pCa,"diff");Eo.compareIdentifiers=C0e;var mCi=/^[0-9]+$/;function C0e(t,e){var r=mCi.test(t),n=mCi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(fOe,"gt");Eo.lt=pmt;function pmt(t,e,r){return x8(t,e,r)<0}a(pmt,"lt");Eo.eq=cEr;function cEr(t,e,r){return x8(t,e,r)===0}a(cEr,"eq");Eo.neq=RCi;function RCi(t,e,r){return x8(t,e,r)!==0}a(RCi,"neq");Eo.gte=lEr;function lEr(t,e,r){return x8(t,e,r)>=0}a(lEr,"gte");Eo.lte=uEr;function uEr(t,e,r){return x8(t,e,r)<=0}a(uEr,"lte");Eo.cmp=hmt;function hmt(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 cEr(t,r,n);case"!=":return RCi(t,r,n);case">":return fOe(t,r,n);case">=":return lEr(t,r,n);case"<":return pmt(t,r,n);case"<=":return uEr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(hmt,"cmp");Eo.Comparator=gR;function gR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof gR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof gR))return new gR(t,e);t=t.trim().split(/\s+/).join(" "),cl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===hOe?this.value="":this.value=this.operator+this.semver.version,cl("comp",this)}a(gR,"Comparator");var hOe={};gR.prototype.parse=function(t){var e=this.options.loose?wu[sEr]:wu[aEr],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new Na(r[2],this.options.loose):this.semver=hOe};gR.prototype.toString=function(){return this.value};gR.prototype.test=function(t){return cl("Comparator.test",t,this.options.loose),this.semver===hOe?!0:(typeof t=="string"&&(t=new Na(t,this.options)),hmt(t,this.operator,this.semver,this.options))};gR.prototype.intersects=function(t,e){if(!(t instanceof gR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new xf(t.value,e),mmt(this.value,r,e);if(t.operator==="")return r=new xf(this.value,e),mmt(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=hmt(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=hmt(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=xf;function xf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof xf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new xf(t.raw,e);if(t instanceof gR)return new xf(t.value,e);if(!(this instanceof xf))return new xf(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(xf,"Range");xf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};xf.prototype.toString=function(){return this.range};xf.prototype.parseRange=function(t){var e=this.options.loose,r=e?wu[xCi]:wu[ICi];t=t.replace(r,kCa),cl("hyphen replace",t),t=t.replace(wu[Lee],lCa),cl("comparator trim",t,wu[Lee]),t=t.replace(wu[S0e],aCa),t=t.replace(wu[T0e],cCa);var n=e?wu[sEr]:wu[aEr],o=t.split(" ").map(function(s){return bCa(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 gR(s,this.options)},this),o};xf.prototype.intersects=function(t,e){if(!(t instanceof xf))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=CCa;function CCa(t,e){return new xf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(CCa,"toComparators");function bCa(t,e){return cl("comp",t,e),t=ICa(t,e),cl("caret",t),t=SCa(t,e),cl("tildes",t),t=wCa(t,e),cl("xrange",t),t=PCa(t,e),cl("stars",t),t}a(bCa,"parseComparator");function mv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(mv,"isX");function SCa(t,e){return t.trim().split(/\s+/).map(function(r){return TCa(r,e)}).join(" ")}a(SCa,"replaceTildes");function TCa(t,e){var r=e.loose?wu[bCi]:wu[CCi];return t.replace(r,function(n,o,s,c,l){cl("tilde",t,n,o,s,c,l);var u;return mv(o)?u="":mv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":mv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(cl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",cl("tilde return",u),u})}a(TCa,"replaceTilde");function ICa(t,e){return t.trim().split(/\s+/).map(function(r){return xCa(r,e)}).join(" ")}a(ICa,"replaceCarets");function xCa(t,e){cl("caret",t,e);var r=e.loose?wu[TCi]:wu[SCi];return t.replace(r,function(n,o,s,c,l){cl("caret",t,n,o,s,c,l);var u;return mv(o)?u="":mv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":mv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(cl("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(cl("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),cl("caret return",u),u})}a(xCa,"replaceCaret");function wCa(t,e){return cl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return RCa(r,e)}).join(" ")}a(wCa,"replaceXRanges");function RCa(t,e){t=t.trim();var r=e.loose?wu[_Ci]:wu[ECi];return t.replace(r,function(n,o,s,c,l,u){cl("xRange",t,n,o,s,c,l,u);var d=mv(s),f=d||mv(c),h=f||mv(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),cl("xRange return",n),n})}a(RCa,"replaceXRange");function PCa(t,e){return cl("replaceStars",t,e),t.trim().replace(wu[wCi],"")}a(PCa,"replaceStars");function kCa(t,e,r,n,o,s,c,l,u,d,f,h,m){return mv(r)?e="":mv(n)?e=">="+r+".0.0":mv(o)?e=">="+r+"."+n+".0":e=">="+e,mv(u)?l="":mv(d)?l="<"+(+u+1)+".0.0":mv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(kCa,"hyphenReplace");xf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Na(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(DCa,"testSet");Eo.satisfies=mmt;function mmt(t,e,r){try{e=new xf(e,r)}catch{return!1}return e.test(t)}a(mmt,"satisfies");Eo.maxSatisfying=NCa;function NCa(t,e,r){var n=null,o=null;try{var s=new xf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Na(n,r))}),n}a(NCa,"maxSatisfying");Eo.minSatisfying=MCa;function MCa(t,e,r){var n=null,o=null;try{var s=new xf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Na(n,r))}),n}a(MCa,"minSatisfying");Eo.minVersion=OCa;function OCa(t,e){t=new xf(t,e);var r=new Na("0.0.0");if(t.test(r)||(r=new Na("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||fOe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(OCa,"minVersion");Eo.validRange=BCa;function BCa(t,e){try{return new xf(t,e).range||"*"}catch{return null}}a(BCa,"validRange");Eo.ltr=LCa;function LCa(t,e,r){return dEr(t,e,"<",r)}a(LCa,"ltr");Eo.gtr=FCa;function FCa(t,e,r){return dEr(t,e,">",r)}a(FCa,"gtr");Eo.outside=dEr;function dEr(t,e,r,n){t=new Na(t,n),e=new xf(e,n);var o,s,c,l,u;switch(r){case">":o=fOe,s=uEr,c=pmt,l=">",u=">=";break;case"<":o=pmt,s=lEr,c=fOe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(mmt(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(dEr,"outside");Eo.prerelease=UCa;function UCa(t,e){var r=Fee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(UCa,"prerelease");Eo.intersects=QCa;function QCa(t,e,r){return t=new xf(t,r),e=new xf(e,r),t.intersects(e)}a(QCa,"intersects");Eo.coerce=qCa;function qCa(t){if(t instanceof Na)return t;if(typeof t!="string")return null;var e=t.match(wu[vCi]);return e==null?null:Fee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(qCa,"coerce")});var MCi=I((Pmp,NCi)=>{p();var jCa=Kme().wrap,pEr=1,hEr=2,mEr=4,_mt=8,Wl=[],HCa=0,wE=!1,cG=[],x0e,gEr;function AEr(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(Wl=cG.pop()),w0e=void 0,n&&!wE},"asyncCatcher"),gEr=a(function(e,r,n){var o=[];wE=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);wE=!1;var d=e.apply(this,arguments);for(wE=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return wE=!1,Wl=cG.pop(),w0e=void 0,d}},"asyncWrap"),jCa(process,"_fatalException",function(t){return a(function(r){return x0e(r)||t(r)},"_asyncFatalException")})):(fEr=!1,x0e=a(function(e){if(fEr)throw e;for(var r=!1,n=Wl.length,o=0;o0&&r[f].before(this,o[r[f].uid]);wE=!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]);wE=!1}Wl=cG.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",x0e));var Emt,w0e,fEr;function GCa(t,e,r){wE=!0;for(var n=0;n0)return gEr(t,r,e);return GCa(t,r,e)}a($Ca,"wrapCallback");function C4(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=pEr),typeof t.before=="function"&&(this.before=t.before,this.flags|=hEr),typeof t.after=="function"&&(this.after=t.after,this.flags|=mEr),typeof t.error=="function"&&(this.error=t.error,this.flags|=_mt),this.uid=++HCa,this.data=e===void 0?null:e}a(C4,"AsyncListener");C4.prototype.create=void 0;C4.prototype.before=void 0;C4.prototype.after=void 0;C4.prototype.error=void 0;C4.prototype.data=void 0;C4.prototype.uid=0;C4.prototype.flags=0;function DCi(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof C4?t:new C4(t,e)}a(DCi,"createAsyncListener");function VCa(t,e){var r;t instanceof C4?r=t:r=DCi(t,e);for(var n=!1,o=0;o{"use strict";p();OCi.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 HCi=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var QCi=Kme(),Cmt=kCi(),Lb=QCi.wrap,lG=QCi.massWrap,wf=MCi(),zCa=require("util"),YCa=Cmt.gte(process.version,"6.0.0"),_Er=Cmt.gte(process.version,"7.0.0"),KCa=Cmt.gte(process.version,"8.0.0"),JCa=Cmt.gte(process.version,"11.0.0"),b4=require("net");_Er&&!b4._normalizeArgs?b4._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:rba(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]}:!_Er&&!b4._normalizeConnectArgs&&(b4._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 b4.Server.prototype?Lb(b4.Server.prototype,"_setUpListenHandle",LCi):Lb(b4.Server.prototype,"_listen2",LCi);function LCi(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=wf(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=wf(this._handle.onconnection))}}}a(LCi,"wrapSetUpListenHandle");function qCi(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=wf(e._originalOnread)}}a(qCi,"patchOnRead");Lb(b4.Socket.prototype,"connect",function(t){return function(){var e;KCa&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=_Er?b4._normalizeArgs(arguments):b4._normalizeConnectArgs(arguments),e[1]&&(e[1]=wf(e[1]));var r=t.apply(this,e);return qCi(this),r}});var ZCa=require("http");Lb(ZCa.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=wf(function(n){return qCi(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var yEr=require("child_process");function FCi(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=wf(e._handle.onread),Lb(e._handle,"close",bmt))}),t._handle&&(t._handle.onexit=wf(t._handle.onexit))}a(FCi,"wrapChildProcess");yEr.ChildProcess?Lb(yEr.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return FCi(this),e}}):lG(yEr,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return FCi(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var bEr=[];process._nextDomainTick&&bEr.push("_nextDomainTick");process._tickDomainCallback&&bEr.push("_tickDomainCallback");lG(process,bEr,S4);Lb(process,"nextTick",bmt);var SEr=["setTimeout","setInterval"];global.setImmediate&&SEr.push("setImmediate");var jCi=require("timers"),XCa=global.setTimeout===jCi.setTimeout;lG(jCi,SEr,bmt);XCa&&lG(global,SEr,bmt);var vEr=require("dns");lG(vEr,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],S4);vEr.resolveNaptr&&Lb(vEr,"resolveNaptr",S4);var Qee=require("fs");lG(Qee,["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"],S4);Qee.lchown&&Lb(Qee,"lchown",S4);Qee.lchmod&&Lb(Qee,"lchmod",S4);Qee.ftruncate&&Lb(Qee,"ftruncate",S4);var mOe;try{mOe=require("zlib")}catch{}mOe&&mOe.Deflate&&mOe.Deflate.prototype&&(Uee=Object.getPrototypeOf(mOe.Deflate.prototype),Uee._transform?Lb(Uee,"_transform",S4):Uee.write&&Uee.flush&&Uee.end&&lG(Uee,["write","flush","end"],S4));var Uee,CEr;try{CEr=require("crypto")}catch{}CEr&&(EEr=["pbkdf2","randomBytes"],JCa||EEr.push("pseudoRandomBytes"),lG(CEr,EEr,S4));var EEr,vmt=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";vmt&&(UCi=process.addAsyncListener({create:a(function(){vmt=!1},"create")}),global.Promise.resolve(!0).then(a(function(){vmt=!1},"notSync")),process.removeAsyncListener(UCi));var UCi;vmt&&eba();function eba(){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"),zCa.inherits(e,t),Lb(t.prototype,"then",s),t.prototype.chain&&Lb(t.prototype,"chain",s),YCa)global.Promise=BCi()(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=wf(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:wf(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(eba,"wrapPromise");function S4(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(tba,"toNumber");function rba(t){return typeof t=="string"&&tba(t)===!1}a(rba,"isPipeName")});var zCi=I((qmp,WCi)=>{"use strict";p();var w8=require("assert"),nba=smt(),gOe="cls@contexts",TEr="error@context";process.addAsyncListener||HCi();function tD(t){this.name=t,this.active=null,this._set=[],this.id=null}a(tD,"Namespace");tD.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};tD.prototype.get=function(t){if(this.active)return this.active[t]};tD.prototype.createContext=function(){return Object.create(this.active)};tD.prototype.run=function(t){var e=this.createContext();this.enter(e);try{return t(e),e}catch(r){throw r&&(r[TEr]=e),r}finally{this.exit(e)}};tD.prototype.runAndReturn=function(t){var e;return this.run(function(r){e=t(r)}),e};tD.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[TEr]=e),n}finally{r.exit(e)}}};tD.prototype.enter=function(t){w8.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};tD.prototype.exit=function(t){if(w8.ok(t,"context must be provided for exiting"),this.active===t){w8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);w8.ok(e>=0,"context not currently entered; can't exit"),w8.ok(e,"can't remove top context"),this._set.splice(e,1)};tD.prototype.bindEmitter=function(t){w8.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[gOe]||(s[gOe]=Object.create(null)),s[gOe][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[gOe]))return s;var c=s,l=s[gOe];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),nba(t,n,o)};tD.prototype.fromException=function(t){return t[TEr]};function GCi(t){return process.namespaces[t]}a(GCi,"get");function iba(t){w8.ok(t,"namespace must be given a name!");var e=new tD(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(iba,"create");function $Ci(t){var e=GCi(t);w8.ok(e,"can't delete nonexistent namespace!"),w8.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a($Ci,"destroy");function VCi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){$Ci(t)}),process.namespaces=Object.create(null)}a(VCi,"reset");process.namespaces||VCi();WCi.exports={getNamespace:GCi,createNamespace:iba,destroyNamespace:$Ci,reset:VCi}});var dG=I(T4=>{"use strict";p();var oba=T4&&T4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sba=T4&&T4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aba=T4&&T4.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&oba(e,t,r);return sba(e,t),e};Object.defineProperty(T4,"__esModule",{value:!0});T4.CorrelationContextManager=void 0;var uG=Vl(),cba=aba(Ght()),qee=$ht(),IEr=KAr(),YCi=gyr(),R0e=ey(),lba=(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 uba(o)}:null},t.spanToContextObject=function(e,r,n){var o=new qee;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=qee.formatOpenTelemetryTraceFlags(e.traceFlags)||qee.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){uG.warn("Error binding to session context",R0e.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){uG.warn("Error binding to session context",R0e.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){uG.warn("Error binding to session context",R0e.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=hCi():this.cls=zCi());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){uG.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",R0e.dumpObj(r)),this.enabled=!1;return}cba.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){uG.warn("Error binding to session context",R0e.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 qee(f.headers.traceparent):f.headers["request-id"]&&(u=new qee(null,f.headers["request-id"])),f.headers.tracestate&&(d=new IEr(f.headers.tracestate)))}u||(u=new qee(n.traceParent||n.traceparent)),d||(d=new IEr(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new YCi(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 qee(c.traceparent?c.traceparent.toString():null),d=new IEr(c.tracestate?c.tracestate.toString():null),m=new YCi(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return uG.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){uG.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",R0e.dumpObj(e)),this.enabled=!1;return}}},t.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},t.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},t.canUseClsHooked=function(){var e=process.versions.node.split("."),r=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,o=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(r&&n)&&o},t.enabled=!1,t.hasEverEnabled=!1,t.forceClsHooked=void 0,t.CONTEXT_NAME="ApplicationInsights-Context",t})();T4.CorrelationContextManager=lba;var uba=(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=c1a;var l1a=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=l1a});var NEr=I((w0p,mbi)=>{"use strict";p();var hbi=fd(),u1a=(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||hbi.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||hbi.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})();mbi.exports=u1a});var gbi={};Ri(gbi,{webSnippet:()=>d1a});var d1a,Abi=_e(()=>{p();d1a=`!function(T,l,y){var S=T.location,k="script",D="instrumentationKey",C="ingestionendpoint",I="disableExceptionTracking",E="ai.device.",b="toLowerCase",w="crossOrigin",N="POST",e="appInsightsSDK",t=y.name||"appInsights";(y.name||T[e])&&(T[e]=t);var n=T[t]||function(d){var g=!1,f=!1,m={initialize:!0,queue:[],sv:"5",version:2,config:d};function v(e,t){var n={},a="Browser";return n[E+"id"]=a[b](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(m.sv||m.version),{time:function(){var e=new Date;function t(e){var t=""+e;return 1===t.length&&(t="0"+t),t}return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}(),iKey:e,name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}}}var h=d.url||y.src;if(h){function a(e){var t,n,a,i,r,o,s,c,u,p,l;g=!0,m.queue=[],f||(f=!0,t=h,s=function(){var e={},t=d.connectionString;if(t)for(var n=t.split(";"),a=0;ae.trim()).join(" ")};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. +`+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();var ybi=require("http"),Ebi=require("https"),N0e=require("zlib"),I4=Vl(),yR=pbi(),_bi=DEr(),yOe=fd(),vbi=NEr(),f1a=(Abi(),_a(gbi)),p1a=(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=yOe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=yOe.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(yOe.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(yOe.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=vbi.parse(e),o=n.instrumentationkey||"";vbi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,I4.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){I4.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=_bi.getOsPrefix(),n=_bi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r +}});`});var pbi=I((vgp,fbi)=>{"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 `).concat(e,` disableIkeyDeprecationMessage: true,\r - sdkExtension: "`).concat(n).concat(r,"d_n_"),s=f1a.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(yOe.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=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 `),r+=c;break;default:c=" ".concat(o,": ").concat(s,`,\r -`),r+=c;break}}})}catch{this._isEnabled=!1,I4.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=ybi.createServer,r=Ebi.createServer,n=this._isEnabled;ybi.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=yR.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){I4.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=yR.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){I4.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},Ebi.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=yR.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){I4.warn("Inject snippet error: "+b)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var E=yR.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){I4.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=yR.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){I4.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=yR.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=yR.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){I4.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 yR.contentEncodingMethod.GZIP:var o=N0e.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=N0e.gzipSync(s)}break;case yR.contentEncodingMethod.DEFLATE:var c=N0e.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=N0e.deflateSync(l)}break;case yR.contentEncodingMethod.BR:var u=yR.getBrotliDecompressSync(N0e),d=yR.getBrotliCompressSync(N0e);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){I4.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();Cbi.exports=p1a});var Tbi=I((OEr,Sbi)=>{"use strict";p();var h1a=OEr&&OEr.__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)}})(),ER=require("url"),MEr=xE(),m1a=ey(),g1a=l0e(),A1a=fyr(),y1a=kee(),E1a=(function(t){h1a(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=m1a.getCorrelationContextTarget(r,g1a.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=MEr.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new ER.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=MEr.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==y1a.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=MEr.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 ER.URL(r)}catch{}else try{var o=new ER.URL("http://"+r);o.port==="443"?r=new ER.URL("https://"+r):r=new ER.URL("http://"+r)}catch{}else{if(r&&typeof ER.URL=="function"&&r instanceof ER.URL)return ER.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 ER.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 ER.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 ER.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",ER.format(r)},e})(A1a);Sbi.exports=E1a});var Ibi=I(M0e=>{"use strict";p();var Fmt=M0e&&M0e.__assign||function(){return Fmt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var S1a=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]})),T1a=k8&&k8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),I1a=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)&&S1a(e,t,r);return T1a(e,t),e};Object.defineProperty(k8,"__esModule",{value:!0});k8.spanToTelemetryContract=N1a;var xbi=require("url"),rD=(lo(),_a(F5)),gs=(_ht(),_a(CAr)),P8=I1a(fd()),x1a=Ibi(),w1a=ey();function R1a(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=w1a.stringify(s)),e}a(R1a,"createPropertiesFromSpan");function P1a(t){return t===gs.DbSystemValues.DB2||t===gs.DbSystemValues.DERBY||t===gs.DbSystemValues.MARIADB||t===gs.DbSystemValues.MSSQL||t===gs.DbSystemValues.ORACLE||t===gs.DbSystemValues.SQLITE||t===gs.DbSystemValues.OTHER_SQL||t===gs.DbSystemValues.HSQLDB||t===gs.DbSystemValues.H2}a(P1a,"isSqlDB");function wbi(t){var e=t.attributes[gs.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[gs.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[gs.SemanticAttributes.HTTP_SCHEME],o=t.attributes[gs.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[gs.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[gs.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[gs.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[gs.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(wbi,"getUrl");function LEr(t){var e=t.attributes[gs.SemanticAttributes.PEER_SERVICE],r=t.attributes[gs.SemanticAttributes.HTTP_HOST],n=t.attributes[gs.SemanticAttributes.HTTP_URL],o=t.attributes[gs.SemanticAttributes.NET_PEER_NAME],s=t.attributes[gs.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(LEr,"getDependencyTarget");function k1a(t){var e={name:t.name,success:t.status.code!=rD.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===rD.SpanKind.PRODUCER&&(e.dependencyTypeName=P8.DependencyTypeName.QueueMessage),t.kind===rD.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=P8.DependencyTypeName.InProc);var r=t.attributes[gs.SemanticAttributes.HTTP_METHOD],n=t.attributes[gs.SemanticAttributes.DB_SYSTEM],o=t.attributes[gs.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=P8.DependencyTypeName.Http;var s=t.attributes[gs.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new xbi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=wbi(t);var u=t.attributes[gs.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=LEr(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)===gs.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===gs.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===gs.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===gs.DbSystemValues.REDIS?e.dependencyTypeName="redis":P1a(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[gs.SemanticAttributes.DB_STATEMENT],y=t.attributes[gs.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=LEr(t),E=t.attributes[gs.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=P8.DependencyTypeName.Grpc;var _=t.attributes[gs.SemanticAttributes.RPC_GRPC_STATUS_CODE];_&&(e.resultCode=String(_));var d=LEr(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(k1a,"createDependencyData");function D1a(t){var e={name:t.name,success:t.status.code!=rD.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[gs.SemanticAttributes.HTTP_METHOD],n=t.attributes[gs.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==rD.SpanKind.SERVER){var o=t.attributes[gs.SemanticAttributes.HTTP_ROUTE],s=t.attributes[gs.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new xbi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=wbi(t);var l=t.attributes[gs.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(D1a,"createRequestData");function N1a(t){var e;switch(t.kind){case rD.SpanKind.CLIENT:case rD.SpanKind.PRODUCER:case rD.SpanKind.INTERNAL:e=k1a(t);break;case rD.SpanKind.SERVER:case rD.SpanKind.CONSUMER:e=D1a(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=R1a(t),t.attributes[P8.AzNamespace]&&(t.kind===rD.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat(P8.DependencyTypeName.InProc," | ").concat(t.attributes[P8.AzNamespace])),t.attributes[P8.AzNamespace]===P8.MicrosoftEventHub&&(0,x1a.parseEventHubSpan)(t,e)),e}a(N1a,"spanToTelemetryContract")});var kbi=I(gG=>{"use strict";p();var O0e=gG&&gG.__assign||function(){return O0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var O1a=jT&&jT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B1a=jT&&jT.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),L1a=jT&&jT.__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)&&O1a(e,t,r);return B1a(e,t),e};Object.defineProperty(jT,"__esModule",{value:!0});jT.subscriber=void 0;jT.enable=j1a;var _Oe=(lo(),_a(F5)),F1a=fd(),FEr=Ap(),U1a=L1a(Rbi()),Q1a=kbi(),Gee=[],q1a=a(function(t){try{var e=t.data,r=U1a.spanToTelemetryContract(e);Q1a.AsyncScopeManager.with(e,function(){Gee.forEach(function(n){e.kind===_Oe.SpanKind.SERVER||e.kind===_Oe.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===_Oe.SpanKind.CLIENT||e.kind===_Oe.SpanKind.INTERNAL||e.kind===_Oe.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");jT.subscriber=q1a;function j1a(t,e){if(t){var r=Gee.find(function(n){return n==e});if(r)return;Gee.length===0&&FEr.channel.subscribe("azure-coretracing",jT.subscriber,FEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(F1a.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),Gee.push(e)}else Gee=Gee.filter(function(n){return n!=e}),Gee.length===0&&FEr.channel.unsubscribe("azure-coretracing",jT.subscriber)}a(j1a,"enable")});var Nbi=I(Vee=>{"use strict";p();Object.defineProperty(Vee,"__esModule",{value:!0});Vee.subscriber=void 0;Vee.enable=$1a;var H1a=fd(),UEr=Ap(),$ee=[],G1a=a(function(t){t.data.event.commandName!=="ismaster"&&$ee.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");Vee.subscriber=G1a;function $1a(t,e){if(t){var r=$ee.find(function(n){return n==e});if(r)return;$ee.length===0&&UEr.channel.subscribe("mongodb",Vee.subscriber,UEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(H1a.StatsbeatInstrumentation.MONGODB)}),$ee.push(e)}else $ee=$ee.filter(function(n){return n!=e}),$ee.length===0&&UEr.channel.unsubscribe("mongodb",Vee.subscriber)}a($1a,"enable")});var Mbi=I(zee=>{"use strict";p();Object.defineProperty(zee,"__esModule",{value:!0});zee.subscriber=void 0;zee.enable=z1a;var V1a=fd(),QEr=Ap(),Wee=[],W1a=a(function(t){Wee.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");zee.subscriber=W1a;function z1a(t,e){if(t){var r=Wee.find(function(n){return n==e});if(r)return;Wee.length===0&&QEr.channel.subscribe("mysql",zee.subscriber,QEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(V1a.StatsbeatInstrumentation.MYSQL)}),Wee.push(e)}else Wee=Wee.filter(function(n){return n!=e}),Wee.length===0&&QEr.channel.unsubscribe("mysql",zee.subscriber)}a(z1a,"enable")});var Obi=I(Kee=>{"use strict";p();Object.defineProperty(Kee,"__esModule",{value:!0});Kee.subscriber=void 0;Kee.enable=J1a;var Y1a=fd(),qEr=Ap(),Yee=[],K1a=a(function(t){Yee.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");Kee.subscriber=K1a;function J1a(t,e){if(t){var r=Yee.find(function(n){return n==e});if(r)return;Yee.length===0&&qEr.channel.subscribe("redis",Kee.subscriber,qEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(Y1a.StatsbeatInstrumentation.REDIS)}),Yee.push(e)}else Yee=Yee.filter(function(n){return n!=e}),Yee.length===0&&qEr.channel.unsubscribe("redis",Kee.subscriber)}a(J1a,"enable")});var Bbi=I(Zee=>{"use strict";p();Object.defineProperty(Zee,"__esModule",{value:!0});Zee.subscriber=void 0;Zee.enable=eSa;var Z1a=fd(),jEr=Ap(),Jee=[],X1a=a(function(t){Jee.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");Zee.subscriber=X1a;function eSa(t,e){if(t){var r=Jee.find(function(n){return n==e});if(r)return;Jee.length===0&&jEr.channel.subscribe("postgres",Zee.subscriber,jEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(Z1a.StatsbeatInstrumentation.POSTGRES)}),Jee.push(e)}else Jee=Jee.filter(function(n){return n!=e}),Jee.length===0&&jEr.channel.unsubscribe("postgres",Zee.subscriber)}a(eSa,"enable")});var F0e=I((D8,Lbi)=>{"use strict";p();var tSa=D8&&D8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rSa=D8&&D8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),nSa=D8&&D8.__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)&&tSa(e,t,r);return rSa(e,t),e},Umt=D8&&D8.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var Fbi=require("http"),Ubi=require("https"),Qbi=Vl(),qbi=ey(),aSa=l0e(),GEr=gyr(),N8=dG(),cSa=Dmt(),lSa=(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||cSa.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?N8.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&N8.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 N8.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 GEr(e),c=this._generateCorrelationContext(s);N8.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){N8.CorrelationContextManager.wrapEmitter(c),N8.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=Fbi.createServer;Fbi.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=Ubi.createServer;Ubi.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){Qbi.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=N8.CorrelationContextManager.getCurrentContext(),o=new GEr(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){Qbi.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=N8.CorrelationContextManager.getCurrentContext(),s=n||new GEr(r.request,o&&o.operation.parentId);qbi.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(aSa.requestContextHeader);qbi.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,N8.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();jbi.exports=lSa});var $bi=I((WEr,Gbi)=>{"use strict";p();var _R=WEr&&WEr.__assign||function(){return _R=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:fSa,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 Xee.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case Xee.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case Xee.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case Xee.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case Xee.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=_R(_R({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=_R(_R({},r),{Message:e.data.baseData.message,SeverityLevel:Xee.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=_R(_R({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=_R(_R({},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=_R(_R({},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=Hbi.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=Hbi.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):dSa.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 Xee.ContextTagKeys,t})();Gbi.exports=pSa});var Wbi=I((hgp,Vbi)=>{"use strict";p();var hSa=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");Vbi.exports={getTransmissionTime:hSa}});var Jbi=I((bOe,Kbi)=>{"use strict";p();var zbi=bOe&&bOe.__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())})},Ybi=bOe&&bOe.__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=vR.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[vR.time]=ASa.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:",zEr.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=YEr.tlsRestrictedAgent,h=mSa.request(l,function(E){if(E.statusCode==200){var _=E.headers[vR.subscribed]==="true",v=null;try{v=E.headers[vR.endpointRedirect]?new ySa.URL(E.headers[vR.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+YEr.dumpObj(T))}var b=E.headers[vR.pollingIntervalHint]?parseInt(E.headers[vR.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:"),zEr.warn(t.TAG,r,e)):zEr.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();Kbi.exports=ESa});var n1i=I((SOe,r1i)=>{"use strict";p();var Zbi=SOe&&SOe.__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())})},Xbi=SOe&&SOe.__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 Zbi(this,void 0,void 0,function(){return Xbi(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&&(e1i.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,e1i.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})();r1i.exports=CSa});var o1i=I(U0e=>{"use strict";p();var jmt=U0e&&U0e.__assign||function(){return jmt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var s1i=yG&&yG.__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())})},a1i=yG&&yG.__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 wSa=kee(),l1i=NEr(),RSa=Vl(),u1i=fd(),PSa=require("url"),kSa=npt(),DSa=(function(){function t(e){this._endpointBase=u1i.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=l1i.parse(e),o=l1i.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]||u1i.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new PSa.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=wSa.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)||RSa.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=kSa.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})();d1i.exports=DSa});var t_r=I(e_r=>{"use strict";p();Object.defineProperty(e_r,"__esModule",{value:!0});e_r.createEmptyPipeline=NSa;var f1i=new Set(["Deserialize","Serialize","Retry","Sign"]),XEr=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&&!f1i.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!f1i.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 NSa(){return XEr.create()}a(NSa,"createEmptyPipeline")});var ete=I(Gmt=>{"use strict";p();Object.defineProperty(Gmt,"__esModule",{value:!0});Gmt.logger=void 0;var MSa=cht();Gmt.logger=(0,MSa.createClientLogger)("core-rest-pipeline")});var n_r=I(r_r=>{"use strict";p();Object.defineProperty(r_r,"__esModule",{value:!0});r_r.getRandomIntegerInclusive=OSa;function OSa(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(OSa,"getRandomIntegerInclusive")});var p1i=I(i_r=>{"use strict";p();Object.defineProperty(i_r,"__esModule",{value:!0});i_r.calculateRetryDelay=LSa;var BSa=n_r();function LSa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,BSa.getRandomIntegerInclusive)(0,n/2)}}a(LSa,"calculateRetryDelay")});var $mt=I(o_r=>{"use strict";p();Object.defineProperty(o_r,"__esModule",{value:!0});o_r.isObject=FSa;function FSa(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(FSa,"isObject")});var h1i=I(s_r=>{"use strict";p();Object.defineProperty(s_r,"__esModule",{value:!0});s_r.isError=QSa;var USa=$mt();function QSa(t){if((0,USa.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(QSa,"isError")});var g1i=I(Vmt=>{"use strict";p();Object.defineProperty(Vmt,"__esModule",{value:!0});Vmt.computeSha256Hmac=qSa;Vmt.computeSha256Hash=jSa;var m1i=require("node:crypto");async function qSa(t,e,r){let n=Buffer.from(t,"base64");return(0,m1i.createHmac)("sha256",n).update(e).digest(r)}a(qSa,"computeSha256Hmac");async function jSa(t,e){return(0,m1i.createHash)("sha256").update(t).digest(e)}a(jSa,"computeSha256Hash")});var A1i=I(c_r=>{"use strict";p();var a_r;Object.defineProperty(c_r,"__esModule",{value:!0});c_r.randomUUID=$Sa;var HSa=require("node:crypto"),GSa=typeof((a_r=globalThis?.crypto)===null||a_r===void 0?void 0:a_r.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):HSa.randomUUID;function $Sa(){return GSa()}a($Sa,"randomUUID")});var y1i=I(A0=>{"use strict";p();var l_r,u_r,d_r,f_r;Object.defineProperty(A0,"__esModule",{value:!0});A0.isReactNative=A0.isNodeRuntime=A0.isNodeLike=A0.isBun=A0.isDeno=A0.isWebWorker=A0.isBrowser=void 0;A0.isBrowser=typeof window<"u"&&typeof window.document<"u";A0.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((l_r=self.constructor)===null||l_r===void 0?void 0:l_r.name)==="DedicatedWorkerGlobalScope"||((u_r=self.constructor)===null||u_r===void 0?void 0:u_r.name)==="ServiceWorkerGlobalScope"||((d_r=self.constructor)===null||d_r===void 0?void 0:d_r.name)==="SharedWorkerGlobalScope");A0.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";A0.isBun=typeof Bun<"u"&&typeof Bun.version<"u";A0.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((f_r=globalThis.process.versions)===null||f_r===void 0)&&f_r.node);A0.isNodeRuntime=A0.isNodeLike&&!A0.isBun&&!A0.isDeno;A0.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var E1i=I(Wmt=>{"use strict";p();Object.defineProperty(Wmt,"__esModule",{value:!0});Wmt.uint8ArrayToString=VSa;Wmt.stringToUint8Array=WSa;function VSa(t,e){return Buffer.from(t).toString(e)}a(VSa,"uint8ArrayToString");function WSa(t,e){return Buffer.from(t,e)}a(WSa,"stringToUint8Array")});var _1i=I(zmt=>{"use strict";p();Object.defineProperty(zmt,"__esModule",{value:!0});zmt.Sanitizer=void 0;var zSa=$mt(),p_r="REDACTED",YSa=["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"],KSa=["api-version"],h_r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=YSa.concat(e),r=KSa.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,zSa.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,p_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]=p_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]=p_r;return r}};zmt.Sanitizer=h_r});var Ymt=I(ha=>{"use strict";p();Object.defineProperty(ha,"__esModule",{value:!0});ha.Sanitizer=ha.uint8ArrayToString=ha.stringToUint8Array=ha.isWebWorker=ha.isReactNative=ha.isDeno=ha.isNodeRuntime=ha.isNodeLike=ha.isBun=ha.isBrowser=ha.randomUUID=ha.computeSha256Hmac=ha.computeSha256Hash=ha.isError=ha.isObject=ha.getRandomIntegerInclusive=ha.calculateRetryDelay=void 0;var JSa=p1i();Object.defineProperty(ha,"calculateRetryDelay",{enumerable:!0,get:a(function(){return JSa.calculateRetryDelay},"get")});var ZSa=n_r();Object.defineProperty(ha,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return ZSa.getRandomIntegerInclusive},"get")});var XSa=$mt();Object.defineProperty(ha,"isObject",{enumerable:!0,get:a(function(){return XSa.isObject},"get")});var eTa=h1i();Object.defineProperty(ha,"isError",{enumerable:!0,get:a(function(){return eTa.isError},"get")});var v1i=g1i();Object.defineProperty(ha,"computeSha256Hash",{enumerable:!0,get:a(function(){return v1i.computeSha256Hash},"get")});Object.defineProperty(ha,"computeSha256Hmac",{enumerable:!0,get:a(function(){return v1i.computeSha256Hmac},"get")});var tTa=A1i();Object.defineProperty(ha,"randomUUID",{enumerable:!0,get:a(function(){return tTa.randomUUID},"get")});var tte=y1i();Object.defineProperty(ha,"isBrowser",{enumerable:!0,get:a(function(){return tte.isBrowser},"get")});Object.defineProperty(ha,"isBun",{enumerable:!0,get:a(function(){return tte.isBun},"get")});Object.defineProperty(ha,"isNodeLike",{enumerable:!0,get:a(function(){return tte.isNodeLike},"get")});Object.defineProperty(ha,"isNodeRuntime",{enumerable:!0,get:a(function(){return tte.isNodeRuntime},"get")});Object.defineProperty(ha,"isDeno",{enumerable:!0,get:a(function(){return tte.isDeno},"get")});Object.defineProperty(ha,"isReactNative",{enumerable:!0,get:a(function(){return tte.isReactNative},"get")});Object.defineProperty(ha,"isWebWorker",{enumerable:!0,get:a(function(){return tte.isWebWorker},"get")});var C1i=E1i();Object.defineProperty(ha,"stringToUint8Array",{enumerable:!0,get:a(function(){return C1i.stringToUint8Array},"get")});Object.defineProperty(ha,"uint8ArrayToString",{enumerable:!0,get:a(function(){return C1i.uint8ArrayToString},"get")});var rTa=_1i();Object.defineProperty(ha,"Sanitizer",{enumerable:!0,get:a(function(){return rTa.Sanitizer},"get")})});var b1i=I(m_r=>{"use strict";p();Object.defineProperty(m_r,"__esModule",{value:!0});m_r.cancelablePromiseRace=nTa;async function nTa(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(nTa,"cancelablePromiseRace")});var S1i=I(Kmt=>{"use strict";p();Object.defineProperty(Kmt,"__esModule",{value:!0});Kmt.AbortError=void 0;var g_r=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};Kmt.AbortError=g_r});var IOe=I(Jmt=>{"use strict";p();Object.defineProperty(Jmt,"__esModule",{value:!0});Jmt.AbortError=void 0;var iTa=S1i();Object.defineProperty(Jmt,"AbortError",{enumerable:!0,get:a(function(){return iTa.AbortError},"get")})});var y_r=I(A_r=>{"use strict";p();Object.defineProperty(A_r,"__esModule",{value:!0});A_r.createAbortablePromise=sTa;var oTa=IOe();function sTa(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new oTa.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(sTa,"createAbortablePromise")});var T1i=I(Zmt=>{"use strict";p();Object.defineProperty(Zmt,"__esModule",{value:!0});Zmt.delay=uTa;Zmt.calculateRetryDelay=dTa;var aTa=y_r(),cTa=Ymt(),lTa="The delay was aborted.";function uTa(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,aTa.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??lTa})}a(uTa,"delay");function dTa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,cTa.getRandomIntegerInclusive)(0,n/2)}}a(dTa,"calculateRetryDelay")});var I1i=I(E_r=>{"use strict";p();Object.defineProperty(E_r,"__esModule",{value:!0});E_r.getErrorMessage=pTa;var fTa=Ymt();function pTa(t){if((0,fTa.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(pTa,"getErrorMessage")});var w1i=I(xOe=>{"use strict";p();Object.defineProperty(xOe,"__esModule",{value:!0});xOe.isDefined=__r;xOe.isObjectWithProperties=hTa;xOe.objectHasProperty=x1i;function __r(t){return typeof t<"u"&&t!==null}a(__r,"isDefined");function hTa(t,e){if(!__r(t)||typeof t!="object")return!1;for(let r of e)if(!x1i(t,r))return!1;return!0}a(hTa,"isObjectWithProperties");function x1i(t,e){return __r(t)&&typeof t=="object"&&e in t}a(x1i,"objectHasProperty")});var x4=I(os=>{"use strict";p();Object.defineProperty(os,"__esModule",{value:!0});os.isWebWorker=os.isReactNative=os.isNodeRuntime=os.isNodeLike=os.isNode=os.isDeno=os.isBun=os.isBrowser=os.objectHasProperty=os.isObjectWithProperties=os.isDefined=os.getErrorMessage=os.delay=os.createAbortablePromise=os.cancelablePromiseRace=void 0;os.calculateRetryDelay=_Ta;os.computeSha256Hash=vTa;os.computeSha256Hmac=CTa;os.getRandomIntegerInclusive=bTa;os.isError=STa;os.isObject=TTa;os.randomUUID=ITa;os.uint8ArrayToString=xTa;os.stringToUint8Array=wTa;var mTa=(n3(),_a(G7)),iy=mTa.__importStar(Ymt()),gTa=b1i();Object.defineProperty(os,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return gTa.cancelablePromiseRace},"get")});var ATa=y_r();Object.defineProperty(os,"createAbortablePromise",{enumerable:!0,get:a(function(){return ATa.createAbortablePromise},"get")});var yTa=T1i();Object.defineProperty(os,"delay",{enumerable:!0,get:a(function(){return yTa.delay},"get")});var ETa=I1i();Object.defineProperty(os,"getErrorMessage",{enumerable:!0,get:a(function(){return ETa.getErrorMessage},"get")});var v_r=w1i();Object.defineProperty(os,"isDefined",{enumerable:!0,get:a(function(){return v_r.isDefined},"get")});Object.defineProperty(os,"isObjectWithProperties",{enumerable:!0,get:a(function(){return v_r.isObjectWithProperties},"get")});Object.defineProperty(os,"objectHasProperty",{enumerable:!0,get:a(function(){return v_r.objectHasProperty},"get")});function _Ta(t,e){return iy.calculateRetryDelay(t,e)}a(_Ta,"calculateRetryDelay");function vTa(t,e){return iy.computeSha256Hash(t,e)}a(vTa,"computeSha256Hash");function CTa(t,e,r){return iy.computeSha256Hmac(t,e,r)}a(CTa,"computeSha256Hmac");function bTa(t,e){return iy.getRandomIntegerInclusive(t,e)}a(bTa,"getRandomIntegerInclusive");function STa(t){return iy.isError(t)}a(STa,"isError");function TTa(t){return iy.isObject(t)}a(TTa,"isObject");function ITa(){return iy.randomUUID()}a(ITa,"randomUUID");os.isBrowser=iy.isBrowser;os.isBun=iy.isBun;os.isDeno=iy.isDeno;os.isNode=iy.isNodeLike;os.isNodeLike=iy.isNodeLike;os.isNodeRuntime=iy.isNodeRuntime;os.isReactNative=iy.isReactNative;os.isWebWorker=iy.isWebWorker;function xTa(t,e){return iy.uint8ArrayToString(t,e)}a(xTa,"uint8ArrayToString");function wTa(t,e){return iy.stringToUint8Array(t,e)}a(wTa,"stringToUint8Array")});var e0t=I(Xmt=>{"use strict";p();Object.defineProperty(Xmt,"__esModule",{value:!0});Xmt.Sanitizer=void 0;var RTa=x4(),C_r="REDACTED",PTa=["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"],kTa=["api-version"],b_r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=PTa.concat(e),r=kTa.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,RTa.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,C_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]=C_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]=C_r;return r}};Xmt.Sanitizer=b_r});var S_r=I(Q0e=>{"use strict";p();Object.defineProperty(Q0e,"__esModule",{value:!0});Q0e.logPolicyName=void 0;Q0e.logPolicy=MTa;var DTa=ete(),NTa=e0t();Q0e.logPolicyName="logPolicy";function MTa(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:DTa.logger.info,n=new NTa.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:Q0e.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(MTa,"logPolicy")});var T_r=I(q0e=>{"use strict";p();Object.defineProperty(q0e,"__esModule",{value:!0});q0e.redirectPolicyName=void 0;q0e.redirectPolicy=OTa;q0e.redirectPolicyName="redirectPolicy";var R1i=["GET","HEAD"];function OTa(t={}){let{maxRetries:e=20}=t;return{name:q0e.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return P1i(n,o,e)}}}a(OTa,"redirectPolicy");async function P1i(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&R1i.includes(o.method)||s===302&&R1i.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(t0t,"__esModule",{value:!0});t0t.getHeaderName=BTa;t0t.setPlatformSpecificData=LTa;var k1i=(n3(),_a(G7)),I_r=k1i.__importStar(require("node:os")),x_r=k1i.__importStar(require("node:process"));function BTa(){return"User-Agent"}a(BTa,"getHeaderName");async function LTa(t){if(x_r&&x_r.versions){let e=x_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",`(${I_r.arch()}-${I_r.type()}-${I_r.release()})`)}a(LTa,"setPlatformSpecificData")});var EG=I(j0e=>{"use strict";p();Object.defineProperty(j0e,"__esModule",{value:!0});j0e.DEFAULT_RETRY_POLICY_COUNT=j0e.SDK_VERSION=void 0;j0e.SDK_VERSION="1.16.3";j0e.DEFAULT_RETRY_POLICY_COUNT=3});var w_r=I(r0t=>{"use strict";p();Object.defineProperty(r0t,"__esModule",{value:!0});r0t.getUserAgentHeaderName=QTa;r0t.getUserAgentValue=qTa;var N1i=D1i(),FTa=EG();function UTa(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(UTa,"getUserAgentString");function QTa(){return(0,N1i.getHeaderName)()}a(QTa,"getUserAgentHeaderName");async function qTa(t){let e=new Map;e.set("core-rest-pipeline",FTa.SDK_VERSION),await(0,N1i.setPlatformSpecificData)(e);let r=UTa(e);return t?`${t} ${r}`:r}a(qTa,"getUserAgentValue")});var R_r=I(H0e=>{"use strict";p();Object.defineProperty(H0e,"__esModule",{value:!0});H0e.userAgentPolicyName=void 0;H0e.userAgentPolicy=jTa;var O1i=w_r(),M1i=(0,O1i.getUserAgentHeaderName)();H0e.userAgentPolicyName="userAgentPolicy";function jTa(t={}){let e=(0,O1i.getUserAgentValue)(t.userAgentPrefix);return{name:H0e.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(M1i)||r.headers.set(M1i,await e),n(r)}}}a(jTa,"userAgentPolicy")});var n0t=I(G0e=>{"use strict";p();Object.defineProperty(G0e,"__esModule",{value:!0});G0e.isNodeReadableStream=B1i;G0e.isWebReadableStream=L1i;G0e.isReadableStream=HTa;G0e.isBlob=GTa;function B1i(t){return!!(t&&typeof t.pipe=="function")}a(B1i,"isNodeReadableStream");function L1i(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(L1i,"isWebReadableStream");function HTa(t){return B1i(t)||L1i(t)}a(HTa,"isReadableStream");function GTa(t){return typeof t.stream=="function"}a(GTa,"isBlob")});var P_r=I(wOe=>{"use strict";p();Object.defineProperty(wOe,"__esModule",{value:!0});wOe.getRawContent=zTa;wOe.createFileFromStream=YTa;wOe.createFile=KTa;var $Ta=x4(),VTa=n0t(),F1i={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},i0t=Symbol("rawContent");function WTa(t){return typeof t[i0t]=="function"}a(WTa,"hasRawContent");function zTa(t){return WTa(t)?t[i0t]():t.stream()}a(zTa,"getRawContent");function YTa(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},F1i),{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,VTa.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[i0t]:t})}a(YTa,"createFileFromStream");function KTa(t,e,r={}){var n,o,s;return $Ta.isNodeLike?Object.assign(Object.assign({},F1i),{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"),[i0t]:()=>t}):new File([t],e,r)}a(KTa,"createFile")});var q1i=I(D_r=>{"use strict";p();Object.defineProperty(D_r,"__esModule",{value:!0});D_r.concat=tIa;var M8=(n3(),_a(G7)),k_r=require("node:stream"),JTa=n0t(),ZTa=P_r();function U1i(){return M8.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield M8.__await(e.read());if(r)return yield M8.__await(void 0);yield yield M8.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(U1i,"streamAsyncIterator");function XTa(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=U1i.bind(t)),t.values||(t.values=U1i.bind(t))}a(XTa,"makeAsyncIterable");function eIa(t){return t instanceof ReadableStream?(XTa(t),k_r.Readable.fromWeb(t)):t}a(eIa,"ensureNodeStream");function Q1i(t){return t instanceof Uint8Array?k_r.Readable.from(Buffer.from(t)):(0,JTa.isBlob)(t)?Q1i((0,ZTa.getRawContent)(t)):eIa(t)}a(Q1i,"toStream");async function tIa(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(Q1i);return k_r.Readable.from((function(){return M8.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,M8.__asyncValues(d)),u;u=yield M8.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield M8.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield M8.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(tIa,"concat")});var N_r=I($0e=>{"use strict";p();Object.defineProperty($0e,"__esModule",{value:!0});$0e.multipartPolicyName=void 0;$0e.multipartPolicy=fIa;var rte=x4(),rIa=q1i(),nIa=n0t();function iIa(){return`----AzSDKFormBoundary${(0,rte.randomUUID)()}`}a(iIa,"generateBoundary");function oIa(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(oIa,"encodeHeaders");function sIa(t){return t instanceof Uint8Array?t.byteLength:(0,nIa.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(sIa,"getLength");function aIa(t){let e=0;for(let r of t){let n=sIa(r);if(n===void 0)return;e+=n}return e}a(aIa,"getTotalLength");async function cIa(t,e,r){let n=[(0,rte.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,rte.stringToUint8Array)(`\r -`,"utf-8"),(0,rte.stringToUint8Array)(oIa(s.headers),"utf-8"),(0,rte.stringToUint8Array)(`\r -`,"utf-8"),s.body,(0,rte.stringToUint8Array)(`\r ---${r}`,"utf-8")]),(0,rte.stringToUint8Array)(`--\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 -`,"utf-8")],o=aIa(n);o&&t.headers.set("Content-Length",o),t.body=await(0,rIa.concat)(n)}a(cIa,"buildRequestBody");$0e.multipartPolicyName="multipartPolicy";var lIa=70,uIa=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function dIa(t){if(t.length>lIa)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!uIa.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(dIa,"assertValidBoundary");function fIa(){return{name:$0e.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?dIa(n):n=iIa(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await cIa(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(fIa,"multipartPolicy")});var M_r=I(V0e=>{"use strict";p();Object.defineProperty(V0e,"__esModule",{value:!0});V0e.decompressResponsePolicyName=void 0;V0e.decompressResponsePolicy=pIa;V0e.decompressResponsePolicyName="decompressResponsePolicy";function pIa(){return{name:V0e.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(pIa,"decompressResponsePolicy")});var s0t=I(o0t=>{"use strict";p();Object.defineProperty(o0t,"__esModule",{value:!0});o0t.delay=gIa;o0t.parseHeaderValueAsNumber=AIa;var hIa=IOe(),mIa="The operation was aborted.";function gIa(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new hIa.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:mIa)),"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(gIa,"delay");function AIa(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(AIa,"parseHeaderValueAsNumber")});var c0t=I(a0t=>{"use strict";p();Object.defineProperty(a0t,"__esModule",{value:!0});a0t.isThrottlingRetryResponse=_Ia;a0t.throttlingRetryStrategy=vIa;var yIa=s0t(),O_r="Retry-After",EIa=["retry-after-ms","x-ms-retry-after-ms",O_r];function j1i(t){if(t&&[429,503].includes(t.status))try{for(let o of EIa){let s=(0,yIa.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===O_r?1e3:1)}let e=t.headers.get(O_r);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(j1i,"getRetryAfterInMs");function _Ia(t){return Number.isFinite(j1i(t))}a(_Ia,"isThrottlingRetryResponse");function vIa(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=j1i(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(vIa,"throttlingRetryStrategy")});var l0t=I(ROe=>{"use strict";p();Object.defineProperty(ROe,"__esModule",{value:!0});ROe.exponentialRetryStrategy=IIa;ROe.isExponentialRetryResponse=H1i;ROe.isSystemError=G1i;var CIa=x4(),bIa=c0t(),SIa=1e3,TIa=1e3*64;function IIa(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:SIa,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:TIa,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=G1i(u),f=d&&t.ignoreSystemErrors,h=H1i(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,bIa.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,CIa.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(IIa,"exponentialRetryStrategy");function H1i(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(H1i,"isExponentialRetryResponse");function G1i(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(G1i,"isSystemError")});var W0e=I(B_r=>{"use strict";p();Object.defineProperty(B_r,"__esModule",{value:!0});B_r.retryPolicy=kIa;var xIa=s0t(),wIa=cht(),RIa=IOe(),$1i=EG(),V1i=(0,wIa.createClientLogger)("core-rest-pipeline retryPolicy"),PIa="retryPolicy";function kIa(t,e={maxRetries:$1i.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||V1i;return{name:PIa,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 RIa.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:$1i.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||V1i;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,xIa.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(kIa,"retryPolicy")});var L_r=I(z0e=>{"use strict";p();Object.defineProperty(z0e,"__esModule",{value:!0});z0e.defaultRetryPolicyName=void 0;z0e.defaultRetryPolicy=BIa;var DIa=l0t(),NIa=c0t(),MIa=W0e(),OIa=EG();z0e.defaultRetryPolicyName="defaultRetryPolicy";function BIa(t={}){var e;return{name:z0e.defaultRetryPolicyName,sendRequest:(0,MIa.retryPolicy)([(0,NIa.throttlingRetryStrategy)(),(0,DIa.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:OIa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(BIa,"defaultRetryPolicy")});var POe=I(U_r=>{"use strict";p();Object.defineProperty(U_r,"__esModule",{value:!0});U_r.createHttpHeaders=FIa;function u0t(t){return t.toLowerCase()}a(u0t,"normalizeName");function*LIa(t){for(let e of t.values())yield[e.name,e.value]}a(LIa,"headerIterator");var F_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(u0t(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(u0t(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(u0t(e))}delete(e){this._headersMap.delete(u0t(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 LIa(this._headersMap)}};function FIa(t){return new F_r(t)}a(FIa,"createHttpHeaders")});var Q_r=I(Y0e=>{"use strict";p();Object.defineProperty(Y0e,"__esModule",{value:!0});Y0e.formDataPolicyName=void 0;Y0e.formDataPolicy=QIa;var z1i=x4(),W1i=POe();Y0e.formDataPolicyName="formDataPolicy";function UIa(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(UIa,"formDataToFormDataMap");function QIa(){return{name:Y0e.formDataPolicyName,async sendRequest(t,e){if(z1i.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=UIa(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=qIa(t.formData):await jIa(t.formData,t),t.formData=void 0}return e(t)}}}a(QIa,"formDataPolicy");function qIa(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(qIa,"wwwFormUrlEncode");async function jIa(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,W1i.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,z1i.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,W1i.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(jIa,"prepareFormData")});var q_r=I(CR=>{"use strict";p();Object.defineProperty(CR,"__esModule",{value:!0});CR.globalNoProxyList=CR.proxyPolicyName=void 0;CR.loadNoProxy=X1i;CR.getDefaultProxySettings=ZIa;CR.proxyPolicy=exa;var HIa=p3t(),GIa=h3t(),$Ia=ete(),VIa="HTTPS_PROXY",WIa="HTTP_PROXY",zIa="ALL_PROXY",YIa="NO_PROXY";CR.proxyPolicyName="proxyPolicy";CR.globalNoProxyList=[];var J1i=!1,KIa=new Map;function d0t(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(d0t,"getEnvironmentValue");function Z1i(){if(!process)return;let t=d0t(VIa),e=d0t(zIa),r=d0t(WIa);return t||e||r}a(Z1i,"loadEnvironmentProxyValue");function JIa(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(JIa,"isBypassed");function X1i(){let t=d0t(YIa);return J1i=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(X1i,"loadNoProxy");function ZIa(t){if(!t&&(t=Z1i(),!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(ZIa,"getDefaultProxySettings");function XIa(){let t=Z1i();return t?new URL(t):void 0}a(XIa,"getDefaultProxySettingsInternal");function Y1i(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(Y1i,"getUrlFromProxySettings");function K1i(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&$Ia.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 GIa.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new HIa.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(K1i,"setProxyAgentOnRequest");function exa(t,e){J1i||CR.globalNoProxyList.push(...X1i());let r=t?Y1i(t):XIa(),n={};return{name:CR.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!JIa(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:CR.globalNoProxyList,e?.customNoProxyList?void 0:KIa)?K1i(o,n,r):o.proxySettings&&K1i(o,n,Y1i(o.proxySettings)),s(o)}}}a(exa,"proxyPolicy")});var j_r=I(K0e=>{"use strict";p();Object.defineProperty(K0e,"__esModule",{value:!0});K0e.setClientRequestIdPolicyName=void 0;K0e.setClientRequestIdPolicy=txa;K0e.setClientRequestIdPolicyName="setClientRequestIdPolicy";function txa(t="x-ms-client-request-id"){return{name:K0e.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(txa,"setClientRequestIdPolicy")});var H_r=I(J0e=>{"use strict";p();Object.defineProperty(J0e,"__esModule",{value:!0});J0e.tlsPolicyName=void 0;J0e.tlsPolicy=rxa;J0e.tlsPolicyName="tlsPolicy";function rxa(t){return{name:J0e.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(rxa,"tlsPolicy")});var G_r=I(O8=>{"use strict";p();Object.defineProperty(O8,"__esModule",{value:!0});O8.TracingContextImpl=O8.knownContextKeys=void 0;O8.createTracingContext=nxa;O8.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function nxa(t={}){let e=new f0t(t.parentContext);return t.span&&(e=e.setValue(O8.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(O8.knownContextKeys.namespace,t.namespace)),e}a(nxa,"createTracingContext");var f0t=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}};O8.TracingContextImpl=f0t});var $_r=I(Z0e=>{"use strict";p();Object.defineProperty(Z0e,"__esModule",{value:!0});Z0e.createDefaultTracingSpan=eSi;Z0e.createDefaultInstrumenter=tSi;Z0e.useInstrumenter=oxa;Z0e.getInstrumenter=sxa;var ixa=G_r(),p0t=a5t();function eSi(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(eSi,"createDefaultTracingSpan");function tSi(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:eSi(),tracingContext:(0,ixa.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(tSi,"createDefaultInstrumenter");function oxa(t){p0t.state.instrumenterImplementation=t}a(oxa,"useInstrumenter");function sxa(){return p0t.state.instrumenterImplementation||(p0t.state.instrumenterImplementation=tSi()),p0t.state.instrumenterImplementation}a(sxa,"getInstrumenter")});var rSi=I(W_r=>{"use strict";p();Object.defineProperty(W_r,"__esModule",{value:!0});W_r.createTracingClient=axa;var h0t=$_r(),V_r=G_r();function axa(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,h0t.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(V_r.knownContextKeys.namespace)||(A=A.setValue(V_r.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(V_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,h0t.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,h0t.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,h0t.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(axa,"createTracingClient")});var nSi=I(X0e=>{"use strict";p();Object.defineProperty(X0e,"__esModule",{value:!0});X0e.createTracingClient=X0e.useInstrumenter=void 0;var cxa=$_r();Object.defineProperty(X0e,"useInstrumenter",{enumerable:!0,get:a(function(){return cxa.useInstrumenter},"get")});var lxa=rSi();Object.defineProperty(X0e,"createTracingClient",{enumerable:!0,get:a(function(){return lxa.createTracingClient},"get")})});var iSi=I(m0t=>{"use strict";p();Object.defineProperty(m0t,"__esModule",{value:!0});m0t.custom=void 0;var uxa=require("node:util");m0t.custom=uxa.inspect.custom});var g0t=I(kOe=>{"use strict";p();Object.defineProperty(kOe,"__esModule",{value:!0});kOe.RestError=void 0;kOe.isRestError=mxa;var dxa=x4(),fxa=iSi(),pxa=e0t(),hxa=new pxa.Sanitizer,ege=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)}[fxa.custom](){return`RestError: ${this.message} - ${hxa.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};kOe.RestError=ege;ege.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";ege.PARSE_ERROR="PARSE_ERROR";function mxa(t){return t instanceof ege?!0:(0,dxa.isError)(t)&&t.name==="RestError"}a(mxa,"isRestError")});var z_r=I(tge=>{"use strict";p();Object.defineProperty(tge,"__esModule",{value:!0});tge.tracingPolicyName=void 0;tge.tracingPolicy=vxa;var gxa=nSi(),Axa=EG(),yxa=w_r(),A0t=ete(),DOe=x4(),Exa=g0t(),_xa=e0t();tge.tracingPolicyName="tracingPolicy";function vxa(t={}){let e=(0,yxa.getUserAgentValue)(t.userAgentPrefix),r=new _xa.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=Cxa();return{name:tge.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=bxa(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return Txa(f,m),m}catch(m){throw Sxa(f,m),m}}}}a(vxa,"tracingPolicy");function Cxa(){try{return(0,gxa.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:Axa.SDK_VERSION})}catch(t){A0t.logger.warning(`Error when creating the TracingClient: ${(0,DOe.getErrorMessage)(t)}`);return}}a(Cxa,"tryCreateTracingClient");function bxa(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){A0t.logger.warning(`Skipping creating a tracing span due to an error: ${(0,DOe.getErrorMessage)(n)}`);return}}a(bxa,"tryCreateSpan");function Sxa(t,e){try{t.setStatus({status:"error",error:(0,DOe.isError)(e)?e:void 0}),(0,Exa.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){A0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,DOe.getErrorMessage)(r)}`)}}a(Sxa,"tryProcessError");function Txa(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){A0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,DOe.getErrorMessage)(r)}`)}}a(Txa,"tryProcessResponse")});var aSi=I(Y_r=>{"use strict";p();Object.defineProperty(Y_r,"__esModule",{value:!0});Y_r.createPipelineFromOptions=Lxa;var Ixa=S_r(),xxa=t_r(),wxa=T_r(),Rxa=R_r(),oSi=N_r(),Pxa=M_r(),kxa=L_r(),Dxa=Q_r(),sSi=x4(),Nxa=q_r(),Mxa=j_r(),Oxa=H_r(),Bxa=z_r();function Lxa(t){var e;let r=(0,xxa.createEmptyPipeline)();return sSi.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,Oxa.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,Nxa.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,Pxa.decompressResponsePolicy)())),r.addPolicy((0,Dxa.formDataPolicy)(),{beforePolicies:[oSi.multipartPolicyName]}),r.addPolicy((0,Rxa.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,Mxa.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,oSi.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,kxa.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,Bxa.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),sSi.isNodeLike&&r.addPolicy((0,wxa.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,Ixa.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(Lxa,"createPipelineFromOptions")});var pSi=I(E0t=>{"use strict";p();Object.defineProperty(E0t,"__esModule",{value:!0});E0t.getBodyLength=fSi;E0t.createNodeHttpClient=Gxa;var X_r=(n3(),_a(G7)),K_r=X_r.__importStar(require("node:http")),J_r=X_r.__importStar(require("node:https")),cSi=X_r.__importStar(require("node:zlib")),Fxa=require("node:stream"),lSi=IOe(),Uxa=POe(),OOe=g0t(),NOe=ete(),Qxa={};function MOe(t){return t&&typeof t.pipe=="function"}a(MOe,"isReadableStream");function uSi(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(uSi,"isStreamComplete");function dSi(t){return t&&typeof t.byteLength=="number"}a(dSi,"isArrayBuffer");var y0t=class extends Fxa.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}},Z_r=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 lSi.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=fSi(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let E=e.onUploadProgress,_=new y0t(E);_.on("error",v=>{NOe.logger.error("Error in upload progress",v)}),MOe(d)?d.pipe(_):_.end(d),d=_}let h=await this.makeRequest(e,s,d),m=qxa(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?jxa(h,m):h;let y=e.onDownloadProgress;if(y){let E=new y0t(y);E.on("error",_=>{NOe.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 Hxa(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();MOe(d)&&(h=uSi(d));let m=Promise.resolve();MOe(f)&&(m=uSi(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{NOe.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?K_r.request(u,d):J_r.request(u,d);h.once("error",m=>{var g;f(new OOe.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:OOe.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new lSi.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&MOe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):dSi(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(NOe.logger.error("Unrecognized body type",n),f(new OOe.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?K_r.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new K_r.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return J_r.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:Qxa,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(NOe.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new J_r.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function qxa(t){let e=(0,Uxa.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(qxa,"getResponseHeaders");function jxa(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=cSi.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=cSi.createInflate();return t.pipe(n),n}return t}a(jxa,"getDecodedResponseStream");function Hxa(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 OOe.RestError(`Error reading response as text: ${o.message}`,{code:OOe.RestError.PARSE_ERROR}))})})}a(Hxa,"streamToText");function fSi(t){return t?Buffer.isBuffer(t)?t.length:MOe(t)?null:dSi(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(fSi,"getBodyLength");function Gxa(){return new Z_r}a(Gxa,"createNodeHttpClient")});var hSi=I(evr=>{"use strict";p();Object.defineProperty(evr,"__esModule",{value:!0});evr.createDefaultHttpClient=Vxa;var $xa=pSi();function Vxa(){return(0,$xa.createNodeHttpClient)()}a(Vxa,"createDefaultHttpClient")});var mSi=I(rvr=>{"use strict";p();Object.defineProperty(rvr,"__esModule",{value:!0});rvr.createPipelineRequest=Yxa;var Wxa=POe(),zxa=x4(),tvr=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,Wxa.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,zxa.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function Yxa(t){return new tvr(t)}a(Yxa,"createPipelineRequest")});var gSi=I(BOe=>{"use strict";p();Object.defineProperty(BOe,"__esModule",{value:!0});BOe.exponentialRetryPolicyName=void 0;BOe.exponentialRetryPolicy=Xxa;var Kxa=l0t(),Jxa=W0e(),Zxa=EG();BOe.exponentialRetryPolicyName="exponentialRetryPolicy";function Xxa(t={}){var e;return(0,Jxa.retryPolicy)([(0,Kxa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Zxa.DEFAULT_RETRY_POLICY_COUNT})}a(Xxa,"exponentialRetryPolicy")});var ASi=I(rge=>{"use strict";p();Object.defineProperty(rge,"__esModule",{value:!0});rge.systemErrorRetryPolicyName=void 0;rge.systemErrorRetryPolicy=nwa;var ewa=l0t(),twa=W0e(),rwa=EG();rge.systemErrorRetryPolicyName="systemErrorRetryPolicy";function nwa(t={}){var e;return{name:rge.systemErrorRetryPolicyName,sendRequest:(0,twa.retryPolicy)([(0,ewa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:rwa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(nwa,"systemErrorRetryPolicy")});var ySi=I(nge=>{"use strict";p();Object.defineProperty(nge,"__esModule",{value:!0});nge.throttlingRetryPolicyName=void 0;nge.throttlingRetryPolicy=awa;var iwa=c0t(),owa=W0e(),swa=EG();nge.throttlingRetryPolicyName="throttlingRetryPolicy";function awa(t={}){var e;return{name:nge.throttlingRetryPolicyName,sendRequest:(0,owa.retryPolicy)([(0,iwa.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:swa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(awa,"throttlingRetryPolicy")});var nvr=I(ige=>{"use strict";p();Object.defineProperty(ige,"__esModule",{value:!0});ige.DEFAULT_CYCLER_OPTIONS=void 0;ige.createTokenCycler=uwa;var cwa=s0t();ige.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function lwa(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(uwa,"createTokenCycler")});var ESi=I(oge=>{"use strict";p();Object.defineProperty(oge,"__esModule",{value:!0});oge.bearerTokenAuthenticationPolicyName=void 0;oge.bearerTokenAuthenticationPolicy=mwa;var dwa=nvr(),fwa=ete();oge.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function pwa(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(pwa,"defaultAuthorizeRequest");function hwa(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a(hwa,"getChallenge");function mwa(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||fwa.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:pwa,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,dwa.createTokenCycler)(r):()=>Promise.resolve(null);return{name:oge.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&&hwa(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(mwa,"bearerTokenAuthenticationPolicy")});var _Si=I(sge=>{"use strict";p();Object.defineProperty(sge,"__esModule",{value:!0});sge.ndJsonPolicyName=void 0;sge.ndJsonPolicy=gwa;sge.ndJsonPolicyName="ndJsonPolicy";function gwa(){return{name:sge.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(gwa,"ndJsonPolicy")});var CSi=I(nte=>{"use strict";p();Object.defineProperty(nte,"__esModule",{value:!0});nte.auxiliaryAuthenticationHeaderPolicyName=void 0;nte.auxiliaryAuthenticationHeaderPolicy=_wa;var Awa=nvr(),ywa=ete();nte.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var vSi="x-ms-authorization-auxiliary";async function Ewa(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(Ewa,"sendAuthorizeRequest");function _wa(t){let{credentials:e,scopes:r}=t,n=t.logger||ywa.logger,o=new WeakMap;return{name:nte.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(`${nte.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,Awa.createTokenCycler)(d),o.set(d,f)),l.push(Ewa({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. ${vSi} header will not be set.`),c(s)):(s.headers.set(vSi,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(_wa,"auxiliaryAuthenticationHeaderPolicy")});var QSi=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 vwa=t_r();Object.defineProperty(vr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return vwa.createEmptyPipeline},"get")});var Cwa=aSi();Object.defineProperty(vr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return Cwa.createPipelineFromOptions},"get")});var bwa=hSi();Object.defineProperty(vr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return bwa.createDefaultHttpClient},"get")});var Swa=POe();Object.defineProperty(vr,"createHttpHeaders",{enumerable:!0,get:a(function(){return Swa.createHttpHeaders},"get")});var Twa=mSi();Object.defineProperty(vr,"createPipelineRequest",{enumerable:!0,get:a(function(){return Twa.createPipelineRequest},"get")});var bSi=g0t();Object.defineProperty(vr,"RestError",{enumerable:!0,get:a(function(){return bSi.RestError},"get")});Object.defineProperty(vr,"isRestError",{enumerable:!0,get:a(function(){return bSi.isRestError},"get")});var SSi=M_r();Object.defineProperty(vr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return SSi.decompressResponsePolicy},"get")});Object.defineProperty(vr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return SSi.decompressResponsePolicyName},"get")});var TSi=gSi();Object.defineProperty(vr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return TSi.exponentialRetryPolicy},"get")});Object.defineProperty(vr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return TSi.exponentialRetryPolicyName},"get")});var ISi=j_r();Object.defineProperty(vr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return ISi.setClientRequestIdPolicy},"get")});Object.defineProperty(vr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return ISi.setClientRequestIdPolicyName},"get")});var xSi=S_r();Object.defineProperty(vr,"logPolicy",{enumerable:!0,get:a(function(){return xSi.logPolicy},"get")});Object.defineProperty(vr,"logPolicyName",{enumerable:!0,get:a(function(){return xSi.logPolicyName},"get")});var wSi=N_r();Object.defineProperty(vr,"multipartPolicy",{enumerable:!0,get:a(function(){return wSi.multipartPolicy},"get")});Object.defineProperty(vr,"multipartPolicyName",{enumerable:!0,get:a(function(){return wSi.multipartPolicyName},"get")});var ivr=q_r();Object.defineProperty(vr,"proxyPolicy",{enumerable:!0,get:a(function(){return ivr.proxyPolicy},"get")});Object.defineProperty(vr,"proxyPolicyName",{enumerable:!0,get:a(function(){return ivr.proxyPolicyName},"get")});Object.defineProperty(vr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return ivr.getDefaultProxySettings},"get")});var RSi=T_r();Object.defineProperty(vr,"redirectPolicy",{enumerable:!0,get:a(function(){return RSi.redirectPolicy},"get")});Object.defineProperty(vr,"redirectPolicyName",{enumerable:!0,get:a(function(){return RSi.redirectPolicyName},"get")});var PSi=ASi();Object.defineProperty(vr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return PSi.systemErrorRetryPolicy},"get")});Object.defineProperty(vr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return PSi.systemErrorRetryPolicyName},"get")});var kSi=ySi();Object.defineProperty(vr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return kSi.throttlingRetryPolicy},"get")});Object.defineProperty(vr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return kSi.throttlingRetryPolicyName},"get")});var Iwa=W0e();Object.defineProperty(vr,"retryPolicy",{enumerable:!0,get:a(function(){return Iwa.retryPolicy},"get")});var DSi=z_r();Object.defineProperty(vr,"tracingPolicy",{enumerable:!0,get:a(function(){return DSi.tracingPolicy},"get")});Object.defineProperty(vr,"tracingPolicyName",{enumerable:!0,get:a(function(){return DSi.tracingPolicyName},"get")});var xwa=L_r();Object.defineProperty(vr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return xwa.defaultRetryPolicy},"get")});var NSi=R_r();Object.defineProperty(vr,"userAgentPolicy",{enumerable:!0,get:a(function(){return NSi.userAgentPolicy},"get")});Object.defineProperty(vr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return NSi.userAgentPolicyName},"get")});var MSi=H_r();Object.defineProperty(vr,"tlsPolicy",{enumerable:!0,get:a(function(){return MSi.tlsPolicy},"get")});Object.defineProperty(vr,"tlsPolicyName",{enumerable:!0,get:a(function(){return MSi.tlsPolicyName},"get")});var OSi=Q_r();Object.defineProperty(vr,"formDataPolicy",{enumerable:!0,get:a(function(){return OSi.formDataPolicy},"get")});Object.defineProperty(vr,"formDataPolicyName",{enumerable:!0,get:a(function(){return OSi.formDataPolicyName},"get")});var BSi=ESi();Object.defineProperty(vr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return BSi.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(vr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return BSi.bearerTokenAuthenticationPolicyName},"get")});var LSi=_Si();Object.defineProperty(vr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return LSi.ndJsonPolicy},"get")});Object.defineProperty(vr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return LSi.ndJsonPolicyName},"get")});var FSi=CSi();Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return FSi.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return FSi.auxiliaryAuthenticationHeaderPolicyName},"get")});var USi=P_r();Object.defineProperty(vr,"createFile",{enumerable:!0,get:a(function(){return USi.createFile},"get")});Object.defineProperty(vr,"createFileFromStream",{enumerable:!0,get:a(function(){return USi.createFileFromStream},"get")})});var jSi=I((FOe,qSi)=>{"use strict";p();var wwa=FOe&&FOe.__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=FOe&&FOe.__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 Mwa=Vl(),Owa=ey(),Bwa=(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){Mwa.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||Owa.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})();HSi.exports=Bwa});var $Si=I(ovr=>{"use strict";p();Object.defineProperty(ovr,"__esModule",{value:!0});ovr.azureRoleEnvironmentTelemetryProcessor=Lwa;function Lwa(t,e){}a(Lwa,"azureRoleEnvironmentTelemetryProcessor")});var zSi=I(_0t=>{"use strict";p();Object.defineProperty(_0t,"__esModule",{value:!0});_0t.samplingTelemetryProcessor=Fwa;_0t.getSamplingHashCode=WSi;var VSi=xE();function Fwa(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&VSi.TelemetryType.Metric===VSi.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=WSi(e.correlationContext.operation.id){"use strict";p();var Uwa=B8&&B8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qwa=B8&&B8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qwa=B8&&B8.__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)&&Uwa(e,t,r);return Qwa(e,t),e};Object.defineProperty(B8,"__esModule",{value:!0});B8.performanceMetricsTelemetryProcessor=jwa;var svr=Dmt(),avr=qwa(xE());function jwa(t,e){switch(e&&e.addDocument(t),t.data.baseType){case avr.TelemetryTypeString.Exception:svr.countException();break;case avr.TelemetryTypeString.Request:var r=t.data.baseData;svr.countRequest(r.duration,r.success);break;case avr.TelemetryTypeString.Dependency:var n=t.data.baseData;svr.countDependency(n.duration,n.success);break}return!0}a(jwa,"performanceMetricsTelemetryProcessor")});var KSi=I(nD=>{"use strict";p();var w4=nD&&nD.__assign||function(){return w4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var zwa=R4&&R4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),C0t=R4&&R4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zwa(e,t,r)};Object.defineProperty(R4,"__esModule",{value:!0});C0t($Si(),R4);C0t(zSi(),R4);C0t(YSi(),R4);C0t(KSi(),R4)});var cvr=I((p_p,eTi)=>{"use strict";p();var Zi=xE(),Fb=ey(),ZSi=dG(),Ywa=Vl(),Kwa=(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=Fb.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=ZSi.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=Fb.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=Fb.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=Fb.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Fb.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=Fb.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=ZSi.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(XSi.regex.test(l)){var u=new XSi(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})(),XSi=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=Fb.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=Fb.trim(n[2])||this.method,this.fileName=Fb.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})();eTi.exports=Kwa});var tTi=I(_G=>{"use strict";p();var Jwa=_G&&_G.__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())})},Zwa=_G&&_G.__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 b0t=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())})},S0t=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._resendInterval=Math.floor(r)),typeof n=="number"&&n>=0&&(this._maxBytesOnDisk=Math.floor(n)),e&&!QOe.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(vG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(vG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return b0t(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return S0t(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 sRa.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(vG.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=Ub.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),iRa.gzip(f,function(g,A){var y=A;g?(h._logWarn(Ub.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(Ub.dumpObj(s)),s[oRa.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(uRa)&&b.statusCode===400&&(uvr.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(lRa.includes(b.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(b.statusCode==cRa||b.statusCode==aRa?h._statsbeat.countThrottle(vG.StatsbeatNetworkCategory.Breeze,o,b.statusCode):h._statsbeat.countRequest(vG.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(vG.StatsbeatNetworkCategory.Breeze,o,b.statusCode);var P=JSON.parse(T),D=[];P.errors&&(P.errors.forEach(function(L){(L.statusCode==429||L.statusCode==500||L.statusCode==503)&&D.push(e[L.index])}),D.length>0&&h._storeToDisk(D))}catch{h._storeToDisk(e)}}if(b.statusCode===307||b.statusCode===308)if(h._numConsecutiveRedirects++,h._numConsecutiveRedirects<10){var N=b.headers.location?b.headers.location.toString():null;N&&(h._redirectedHost=N,h.send(e,r))}else{var B={name:"Circular Redirect",message:"Error sending telemetry because of circular redirects."};h._statsbeat&&h._statsbeat.countException(vG.StatsbeatNetworkCategory.Breeze,o,B),typeof r=="function"&&r("Error sending telemetry because of circular redirects.")}else h._numConsecutiveRedirects=0,typeof r=="function"&&r(T),h._logInfo(T),typeof h._onSuccess=="function"&&h._onSuccess(T)})},"requestCallback"),v=Ub.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(vG.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,Ub.dumpObj(b))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,Ub.dumpObj(b))}h._onErrorHelper(b),typeof r=="function"&&(b?(h._requestTimedOut&&(b.name="telemetry timeout",b.message="telemetry request timed out"),r(Ub.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(Ub.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 b0t(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return S0t(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,L8.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: "+Ub.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,QOe.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: "+Ub.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,L8.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: "+Ub.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=ite.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,L8.writeFileAsync(l,Ub.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: "+Ub.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),lvr.existsSync(this._tempDir)||lvr.mkdirSync(this._tempDir),QOe.FileAccessControl.applyACLRulesSync(this._tempDir);var r=L8.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=ite.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),lvr.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+Ub.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return b0t(this,void 0,void 0,function(){var e,r,n,o,s,c;return S0t(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,L8.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return ite.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=ite.join(this._tempDir,r),[4,L8.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,L8.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 b0t(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return S0t(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,L8.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return ite.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=ite.join(this._tempDir,e[r]),[4,L8.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})();rTi.exports=dRa});var iTi=I(T0t=>{"use strict";p();Object.defineProperty(T0t,"__esModule",{value:!0});T0t.AzureVirtualMachine=void 0;var nTi=Vl(),fRa=ey(),pRa=F0e(),hRa="http://169.254.169.254/metadata/instance/compute",mRa="api-version=2017-12-01",gRa="format=json",ARa="UNREACH",yRa=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat(hRa,"?").concat(mRa,"&").concat(gRa),l=(n={method:"GET"},n[pRa.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=fRa.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){nTi.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(ARa)>-1?s.isVM=!1:nTi.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();T0t.AzureVirtualMachine=yRa});var oTi=I(I0t=>{"use strict";p();Object.defineProperty(I0t,"__esModule",{value:!0});I0t.NetworkStatsbeat=void 0;var ERa=(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})();I0t.NetworkStatsbeat=ERa});var uTi=I((ote,lTi)=>{"use strict";p();var P4=ote&&ote.__assign||function(){return P4=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:hd.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:hd.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(P4(P4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:hd.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(P4(P4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:hd.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(P4(P4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:hd.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(P4(P4({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:hd.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})();lTi.exports=wRa});var pTi=I((R_p,fTi)=>{"use strict";p();var RRa=require("url"),PRa=ZEr(),kRa=jSi(),DRa=k0e(),F8=xE(),NRa=GSi(),hvr=JSi(),dTi=dG(),MRa=uTi(),ORa=dvr(),mvr=ey(),x0t=Vl(),BRa=cvr(),LRa=(function(){function t(e){this._telemetryProcessors=[];var r=new PRa(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 DRa,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new MRa(this.config,this.context),this._statsbeat.enable(!0));var n=new ORa(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new NRa(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,F8.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,F8.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,F8.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,F8.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!mvr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,F8.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,F8.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,F8.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new RRa.URL(e.data).host}catch(r){e.target=null,x0t.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,F8.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&&F8.telemetryTypeToBaseType(r)){var n=BRa.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&&hvr.samplingTelemetryProcessor(n,{correlationContext:dTi.CorrelationContextManager.getCurrentContext()}),hvr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(hvr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else x0t.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||(x0t.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new kRa(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=dTi.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var FRa=gvr&&gvr.__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)}})(),URa=pTi(),hTi=$Er(),QRa=F0e(),w0t=Vl(),qRa=(function(t){FRa(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?hTi.trackRequestSync(this,r):w0t.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&w0t.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?hTi.trackRequest(this,r):w0t.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?QRa.trackRequest(this,r):w0t.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(URa);mTi.exports=qRa});var yTi=I(ATi=>{"use strict";p();Object.defineProperty(ATi,"__esModule",{value:!0})});var CTi=I(At=>{"use strict";p();Object.defineProperty(At,"__esModule",{value:!0});At.Configuration=At.liveMetricsClient=At.defaultClient=At.DistributedTracingModes=void 0;At.setup=KRa;At.start=vTi;At.getCorrelationContext=ZRa;At.startOperation=XRa;At.wrapWithCorrelationContext=ePa;At.dispose=tPa;var yvr=dG(),jRa=ebi(),HRa=rbi(),Evr=Dmt(),GRa=kEr(),$Ra=fbi(),VRa=bbi(),WRa=F0e(),zRa=$Er(),ETi=kee(),jOe=Vl(),_Ti=n1i(),_vr=o1i(),YRa=c1i();At.TelemetryClient=gTi();At.Contracts=xE();At.azureFunctionsTypes=yTi();var Avr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(Avr||(At.DistributedTracingModes=Avr={}));var HOe,GOe,$Oe,VOe,WOe,cge,lge,ste,zOe,YOe,HT=!1,R0t;function KRa(t){return At.defaultClient?jOe.info("The default client is already setup"):(At.defaultClient=new At.TelemetryClient(t),HOe=new jRa(At.defaultClient),GOe=new HRa(At.defaultClient),$Oe=new Evr(At.defaultClient),VOe=new GRa(At.defaultClient),WOe=new $Ra(At.defaultClient),cge=new VRa(At.defaultClient),ste=new zRa(At.defaultClient),zOe=new WRa(At.defaultClient),lge||(lge=new _vr.AutoCollectNativePerformance(At.defaultClient)),YOe=new YRa.AzureFunctionsHook(At.defaultClient)),vvr}a(KRa,"setup");function JRa(){At.defaultClient&&(At.defaultClient.config.enableAutoCollectExternalLoggers==null&&(At.defaultClient.config.enableAutoCollectExternalLoggers=!0),At.defaultClient.config.enableAutoCollectConsole==null&&(At.defaultClient.config.enableAutoCollectConsole=!1),At.defaultClient.config.enableAutoCollectExceptions==null&&(At.defaultClient.config.enableAutoCollectExceptions=!0),At.defaultClient.config.enableAutoCollectPerformance==null&&(At.defaultClient.config.enableAutoCollectPerformance=!0),At.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),At.defaultClient.config.enableAutoCollectHeartbeat==null&&(At.defaultClient.config.enableAutoCollectHeartbeat=!0),At.defaultClient.config.enableAutoCollectRequests==null&&(At.defaultClient.config.enableAutoCollectRequests=!0),At.defaultClient.config.enableAutoCollectDependencies==null&&(At.defaultClient.config.enableAutoCollectDependencies=!0),At.defaultClient.config.enableUseDiskRetryCaching==null&&(At.defaultClient.config.enableUseDiskRetryCaching=!0),At.defaultClient.config.enableAutoDependencyCorrelation==null&&(At.defaultClient.config.enableAutoDependencyCorrelation=!0),At.defaultClient.config.enableSendLiveMetrics==null&&(At.defaultClient.config.enableSendLiveMetrics=!1),At.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(At.defaultClient.config.enableAutoCollectExtendedMetrics=!0),At.defaultClient.config.enableWebInstrumentation==null&&(At.defaultClient.config.enableWebInstrumentation=!1),At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}a(JRa,"_setDefaultConfig");function vTi(){if(At.defaultClient){HT=!0,JRa(),HOe.enable(At.defaultClient.config.enableAutoCollectExternalLoggers,At.defaultClient.config.enableAutoCollectConsole),GOe.enable(At.defaultClient.config.enableAutoCollectExceptions),$Oe.enable(At.defaultClient.config.enableAutoCollectPerformance),VOe.enable(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics),WOe.enable(At.defaultClient.config.enableAutoCollectHeartbeat),ste.useAutoCorrelation(At.defaultClient.config.enableAutoDependencyCorrelation,At.defaultClient.config.enableUseAsyncHooks),ste.enable(At.defaultClient.config.enableAutoCollectRequests),zOe.enable(At.defaultClient.config.enableAutoCollectDependencies),cge.enable(At.defaultClient.config.enableWebInstrumentation,At.defaultClient.config.webInstrumentationConnectionString),At.defaultClient.config.enableSendLiveMetrics&&(At.liveMetricsClient||(At.liveMetricsClient=new _Ti(At.defaultClient.config,At.defaultClient.context,At.defaultClient.getAuthorizationHandler,At.defaultClient),R0t=new Evr(At.liveMetricsClient,1e3,!0),At.liveMetricsClient.addCollector(R0t),At.defaultClient.quickPulseClient=At.liveMetricsClient),At.liveMetricsClient.enable(At.defaultClient.config.enableSendLiveMetrics)),YOe.enable(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=_vr.AutoCollectNativePerformance.parseEnabled(At.defaultClient.config.enableAutoCollectExtendedMetrics,At.defaultClient.config);lge.enable(At.defaultClient.config.enableAutoCollectExtendedMetrics,t.disabledMetrics),At.defaultClient&&At.defaultClient.channel&&At.defaultClient.channel.setUseDiskRetryCaching(At.defaultClient.config.enableUseDiskRetryCaching,At.defaultClient.config.enableResendInterval,At.defaultClient.config.enableMaxBytesOnDisk)}else jOe.warn("Start cannot be called before setup");return vvr}a(vTi,"start");function ZRa(){return yvr.CorrelationContextManager.getCurrentContext()}a(ZRa,"getCorrelationContext");function XRa(t,e){return yvr.CorrelationContextManager.startOperation(t,e)}a(XRa,"startOperation");function ePa(t,e){return yvr.CorrelationContextManager.wrapCallback(t,e)}a(ePa,"wrapWithCorrelationContext");var vvr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return ETi.w3cEnabled=e===Avr.AI_AND_W3C,t},t.setAutoCollectConsole=function(e,r){return r===void 0&&(r=!1),At.defaultClient&&(At.defaultClient.config.enableAutoCollectExternalLoggers=e,At.defaultClient.config.enableAutoCollectConsole=r,HT&&HOe.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectExceptions=e,HT&&GOe.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),At.defaultClient){At.defaultClient.config.enableAutoCollectPerformance=e;var n=_vr.AutoCollectNativePerformance.parseEnabled(r,At.defaultClient.config);At.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,HT&&($Oe.enable(e),lge.enable(At.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,HT&&VOe.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectHeartbeat=e,HT&&WOe.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableWebInstrumentation=e,At.defaultClient.config.webInstrumentationConnectionString=r,HT&&cge.enable(At.defaultClient.config.enableAutoWebSnippetInjection,At.defaultClient.config.webSnippetConnectionString)),t},t.enableWebInstrumentation=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableWebInstrumentation=e,At.defaultClient.config.webInstrumentationConnectionString=r,HT&&cge.enable(At.defaultClient.config.enableWebInstrumentation,At.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectRequests=e,HT&&ste.enable(e)),t},t.setAutoCollectDependencies=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectDependencies=e,HT&&zOe.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableAutoDependencyCorrelation=e,At.defaultClient.config.enableUseAsyncHooks=r,HT&&ste.useAutoCorrelation(e,r)),t},t.setUseDiskRetryCaching=function(e,r,n){return At.defaultClient&&(At.defaultClient.config.enableUseDiskRetryCaching=e,At.defaultClient.config.enableResendInterval=r,At.defaultClient.config.enableMaxBytesOnDisk=n,At.defaultClient.channel&&At.defaultClient.channel.setUseDiskRetryCaching(At.defaultClient.config.enableUseDiskRetryCaching,At.defaultClient.config.enableResendInterval,At.defaultClient.config.enableMaxBytesOnDisk)),t},t.setInternalLogging=function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!0),jOe.enableDebug=e,jOe.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,HT&&YOe.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),At.defaultClient?(!At.liveMetricsClient&&e?(At.liveMetricsClient=new _Ti(At.defaultClient.config,At.defaultClient.context,At.defaultClient.getAuthorizationHandler,At.defaultClient),R0t=new Evr(At.liveMetricsClient,1e3,!0),At.liveMetricsClient.addCollector(R0t),At.defaultClient.quickPulseClient=At.liveMetricsClient):At.liveMetricsClient&&At.liveMetricsClient.enable(e),At.defaultClient.config.enableSendLiveMetrics=e,t):(jOe.warn("Live metrics client cannot be setup without the default client"),t)},t.start=vTi,t})();At.Configuration=vvr;function tPa(){ETi.w3cEnabled=!0,At.defaultClient=null,HT=!1,HOe&&HOe.dispose(),GOe&&GOe.dispose(),$Oe&&$Oe.dispose(),VOe&&VOe.dispose(),WOe&&WOe.dispose(),cge&&cge.dispose(),lge&&lge.dispose(),ste&&ste.dispose(),zOe&&zOe.dispose(),At.liveMetricsClient&&(At.liveMetricsClient.enable(!1),At.liveMetricsClient=void 0),YOe&&YOe.dispose()}a(tPa,"dispose")});var bvr=I(bR=>{"use strict";p();var rPa=bR&&bR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nPa=bR&&bR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bTi=bR&&bR.__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 aPa(e)?STi(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};bR.AzureInsightReporter=Cvr;function cPa(t,e,r){let n=new iPa.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,TTi(t,e,n),n}a(cPa,"createAppInsightsClient");function TTi(t,e,r){r.commonProperties=lPa(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(TTi,"configureReporter");function lPa(t,e){return t=t||{},t.common_os=P0t.platform(),t.common_platformversion=P0t.release(),t.common_arch=P0t.arch(),t.common_cpu=Array.from(new Set(P0t.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(lPa,"decorateWithCommonProperties")});var ITi=I((j_p,uPa)=>{uPa.exports={name:"copilot-chat",displayName:"GitHub Copilot Chat",description:"AI chat features powered by Copilot",version:"0.51.0",build:"1",completionsCoreVersion:"1.378.1799",internalLargeStorageAriaKey:"ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917",ariaKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",buildType:"dev",publisher:"GitHub",homepage:"https://github.com/features/copilot?editor=vscode",license:"SEE LICENSE IN LICENSE.txt",repository:{type:"git",url:"https://github.com/microsoft/vscode-copilot-chat"},bugs:{url:"https://github.com/microsoft/vscode/issues"},qna:"https://github.com/github-community/community/discussions/categories/copilot",icon:"assets/copilot.png",pricing:"Trial",engines:{vscode:"^1.123.0",npm:">=9.0.0",node:">=22.14.0"},categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["ai","openai","codex","pilot","snippets","documentation","autocomplete","intellisense","refactor","javascript","python","typescript","php","go","golang","ruby","c++","c#","java","kotlin","co-pilot"],badges:[{url:"https://img.shields.io/badge/GitHub%20Copilot-Subscription%20Required-orange",href:"https://github.com/github-copilot/signup?editor=vscode",description:"%github.copilot.badge.signUp%"},{url:"https://img.shields.io/github/stars/github/copilot-docs?style=social",href:"https://github.com/github/copilot-docs",description:"%github.copilot.badge.star%"},{url:"https://img.shields.io/youtube/channel/views/UC7c3Kb6jYCRj4JOHHZTxKsQ?style=social",href:"https://www.youtube.com/@GitHub/search?query=copilot",description:"%github.copilot.badge.youtube%"},{url:"https://img.shields.io/twitter/follow/github?style=social",href:"https://twitter.com/github",description:"%github.copilot.badge.twitter%"}],activationEvents:["onStartupFinished","onLanguageModelChat:copilot","onUri","onFileSystem:ccreq","onFileSystem:ccsettings"],main:"./dist/extension",l10n:"./l10n",enabledApiProposals:["agentSessionsWorkspace","agentsWindowConfiguration","chatDebug","chatHooks","extensionsAny","newSymbolNamesProvider","interactive","codeActionAI","activeComment","commentReveal","contribCommentThreadAdditionalMenu","contribCommentsViewThreadMenus","contribChatEditorInlineGutterMenu","documentFiltersExclusive","embeddings","findTextInFiles","findTextInFiles2","languageModelToolSupportsModel","findFiles2","textSearchProvider","terminalDataWriteEvent","terminalExecuteCommandEvent","terminalSelection","terminalQuickFixProvider","mappedEditsProvider","aiRelatedInformation","aiSettingsSearch","chatParticipantAdditions","defaultChatParticipant","contribSourceControlInputBoxMenu","authLearnMore","testObserver","aiTextSearchProvider","chatParticipantPrivate","chatProvider","contribDebugCreateConfiguration","chatReferenceDiagnostic","textSearchProvider2","chatReferenceBinaryData","languageModelSystem","languageModelCapabilities","languageModelPricing","inlineCompletionsAdditions","chatStatusItem","chatInputNotification","taskProblemMatcherStatus","contribLanguageModelToolSets","textDocumentChangeReason","resolvers","taskExecutionTerminal","dataChannels","languageModelThinkingPart","chatSessionsProvider","devDeviceId","contribEditorContentMenu","chatPromptFiles","mcpServerDefinitions","tabInputMultiDiff","workspaceTrust","environmentPower","terminalTitle","toolInvocationApproveCombination","chatSessionCustomizationProvider"],contributes:{languageModelTools:[{name:"copilot_searchCodebase",toolReferenceName:"codebase",displayName:"%copilot.tools.searchCodebase.name%",icon:"$(folder)",userDescription:"%copilot.codebase.tool.description%",modelDescription:"Run a natural language search for relevant code or documentation comments from the user's current workspace. Returns relevant code snippets from the user's current workspace if it is large, or the full contents of the workspace if it is small.",tags:["codesearch","vscode_codesearch"],inputSchema:{type:"object",properties:{query:{type:"string",description:"The query to search the codebase for. Should contain all relevant context. Should ideally be text that might appear in the codebase, such as function names, variable names, or comments."}},required:["query"]}},{name:"execution_subagent",toolReferenceName:"executionSubagent",displayName:"%copilot.tools.executionSubagent.name%",icon:"$(play)",userDescription:"%copilot.tools.executionSubagent.description%",modelDescription:`Launch an iterative execution-focused subagent that performs an execution-based task. +`,"utf-8")],o=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. 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. @@ -696,7 +690,7 @@ This tool provides complete project setup including: - Development environment setup - Build and run instructions -Use other file creation tools for individual files within existing projects.`,inputSchema:{type:"object",properties:{query:{type:"string",description:"The query to use to generate the new workspace. This should be a clear and concise description of the workspace the user wants to create."}},required:["query"]},tags:["enable_other_tool_install_extension"]},{name:"copilot_installExtension",displayName:"Install Extension in VS Code",when:"!config.github.copilot.chat.installExtensionSkill.enabled",toolReferenceName:"installExtension",legacyToolReferenceFullNames:["new/installExtension"],modelDescription:"Install an extension in VS Code. Use this tool to install an extension in Visual Studio Code as part of a new workspace creation process only.",inputSchema:{type:"object",properties:{id:{type:"string",description:"The ID of the extension to install. This should be in the format .."},name:{type:"string",description:"The name of the extension to install. This should be a clear and concise description of the extension."}},required:["id","name"]},tags:[]},{name:"copilot_runVscodeCommand",displayName:"Run VS Code Command",when:"config.github.copilot.chat.newWorkspaceCreation.enabled",toolReferenceName:"runCommand",legacyToolReferenceFullNames:["new/runVscodeCommand"],modelDescription:"Run a command in VS Code. Use this tool to run a command in Visual Studio Code as part of a new workspace creation process only.",inputSchema:{type:"object",properties:{commandId:{type:"string",description:"The ID of the command to execute. This should be in the format ."},name:{type:"string",description:"The name of the command to execute. This should be a clear and concise description of the command."},args:{type:"array",description:"The arguments to pass to the command. This should be an array of strings.",items:{type:"string"}},skipCheck:{type:"boolean",description:"If true, skip checking whether the command exists before executing it."}},required:["commandId","name"]},tags:[]},{name:"copilot_createNewJupyterNotebook",displayName:"Create New Jupyter Notebook",icon:"$(notebook)",toolReferenceName:"createJupyterNotebook",legacyToolReferenceFullNames:["newJupyterNotebook"],modelDescription:"Generates a new Jupyter Notebook (.ipynb) in VS Code. Jupyter Notebooks are interactive documents commonly used for data exploration, analysis, visualization, and combining code with narrative text. Prefer creating plain Python files or similar unless a user explicitly requests creating a new Jupyter Notebook or already has a Jupyter Notebook opened or exists in the workspace.",userDescription:"%copilot.tools.newJupyterNotebook.description%",inputSchema:{type:"object",properties:{query:{type:"string",description:"The query to use to generate the jupyter notebook. This should be a clear and concise description of the notebook the user wants to create."}},required:["query"]},tags:[]},{name:"copilot_insertEdit",toolReferenceName:"insertEdit",displayName:"%copilot.tools.insertEdit.name%",modelDescription:`Insert new code into an existing 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. +Use other file creation tools for individual files within existing projects.`,inputSchema:{type:"object",properties:{query:{type:"string",description:"The query to use to generate the new workspace. This should be a clear and concise description of the workspace the user wants to create."}},required:["query"]},tags:["enable_other_tool_install_extension"]},{name:"copilot_installExtension",displayName:"Install Extension in VS Code",when:"!config.github.copilot.chat.installExtensionSkill.enabled",toolReferenceName:"installExtension",legacyToolReferenceFullNames:["new/installExtension"],modelDescription:"Install an extension in VS Code. Use this tool to install an extension in Visual Studio Code as part of a new workspace creation process only.",inputSchema:{type:"object",properties:{id:{type:"string",description:"The ID of the extension to install. This should be in the format .."},name:{type:"string",description:"The name of the extension to install. This should be a clear and concise description of the extension."}},required:["id","name"]},tags:[]},{name:"copilot_runVscodeCommand",displayName:"Run VS Code Command",toolReferenceName:"runCommand",legacyToolReferenceFullNames:["new/runVscodeCommand"],modelDescription:"Run a command in VS Code. Use this tool to run a command in Visual Studio Code as part of a new workspace creation process only.",inputSchema:{type:"object",properties:{commandId:{type:"string",description:"The ID of the command to execute. This should be in the format ."},name:{type:"string",description:"The name of the command to execute. This should be a clear and concise description of the command."},args:{type:"array",description:"The arguments to pass to the command. This should be an array of strings.",items:{type:"string"}},skipCheck:{type:"boolean",description:"If true, skip checking whether the command exists before executing it."}},required:["commandId","name"]},tags:[]},{name:"copilot_createNewJupyterNotebook",displayName:"Create New Jupyter Notebook",icon:"$(notebook)",toolReferenceName:"createJupyterNotebook",legacyToolReferenceFullNames:["newJupyterNotebook"],modelDescription:"Generates a new Jupyter Notebook (.ipynb) in VS Code. Jupyter Notebooks are interactive documents commonly used for data exploration, analysis, visualization, and combining code with narrative text. Prefer creating plain Python files or similar unless a user explicitly requests creating a new Jupyter Notebook or already has a Jupyter Notebook opened or exists in the workspace.",userDescription:"%copilot.tools.newJupyterNotebook.description%",inputSchema:{type:"object",properties:{query:{type:"string",description:"The query to use to generate the jupyter notebook. This should be a clear and concise description of the notebook the user wants to create."}},required:["query"]},tags:[]},{name:"copilot_insertEdit",toolReferenceName:"insertEdit",displayName:"%copilot.tools.insertEdit.name%",modelDescription:`Insert new code into an existing 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... @@ -752,7 +746,7 @@ EXAMPLES: - User attached a detailed spec, plan, or requirements doc \u2192 context already provided - You already started editing files in this conversation \u2192 too late to switch - Single obvious change like fixing a typo or renaming \u2192 just do it -- User gave explicit step-by-step instructions \u2192 follow them directly`,when:"config.github.copilot.chat.switchAgent.enabled",icon:"$(arrow-swap)",inputSchema:{type:"object",properties:{agentName:{type:"string",description:"The name of the agent to switch to. Currently only 'Plan' is supported.",enum:["Plan"]}},required:["agentName"]}},{name:"copilot_memory",displayName:"Memory",toolReferenceName:"memory",userDescription:"Manage persistent memory across conversations",modelDescription:'Manage a persistent memory system with three scopes for storing notes and information across conversations.\n\nMemory is organized under /memories/ with three tiers:\n- `/memories/` \u2014 User memory: persistent notes that survive across all workspaces and conversations. Store preferences, patterns, and general insights here.\n- `/memories/session/` \u2014 Session memory: notes scoped to the current conversation. Store task-specific context and in-progress notes here. Cleared after the conversation ends.\n- `/memories/repo/` \u2014 Repository memory: repository-scoped notes stored locally in the workspace. Store codebase conventions, build commands, project structure facts, and verified practices here.\n\nIMPORTANT: Before creating new memory files, first view the /memories/ directory to understand what already exists. This helps avoid duplicates and maintain organized notes.\n\nCommands:\n- `view`: View contents of a file or list directory contents. Can be used on files or directories (e.g., "/memories/" to see all top-level items).\n- `create`: Create a new file at the specified path with the given content. Fails if the file already exists.\n- `str_replace`: Replace an exact string in a file with a new string. The old_str must appear exactly once in the file.\n- `insert`: Insert text at a specific line number in a file. Line 0 inserts at the beginning.\n- `delete`: Delete a file or directory (and all its contents).\n- `rename`: Rename or move a file or directory from path to new_path. Cannot rename across scopes.',inputSchema:{type:"object",properties:{command:{type:"string",enum:["view","create","str_replace","insert","delete","rename"],description:"The operation to perform on the memory file system."},path:{type:"string",description:'The absolute path to the file or directory inside /memories/, e.g. "/memories/notes.md". Used by all commands except `rename`.'},file_text:{type:"string",description:"Required for `create`. The content of the file to create."},old_str:{type:"string",description:"Required for `str_replace`. The exact string in the file to replace. Must appear exactly once."},new_str:{type:"string",description:"Required for `str_replace`. The new string to replace old_str with."},insert_line:{type:"number",description:"Required for `insert`. The 0-based line number to insert text at. 0 inserts before the first line."},insert_text:{type:"string",description:"Required for `insert`. The text to insert at the specified line."},view_range:{type:"array",items:{type:"number"},minItems:2,maxItems:2,description:"Optional for `view`. A two-element array [start_line, end_line] (1-indexed) to view a specific range of lines."},old_path:{type:"string",description:"Required for `rename`. The current path of the file or directory to rename."},new_path:{type:"string",description:"Required for `rename`. The new path for the file or directory."}},required:["command"]}},{name:"copilot_resolveMemoryFileUri",displayName:"Resolve Memory File URI",toolReferenceName:"resolveMemoryFileUri",userDescription:"Resolve a memory file path to its actual URI",modelDescription:"Resolve a memory file path (like /memories/session/plan.md or /memories/repo/notes.md) to its fully qualified URI. Use this when you need the actual URI for a memory file, for example to pass it to setArtifacts. The path must start with /memories/.",tags:[],inputSchema:{type:"object",properties:{path:{type:"string",description:"The memory file path to resolve (e.g. /memories/session/plan.md)."}},required:["path"]}},{name:"copilot_editFiles",modelDescription:"This is a placeholder tool, do not use",userDescription:"Edit files",icon:"$(pencil)",displayName:"Edit Files",toolReferenceName:"editFiles",legacyToolReferenceFullNames:["editFiles"]},{name:"copilot_sessionStoreSql",displayName:"Session Store SQL",toolReferenceName:"sessionStoreSql",when:"github.copilot.sessionSearch.enabled",userDescription:"Query your Copilot session history using SQL",modelDescription:"Query the local session store containing history from past coding sessions. Uses SQLite syntax (NOT DuckDB or Postgres). SQL queries are read-only \u2014 only SELECT and WITH are allowed. Use `datetime('now', '-1 day')` for date math (NOT `now() - INTERVAL '1 day'`), FTS5 `MATCH` for text search.\n\nTables: `sessions`, `turns`, `session_files`, `session_refs`, `checkpoints`, `search_index`. For column details and query patterns, use the **chronicle** skill.\n\nActions: 'query' (execute SQL \u2014 supports JOINs, FTS5 MATCH, aggregations), 'standup' (pre-fetch last 24h data), 'reindex' (rebuild index from debug logs).",tags:[],canBeReferencedInPrompt:!1,inputSchema:{type:"object",properties:{action:{type:"string",enum:["query","standup","reindex"],description:"The action to perform. 'query' (default) executes a SQL query. 'standup' pre-fetches last 24h session data for standup reports. 'reindex' rebuilds the local session index and syncs to cloud if enabled."},query:{type:"string",description:"A single read-only SQL query to execute. Required when action is 'query'. Supports SELECT, WITH, JOINs, aggregations, and FTS5 MATCH. Only one statement per call \u2014 do not combine multiple queries with semicolons."},force:{type:"boolean",description:"When true with action 'reindex', re-processes all sessions including already-indexed ones. Default false (skips already-indexed sessions)."},description:{type:"string",description:"A 2-5 word summary of what this call does (e.g. 'Recent sessions overview', 'Generate standup', 'Reindex sessions')."},subcommand:{type:"string",enum:["standup","tips","cost-tips","search","improve","reindex"],description:"The chronicle subcommand that triggered this call (e.g. 'tips' for /chronicle tips). Used for telemetry attribution only \u2014 pass this whenever the call originates from a /chronicle slash command."}},required:["description"]}}],languageModelToolSets:[{name:"edit",description:"%copilot.toolSet.editing.description%",icon:"$(pencil)",tools:["createDirectory","createFile","createJupyterNotebook","editFiles","editNotebook","rename"]},{name:"execute",description:"",tools:["runNotebookCell","executionSubagent"]},{name:"read",description:"%copilot.toolSet.read.description%",icon:"$(eye)",tools:["getNotebookSummary","problems","readFile","viewImage","readNotebookCellOutput","skill"]},{name:"search",description:"%copilot.toolSet.search.description%",icon:"$(search)",tools:["changes","codebase","fileSearch","listDirectory","textSearch","searchSubagent","usages"]},{name:"vscode",description:"",tools:["installExtension","memory","newWorkspace","resolveMemoryFileUri","runCommand","switchAgent","toolSearch","vscodeAPI"]},{name:"web",description:"%copilot.toolSet.web.description%",icon:"$(globe)",tools:["fetch","githubRepo","githubTextSearch"]}],chatParticipants:[{id:"github.copilot.default",name:"GitHubCopilot",fullName:"GitHub Copilot",description:"%copilot.description%",isDefault:!0,locations:["panel"],modes:["ask"],disambiguation:[{category:"generate_code_sample",description:"The user wants to generate code snippets without referencing the contents of the current workspace. This category does not include generating entire projects.",examples:["Write an example of computing a SHA256 hash."]},{category:"add_feature_to_file",description:"The user wants to change code in a file that is provided in their request, without referencing the contents of the current workspace. This category does not include generating entire projects.",examples:["Add a refresh button to the table widget."]},{category:"question_about_specific_files",description:"The user has a question about a specific file or code snippet that they have provided as part of their query, and the question does not require additional workspace context to answer.",examples:["What does this file do?"]}],commands:[{name:"explain",description:"%copilot.workspace.explain.description%"},{name:"review",description:"%copilot.workspace.review.description%",when:"github.copilot.advanced.review.intent"},{name:"tests",description:"%copilot.workspace.tests.description%",disambiguation:[{category:"create_tests",description:"The user wants to generate unit tests.",examples:["Generate tests for my selection using pytest."]}]},{name:"fix",description:"%copilot.workspace.fix.description%",sampleRequest:"%copilot.workspace.fix.sampleRequest%"},{name:"new",description:"%copilot.workspace.new.description%",sampleRequest:"%copilot.workspace.new.sampleRequest%",isSticky:!0,disambiguation:[{category:"create_new_workspace_or_extension",description:"The user wants to create a complete Visual Studio Code workspace from scratch, such as a new application or a Visual Studio Code extension. Use this category only if the question relates to generating or creating new workspaces in Visual Studio Code. Do not use this category for updating existing code or generating sample code snippets",examples:["Scaffold a Node server.","Create a sample project which uses the fileSystemProvider API.","react application"]}]},{name:"newNotebook",description:"%copilot.workspace.newNotebook.description%",sampleRequest:"%copilot.workspace.newNotebook.sampleRequest%",disambiguation:[{category:"create_jupyter_notebook",description:"The user wants to create a new Jupyter notebook in Visual Studio Code.",examples:["Create a notebook to analyze this CSV file."]}]},{name:"semanticSearch",description:"%copilot.workspace.semanticSearch.description%",sampleRequest:"%copilot.workspace.semanticSearch.sampleRequest%",when:"config.github.copilot.semanticSearch.enabled"},{name:"setupTests",description:"%copilot.vscode.setupTests.description%",sampleRequest:"%copilot.vscode.setupTests.sampleRequest%",when:"config.github.copilot.chat.setupTests.enabled",disambiguation:[{category:"set_up_tests",description:"The user wants to configure project test setup, framework, or test runner. The user does not want to fix their existing tests.",examples:["Set up tests for this project."]}]}]},{id:"github.copilot.editingSession",name:"GitHubCopilot",fullName:"GitHub Copilot",description:"%copilot.edits.description%",isDefault:!0,locations:["panel"],modes:["edit"]},{id:"github.copilot.editingSessionEditor",name:"GitHubCopilot",fullName:"GitHub Copilot",description:"%copilot.edits.description%",isDefault:!0,locations:["editor"],commands:[]},{id:"github.copilot.editsAgent",name:"agent",fullName:"GitHub Copilot",description:"%copilot.agent.description%",locations:["panel"],modes:["agent"],isEngine:!0,isDefault:!0,isAgent:!0,when:"config.chat.agent.enabled",commands:[{name:"error",description:"Make a model request which will result in an error",when:"github.copilot.chat.debug"},{name:"compact",description:"%copilot.agent.compact.description%"},{name:"explain",description:"%copilot.workspace.explain.description%"},{name:"review",description:"%copilot.workspace.review.description%",when:"github.copilot.advanced.review.intent"},{name:"tests",description:"%copilot.workspace.tests.description%",disambiguation:[{category:"create_tests",description:"The user wants to generate unit tests.",examples:["Generate tests for my selection using pytest."]}]},{name:"fix",description:"%copilot.workspace.fix.description%",sampleRequest:"%copilot.workspace.fix.sampleRequest%"},{name:"new",description:"%copilot.workspace.new.description%",sampleRequest:"%copilot.workspace.new.sampleRequest%",isSticky:!0,disambiguation:[{category:"create_new_workspace_or_extension",description:"The user wants to create a complete Visual Studio Code workspace from scratch, such as a new application or a Visual Studio Code extension. Use this category only if the question relates to generating or creating new workspaces in Visual Studio Code. Do not use this category for updating existing code or generating sample code snippets",examples:["Scaffold a Node server.","Create a sample project which uses the fileSystemProvider API.","react application"]}]},{name:"newNotebook",description:"%copilot.workspace.newNotebook.description%",sampleRequest:"%copilot.workspace.newNotebook.sampleRequest%",disambiguation:[{category:"create_jupyter_notebook",description:"The user wants to create a new Jupyter notebook in Visual Studio Code.",examples:["Create a notebook to analyze this CSV file."]}]},{name:"semanticSearch",description:"%copilot.workspace.semanticSearch.description%",sampleRequest:"%copilot.workspace.semanticSearch.sampleRequest%",when:"config.github.copilot.semanticSearch.enabled"},{name:"setupTests",description:"%copilot.vscode.setupTests.description%",sampleRequest:"%copilot.vscode.setupTests.sampleRequest%",when:"config.github.copilot.chat.setupTests.enabled",disambiguation:[{category:"set_up_tests",description:"The user wants to configure project test setup, framework, or test runner. The user does not want to fix their existing tests.",examples:["Set up tests for this project."]}]}]},{id:"github.copilot.notebook",name:"GitHubCopilot",fullName:"GitHub Copilot",description:"%copilot.description%",isDefault:!0,locations:["notebook"],when:"!config.inlineChat.notebookAgent",commands:[{name:"fix",description:"%copilot.workspace.fix.description%"},{name:"explain",description:"%copilot.workspace.explain.description%"}]},{id:"github.copilot.notebookEditorAgent",name:"GitHubCopilot",fullName:"GitHub Copilot",description:"%copilot.description%",isDefault:!0,locations:["notebook"],when:"config.inlineChat.notebookAgent",commands:[{name:"fix",description:"%copilot.workspace.fix.description%"},{name:"explain",description:"%copilot.workspace.explain.description%"}]},{id:"github.copilot.vscode",name:"vscode",fullName:"VS Code",description:"%copilot.vscode.description%",when:"!github.copilot.interactiveSession.disabled",sampleRequest:"%copilot.vscode.sampleRequest%",locations:["panel"],disambiguation:[{category:"vscode_configuration_questions",description:"The user wants to learn about, use, or configure the Visual Studio Code. Use this category if the users question is specifically about commands, settings, keybindings, extensions and other features available in Visual Studio Code. Do not use this category to answer questions about generating code or creating new projects including Visual Studio Code extensions.",examples:["Switch to light mode.","Keyboard shortcut to toggle terminal visibility.","Settings to enable minimap.","Whats new in the latest release?"]},{category:"configure_python_environment",description:"The user wants to set up their Python environment.",examples:["Create a virtual environment for my project."]}],commands:[{name:"search",description:"%copilot.vscode.search.description%",sampleRequest:"%copilot.vscode.search.sampleRequest%"}]},{id:"github.copilot.terminal",name:"terminal",fullName:"Terminal",description:"%copilot.terminal.description%",when:"!github.copilot.interactiveSession.disabled",sampleRequest:"%copilot.terminal.sampleRequest%",isDefault:!0,locations:["terminal"],commands:[{name:"explain",description:"%copilot.terminal.explain.description%",sampleRequest:"%copilot.terminal.explain.sampleRequest%"}]},{id:"github.copilot.terminalPanel",name:"terminal",fullName:"Terminal",description:"%copilot.terminalPanel.description%",when:"!github.copilot.interactiveSession.disabled",sampleRequest:"%copilot.terminal.sampleRequest%",locations:["panel"],commands:[{name:"explain",description:"%copilot.terminal.explain.description%",sampleRequest:"%copilot.terminal.explain.sampleRequest%",disambiguation:[{category:"terminal_state_questions",description:"The user wants to learn about specific state such as the selection, command, or failed command in the integrated terminal in Visual Studio Code.",examples:["Why did the latest terminal command fail?"]}]}]}],languageModelChatProviders:[{vendor:"copilot",displayName:"Copilot"},{vendor:"copilotcli",displayName:"Copilot CLI",when:"false"},{vendor:"claude-code",displayName:"Claude Code",when:"false"},{vendor:"anthropic",displayName:"Anthropic",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for Anthropic",title:"API Key"}},required:["apiKey"]}},{vendor:"xai",displayName:"xAI",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for xAI",title:"API Key"}},required:["apiKey"]}},{vendor:"gemini",displayName:"Google",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for Google Gemini",title:"API Key"}},required:["apiKey"]}},{vendor:"openrouter",displayName:"OpenRouter",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for OpenRouter",title:"API Key"}},required:["apiKey"]}},{vendor:"openai",displayName:"OpenAI",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for OpenAI",title:"API Key"}},required:["apiKey"]}},{vendor:"ollama",displayName:"Ollama",configuration:{type:"object",properties:{url:{type:"string",description:"The endpoint URL for the Ollama server",default:"http://localhost:11434",title:"URL"}},required:["url"]}},{vendor:"customoai",when:"productQualityType != 'stable'",displayName:"OpenAI Compatible (Deprecated)",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for the models",title:"API Key",markdownDeprecationMessage:'**Deprecated.** Use the `customendpoint` provider ("Custom Endpoint") instead. It supports the Chat Completions API, the Responses API, and the Messages API \u2014 selectable per model via the `apiType` property.'},models:{type:"array",markdownDeprecationMessage:'**Deprecated.** Use the `customendpoint` provider ("Custom Endpoint") instead. It supports the Chat Completions API, the Responses API, and the Messages API \u2014 selectable per model via the `apiType` property.',defaultSnippets:[{label:"New Model",description:"Add a new custom model configuration",body:[{id:"$1",name:"$2",url:"$3",toolCalling:"^${4|true,false|}",vision:"^${5|true,false|}",maxInputTokens:"^${6:128000}",maxOutputTokens:"^${7:16000}"}]}],items:{type:"object",properties:{id:{type:"string",description:"Unique identifier for the model"},name:{type:"string",description:"Display name of the custom OpenAI model"},url:{type:"string",markdownDescription:"URL endpoint for the custom OpenAI-compatible model.\n\n**Important:** Base URLs default to Chat Completions API. Explicit API paths including `/responses` or `/chat/completions` are respected."},toolCalling:{type:"boolean",description:"Whether the model supports tool calling"},vision:{type:"boolean",description:"Whether the model supports vision capabilities"},maxInputTokens:{type:"number",description:"Maximum number of input tokens supported by the model"},maxOutputTokens:{type:"number",description:"Maximum number of output tokens supported by the model"},editTools:{type:"array",description:`List of edit tools supported by the model. If this is not configured, the editor will try multiple edit tools and pick the best one. +- User gave explicit step-by-step instructions \u2192 follow them directly`,when:"config.github.copilot.chat.switchAgent.enabled",icon:"$(arrow-swap)",inputSchema:{type:"object",properties:{agentName:{type:"string",description:"The name of the agent to switch to. Currently only 'Plan' is supported.",enum:["Plan"]}},required:["agentName"]}},{name:"copilot_memory",displayName:"Memory",toolReferenceName:"memory",userDescription:"Manage persistent memory across conversations",modelDescription:'Manage a persistent memory system with three scopes for storing notes and information across conversations.\n\nMemory is organized under /memories/ with three tiers:\n- `/memories/` \u2014 User memory: persistent notes that survive across all workspaces and conversations. Store preferences, patterns, and general insights here.\n- `/memories/session/` \u2014 Session memory: notes scoped to the current conversation. Store task-specific context and in-progress notes here. Cleared after the conversation ends.\n- `/memories/repo/` \u2014 Repository memory: repository-scoped notes stored locally in the workspace. Store codebase conventions, build commands, project structure facts, and verified practices here.\n\nIMPORTANT: Before creating new memory files, first view the /memories/ directory to understand what already exists. This helps avoid duplicates and maintain organized notes.\n\nCommands:\n- `view`: View contents of a file or list directory contents. Can be used on files or directories (e.g., "/memories/" to see all top-level items).\n- `create`: Create a new file at the specified path with the given content. Fails if the file already exists.\n- `str_replace`: Replace an exact string in a file with a new string. The old_str must appear exactly once in the file.\n- `insert`: Insert text at a specific line number in a file. Line 0 inserts at the beginning.\n- `delete`: Delete a file or directory (and all its contents).\n- `rename`: Rename or move a file or directory from path to new_path. Cannot rename across scopes.',inputSchema:{type:"object",properties:{command:{type:"string",enum:["view","create","str_replace","insert","delete","rename"],description:"The operation to perform on the memory file system."},path:{type:"string",description:'The absolute path to the file or directory inside /memories/, e.g. "/memories/notes.md". Used by all commands except `rename`.'},file_text:{type:"string",description:"Required for `create`. The content of the file to create."},old_str:{type:"string",description:"Required for `str_replace`. The exact string in the file to replace. Must appear exactly once."},new_str:{type:"string",description:"Required for `str_replace`. The new string to replace old_str with."},insert_line:{type:"number",description:"Required for `insert`. The 0-based line number to insert text at. 0 inserts before the first line."},insert_text:{type:"string",description:"Required for `insert`. The text to insert at the specified line."},view_range:{type:"array",items:{type:"number"},minItems:2,maxItems:2,description:"Optional for `view`. A two-element array [start_line, end_line] (1-indexed) to view a specific range of lines."},old_path:{type:"string",description:"Required for `rename`. The current path of the file or directory to rename."},new_path:{type:"string",description:"Required for `rename`. The new path for the file or directory."}},required:["command"]}},{name:"copilot_resolveMemoryFileUri",displayName:"Resolve Memory File URI",toolReferenceName:"resolveMemoryFileUri",userDescription:"Resolve a memory file path to its actual URI",modelDescription:"Resolve a memory file path (like /memories/session/plan.md or /memories/repo/notes.md) to its fully qualified URI. Use this when you need the actual URI for a memory file, for example to pass it to setArtifacts. The path must start with /memories/.",tags:[],inputSchema:{type:"object",properties:{path:{type:"string",description:"The memory file path to resolve (e.g. /memories/session/plan.md)."}},required:["path"]}},{name:"copilot_editFiles",modelDescription:"This is a placeholder tool, do not use",userDescription:"Edit files",icon:"$(pencil)",displayName:"Edit Files",toolReferenceName:"editFiles",legacyToolReferenceFullNames:["editFiles"]},{name:"copilot_sessionStoreSql",displayName:"Session Store SQL",toolReferenceName:"sessionStoreSql",when:"github.copilot.sessionSearch.enabled",userDescription:"Query your Copilot session history using SQL",modelDescription:"Query the local session store containing history from past coding sessions. Uses SQLite syntax (NOT DuckDB or Postgres). SQL queries are read-only \u2014 only SELECT and WITH are allowed. Use `datetime('now', '-1 day')` for date math (NOT `now() - INTERVAL '1 day'`), FTS5 `MATCH` for text search.\n\nTables: `sessions`, `turns`, `session_files`, `session_refs`, `checkpoints`, `search_index`. For column details and query patterns, use the **chronicle** skill.\n\nActions: 'query' (execute SQL \u2014 supports JOINs, FTS5 MATCH, aggregations), 'reindex' (rebuild index from debug logs).",tags:[],canBeReferencedInPrompt:!1,inputSchema:{type:"object",properties:{action:{type:"string",enum:["query","reindex"],description:"The action to perform. 'query' (default) executes a SQL query. 'reindex' rebuilds the local session index and syncs to cloud if enabled."},query:{type:"string",description:"A single read-only SQL query to execute. Required when action is 'query'. Supports SELECT, WITH, JOINs, aggregations, and FTS5 MATCH. Only one statement per call \u2014 do not combine multiple queries with semicolons."},force:{type:"boolean",description:"When true with action 'reindex', re-processes all sessions including already-indexed ones. Default false (skips already-indexed sessions)."},description:{type:"string",description:"A 2-5 word summary of what this call does (e.g. 'Recent sessions overview', 'Generate standup', 'Reindex sessions')."},subcommand:{type:"string",enum:["standup","tips","cost-tips","search","improve","reindex"],description:"The chronicle subcommand that triggered this call (e.g. 'tips' for /chronicle tips). Used for telemetry attribution only \u2014 pass this whenever the call originates from a /chronicle slash command."}},required:["description"]}}],languageModelToolSets:[{name:"edit",description:"%copilot.toolSet.editing.description%",icon:"$(pencil)",tools:["createDirectory","createFile","createJupyterNotebook","editFiles","editNotebook","rename"]},{name:"execute",description:"",tools:["runNotebookCell","executionSubagent"]},{name:"read",description:"%copilot.toolSet.read.description%",icon:"$(eye)",tools:["getNotebookSummary","problems","readFile","viewImage","readNotebookCellOutput","skill"]},{name:"search",description:"%copilot.toolSet.search.description%",icon:"$(search)",tools:["changes","codebase","fileSearch","listDirectory","textSearch","searchSubagent","usages"]},{name:"vscode",description:"",tools:["installExtension","memory","newWorkspace","resolveMemoryFileUri","runCommand","switchAgent","toolSearch","vscodeAPI"]},{name:"web",description:"%copilot.toolSet.web.description%",icon:"$(globe)",tools:["fetch","githubRepo","githubTextSearch"]}],chatParticipants:[{id:"github.copilot.default",name:"GitHubCopilot",fullName:"GitHub Copilot",description:"%copilot.description%",isDefault:!0,locations:["panel"],modes:["ask"],disambiguation:[{category:"generate_code_sample",description:"The user wants to generate code snippets without referencing the contents of the current workspace. This category does not include generating entire projects.",examples:["Write an example of computing a SHA256 hash."]},{category:"add_feature_to_file",description:"The user wants to change code in a file that is provided in their request, without referencing the contents of the current workspace. This category does not include generating entire projects.",examples:["Add a refresh button to the table widget."]},{category:"question_about_specific_files",description:"The user has a question about a specific file or code snippet that they have provided as part of their query, and the question does not require additional workspace context to answer.",examples:["What does this file do?"]}],commands:[{name:"explain",description:"%copilot.workspace.explain.description%"},{name:"review",description:"%copilot.workspace.review.description%",when:"github.copilot.advanced.review.intent"},{name:"tests",description:"%copilot.workspace.tests.description%",disambiguation:[{category:"create_tests",description:"The user wants to generate unit tests.",examples:["Generate tests for my selection using pytest."]}]},{name:"fix",description:"%copilot.workspace.fix.description%",sampleRequest:"%copilot.workspace.fix.sampleRequest%"},{name:"new",description:"%copilot.workspace.new.description%",sampleRequest:"%copilot.workspace.new.sampleRequest%",isSticky:!0,disambiguation:[{category:"create_new_workspace_or_extension",description:"The user wants to create a complete Visual Studio Code workspace from scratch, such as a new application or a Visual Studio Code extension. Use this category only if the question relates to generating or creating new workspaces in Visual Studio Code. Do not use this category for updating existing code or generating sample code snippets",examples:["Scaffold a Node server.","Create a sample project which uses the fileSystemProvider API.","react application"]}]},{name:"newNotebook",description:"%copilot.workspace.newNotebook.description%",sampleRequest:"%copilot.workspace.newNotebook.sampleRequest%",disambiguation:[{category:"create_jupyter_notebook",description:"The user wants to create a new Jupyter notebook in Visual Studio Code.",examples:["Create a notebook to analyze this CSV file."]}]},{name:"semanticSearch",description:"%copilot.workspace.semanticSearch.description%",sampleRequest:"%copilot.workspace.semanticSearch.sampleRequest%",when:"config.github.copilot.semanticSearch.enabled"},{name:"setupTests",description:"%copilot.vscode.setupTests.description%",sampleRequest:"%copilot.vscode.setupTests.sampleRequest%",when:"config.github.copilot.chat.setupTests.enabled",disambiguation:[{category:"set_up_tests",description:"The user wants to configure project test setup, framework, or test runner. The user does not want to fix their existing tests.",examples:["Set up tests for this project."]}]}]},{id:"github.copilot.editingSession",name:"GitHubCopilot",fullName:"GitHub Copilot",description:"%copilot.edits.description%",isDefault:!0,locations:["panel"],modes:["edit"]},{id:"github.copilot.editingSessionEditor",name:"GitHubCopilot",fullName:"GitHub Copilot",description:"%copilot.edits.description%",isDefault:!0,locations:["editor"],commands:[]},{id:"github.copilot.editsAgent",name:"agent",fullName:"GitHub Copilot",description:"%copilot.agent.description%",locations:["panel"],modes:["agent"],isEngine:!0,isDefault:!0,isAgent:!0,when:"config.chat.agent.enabled",commands:[{name:"error",description:"Make a model request which will result in an error",when:"github.copilot.chat.debug"},{name:"compact",description:"%copilot.agent.compact.description%"},{name:"explain",description:"%copilot.workspace.explain.description%"},{name:"review",description:"%copilot.workspace.review.description%",when:"github.copilot.advanced.review.intent"},{name:"tests",description:"%copilot.workspace.tests.description%",disambiguation:[{category:"create_tests",description:"The user wants to generate unit tests.",examples:["Generate tests for my selection using pytest."]}]},{name:"fix",description:"%copilot.workspace.fix.description%",sampleRequest:"%copilot.workspace.fix.sampleRequest%"},{name:"new",description:"%copilot.workspace.new.description%",sampleRequest:"%copilot.workspace.new.sampleRequest%",isSticky:!0,disambiguation:[{category:"create_new_workspace_or_extension",description:"The user wants to create a complete Visual Studio Code workspace from scratch, such as a new application or a Visual Studio Code extension. Use this category only if the question relates to generating or creating new workspaces in Visual Studio Code. Do not use this category for updating existing code or generating sample code snippets",examples:["Scaffold a Node server.","Create a sample project which uses the fileSystemProvider API.","react application"]}]},{name:"newNotebook",description:"%copilot.workspace.newNotebook.description%",sampleRequest:"%copilot.workspace.newNotebook.sampleRequest%",disambiguation:[{category:"create_jupyter_notebook",description:"The user wants to create a new Jupyter notebook in Visual Studio Code.",examples:["Create a notebook to analyze this CSV file."]}]},{name:"semanticSearch",description:"%copilot.workspace.semanticSearch.description%",sampleRequest:"%copilot.workspace.semanticSearch.sampleRequest%",when:"config.github.copilot.semanticSearch.enabled"},{name:"setupTests",description:"%copilot.vscode.setupTests.description%",sampleRequest:"%copilot.vscode.setupTests.sampleRequest%",when:"config.github.copilot.chat.setupTests.enabled",disambiguation:[{category:"set_up_tests",description:"The user wants to configure project test setup, framework, or test runner. The user does not want to fix their existing tests.",examples:["Set up tests for this project."]}]}]},{id:"github.copilot.notebook",name:"GitHubCopilot",fullName:"GitHub Copilot",description:"%copilot.description%",isDefault:!0,locations:["notebook"],when:"!config.inlineChat.notebookAgent",commands:[{name:"fix",description:"%copilot.workspace.fix.description%"},{name:"explain",description:"%copilot.workspace.explain.description%"}]},{id:"github.copilot.notebookEditorAgent",name:"GitHubCopilot",fullName:"GitHub Copilot",description:"%copilot.description%",isDefault:!0,locations:["notebook"],when:"config.inlineChat.notebookAgent",commands:[{name:"fix",description:"%copilot.workspace.fix.description%"},{name:"explain",description:"%copilot.workspace.explain.description%"}]},{id:"github.copilot.vscode",name:"vscode",fullName:"VS Code",description:"%copilot.vscode.description%",when:"!github.copilot.interactiveSession.disabled",sampleRequest:"%copilot.vscode.sampleRequest%",locations:["panel"],disambiguation:[{category:"vscode_configuration_questions",description:"The user wants to learn about, use, or configure the Visual Studio Code. Use this category if the users question is specifically about commands, settings, keybindings, extensions and other features available in Visual Studio Code. Do not use this category to answer questions about generating code or creating new projects including Visual Studio Code extensions.",examples:["Switch to light mode.","Keyboard shortcut to toggle terminal visibility.","Settings to enable minimap.","Whats new in the latest release?"]},{category:"configure_python_environment",description:"The user wants to set up their Python environment.",examples:["Create a virtual environment for my project."]}],commands:[{name:"search",description:"%copilot.vscode.search.description%",sampleRequest:"%copilot.vscode.search.sampleRequest%"}]},{id:"github.copilot.terminal",name:"terminal",fullName:"Terminal",description:"%copilot.terminal.description%",when:"!github.copilot.interactiveSession.disabled",sampleRequest:"%copilot.terminal.sampleRequest%",isDefault:!0,locations:["terminal"],commands:[{name:"explain",description:"%copilot.terminal.explain.description%",sampleRequest:"%copilot.terminal.explain.sampleRequest%"}]},{id:"github.copilot.terminalPanel",name:"terminal",fullName:"Terminal",description:"%copilot.terminalPanel.description%",when:"!github.copilot.interactiveSession.disabled",sampleRequest:"%copilot.terminal.sampleRequest%",locations:["panel"],commands:[{name:"explain",description:"%copilot.terminal.explain.description%",sampleRequest:"%copilot.terminal.explain.sampleRequest%",disambiguation:[{category:"terminal_state_questions",description:"The user wants to learn about specific state such as the selection, command, or failed command in the integrated terminal in Visual Studio Code.",examples:["Why did the latest terminal command fail?"]}]}]}],languageModelChatProviders:[{vendor:"copilot",displayName:"Copilot"},{vendor:"copilotcli",displayName:"Copilot CLI",when:"false"},{vendor:"claude-code",displayName:"Claude Code",when:"false"},{vendor:"anthropic",displayName:"Anthropic",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for Anthropic",title:"API Key"}},required:["apiKey"]}},{vendor:"xai",displayName:"xAI",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for xAI",title:"API Key"}},required:["apiKey"]}},{vendor:"gemini",displayName:"Google",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for Google Gemini",title:"API Key"}},required:["apiKey"]}},{vendor:"openrouter",displayName:"OpenRouter",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for OpenRouter",title:"API Key"}},required:["apiKey"]}},{vendor:"openai",displayName:"OpenAI",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for OpenAI",title:"API Key"}},required:["apiKey"]}},{vendor:"ollama",displayName:"Ollama",configuration:{type:"object",properties:{url:{type:"string",description:"The endpoint URL for the Ollama server",default:"http://localhost:11434",title:"URL"}},required:["url"]}},{vendor:"customoai",when:"productQualityType != 'stable'",displayName:"OpenAI Compatible (Deprecated)",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for the models",title:"API Key",markdownDeprecationMessage:'**Deprecated.** Use the `customendpoint` provider ("Custom Endpoint") instead. It supports the Chat Completions API, the Responses API, and the Messages API \u2014 selectable per model via the `apiType` property.'},models:{type:"array",markdownDeprecationMessage:'**Deprecated.** Use the `customendpoint` provider ("Custom Endpoint") instead. It supports the Chat Completions API, the Responses API, and the Messages API \u2014 selectable per model via the `apiType` property.',defaultSnippets:[{label:"New Model",description:"Add a new custom model configuration",body:[{id:"$1",name:"$2",url:"$3",toolCalling:"^${4|true,false|}",vision:"^${5|true,false|}",maxInputTokens:"^${6:128000}",maxOutputTokens:"^${7:16000}"}]}],items:{type:"object",properties:{id:{type:"string",description:"Unique identifier for the model"},name:{type:"string",description:"Display name of the custom OpenAI model"},url:{type:"string",markdownDescription:"URL endpoint for the custom OpenAI-compatible model.\n\n**Important:** Base URLs default to Chat Completions API. Explicit API paths including `/responses` or `/chat/completions` are respected."},toolCalling:{type:"boolean",description:"Whether the model supports tool calling"},vision:{type:"boolean",description:"Whether the model supports vision capabilities"},maxInputTokens:{type:"number",description:"Maximum number of input tokens supported by the model"},maxOutputTokens:{type:"number",description:"Maximum number of output tokens supported by the model"},editTools:{type:"array",description:`List of edit tools supported by the model. If this is not configured, the editor will try multiple edit tools and pick the best one. - 'find-replace': Find and replace text in a document. - 'multi-find-replace': Find and replace text in a document. @@ -762,47 +756,55 @@ EXAMPLES: - 'find-replace': Find and replace text in a document. - 'multi-find-replace': Find and replace text in a document. - 'apply-patch': A file-oriented diff format used by some OpenAI models -- 'code-rewrite': A general but slower editing tool that allows the model to rewrite and code snippet and provide only the replacement to the editor.`,items:{type:"string",enum:["find-replace","multi-find-replace","apply-patch","code-rewrite"]}},thinking:{type:"boolean",default:!1,description:"Whether the model supports thinking capabilities"},streaming:{type:"boolean",default:!0,description:"Whether the model supports streaming responses. Defaults to true."},zeroDataRetentionEnabled:{type:"boolean",default:!1,markdownDescription:"Whether Zero Data Retention (ZDR) is enabled for this endpoint. When `true`, `previous_response_id` will not be sent in requests via Responses API."},supportsReasoningEffort:{type:"array",markdownDescription:'Reasoning effort levels the model accepts (e.g. `["low", "medium", "high"]`). When set, a `Thinking Effort` picker is shown in the model picker and the chosen value is forwarded to the model. Levels supported by mainstream OpenAI-compatible servers are `minimal`, `low`, `medium`, `high`.',items:{type:"string"}},reasoningEffortFormat:{type:"string",enum:["chat-completions","responses"],markdownDescription:"Body shape used to forward the reasoning effort to the model. `chat-completions` sends a top-level `reasoning_effort` string. `responses` sends a nested `reasoning.effort` object. When unset the format follows the URL: `/responses` \u2192 nested, otherwise top-level."},requestHeaders:{type:"object",description:"Additional HTTP headers to include with requests to this model. These reserved headers are not allowed and ignored if present: forbidden request headers (https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header), forwarding headers ('forwarded', 'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto'), and others ('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'). Pattern-based forbidden headers ('proxy-*', 'sec-*', 'x-http-method*' with forbidden methods) are also blocked.",additionalProperties:{type:"string"}}},required:["id","name","url","toolCalling","vision","maxInputTokens","maxOutputTokens"]}}}}},{vendor:"azure",displayName:"Azure",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for the models. If not set then Entra ID (Azure AD) authentication with your Microsoft account credentials will be used.",title:"API Key"},models:{type:"array",defaultSnippets:[{label:"New Model",description:"Add a new custom model configuration",body:[{id:"$1",name:"$2",url:"$3",toolCalling:"^${4|true,false|}",vision:"^${5|true,false|}",maxInputTokens:"^${6:128000}",maxOutputTokens:"^${7:16000}"}]}],items:{type:"object",properties:{id:{type:"string",description:"Unique identifier for the model"},name:{type:"string",description:"Display name of the custom OpenAI model"},url:{type:"string",markdownDescription:"URL endpoint for the custom OpenAI-compatible model.\n\n**Important:** Base URLs default to Chat Completions API. Explicit API paths including `/responses` or `/chat/completions` are respected."},toolCalling:{type:"boolean",description:"Whether the model supports tool calling"},vision:{type:"boolean",description:"Whether the model supports vision capabilities"},maxInputTokens:{type:"number",description:"Maximum number of input tokens supported by the model"},maxOutputTokens:{type:"number",description:"Maximum number of output tokens supported by the model"},thinking:{type:"boolean",default:!1,description:"Whether the model supports thinking capabilities"},streaming:{type:"boolean",default:!0,description:"Whether the model supports streaming responses. Defaults to true."},zeroDataRetentionEnabled:{type:"boolean",default:!1,markdownDescription:"Whether Zero Data Retention (ZDR) is enabled for this endpoint. When `true`, `previous_response_id` will not be sent in requests via Responses API."},supportsReasoningEffort:{type:"array",markdownDescription:'Reasoning effort levels the model accepts (e.g. `["low", "medium", "high"]`). When set, a `Thinking Effort` picker is shown in the model picker and the chosen value is forwarded to the model. Levels supported by mainstream OpenAI-compatible servers are `minimal`, `low`, `medium`, `high`.',items:{type:"string"}},reasoningEffortFormat:{type:"string",enum:["chat-completions","responses"],markdownDescription:"Body shape used to forward the reasoning effort to the model. `chat-completions` sends a top-level `reasoning_effort` string. `responses` sends a nested `reasoning.effort` object. When unset the format follows the URL: `/responses` \u2192 nested, otherwise top-level."},requestHeaders:{type:"object",description:"Additional HTTP headers to include with requests to this model. These reserved headers are not allowed and ignored if present: forbidden request headers (https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header), forwarding headers ('forwarded', 'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto'), and others ('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'). Pattern-based forbidden headers ('proxy-*', 'sec-*', 'x-http-method*' with forbidden methods) are also blocked.",additionalProperties:{type:"string"}}},required:["id","name","url","toolCalling","vision","maxInputTokens","maxOutputTokens"]}}}}}],interactiveSession:[{label:"GitHub Copilot",id:"copilot",icon:"",when:"!github.copilot.interactiveSession.disabled"}],mcpServerDefinitionProviders:[{id:"github",label:"GitHub"}],viewsWelcome:[{view:"debug",when:"github.copilot-chat.activated",contents:"%github.copilot.viewsWelcome.debug%"}],chatViewsWelcome:[{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.individual.expired%",when:"github.copilot.interactiveSession.individual.expired && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.enterprise%",when:"github.copilot.interactiveSession.enterprise.disabled && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.offline%",when:"github.copilot.offline && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.invalidToken%",when:"github.copilot.interactiveSession.invalidToken && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.rateLimited%",when:"github.copilot.interactiveSession.rateLimited && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.gitHubLoginFailed%",when:"github.copilot.interactiveSession.gitHubLoginFailed && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.contactSupport%",when:"github.copilot.interactiveSession.contactSupport && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.chatDisabled%",when:"github.copilot.interactiveSession.chatDisabled && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.switchToReleaseChannel%",when:"github.copilot.interactiveSession.switchToReleaseChannel"}],commands:[{command:"github.copilot.chat.triggerPermissiveSignIn",title:"%github.copilot.command.triggerPermissiveSignIn%"},{command:"copilot.claude.agents",title:"Manage Agents",category:"Claude Agent"},{command:"copilot.claude.hooks",title:"Configure Hooks",category:"Claude Agent"},{command:"copilot.claude.memory",title:"Open Memory Files",category:"Claude Agent"},{command:"github.copilot.cli.sessions.delete",title:"%github.copilot.command.deleteAgentSession%",icon:"$(close)",category:"Copilot CLI"},{command:"agents.github.copilot.cli.deleteSessions",title:"%github.copilot.command.deleteAgentSession%",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.resumeInTerminal",title:"%github.copilot.command.cli.sessions.resumeInTerminal%",icon:"$(terminal)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.rename",title:"%github.copilot.command.cli.sessions.rename%",icon:"$(edit)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.setTitle",title:"%github.copilot.command.cli.sessions.setTitle%",category:"Copilot CLI"},{command:"github.copilot.claude.sessions.rename",title:"%github.copilot.command.claude.sessions.rename%",icon:"$(edit)",category:"Claude"},{command:"github.copilot.cli.sessions.openRepository",title:"%github.copilot.command.cli.sessions.openRepository%",icon:"$(folder-opened)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",title:"%github.copilot.command.cli.sessions.openWorktreeInNewWindow%",icon:"$(folder-opened)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",title:"%github.copilot.command.cli.sessions.openWorktreeInTerminal%",icon:"$(terminal)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",title:"%github.copilot.command.cli.sessions.copyWorktreeBranchName%",icon:"$(copy)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.commitToWorktree",title:"%github.copilot.command.cli.sessions.commitToWorktree%",icon:"$(git-commit)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.commitToRepository",title:"%github.copilot.command.cli.sessions.commitToRepository%",icon:"$(git-commit)",category:"Copilot CLI"},{command:"github.copilot.cli.newSession",title:"%github.copilot.command.cli.newSession%",icon:"$(terminal)",category:"Chat"},{command:"github.copilot.cli.newSessionToSide",title:"%github.copilot.command.cli.newSessionToSide%",icon:"$(terminal)",category:"Chat"},{command:"github.copilot.cli.openInCopilotCLI",title:"%github.copilot.command.cli.openInCopilotCLI%",icon:"$(terminal)",category:"Copilot CLI"},{command:"github.copilot.chat.compact",title:"%github.copilot.command.compactConversation%"},{command:"github.copilot.chat.explain",title:"%github.copilot.command.explainThis%",enablement:"!github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.explain.palette",title:"%github.copilot.command.explainThis%",enablement:"!github.copilot.interactiveSession.disabled && !editorReadonly",category:"Chat"},{command:"github.copilot.chat.review",title:"%github.copilot.command.reviewAndComment%",enablement:"config.github.copilot.chat.reviewSelection.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.review.apply",title:"%github.copilot.command.applyReviewSuggestion%",icon:"$(sparkle)",enablement:"commentThread =~ /hasSuggestion/",category:"Chat"},{command:"github.copilot.chat.review.applyAndNext",title:"%github.copilot.command.applyReviewSuggestionAndNext%",icon:"$(sparkle)",enablement:"commentThread =~ /hasSuggestion/",category:"Chat"},{command:"github.copilot.chat.review.discard",title:"%github.copilot.command.discardReviewSuggestion%",icon:"$(close)",category:"Chat"},{command:"github.copilot.chat.review.discardAndNext",title:"%github.copilot.command.discardReviewSuggestionAndNext%",icon:"$(close)",category:"Chat"},{command:"github.copilot.chat.review.discardAll",title:"%github.copilot.command.discardAllReviewSuggestion%",icon:"$(close-all)",category:"Chat"},{command:"github.copilot.chat.review.stagedChanges",title:"%github.copilot.command.reviewStagedChanges%",icon:"$(code-review)",enablement:"github.copilot.chat.reviewDiff.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.review.unstagedChanges",title:"%github.copilot.command.reviewUnstagedChanges%",icon:"$(code-review)",enablement:"github.copilot.chat.reviewDiff.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.review.changes",title:"%github.copilot.command.reviewChanges%",icon:"$(code-review)",enablement:"github.copilot.chat.reviewDiff.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.review.stagedFileChange",title:"%github.copilot.command.reviewFileChange%",icon:"$(code-review)",enablement:"github.copilot.chat.reviewDiff.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.review.unstagedFileChange",title:"%github.copilot.command.reviewFileChange%",icon:"$(code-review)",enablement:"github.copilot.chat.reviewDiff.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.codeReview.run",title:"%github.copilot.command.codeReviewRun%",enablement:"github.copilot.chat.reviewDiff.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.review.previous",title:"%github.copilot.command.gotoPreviousReviewSuggestion%",icon:"$(arrow-up)",category:"Chat"},{command:"github.copilot.chat.review.next",title:"%github.copilot.command.gotoNextReviewSuggestion%",icon:"$(arrow-down)",category:"Chat"},{command:"github.copilot.chat.review.continueInInlineChat",title:"%github.copilot.command.continueReviewInInlineChat%",icon:"$(comment-discussion)",category:"Chat"},{command:"github.copilot.chat.review.continueInChat",title:"%github.copilot.command.continueReviewInChat%",icon:"$(comment-discussion)",category:"Chat"},{command:"github.copilot.chat.review.markHelpful",title:"%github.copilot.command.helpfulReviewSuggestion%",icon:"$(thumbsup)",enablement:"!(commentThread =~ /markedAsHelpful/)",category:"Chat"},{command:"github.copilot.chat.openUserPreferences",title:"%github.copilot.command.openUserPreferences%",category:"Chat",enablement:"config.github.copilot.chat.enableUserPreferences"},{command:"github.copilot.chat.review.markUnhelpful",title:"%github.copilot.command.unhelpfulReviewSuggestion%",icon:"$(thumbsdown)",enablement:"!(commentThread =~ /markedAsUnhelpful/)",category:"Chat"},{command:"github.copilot.chat.generate",title:"%github.copilot.command.generateThis%",icon:"$(sparkle)",enablement:"!github.copilot.interactiveSession.disabled && !editorReadonly",category:"Chat"},{command:"github.copilot.chat.fix",title:"%github.copilot.command.fixThis%",enablement:"!github.copilot.interactiveSession.disabled && !editorReadonly",category:"Chat"},{command:"github.copilot.interactiveSession.feedback",title:"%github.copilot.command.sendChatFeedback%",enablement:"github.copilot-chat.activated && !github.copilot.interactiveSession.disabled",icon:"$(feedback)",category:"Chat"},{command:"github.copilot.debug.workbenchState",title:"%github.copilot.command.logWorkbenchState%",category:"Developer"},{command:"github.copilot.debug.togglePowerSaveBlocker",title:"%github.copilot.command.togglePowerSaveBlocker%",category:"Developer"},{command:"github.copilot.debug.showChatLogView",title:"%github.copilot.command.showChatLogView%",category:"Developer"},{command:"github.copilot.debug.showOutputChannel",title:"%github.copilot.command.showOutputChannel%",category:"Developer"},{command:"github.copilot.debug.showContextInspectorView",title:"%github.copilot.command.showContextInspectorView%",icon:"$(inspect)",category:"Developer"},{command:"github.copilot.debug.validateNesRename",title:"%github.copilot.command.validateNesRename%",category:"Developer"},{command:"github.copilot.debug.resetVirtualToolGroups",title:"%github.copilot.command.resetVirtualToolGroups%",icon:"$(inspect)",category:"Developer"},{command:"github.copilot.debug.extensionState",title:"%github.copilot.command.extensionState%",category:"Developer"},{command:"github.copilot.chat.tools.memory.showMemories",title:"%github.copilot.command.showMemories%",category:"Chat"},{command:"github.copilot.chat.tools.memory.clearMemories",title:"%github.copilot.command.clearMemories%",category:"Chat"},{command:"github.copilot.terminal.explainTerminalLastCommand",title:"%github.copilot.command.explainTerminalLastCommand%",category:"Chat"},{command:"github.copilot.git.generateCommitMessage",title:"%github.copilot.git.generateCommitMessage%",icon:"$(sparkle)",enablement:"!github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.git.resolveMergeConflicts",title:"%github.copilot.git.resolveMergeConflicts%",icon:"$(chat-sparkle)",enablement:"!github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.devcontainer.generateDevContainerConfig",title:"%github.copilot.devcontainer.generateDevContainerConfig%",category:"Chat"},{command:"github.copilot.tests.fixTestFailure",icon:"$(sparkle)",title:"%github.copilot.command.fixTestFailure%",category:"Chat"},{command:"github.copilot.tests.fixTestFailure.fromInline",icon:"$(sparkle)",title:"%github.copilot.command.fixTestFailure%"},{command:"github.copilot.chat.attachFile",title:"%github.copilot.chat.attachFile%",category:"Chat"},{command:"github.copilot.chat.attachSelection",title:"%github.copilot.chat.attachSelection%",icon:"$(comment-discussion)",category:"Chat"},{command:"github.copilot.debug.collectDiagnostics",title:"%github.copilot.command.collectDiagnostics%",category:"Developer"},{command:"github.copilot.debug.inlineEdit.clearCache",title:"%github.copilot.command.inlineEdit.clearCache%",category:"Developer"},{command:"github.copilot.debug.inlineEdit.reportNotebookNESIssue",title:"%github.copilot.command.inlineEdit.reportNotebookNESIssue%",enablement:"config.github.copilot.chat.advanced.notebook.alternativeNESFormat.enabled || github.copilot.chat.enableEnhancedNotebookNES",category:"Developer"},{command:"github.copilot.debug.generateSTest",title:"%github.copilot.command.generateSTest%",enablement:"github.copilot.debugReportFeedback",category:"Developer"},{command:"github.copilot.open.walkthrough",title:"%github.copilot.command.openWalkthrough%",category:"Chat"},{command:"github.copilot.debug.generateInlineEditTests",title:"Generate Inline Edit Tests",category:"Chat",enablement:"resourceScheme == 'ccreq'"},{command:"github.copilot.buildRemoteWorkspaceIndex",title:"%github.copilot.command.buildRemoteWorkspaceIndex%",category:"Chat",enablement:"github.copilot-chat.activated"},{command:"github.copilot.deleteExternalIngestWorkspaceIndex",title:"%github.copilot.command.deleteExternalIngestWorkspaceIndex%",category:"Developer",enablement:"github.copilot-chat.activated && !github.copilot.blackbirdExternalIndexingDisabled"},{command:"github.copilot.report",title:"Report Issue",category:"Chat"},{command:"github.copilot.chat.rerunWithCopilotDebug",title:"%github.copilot.command.rerunWithCopilotDebug%",category:"Chat"},{command:"github.copilot.chat.startCopilotDebugCommand",title:"Start Copilot Debug"},{command:"github.copilot.chat.clearTemporalContext",title:"Clear Temporal Context",category:"Developer"},{command:"github.copilot.search.markHelpful",title:"Helpful",icon:"$(thumbsup)",enablement:"!github.copilot.search.feedback.sent"},{command:"github.copilot.search.markUnhelpful",title:"Unhelpful",icon:"$(thumbsdown)",enablement:"!github.copilot.search.feedback.sent"},{command:"github.copilot.search.feedback",title:"Feedback",icon:"$(feedback)",enablement:"!github.copilot.search.feedback.sent"},{command:"github.copilot.chat.debug.showElements",title:"Show Rendered Elements"},{command:"github.copilot.chat.debug.hideElements",title:"Hide Rendered Elements"},{command:"github.copilot.chat.debug.showTools",title:"Show Tools"},{command:"github.copilot.chat.debug.hideTools",title:"Hide Tools"},{command:"github.copilot.chat.debug.showNesRequests",title:"Show NES Requests"},{command:"github.copilot.chat.debug.hideNesRequests",title:"Hide NES Requests"},{command:"github.copilot.chat.debug.showGhostRequests",title:"Show Ghost Requests"},{command:"github.copilot.chat.debug.hideGhostRequests",title:"Hide Ghost Requests"},{command:"github.copilot.chat.debug.showRawRequestBody",title:"Show Raw Request Body"},{command:"github.copilot.chat.debug.exportLogItem",title:"Export as...",icon:"$(export)"},{command:"github.copilot.chat.debug.exportPromptArchive",title:"Export All as Archive...",icon:"$(archive)"},{command:"github.copilot.chat.debug.exportPromptLogsAsJson",title:"Export All as JSON...",icon:"$(export)"},{command:"github.copilot.chat.debug.exportAllPromptLogsAsJson",title:"Export All Prompt Logs as JSON...",icon:"$(export)"},{command:"github.copilot.chat.otel.exportAgentTracesDB",title:"Export Agent Traces DB",category:"Chat",enablement:"config.github.copilot.chat.otel.dbSpanExporter.enabled"},{command:"github.copilot.sessionSync.deleteSessions",title:"%github.copilot.command.sessionSync.deleteSessions%",category:"Chat",enablement:"github.copilot.sessionSearch.enabled && config.chat.sessionSync.enabled"},{command:"github.copilot.chronicle.reindex",title:"%github.copilot.command.chronicle.reindex%",category:"Chat",enablement:"github.copilot.sessionSearch.enabled"},{command:"github.copilot.nes.captureExpected.start",title:"Record Expected Edit (NES)",category:"Copilot"},{command:"github.copilot.nes.captureExpected.confirm",title:"Confirm and Save Expected Edit Capture",category:"Copilot"},{command:"github.copilot.nes.captureExpected.abort",title:"Cancel Expected Edit Capture",category:"Copilot"},{command:"github.copilot.nes.captureExpected.submit",title:"Submit NES Captures",category:"Copilot"},{command:"github.copilot.debug.collectWorkspaceIndexDiagnostics",title:"%github.copilot.command.collectWorkspaceIndexDiagnostics%",category:"Developer"},{command:"github.copilot.chat.mcp.setup.check",title:"MCP Check: is supported"},{command:"github.copilot.chat.mcp.setup.validatePackage",title:"MCP Check: validate package"},{command:"github.copilot.chat.mcp.setup.flow",title:"MCP Check: do prompts"},{command:"github.copilot.chat.generateAltText",title:"Generate/Refine Alt Text"},{command:"github.copilot.chat.notebook.enableFollowCellExecution",title:"Enable Follow Cell Execution from Chat",shortTitle:"Follow",icon:"$(pinned)"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",title:"Disable Follow Cell Execution from Chat",shortTitle:"Unfollow",icon:"$(pinned-dirty)"},{command:"github.copilot.cloud.resetWorkspaceConfirmations",title:"%github.copilot.command.resetCloudAgentWorkspaceConfirmations%"},{command:"github.copilot.cloud.sessions.openInBrowser",title:"%github.copilot.command.openCopilotAgentSessionsInBrowser%",icon:"$(link-external)"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",title:"%github.copilot.command.closeChatSessionPullRequest.title%"},{command:"github.copilot.cloud.sessions.installPRExtension",title:"%github.copilot.command.installPRExtension.title%",icon:"$(extensions)"},{command:"github.copilot.chat.openSuggestionsPanel",title:"Open Completions Panel",enablement:"github.copilot.extensionUnification.activated && !isWeb",category:"GitHub Copilot"},{command:"github.copilot.chat.toggleStatusMenu",title:"Open Status Menu",enablement:"github.copilot.extensionUnification.activated",category:"GitHub Copilot"},{command:"github.copilot.chat.completions.disable",title:"Disable Inline Suggestions",enablement:"github.copilot.extensionUnification.activated && github.copilot.activated && config.editor.inlineSuggest.enabled && github.copilot.completions.enabled",category:"GitHub Copilot"},{command:"github.copilot.chat.completions.enable",title:"Enable Inline Suggestions",enablement:"github.copilot.extensionUnification.activated && github.copilot.activated && !(config.editor.inlineSuggest.enabled && github.copilot.completions.enabled)",category:"GitHub Copilot"},{command:"github.copilot.chat.completions.toggle",title:"Toggle (Enable/Disable) Inline Suggestions",enablement:"github.copilot.extensionUnification.activated && github.copilot.activated",category:"GitHub Copilot"},{command:"github.copilot.chat.openModelPicker",title:"Change Completions Model",category:"GitHub Copilot",enablement:"github.copilot.extensionUnification.activated && !isWeb && github.copilot.completions.hasMultipleModels"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",title:"%github.copilot.command.applyCopilotCLIAgentSessionChanges%",enablement:"!chatSessionRequestInProgress",category:"GitHub Copilot"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply",title:"%github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply%",enablement:"!chatSessionRequestInProgress",icon:"$(git-stash-pop)",category:"GitHub Copilot"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",title:"%github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge%",enablement:"!chatSessionRequestInProgress",icon:"$(git-merge)",category:"GitHub Copilot"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync",title:"%github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync%",enablement:"!chatSessionRequestInProgress",icon:"$(sync)",category:"GitHub Copilot"},{command:"github.copilot.sessions.commit",title:"%github.copilot.command.sessions.commit%",enablement:"!chatSessionRequestInProgress && !sessions.hasGitOperationInProgress",icon:"$(git-commit)",category:"GitHub Copilot"},{command:"github.copilot.sessions.commitAndSync",title:"%github.copilot.command.sessions.commitAndSync%",enablement:"!chatSessionRequestInProgress && !sessions.hasGitOperationInProgress",icon:"$(sync)",category:"GitHub Copilot"},{command:"github.copilot.sessions.sync",title:"%github.copilot.command.sessions.sync%",enablement:"!chatSessionRequestInProgress && !sessions.hasGitOperationInProgress",icon:"$(sync)",category:"GitHub Copilot"},{command:"github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR",title:"%github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR%",enablement:"!chatSessionRequestInProgress && !sessions.hasGitOperationInProgress",icon:"$(git-pull-request-create)",category:"GitHub Copilot"},{command:"github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR",title:"%github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR%",enablement:"!chatSessionRequestInProgress && !sessions.hasGitOperationInProgress",icon:"$(git-pull-request-draft)",category:"GitHub Copilot"},{command:"github.copilot.sessions.discardChanges",title:"%github.copilot.command.sessions.discardChanges%",enablement:"!chatSessionRequestInProgress",icon:"$(discard)",category:"GitHub Copilot"},{command:"github.copilot.chat.copilotCLI.addFileReference",title:"%github.copilot.command.chat.copilotCLI.addFileReference%",enablement:"github.copilot.chat.copilotCLI.hasSession",category:"Copilot CLI"},{command:"github.copilot.chat.copilotCLI.addSelection",title:"%github.copilot.command.chat.copilotCLI.addSelection%",enablement:"github.copilot.chat.copilotCLI.hasSession",category:"Copilot CLI"},{command:"github.copilot.chat.copilotCLI.acceptDiff",title:"%github.copilot.command.chat.copilotCLI.acceptDiff%",enablement:"github.copilot.chat.copilotCLI.hasActiveDiff",icon:"$(check)",category:"Copilot CLI"},{command:"github.copilot.chat.copilotCLI.rejectDiff",title:"%github.copilot.command.chat.copilotCLI.rejectDiff%",enablement:"github.copilot.chat.copilotCLI.hasActiveDiff",icon:"$(close)",category:"Copilot CLI"},{command:"github.copilot.chat.checkoutPullRequestReroute",title:"%github.copilot.command.checkoutPullRequestReroute.title%",icon:"$(git-pull-request)",category:"GitHub Pull Request"},{command:"github.copilot.chat.cloudSessions.openRepository",title:"%github.copilot.command.cloudSessions.openRepository.title%",icon:"$(repo)",category:"GitHub Copilot"},{command:"github.copilot.chat.cloudSessions.clearCaches",title:"%github.copilot.command.cloudSessions.clearCaches.title%",category:"GitHub Copilot"},{command:"github.copilot.sessions.refreshChanges",title:"%github.copilot.command.sessions.refreshChanges%",icon:"$(refresh)",category:"GitHub Copilot"},{command:"github.copilot.sessions.initializeRepository",title:"%github.copilot.command.sessions.initializeRepository%",enablement:"!chatSessionRequestInProgress",icon:"$(repo)",category:"GitHub Copilot"},{command:"github.copilot.claude.sessions.commit",title:"%github.copilot.command.claude.sessions.commit%",enablement:"!chatSessionRequestInProgress",icon:"$(git-commit)",category:"GitHub Copilot"},{command:"github.copilot.claude.sessions.commitAndSync",title:"%github.copilot.command.claude.sessions.commitAndSync%",enablement:"!chatSessionRequestInProgress",icon:"$(sync)",category:"GitHub Copilot"},{command:"github.copilot.claude.sessions.sync",title:"%github.copilot.command.claude.sessions.sync%",enablement:"!chatSessionRequestInProgress",icon:"$(sync)",category:"GitHub Copilot"},{command:"github.copilot.claude.sessions.initializeRepository",title:"%github.copilot.command.claude.sessions.initializeRepository%",enablement:"!chatSessionRequestInProgress",icon:"$(repo)",category:"GitHub Copilot"}],configuration:[{title:"GitHub Copilot Chat",id:"stable",properties:{"github.copilot.chat.backgroundAgent.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.backgroundAgent.enabled%"},"github.copilot.chat.cloudAgent.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cloudAgent.enabled%"},"github.copilot.chat.codeGeneration.useInstructionFiles":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.codeGeneration.useInstructionFiles%"},"github.copilot.editor.enableCodeActions":{type:"boolean",default:!0,description:"%github.copilot.config.enableCodeActions%"},"github.copilot.renameSuggestions.triggerAutomatically":{type:"boolean",default:!0,description:"%github.copilot.config.renameSuggestions.triggerAutomatically%"},"github.copilot.chat.localeOverride":{type:"string",enum:["auto","en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],enumDescriptions:["Use VS Code's configured display language","English","fran\xE7ais","italiano","Deutsch","espa\xF1ol","\u0440\u0443\u0441\u0441\u043A\u0438\u0439","\u4E2D\u6587(\u7B80\u4F53)","\u4E2D\u6587(\u7E41\u9AD4)","\u65E5\u672C\u8A9E","\uD55C\uAD6D\uC5B4","\u010De\u0161tina","portugu\xEAs","T\xFCrk\xE7e","polski"],default:"auto",markdownDescription:"%github.copilot.config.localeOverride%"},"github.copilot.chat.terminalChatLocation":{type:"string",default:"chatView",markdownDescription:"%github.copilot.config.terminalChatLocation%",markdownEnumDescriptions:["%github.copilot.config.terminalChatLocation.chatView%","%github.copilot.config.terminalChatLocation.quickChat%","%github.copilot.config.terminalChatLocation.terminal%"],enum:["chatView","quickChat","terminal"]},"github.copilot.chat.scopeSelection":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.scopeSelection%"},"github.copilot.chat.useProjectTemplates":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.useProjectTemplates%"},"github.copilot.nextEditSuggestions.enabled":{type:"boolean",default:!0,tags:["nextEditSuggestions","onExp"],markdownDescription:"%github.copilot.nextEditSuggestions.enabled%",scope:"language-overridable"},"github.copilot.nextEditSuggestions.extendedRange":{type:"boolean",default:!0,tags:["nextEditSuggestions","onExp"],markdownDescription:"%github.copilot.nextEditSuggestions.extendedRange%"},"github.copilot.nextEditSuggestions.fixes":{type:"boolean",default:!0,tags:["nextEditSuggestions","onExp"],markdownDescription:"%github.copilot.nextEditSuggestions.fixes%",scope:"language-overridable"},"github.copilot.nextEditSuggestions.allowWhitespaceOnlyChanges":{type:"boolean",default:!0,tags:["nextEditSuggestions","onExp"],markdownDescription:"%github.copilot.nextEditSuggestions.allowWhitespaceOnlyChanges%",scope:"language-overridable"},"github.copilot.chat.agent.autoFix":{type:"boolean",default:!1,description:"%github.copilot.config.autoFix%",tags:["onExp"]},"github.copilot.chat.rateLimitAutoSwitchToAuto":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.rateLimitAutoSwitchToAuto%",tags:["onExp"]},"github.copilot.chat.customInstructionsInSystemMessage":{type:"boolean",default:!0,description:"%github.copilot.config.customInstructionsInSystemMessage%"},"github.copilot.chat.organizationCustomAgents.enabled":{type:"boolean",default:!0,description:"%github.copilot.config.organizationCustomAgents.enabled%"},"github.copilot.chat.organizationInstructions.enabled":{type:"boolean",default:!0,description:"%github.copilot.config.organizationInstructions.enabled%"},"github.copilot.chat.additionalReadAccessPaths":{type:"array",default:[],items:{type:"string"},markdownDescription:"%github.copilot.config.additionalReadAccessPaths%",scope:"window"},"github.copilot.chat.agent.currentEditorContext.enabled":{type:"boolean",default:!0,description:"%github.copilot.config.agent.currentEditorContext.enabled%"},"github.copilot.enable":{type:"object",scope:"window",default:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},additionalProperties:{type:"boolean"},markdownDescription:"Enable or disable auto triggering of Copilot completions for specified [languages](https://code.visualstudio.com/docs/languages/identifiers). You can still trigger suggestions manually using `Alt + \\`",agentsWindow:{default:{markdown:!0,plaintext:!0}}},"github.copilot.selectedCompletionModel":{type:"string",default:"",markdownDescription:'The currently selected completion model ID. To select from a list of available models, use the __"Change Completions Model"__ command or open the model picker (from the Copilot menu in the VS Code title bar, select __"Configure Code Completions"__ then __"Change Completions Model"__. The value must be a valid model ID. An empty value indicates that the default model will be used.'},"github.copilot.chat.claudeAgent.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.claudeAgent.enabled%"},"github.copilot.chat.claudeAgent.allowDangerouslySkipPermissions":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.claudeAgent.allowDangerouslySkipPermissions%"},"github.copilot.chat.reviewAgent.enabled":{type:"boolean",default:!0,description:"%github.copilot.config.reviewAgent.enabled%"},"github.copilot.chat.reviewSelection.enabled":{type:"boolean",default:!0,description:"%github.copilot.config.reviewSelection.enabled%"},"github.copilot.chat.reviewSelection.instructions":{type:"array",items:{oneOf:[{type:"object",markdownDescription:"%github.copilot.config.reviewSelection.instruction.file%",properties:{file:{type:"string",examples:[".copilot-review-instructions.md"]},language:{type:"string"}},examples:[{file:".copilot-review-instructions.md"}],required:["file"]},{type:"object",markdownDescription:"%github.copilot.config.reviewSelection.instruction.text%",properties:{text:{type:"string",examples:["Use underscore for field names."]},language:{type:"string"}},required:["text"],examples:[{text:"Use underscore for field names."},{text:"Resolve all TODO tasks."}]}]},default:[],markdownDescription:"%github.copilot.config.reviewSelection.instructions%",examples:[[{file:".copilot-review-instructions.md"},{text:"Resolve all TODO tasks."}]]},"github.copilot.chat.anthropic.useMessagesApi":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.useMessagesApi%",tags:["onExp"]}}},{id:"preview",properties:{"github.copilot.chat.claudeAgent.allowAutoPermissions":{type:"boolean",default:!1,tags:["preview","onExp"],markdownDescription:"%github.copilot.config.claudeAgent.allowAutoPermissions%"},"github.copilot.chat.claudeAgent.useSdkExtension":{type:"boolean",default:!1,tags:["preview","onExp"],markdownDescription:"%github.copilot.config.claudeAgent.useSdkExtension%"},"github.copilot.chat.claudeAgent.sdkExtensionInstallTimeout":{type:"number",default:12e4,minimum:1e3,tags:["preview"],markdownDescription:"%github.copilot.config.claudeAgent.sdkExtensionInstallTimeout%"},"github.copilot.chat.copilotDebugCommand.enabled":{type:"boolean",default:!0,tags:["preview"],description:"%github.copilot.chat.copilotDebugCommand.enabled%"},"github.copilot.chat.codesearch.enabled":{type:"boolean",default:!1,tags:["preview"],markdownDescription:"%github.copilot.config.codesearch.enabled%"},"github.copilot.chat.tools.viewImage.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.tools.viewImage.enabled%",tags:["preview","onExp"]}}},{id:"experimental",properties:{"github.copilot.chat.githubMcpServer.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.githubMcpServer.enabled%",tags:["experimental"],agentsWindow:{default:!0}},"github.copilot.chat.githubMcpServer.toolsets":{type:"array",default:["default"],markdownDescription:"%github.copilot.config.githubMcpServer.toolsets%",items:{type:"string"},tags:["experimental"]},"github.copilot.chat.githubMcpServer.readonly":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.githubMcpServer.readonly%",tags:["experimental"]},"github.copilot.chat.githubMcpServer.lockdown":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.githubMcpServer.lockdown%",tags:["experimental"]},"github.copilot.chat.githubMcpServer.channel":{type:"string",default:"stable",enum:["stable","insiders"],enumDescriptions:["%github.copilot.config.githubMcpServer.channel.stable%","%github.copilot.config.githubMcpServer.channel.insiders%"],markdownDescription:"%github.copilot.config.githubMcpServer.channel%",tags:["experimental"]},"github.copilot.chat.cloudAgentBackend.version":{type:"string",default:"v1",enum:["v1","v2"],enumDescriptions:["%github.copilot.config.cloudAgentBackend.version.v1%","%github.copilot.config.cloudAgentBackend.version.v2%"],markdownDescription:"%github.copilot.config.cloudAgentBackend.version%",tags:["experimental"]},"github.copilot.chat.switchAgent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.switchAgent.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.imageUpload.enabled":{type:"boolean",default:!0,tags:["experimental","onExp"],markdownDescription:"%github.copilot.config.imageUpload.enabled%"},"github.copilot.chat.codeGeneration.instructions":{markdownDeprecationMessage:"%github.copilot.config.codeGeneration.instructions.deprecated%",type:"array",items:{oneOf:[{type:"object",markdownDescription:"%github.copilot.config.codeGeneration.instruction.file%",properties:{file:{type:"string",examples:[".copilot-codeGeneration-instructions.md"]},language:{type:"string"}},examples:[{file:".copilot-codeGeneration-instructions.md"}],required:["file"]},{type:"object",markdownDescription:"%github.copilot.config.codeGeneration.instruction.text%",properties:{text:{type:"string",examples:["Use underscore for field names."]},language:{type:"string"}},required:["text"],examples:[{text:"Use underscore for field names."},{text:"Always add a comment: 'Generated by Copilot'."}]}]},default:[],markdownDescription:"%github.copilot.config.codeGeneration.instructions%",examples:[[{file:".copilot-codeGeneration-instructions.md"},{text:"Always add a comment: 'Generated by Copilot'."}]],tags:["experimental"]},"github.copilot.chat.testGeneration.instructions":{markdownDeprecationMessage:"%github.copilot.config.testGeneration.instructions.deprecated%",type:"array",items:{oneOf:[{type:"object",markdownDescription:"%github.copilot.config.experimental.testGeneration.instruction.file%",properties:{file:{type:"string",examples:[".copilot-test-instructions.md"]},language:{type:"string"}},examples:[{file:".copilot-test-instructions.md"}],required:["file"]},{type:"object",markdownDescription:"%github.copilot.config.experimental.testGeneration.instruction.text%",properties:{text:{type:"string",examples:["Use suite and test instead of describe and it."]},language:{type:"string"}},required:["text"],examples:[{text:"Always try uniting related tests in a suite."}]}]},default:[],markdownDescription:"%github.copilot.config.testGeneration.instructions%",examples:[[{file:".copilot-test-instructions.md"},{text:"Always try uniting related tests in a suite."}]],tags:["experimental"]},"github.copilot.chat.commitMessageGeneration.instructions":{type:"array",items:{oneOf:[{type:"object",markdownDescription:"%github.copilot.config.commitMessageGeneration.instruction.file%",properties:{file:{type:"string",examples:[".copilot-commit-message-instructions.md"]}},examples:[{file:".copilot-commit-message-instructions.md"}],required:["file"]},{type:"object",markdownDescription:"%github.copilot.config.commitMessageGeneration.instruction.text%",properties:{text:{type:"string",examples:["Use conventional commit message format."]}},required:["text"],examples:[{text:"Use conventional commit message format."}]}]},default:[],markdownDescription:"%github.copilot.config.commitMessageGeneration.instructions%",examples:[[{file:".copilot-commit-message-instructions.md"},{text:"Use conventional commit message format."}]],tags:["experimental"]},"github.copilot.chat.pullRequestDescriptionGeneration.instructions":{type:"array",items:{oneOf:[{type:"object",markdownDescription:"%github.copilot.config.pullRequestDescriptionGeneration.instruction.file%",properties:{file:{type:"string",examples:[".copilot-pull-request-description-instructions.md"]}},examples:[{file:".copilot-pull-request-description-instructions.md"}],required:["file"]},{type:"object",markdownDescription:"%github.copilot.config.pullRequestDescriptionGeneration.instruction.text%",properties:{text:{type:"string",examples:["Include every commit message in the pull request description."]}},required:["text"],examples:[{text:"Include every commit message in the pull request description."}]}]},default:[],markdownDescription:"%github.copilot.config.pullRequestDescriptionGeneration.instructions%",examples:[[{file:".copilot-pull-request-description-instructions.md"},{text:"Use conventional commit message format."}]],tags:["experimental"]},"github.copilot.chat.setupTests.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.setupTests.enabled%",tags:["experimental"]},"github.copilot.chat.languageContext.typescript.enabled":{type:"boolean",default:!0,scope:"resource",tags:["experimental","onExP"],markdownDescription:"%github.copilot.chat.languageContext.typescript.enabled%",agentsWindow:{default:!0}},"github.copilot.chat.languageContext.typescript.items":{type:"string",enum:["minimal","double","fillHalf","fill"],default:"double",scope:"resource",tags:["experimental","onExP"],markdownDescription:"%github.copilot.chat.languageContext.typescript.items%"},"github.copilot.chat.languageContext.typescript.includeDocumentation":{type:"boolean",default:!1,scope:"resource",tags:["experimental","onExP"],markdownDescription:"%github.copilot.chat.languageContext.typescript.includeDocumentation%"},"github.copilot.chat.languageContext.typescript.cacheTimeout":{type:"number",default:500,scope:"resource",tags:["experimental","onExP"],markdownDescription:"%github.copilot.chat.languageContext.typescript.cacheTimeout%"},"github.copilot.chat.languageContext.fix.typescript.enabled":{type:"boolean",default:!1,scope:"resource",tags:["experimental","onExP"],markdownDescription:"%github.copilot.chat.languageContext.fix.typescript.enabled%"},"github.copilot.chat.languageContext.inline.typescript.enabled":{type:"boolean",default:!1,scope:"resource",tags:["experimental","onExP"],markdownDescription:"%github.copilot.chat.languageContext.inline.typescript.enabled%"},"github.copilot.chat.newWorkspaceCreation.enabled":{type:"boolean",default:!0,tags:["experimental"],description:"%github.copilot.config.newWorkspaceCreation.enabled%"},"github.copilot.chat.newWorkspace.useContext7":{type:"boolean",default:!1,tags:["experimental"],markdownDescription:"%github.copilot.config.newWorkspace.useContext7%"},"github.copilot.chat.notebook.followCellExecution.enabled":{type:"boolean",default:!1,tags:["experimental"],description:"%github.copilot.config.notebook.followCellExecution%"},"github.copilot.chat.notebook.enhancedNextEditSuggestions.enabled":{type:"boolean",default:!1,tags:["experimental","onExp"],description:"%github.copilot.config.notebook.enhancedNextEditSuggestions%"},"github.copilot.chat.summarizeAgentConversationHistory.enabled":{type:"boolean",default:!0,tags:["experimental"],description:"%github.copilot.config.summarizeAgentConversationHistory.enabled%"},"github.copilot.chat.virtualTools.threshold":{type:"number",minimum:0,maximum:128,default:128,tags:["experimental"],markdownDescription:"%github.copilot.config.virtualTools.threshold%"},"github.copilot.chat.alternateGptPrompt.enabled":{type:"boolean",default:!1,tags:["experimental"],description:"%github.copilot.config.alternateGptPrompt.enabled%"},"github.copilot.chat.alternateGeminiModelFPrompt.enabled":{type:"boolean",default:!1,tags:["experimental","onExp"],description:"%github.copilot.config.alternateGeminiModelFPrompt.enabled%"},"github.copilot.chat.anthropic.contextEditing.mode":{type:"string",default:"off",markdownDescription:"%github.copilot.config.anthropic.contextEditing.mode%",tags:["experimental","onExp"],enum:["off","clear-thinking","clear-tooluse","clear-both"]},"github.copilot.chat.responsesApiReasoningSummary":{type:"string",default:"detailed",markdownDescription:"%github.copilot.config.responsesApiReasoningSummary%",tags:["experimental","onExp"],enum:["off","detailed"]},"github.copilot.chat.responsesApiContextManagement.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.responsesApiContextManagement.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.responsesApi.promptCacheKey.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.responsesApi.promptCacheKey.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.updated53CodexPrompt.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.updated53CodexPrompt.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.claude47OpusPrompt.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.claude47OpusPrompt.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.gpt55GetChangedFilesTool.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.gpt55GetChangedFilesTool.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.gemini3GetChangedFilesTool.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.gemini3GetChangedFilesTool.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.gpt55ReadFileTool.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.gpt55ReadFileTool.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.gpt55EconomicalSearchAndEdit.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.gpt55EconomicalSearchAndEdit.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.gpt55LargePromptSections.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.gpt55LargePromptSections.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.anthropic.tools.websearch.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.anthropic.tools.websearch.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.anthropic.tools.websearch.maxUses":{type:"number",default:5,markdownDescription:"%github.copilot.config.anthropic.tools.websearch.maxUses%",minimum:1,maximum:20,tags:["experimental"]},"github.copilot.chat.anthropic.tools.websearch.allowedDomains":{type:"array",default:[],markdownDescription:"%github.copilot.config.anthropic.tools.websearch.allowedDomains%",items:{type:"string"},tags:["experimental"]},"github.copilot.chat.anthropic.tools.websearch.blockedDomains":{type:"array",default:[],markdownDescription:"%github.copilot.config.anthropic.tools.websearch.blockedDomains%",items:{type:"string"},tags:["experimental"]},"github.copilot.chat.anthropic.tools.websearch.userLocation":{type:["object","null"],default:null,markdownDescription:"%github.copilot.config.anthropic.tools.websearch.userLocation%",properties:{city:{type:"string",description:"City name (e.g., 'San Francisco')"},region:{type:"string",description:"State or region (e.g., 'California')"},country:{type:"string",description:"ISO country code (e.g., 'US')"},timezone:{type:"string",description:"IANA timezone identifier (e.g., 'America/Los_Angeles')"}},tags:["experimental"]},"github.copilot.chat.completionsFetcher":{type:["string","null"],markdownDescription:"%github.copilot.config.completionsFetcher%",tags:["experimental","onExp"],enum:["electron-fetch","node-fetch"]},"github.copilot.chat.nesFetcher":{type:["string","null"],markdownDescription:"%github.copilot.config.nesFetcher%",tags:["experimental","onExp"],enum:["electron-fetch","node-fetch"]},"github.copilot.chat.planAgent.additionalTools":{type:"array",items:{type:"string"},default:[],scope:"resource",markdownDescription:"%github.copilot.config.planAgent.additionalTools%",tags:["experimental"]},"github.copilot.chat.implementAgent.model":{type:"string",default:"",scope:"resource",markdownDescription:"%github.copilot.config.implementAgent.model%",tags:["experimental"]},"github.copilot.chat.askAgent.additionalTools":{type:"array",items:{type:"string"},default:[],scope:"resource",markdownDescription:"%github.copilot.config.askAgent.additionalTools%",tags:["experimental"]},"github.copilot.chat.askAgent.model":{type:"string",default:"",scope:"resource",markdownDescription:"%github.copilot.config.askAgent.model%",tags:["experimental"]},"github.copilot.chat.exploreAgent.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.exploreAgent.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.exploreAgent.model":{type:"string",default:"",scope:"resource",markdownDescription:"%github.copilot.config.exploreAgent.model%",tags:["experimental"]},"github.copilot.chat.localIndex.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.localIndex.enabled%",tags:["experimental","onExp"]}}},{id:"advanced",properties:{"github.copilot.chat.inlineEdits.xtabProvider.modelConfiguration":{type:["object","null"],default:null,markdownDescription:`Advanced model configuration for the next edit suggestions xtab provider. +- 'code-rewrite': A general but slower editing tool that allows the model to rewrite and code snippet and provide only the replacement to the editor.`,items:{type:"string",enum:["find-replace","multi-find-replace","apply-patch","code-rewrite"]}},thinking:{type:"boolean",default:!1,description:"Whether the model supports thinking capabilities"},streaming:{type:"boolean",default:!0,description:"Whether the model supports streaming responses. Defaults to true."},zeroDataRetentionEnabled:{type:"boolean",default:!1,markdownDescription:"Whether Zero Data Retention (ZDR) is enabled for this endpoint. When `true`, `previous_response_id` will not be sent in requests via Responses API."},supportsReasoningEffort:{type:"array",markdownDescription:'Reasoning effort levels the model accepts (e.g. `["low", "medium", "high"]`). When set, a `Thinking Effort` picker is shown in the model picker and the chosen value is forwarded to the model. Levels supported by mainstream OpenAI-compatible servers are `minimal`, `low`, `medium`, `high`.',items:{type:"string"}},reasoningEffortFormat:{type:"string",enum:["chat-completions","responses"],markdownDescription:"Body shape used to forward the reasoning effort to the model. `chat-completions` sends a top-level `reasoning_effort` string. `responses` sends a nested `reasoning.effort` object. When unset the format follows the URL: `/responses` \u2192 nested, otherwise top-level."},requestHeaders:{type:"object",description:"Additional HTTP headers to include with requests to this model. These reserved headers are not allowed and ignored if present: forbidden request headers (https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header), forwarding headers ('forwarded', 'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto'), and others ('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'). Pattern-based forbidden headers ('proxy-*', 'sec-*', 'x-http-method*' with forbidden methods) are also blocked.",additionalProperties:{type:"string"}}},required:["id","name","url","toolCalling","vision","maxInputTokens","maxOutputTokens"]}}}}},{vendor:"azure",displayName:"Azure",configuration:{type:"object",properties:{apiKey:{type:"string",secret:!0,description:"API key for the models. If not set then Entra ID (Azure AD) authentication with your Microsoft account credentials will be used.",title:"API Key"},models:{type:"array",defaultSnippets:[{label:"New Model",description:"Add a new custom model configuration",body:[{id:"$1",name:"$2",url:"$3",toolCalling:"^${4|true,false|}",vision:"^${5|true,false|}",maxInputTokens:"^${6:128000}",maxOutputTokens:"^${7:16000}"}]}],items:{type:"object",properties:{id:{type:"string",description:"Unique identifier for the model"},name:{type:"string",description:"Display name of the custom OpenAI model"},url:{type:"string",markdownDescription:"URL endpoint for the custom OpenAI-compatible model.\n\n**Important:** Base URLs default to Chat Completions API. Explicit API paths including `/responses` or `/chat/completions` are respected."},toolCalling:{type:"boolean",description:"Whether the model supports tool calling"},vision:{type:"boolean",description:"Whether the model supports vision capabilities"},maxInputTokens:{type:"number",description:"Maximum number of input tokens supported by the model"},maxOutputTokens:{type:"number",description:"Maximum number of output tokens supported by the model"},thinking:{type:"boolean",default:!1,description:"Whether the model supports thinking capabilities"},streaming:{type:"boolean",default:!0,description:"Whether the model supports streaming responses. Defaults to true."},zeroDataRetentionEnabled:{type:"boolean",default:!1,markdownDescription:"Whether Zero Data Retention (ZDR) is enabled for this endpoint. When `true`, `previous_response_id` will not be sent in requests via Responses API."},supportsReasoningEffort:{type:"array",markdownDescription:'Reasoning effort levels the model accepts (e.g. `["low", "medium", "high"]`). When set, a `Thinking Effort` picker is shown in the model picker and the chosen value is forwarded to the model. Levels supported by mainstream OpenAI-compatible servers are `minimal`, `low`, `medium`, `high`.',items:{type:"string"}},reasoningEffortFormat:{type:"string",enum:["chat-completions","responses"],markdownDescription:"Body shape used to forward the reasoning effort to the model. `chat-completions` sends a top-level `reasoning_effort` string. `responses` sends a nested `reasoning.effort` object. When unset the format follows the URL: `/responses` \u2192 nested, otherwise top-level."},requestHeaders:{type:"object",description:"Additional HTTP headers to include with requests to this model. These reserved headers are not allowed and ignored if present: forbidden request headers (https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header), forwarding headers ('forwarded', 'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto'), and others ('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'). Pattern-based forbidden headers ('proxy-*', 'sec-*', 'x-http-method*' with forbidden methods) are also blocked.",additionalProperties:{type:"string"}}},required:["id","name","url","toolCalling","vision","maxInputTokens","maxOutputTokens"]}}}}}],interactiveSession:[{label:"GitHub Copilot",id:"copilot",icon:"",when:"!github.copilot.interactiveSession.disabled"}],mcpServerDefinitionProviders:[{id:"github",label:"GitHub"}],viewsWelcome:[{view:"debug",when:"github.copilot-chat.activated",contents:"%github.copilot.viewsWelcome.debug%"}],chatViewsWelcome:[{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.individual.expired%",when:"github.copilot.interactiveSession.individual.expired && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.enterprise%",when:"github.copilot.interactiveSession.enterprise.disabled && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.offline%",when:"github.copilot.offline && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.invalidToken%",when:"github.copilot.interactiveSession.invalidToken && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.rateLimited%",when:"github.copilot.interactiveSession.rateLimited && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.gitHubLoginFailed%",when:"github.copilot.interactiveSession.gitHubLoginFailed && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.contactSupport%",when:"github.copilot.interactiveSession.contactSupport && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.chatDisabled%",when:"github.copilot.interactiveSession.chatDisabled && !github.copilot.hasByokModels"},{icon:"$(chat-sparkle)",title:"%copilot.title%",content:"%github.copilot.viewsWelcome.switchToReleaseChannel%",when:"github.copilot.interactiveSession.switchToReleaseChannel"}],commands:[{command:"github.copilot.chat.triggerPermissiveSignIn",title:"%github.copilot.command.triggerPermissiveSignIn%"},{command:"copilot.claude.agents",title:"Manage Agents",category:"Claude Agent"},{command:"copilot.claude.hooks",title:"Configure Hooks",category:"Claude Agent"},{command:"copilot.claude.memory",title:"Open Memory Files",category:"Claude Agent"},{command:"github.copilot.cli.sessions.delete",title:"%github.copilot.command.deleteAgentSession%",icon:"$(close)",category:"Copilot CLI"},{command:"agents.github.copilot.cli.deleteSessions",title:"%github.copilot.command.deleteAgentSession%",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.resumeInTerminal",title:"%github.copilot.command.cli.sessions.resumeInTerminal%",icon:"$(terminal)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.rename",title:"%github.copilot.command.cli.sessions.rename%",icon:"$(edit)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.setTitle",title:"%github.copilot.command.cli.sessions.setTitle%",category:"Copilot CLI"},{command:"github.copilot.claude.sessions.rename",title:"%github.copilot.command.claude.sessions.rename%",icon:"$(edit)",category:"Claude"},{command:"github.copilot.cli.sessions.openRepository",title:"%github.copilot.command.cli.sessions.openRepository%",icon:"$(folder-opened)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",title:"%github.copilot.command.cli.sessions.openWorktreeInNewWindow%",icon:"$(folder-opened)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",title:"%github.copilot.command.cli.sessions.openWorktreeInTerminal%",icon:"$(terminal)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",title:"%github.copilot.command.cli.sessions.copyWorktreeBranchName%",icon:"$(copy)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.commitToWorktree",title:"%github.copilot.command.cli.sessions.commitToWorktree%",icon:"$(git-commit)",category:"Copilot CLI"},{command:"github.copilot.cli.sessions.commitToRepository",title:"%github.copilot.command.cli.sessions.commitToRepository%",icon:"$(git-commit)",category:"Copilot CLI"},{command:"github.copilot.cli.newSession",title:"%github.copilot.command.cli.newSession%",icon:"$(terminal)",category:"Chat"},{command:"github.copilot.cli.newSessionToSide",title:"%github.copilot.command.cli.newSessionToSide%",icon:"$(terminal)",category:"Chat"},{command:"github.copilot.cli.openInCopilotCLI",title:"%github.copilot.command.cli.openInCopilotCLI%",icon:"$(terminal)",category:"Copilot CLI"},{command:"github.copilot.chat.compact",title:"%github.copilot.command.compactConversation%"},{command:"github.copilot.chat.explain",title:"%github.copilot.command.explainThis%",enablement:"!github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.explain.palette",title:"%github.copilot.command.explainThis%",enablement:"!github.copilot.interactiveSession.disabled && !editorReadonly",category:"Chat"},{command:"github.copilot.chat.review",title:"%github.copilot.command.reviewAndComment%",enablement:"config.github.copilot.chat.reviewSelection.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.review.apply",title:"%github.copilot.command.applyReviewSuggestion%",icon:"$(sparkle)",enablement:"commentThread =~ /hasSuggestion/",category:"Chat"},{command:"github.copilot.chat.review.applyAndNext",title:"%github.copilot.command.applyReviewSuggestionAndNext%",icon:"$(sparkle)",enablement:"commentThread =~ /hasSuggestion/",category:"Chat"},{command:"github.copilot.chat.review.discard",title:"%github.copilot.command.discardReviewSuggestion%",icon:"$(close)",category:"Chat"},{command:"github.copilot.chat.review.discardAndNext",title:"%github.copilot.command.discardReviewSuggestionAndNext%",icon:"$(close)",category:"Chat"},{command:"github.copilot.chat.review.discardAll",title:"%github.copilot.command.discardAllReviewSuggestion%",icon:"$(close-all)",category:"Chat"},{command:"github.copilot.chat.review.stagedChanges",title:"%github.copilot.command.reviewStagedChanges%",icon:"$(code-review)",enablement:"github.copilot.chat.reviewDiff.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.review.unstagedChanges",title:"%github.copilot.command.reviewUnstagedChanges%",icon:"$(code-review)",enablement:"github.copilot.chat.reviewDiff.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.review.changes",title:"%github.copilot.command.reviewChanges%",icon:"$(code-review)",enablement:"github.copilot.chat.reviewDiff.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.review.stagedFileChange",title:"%github.copilot.command.reviewFileChange%",icon:"$(code-review)",enablement:"github.copilot.chat.reviewDiff.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.review.unstagedFileChange",title:"%github.copilot.command.reviewFileChange%",icon:"$(code-review)",enablement:"github.copilot.chat.reviewDiff.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.codeReview.run",title:"%github.copilot.command.codeReviewRun%",enablement:"github.copilot.chat.reviewDiff.enabled && !github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.chat.review.previous",title:"%github.copilot.command.gotoPreviousReviewSuggestion%",icon:"$(arrow-up)",category:"Chat"},{command:"github.copilot.chat.review.next",title:"%github.copilot.command.gotoNextReviewSuggestion%",icon:"$(arrow-down)",category:"Chat"},{command:"github.copilot.chat.review.continueInInlineChat",title:"%github.copilot.command.continueReviewInInlineChat%",icon:"$(comment-discussion)",category:"Chat"},{command:"github.copilot.chat.review.continueInChat",title:"%github.copilot.command.continueReviewInChat%",icon:"$(comment-discussion)",category:"Chat"},{command:"github.copilot.chat.review.markHelpful",title:"%github.copilot.command.helpfulReviewSuggestion%",icon:"$(thumbsup)",enablement:"!(commentThread =~ /markedAsHelpful/)",category:"Chat"},{command:"github.copilot.chat.openUserPreferences",title:"%github.copilot.command.openUserPreferences%",category:"Chat",enablement:"config.github.copilot.chat.enableUserPreferences"},{command:"github.copilot.chat.review.markUnhelpful",title:"%github.copilot.command.unhelpfulReviewSuggestion%",icon:"$(thumbsdown)",enablement:"!(commentThread =~ /markedAsUnhelpful/)",category:"Chat"},{command:"github.copilot.chat.generate",title:"%github.copilot.command.generateThis%",icon:"$(sparkle)",enablement:"!github.copilot.interactiveSession.disabled && !editorReadonly",category:"Chat"},{command:"github.copilot.chat.fix",title:"%github.copilot.command.fixThis%",enablement:"!github.copilot.interactiveSession.disabled && !editorReadonly",category:"Chat"},{command:"github.copilot.interactiveSession.feedback",title:"%github.copilot.command.sendChatFeedback%",enablement:"github.copilot-chat.activated && !github.copilot.interactiveSession.disabled",icon:"$(feedback)",category:"Chat"},{command:"github.copilot.debug.workbenchState",title:"%github.copilot.command.logWorkbenchState%",category:"Developer"},{command:"github.copilot.debug.togglePowerSaveBlocker",title:"%github.copilot.command.togglePowerSaveBlocker%",category:"Developer"},{command:"github.copilot.debug.showChatLogView",title:"%github.copilot.command.showChatLogView%",category:"Developer"},{command:"github.copilot.debug.showOutputChannel",title:"%github.copilot.command.showOutputChannel%",category:"Developer"},{command:"github.copilot.debug.showContextInspectorView",title:"%github.copilot.command.showContextInspectorView%",icon:"$(inspect)",category:"Developer"},{command:"github.copilot.debug.validateNesRename",title:"%github.copilot.command.validateNesRename%",category:"Developer"},{command:"github.copilot.debug.resetVirtualToolGroups",title:"%github.copilot.command.resetVirtualToolGroups%",icon:"$(inspect)",category:"Developer"},{command:"github.copilot.debug.extensionState",title:"%github.copilot.command.extensionState%",category:"Developer"},{command:"github.copilot.chat.tools.memory.showMemories",title:"%github.copilot.command.showMemories%",category:"Chat"},{command:"github.copilot.chat.tools.memory.clearMemories",title:"%github.copilot.command.clearMemories%",category:"Chat"},{command:"github.copilot.terminal.explainTerminalLastCommand",title:"%github.copilot.command.explainTerminalLastCommand%",category:"Chat"},{command:"github.copilot.git.generateCommitMessage",title:"%github.copilot.git.generateCommitMessage%",icon:"$(sparkle)",enablement:"!github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.git.resolveMergeConflicts",title:"%github.copilot.git.resolveMergeConflicts%",icon:"$(chat-sparkle)",enablement:"!github.copilot.interactiveSession.disabled",category:"Chat"},{command:"github.copilot.devcontainer.generateDevContainerConfig",title:"%github.copilot.devcontainer.generateDevContainerConfig%",category:"Chat"},{command:"github.copilot.tests.fixTestFailure",icon:"$(sparkle)",title:"%github.copilot.command.fixTestFailure%",category:"Chat"},{command:"github.copilot.tests.fixTestFailure.fromInline",icon:"$(sparkle)",title:"%github.copilot.command.fixTestFailure%"},{command:"github.copilot.chat.attachFile",title:"%github.copilot.chat.attachFile%",category:"Chat"},{command:"github.copilot.chat.attachSelection",title:"%github.copilot.chat.attachSelection%",icon:"$(comment-discussion)",category:"Chat"},{command:"github.copilot.debug.collectDiagnostics",title:"%github.copilot.command.collectDiagnostics%",category:"Developer"},{command:"github.copilot.debug.inlineEdit.clearCache",title:"%github.copilot.command.inlineEdit.clearCache%",category:"Developer"},{command:"github.copilot.debug.inlineEdit.reportNotebookNESIssue",title:"%github.copilot.command.inlineEdit.reportNotebookNESIssue%",enablement:"config.github.copilot.chat.advanced.notebook.alternativeNESFormat.enabled || github.copilot.chat.enableEnhancedNotebookNES",category:"Developer"},{command:"github.copilot.debug.generateSTest",title:"%github.copilot.command.generateSTest%",enablement:"github.copilot.debugReportFeedback",category:"Developer"},{command:"github.copilot.open.walkthrough",title:"%github.copilot.command.openWalkthrough%",category:"Chat"},{command:"github.copilot.debug.generateInlineEditTests",title:"Generate Inline Edit Tests",category:"Chat",enablement:"resourceScheme == 'ccreq'"},{command:"github.copilot.buildRemoteWorkspaceIndex",title:"%github.copilot.command.buildRemoteWorkspaceIndex%",category:"Chat",enablement:"github.copilot-chat.activated"},{command:"github.copilot.deleteExternalIngestWorkspaceIndex",title:"%github.copilot.command.deleteExternalIngestWorkspaceIndex%",category:"Developer",enablement:"github.copilot-chat.activated && !github.copilot.blackbirdExternalIndexingDisabled"},{command:"github.copilot.report",title:"Report Issue",category:"Chat"},{command:"github.copilot.chat.rerunWithCopilotDebug",title:"%github.copilot.command.rerunWithCopilotDebug%",category:"Chat"},{command:"github.copilot.chat.startCopilotDebugCommand",title:"Start Copilot Debug"},{command:"github.copilot.chat.clearTemporalContext",title:"Clear Temporal Context",category:"Developer"},{command:"github.copilot.search.markHelpful",title:"Helpful",icon:"$(thumbsup)",enablement:"!github.copilot.search.feedback.sent"},{command:"github.copilot.search.markUnhelpful",title:"Unhelpful",icon:"$(thumbsdown)",enablement:"!github.copilot.search.feedback.sent"},{command:"github.copilot.search.feedback",title:"Feedback",icon:"$(feedback)",enablement:"!github.copilot.search.feedback.sent"},{command:"github.copilot.chat.debug.showElements",title:"Show Rendered Elements"},{command:"github.copilot.chat.debug.hideElements",title:"Hide Rendered Elements"},{command:"github.copilot.chat.debug.showTools",title:"Show Tools"},{command:"github.copilot.chat.debug.hideTools",title:"Hide Tools"},{command:"github.copilot.chat.debug.showNesRequests",title:"Show NES Requests"},{command:"github.copilot.chat.debug.hideNesRequests",title:"Hide NES Requests"},{command:"github.copilot.chat.debug.showGhostRequests",title:"Show Ghost Requests"},{command:"github.copilot.chat.debug.hideGhostRequests",title:"Hide Ghost Requests"},{command:"github.copilot.chat.debug.showRawRequestBody",title:"Show Raw Request Body"},{command:"github.copilot.chat.debug.exportLogItem",title:"Export as...",icon:"$(export)"},{command:"github.copilot.chat.debug.exportPromptArchive",title:"Export All as Archive...",icon:"$(archive)"},{command:"github.copilot.chat.debug.exportPromptLogsAsJson",title:"Export All as JSON...",icon:"$(export)"},{command:"github.copilot.chat.debug.exportAllPromptLogsAsJson",title:"Export All Prompt Logs as JSON...",icon:"$(export)"},{command:"github.copilot.chat.otel.exportAgentTracesDB",title:"Export Agent Traces DB",category:"Chat",enablement:"config.github.copilot.chat.otel.dbSpanExporter.enabled"},{command:"github.copilot.chat.otel.statusActive",title:"OpenTelemetry",category:"Chat",icon:"$(broadcast)"},{command:"github.copilot.sessionSync.deleteSessions",title:"%github.copilot.command.sessionSync.deleteSessions%",category:"Chat",enablement:"github.copilot.sessionSearch.enabled && config.chat.sessionSync.enabled"},{command:"github.copilot.chronicle.reindex",title:"%github.copilot.command.chronicle.reindex%",category:"Chat",enablement:"github.copilot.sessionSearch.enabled"},{command:"github.copilot.nes.captureExpected.start",title:"Record Expected Edit (NES)",category:"Copilot"},{command:"github.copilot.nes.captureExpected.confirm",title:"Confirm and Save Expected Edit Capture",category:"Copilot"},{command:"github.copilot.nes.captureExpected.abort",title:"Cancel Expected Edit Capture",category:"Copilot"},{command:"github.copilot.nes.captureExpected.submit",title:"Submit NES Captures",category:"Copilot"},{command:"github.copilot.debug.collectWorkspaceIndexDiagnostics",title:"%github.copilot.command.collectWorkspaceIndexDiagnostics%",category:"Developer"},{command:"github.copilot.chat.mcp.setup.check",title:"MCP Check: is supported"},{command:"github.copilot.chat.mcp.setup.validatePackage",title:"MCP Check: validate package"},{command:"github.copilot.chat.mcp.setup.flow",title:"MCP Check: do prompts"},{command:"github.copilot.chat.generateAltText",title:"Generate/Refine Alt Text"},{command:"github.copilot.chat.notebook.enableFollowCellExecution",title:"Enable Follow Cell Execution from Chat",shortTitle:"Follow",icon:"$(pinned)"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",title:"Disable Follow Cell Execution from Chat",shortTitle:"Unfollow",icon:"$(pinned-dirty)"},{command:"github.copilot.cloud.resetWorkspaceConfirmations",title:"%github.copilot.command.resetCloudAgentWorkspaceConfirmations%"},{command:"github.copilot.cloud.sessions.openInBrowser",title:"%github.copilot.command.openCopilotAgentSessionsInBrowser%",icon:"$(link-external)"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",title:"%github.copilot.command.closeChatSessionPullRequest.title%"},{command:"github.copilot.cloud.sessions.installPRExtension",title:"%github.copilot.command.installPRExtension.title%",icon:"$(extensions)"},{command:"github.copilot.chat.openSuggestionsPanel",title:"Open Completions Panel",enablement:"github.copilot.extensionUnification.activated && !isWeb",category:"GitHub Copilot"},{command:"github.copilot.chat.toggleStatusMenu",title:"Open Status Menu",enablement:"github.copilot.extensionUnification.activated",category:"GitHub Copilot"},{command:"github.copilot.chat.completions.disable",title:"Disable Inline Suggestions",enablement:"github.copilot.extensionUnification.activated && github.copilot.activated && config.editor.inlineSuggest.enabled && github.copilot.completions.enabled",category:"GitHub Copilot"},{command:"github.copilot.chat.completions.enable",title:"Enable Inline Suggestions",enablement:"github.copilot.extensionUnification.activated && github.copilot.activated && !(config.editor.inlineSuggest.enabled && github.copilot.completions.enabled)",category:"GitHub Copilot"},{command:"github.copilot.chat.completions.toggle",title:"Toggle (Enable/Disable) Inline Suggestions",enablement:"github.copilot.extensionUnification.activated && github.copilot.activated",category:"GitHub Copilot"},{command:"github.copilot.chat.openModelPicker",title:"Change Completions Model",category:"GitHub Copilot",enablement:"github.copilot.extensionUnification.activated && !isWeb && github.copilot.completions.hasMultipleModels"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",title:"%github.copilot.command.applyCopilotCLIAgentSessionChanges%",enablement:"!chatSessionRequestInProgress",category:"GitHub Copilot"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply",title:"%github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply%",enablement:"!chatSessionRequestInProgress",icon:"$(git-stash-pop)",category:"GitHub Copilot"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",title:"%github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge%",enablement:"!chatSessionRequestInProgress",icon:"$(git-merge)",category:"GitHub Copilot"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync",title:"%github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync%",enablement:"!chatSessionRequestInProgress",icon:"$(sync)",category:"GitHub Copilot"},{command:"github.copilot.sessions.commit",title:"%github.copilot.command.sessions.commit%",enablement:"!chatSessionRequestInProgress && !sessions.hasGitOperationInProgress",icon:"$(git-commit)",category:"GitHub Copilot"},{command:"github.copilot.sessions.commitAndSync",title:"%github.copilot.command.sessions.commitAndSync%",enablement:"!chatSessionRequestInProgress && !sessions.hasGitOperationInProgress",icon:"$(sync)",category:"GitHub Copilot"},{command:"github.copilot.sessions.sync",title:"%github.copilot.command.sessions.sync%",enablement:"!chatSessionRequestInProgress && !sessions.hasGitOperationInProgress",icon:"$(sync)",category:"GitHub Copilot"},{command:"github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR",title:"%github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR%",enablement:"!chatSessionRequestInProgress && !sessions.hasGitOperationInProgress",icon:"$(git-pull-request-create)",category:"GitHub Copilot"},{command:"github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR",title:"%github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR%",enablement:"!chatSessionRequestInProgress && !sessions.hasGitOperationInProgress",icon:"$(git-pull-request-draft)",category:"GitHub Copilot"},{command:"github.copilot.sessions.discardChanges",title:"%github.copilot.command.sessions.discardChanges%",enablement:"!chatSessionRequestInProgress",icon:"$(discard)",category:"GitHub Copilot"},{command:"github.copilot.chat.copilotCLI.addFileReference",title:"%github.copilot.command.chat.copilotCLI.addFileReference%",enablement:"github.copilot.chat.copilotCLI.hasSession",category:"Copilot CLI"},{command:"github.copilot.chat.copilotCLI.addSelection",title:"%github.copilot.command.chat.copilotCLI.addSelection%",enablement:"github.copilot.chat.copilotCLI.hasSession",category:"Copilot CLI"},{command:"github.copilot.chat.copilotCLI.acceptDiff",title:"%github.copilot.command.chat.copilotCLI.acceptDiff%",enablement:"github.copilot.chat.copilotCLI.hasActiveDiff",icon:"$(check)",category:"Copilot CLI"},{command:"github.copilot.chat.copilotCLI.rejectDiff",title:"%github.copilot.command.chat.copilotCLI.rejectDiff%",enablement:"github.copilot.chat.copilotCLI.hasActiveDiff",icon:"$(close)",category:"Copilot CLI"},{command:"github.copilot.chat.checkoutPullRequestReroute",title:"%github.copilot.command.checkoutPullRequestReroute.title%",icon:"$(git-pull-request)",category:"GitHub Pull Request"},{command:"github.copilot.chat.cloudSessions.createPullRequestForTask",title:"%github.copilot.command.cloudSessions.createPullRequestForTask.title%",icon:"$(git-pull-request-create)",category:"GitHub Pull Request"},{command:"github.copilot.chat.cloudSessions.openPullRequestForTask",title:"%github.copilot.command.cloudSessions.openPullRequestForTask.title%",icon:"$(git-pull-request)",category:"GitHub Pull Request"},{command:"github.copilot.chat.cloudSessions.openRepository",title:"%github.copilot.command.cloudSessions.openRepository.title%",icon:"$(repo)",category:"GitHub Copilot"},{command:"github.copilot.chat.cloudSessions.clearCaches",title:"%github.copilot.command.cloudSessions.clearCaches.title%",category:"GitHub Copilot"},{command:"github.copilot.sessions.refreshChanges",title:"%github.copilot.command.sessions.refreshChanges%",icon:"$(refresh)",category:"GitHub Copilot"},{command:"github.copilot.sessions.initializeRepository",title:"%github.copilot.command.sessions.initializeRepository%",enablement:"!chatSessionRequestInProgress",icon:"$(repo)",category:"GitHub Copilot"},{command:"github.copilot.claude.sessions.commit",title:"%github.copilot.command.claude.sessions.commit%",enablement:"!chatSessionRequestInProgress",icon:"$(git-commit)",category:"GitHub Copilot"},{command:"github.copilot.claude.sessions.commitAndSync",title:"%github.copilot.command.claude.sessions.commitAndSync%",enablement:"!chatSessionRequestInProgress",icon:"$(sync)",category:"GitHub Copilot"},{command:"github.copilot.claude.sessions.sync",title:"%github.copilot.command.claude.sessions.sync%",enablement:"!chatSessionRequestInProgress",icon:"$(sync)",category:"GitHub Copilot"},{command:"github.copilot.claude.sessions.initializeRepository",title:"%github.copilot.command.claude.sessions.initializeRepository%",enablement:"!chatSessionRequestInProgress",icon:"$(repo)",category:"GitHub Copilot"}],configuration:[{title:"GitHub Copilot Chat",id:"stable",properties:{"github.copilot.chat.backgroundAgent.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.backgroundAgent.enabled%"},"github.copilot.chat.cloudAgent.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cloudAgent.enabled%"},"github.copilot.chat.codeGeneration.useInstructionFiles":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.codeGeneration.useInstructionFiles%"},"github.copilot.editor.enableCodeActions":{type:"boolean",default:!0,description:"%github.copilot.config.enableCodeActions%"},"github.copilot.renameSuggestions.triggerAutomatically":{type:"boolean",default:!0,description:"%github.copilot.config.renameSuggestions.triggerAutomatically%"},"github.copilot.chat.localeOverride":{type:"string",enum:["auto","en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],enumDescriptions:["Use VS Code's configured display language","English","fran\xE7ais","italiano","Deutsch","espa\xF1ol","\u0440\u0443\u0441\u0441\u043A\u0438\u0439","\u4E2D\u6587(\u7B80\u4F53)","\u4E2D\u6587(\u7E41\u9AD4)","\u65E5\u672C\u8A9E","\uD55C\uAD6D\uC5B4","\u010De\u0161tina","portugu\xEAs","T\xFCrk\xE7e","polski"],default:"auto",markdownDescription:"%github.copilot.config.localeOverride%"},"github.copilot.chat.terminalChatLocation":{type:"string",default:"chatView",markdownDescription:"%github.copilot.config.terminalChatLocation%",markdownEnumDescriptions:["%github.copilot.config.terminalChatLocation.chatView%","%github.copilot.config.terminalChatLocation.quickChat%","%github.copilot.config.terminalChatLocation.terminal%"],enum:["chatView","quickChat","terminal"]},"github.copilot.chat.scopeSelection":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.scopeSelection%"},"github.copilot.chat.useProjectTemplates":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.useProjectTemplates%"},"github.copilot.nextEditSuggestions.enabled":{type:"boolean",default:!0,tags:["nextEditSuggestions","onExp"],markdownDescription:"%github.copilot.nextEditSuggestions.enabled%",scope:"language-overridable"},"github.copilot.completions.chat.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.completions.chat.enabled%"},"github.copilot.nextEditSuggestions.extendedRange":{type:"boolean",default:!0,tags:["nextEditSuggestions","onExp"],markdownDescription:"%github.copilot.nextEditSuggestions.extendedRange%"},"github.copilot.nextEditSuggestions.fixes":{type:"boolean",default:!0,tags:["nextEditSuggestions","onExp"],markdownDescription:"%github.copilot.nextEditSuggestions.fixes%",scope:"language-overridable"},"github.copilot.nextEditSuggestions.allowWhitespaceOnlyChanges":{type:"boolean",default:!0,tags:["nextEditSuggestions","onExp"],markdownDescription:"%github.copilot.nextEditSuggestions.allowWhitespaceOnlyChanges%",scope:"language-overridable"},"github.copilot.chat.agent.autoFix":{type:"boolean",default:!1,description:"%github.copilot.config.autoFix%",tags:["onExp"]},"github.copilot.chat.rateLimitAutoSwitchToAuto":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.rateLimitAutoSwitchToAuto%",tags:["onExp"]},"github.copilot.chat.customInstructionsInSystemMessage":{type:"boolean",default:!0,description:"%github.copilot.config.customInstructionsInSystemMessage%"},"github.copilot.chat.organizationCustomAgents.enabled":{type:"boolean",default:!0,description:"%github.copilot.config.organizationCustomAgents.enabled%"},"github.copilot.chat.organizationInstructions.enabled":{type:"boolean",default:!0,description:"%github.copilot.config.organizationInstructions.enabled%"},"github.copilot.chat.additionalReadAccessPaths":{type:"array",default:[],items:{type:"string"},markdownDescription:"%github.copilot.config.additionalReadAccessPaths%",scope:"window"},"github.copilot.chat.agent.currentEditorContext.enabled":{type:"boolean",default:!0,description:"%github.copilot.config.agent.currentEditorContext.enabled%"},"github.copilot.enable":{type:"object",scope:"window",default:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},additionalProperties:{type:"boolean"},markdownDescription:"Enable or disable auto triggering of Copilot completions for specified [languages](https://code.visualstudio.com/docs/languages/identifiers). You can still trigger suggestions manually using `Alt + \\`",agentsWindow:{default:{markdown:!0,plaintext:!0}}},"github.copilot.selectedCompletionModel":{type:"string",default:"",markdownDescription:'The currently selected completion model ID. To select from a list of available models, use the __"Change Completions Model"__ command or open the model picker (from the Copilot menu in the VS Code title bar, select __"Configure Code Completions"__ then __"Change Completions Model"__. The value must be a valid model ID. An empty value indicates that the default model will be used.'},"github.copilot.chat.claudeAgent.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.claudeAgent.enabled%"},"github.copilot.chat.claudeAgent.allowDangerouslySkipPermissions":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.claudeAgent.allowDangerouslySkipPermissions%"},"github.copilot.chat.reviewAgent.enabled":{type:"boolean",default:!0,description:"%github.copilot.config.reviewAgent.enabled%"},"github.copilot.chat.reviewSelection.enabled":{type:"boolean",default:!0,description:"%github.copilot.config.reviewSelection.enabled%"},"github.copilot.chat.reviewSelection.instructions":{type:"array",items:{oneOf:[{type:"object",markdownDescription:"%github.copilot.config.reviewSelection.instruction.file%",properties:{file:{type:"string",examples:[".copilot-review-instructions.md"]},language:{type:"string"}},examples:[{file:".copilot-review-instructions.md"}],required:["file"]},{type:"object",markdownDescription:"%github.copilot.config.reviewSelection.instruction.text%",properties:{text:{type:"string",examples:["Use underscore for field names."]},language:{type:"string"}},required:["text"],examples:[{text:"Use underscore for field names."},{text:"Resolve all TODO tasks."}]}]},default:[],markdownDescription:"%github.copilot.config.reviewSelection.instructions%",examples:[[{file:".copilot-review-instructions.md"},{text:"Resolve all TODO tasks."}]]},"github.copilot.chat.anthropic.useMessagesApi":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.useMessagesApi%",tags:["onExp"]}}},{id:"preview",properties:{"github.copilot.chat.claudeAgent.allowAutoPermissions":{type:"boolean",default:!1,tags:["preview","onExp"],markdownDescription:"%github.copilot.config.claudeAgent.allowAutoPermissions%"},"github.copilot.chat.claudeAgent.useSdkExtension":{type:"boolean",default:!1,tags:["preview","onExp"],markdownDescription:"%github.copilot.config.claudeAgent.useSdkExtension%"},"github.copilot.chat.claudeAgent.sdkExtensionInstallTimeout":{type:"number",default:12e4,minimum:1e3,tags:["preview"],markdownDescription:"%github.copilot.config.claudeAgent.sdkExtensionInstallTimeout%"},"github.copilot.chat.copilotDebugCommand.enabled":{type:"boolean",default:!0,tags:["preview"],description:"%github.copilot.chat.copilotDebugCommand.enabled%"},"github.copilot.chat.codesearch.enabled":{type:"boolean",default:!1,tags:["preview"],markdownDescription:"%github.copilot.config.codesearch.enabled%"},"github.copilot.chat.tools.viewImage.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.tools.viewImage.enabled%",tags:["preview","onExp"]}}},{id:"experimental",properties:{"github.copilot.chat.githubMcpServer.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.githubMcpServer.enabled%",tags:["experimental"],agentsWindow:{default:!0}},"github.copilot.chat.githubMcpServer.toolsets":{type:"array",default:["default"],markdownDescription:"%github.copilot.config.githubMcpServer.toolsets%",items:{type:"string"},tags:["experimental"]},"github.copilot.chat.githubMcpServer.readonly":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.githubMcpServer.readonly%",tags:["experimental"]},"github.copilot.chat.githubMcpServer.lockdown":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.githubMcpServer.lockdown%",tags:["experimental"]},"github.copilot.chat.githubMcpServer.channel":{type:"string",default:"stable",enum:["stable","insiders"],enumDescriptions:["%github.copilot.config.githubMcpServer.channel.stable%","%github.copilot.config.githubMcpServer.channel.insiders%"],markdownDescription:"%github.copilot.config.githubMcpServer.channel%",tags:["experimental"]},"github.copilot.chat.cloudAgentBackend.version":{type:"string",default:"v1",enum:["v1","v2"],enumDescriptions:["%github.copilot.config.cloudAgentBackend.version.v1%","%github.copilot.config.cloudAgentBackend.version.v2%"],markdownDescription:"%github.copilot.config.cloudAgentBackend.version%",tags:["experimental","onExp"]},"github.copilot.chat.switchAgent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.switchAgent.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.imageUpload.enabled":{type:"boolean",default:!0,tags:["experimental","onExp"],markdownDescription:"%github.copilot.config.imageUpload.enabled%"},"github.copilot.chat.codeGeneration.instructions":{markdownDeprecationMessage:"%github.copilot.config.codeGeneration.instructions.deprecated%",type:"array",items:{oneOf:[{type:"object",markdownDescription:"%github.copilot.config.codeGeneration.instruction.file%",properties:{file:{type:"string",examples:[".copilot-codeGeneration-instructions.md"]},language:{type:"string"}},examples:[{file:".copilot-codeGeneration-instructions.md"}],required:["file"]},{type:"object",markdownDescription:"%github.copilot.config.codeGeneration.instruction.text%",properties:{text:{type:"string",examples:["Use underscore for field names."]},language:{type:"string"}},required:["text"],examples:[{text:"Use underscore for field names."},{text:"Always add a comment: 'Generated by Copilot'."}]}]},default:[],markdownDescription:"%github.copilot.config.codeGeneration.instructions%",examples:[[{file:".copilot-codeGeneration-instructions.md"},{text:"Always add a comment: 'Generated by Copilot'."}]],tags:["experimental"]},"github.copilot.chat.testGeneration.instructions":{markdownDeprecationMessage:"%github.copilot.config.testGeneration.instructions.deprecated%",type:"array",items:{oneOf:[{type:"object",markdownDescription:"%github.copilot.config.experimental.testGeneration.instruction.file%",properties:{file:{type:"string",examples:[".copilot-test-instructions.md"]},language:{type:"string"}},examples:[{file:".copilot-test-instructions.md"}],required:["file"]},{type:"object",markdownDescription:"%github.copilot.config.experimental.testGeneration.instruction.text%",properties:{text:{type:"string",examples:["Use suite and test instead of describe and it."]},language:{type:"string"}},required:["text"],examples:[{text:"Always try uniting related tests in a suite."}]}]},default:[],markdownDescription:"%github.copilot.config.testGeneration.instructions%",examples:[[{file:".copilot-test-instructions.md"},{text:"Always try uniting related tests in a suite."}]],tags:["experimental"]},"github.copilot.chat.commitMessageGeneration.instructions":{type:"array",items:{oneOf:[{type:"object",markdownDescription:"%github.copilot.config.commitMessageGeneration.instruction.file%",properties:{file:{type:"string",examples:[".copilot-commit-message-instructions.md"]}},examples:[{file:".copilot-commit-message-instructions.md"}],required:["file"]},{type:"object",markdownDescription:"%github.copilot.config.commitMessageGeneration.instruction.text%",properties:{text:{type:"string",examples:["Use conventional commit message format."]}},required:["text"],examples:[{text:"Use conventional commit message format."}]}]},default:[],markdownDescription:"%github.copilot.config.commitMessageGeneration.instructions%",examples:[[{file:".copilot-commit-message-instructions.md"},{text:"Use conventional commit message format."}]],tags:["experimental"]},"github.copilot.chat.pullRequestDescriptionGeneration.instructions":{type:"array",items:{oneOf:[{type:"object",markdownDescription:"%github.copilot.config.pullRequestDescriptionGeneration.instruction.file%",properties:{file:{type:"string",examples:[".copilot-pull-request-description-instructions.md"]}},examples:[{file:".copilot-pull-request-description-instructions.md"}],required:["file"]},{type:"object",markdownDescription:"%github.copilot.config.pullRequestDescriptionGeneration.instruction.text%",properties:{text:{type:"string",examples:["Include every commit message in the pull request description."]}},required:["text"],examples:[{text:"Include every commit message in the pull request description."}]}]},default:[],markdownDescription:"%github.copilot.config.pullRequestDescriptionGeneration.instructions%",examples:[[{file:".copilot-pull-request-description-instructions.md"},{text:"Use conventional commit message format."}]],tags:["experimental"]},"github.copilot.chat.setupTests.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.setupTests.enabled%",tags:["experimental"]},"github.copilot.chat.languageContext.typescript.enabled":{type:"boolean",default:!0,scope:"resource",tags:["experimental","onExP"],markdownDescription:"%github.copilot.chat.languageContext.typescript.enabled%",agentsWindow:{default:!0}},"github.copilot.chat.languageContext.typescript.items":{type:"string",enum:["minimal","double","fillHalf","fill"],default:"double",scope:"resource",tags:["experimental","onExP"],markdownDescription:"%github.copilot.chat.languageContext.typescript.items%"},"github.copilot.chat.languageContext.typescript.includeDocumentation":{type:"boolean",default:!1,scope:"resource",tags:["experimental","onExP"],markdownDescription:"%github.copilot.chat.languageContext.typescript.includeDocumentation%"},"github.copilot.chat.languageContext.typescript.cacheTimeout":{type:"number",default:500,scope:"resource",tags:["experimental","onExP"],markdownDescription:"%github.copilot.chat.languageContext.typescript.cacheTimeout%"},"github.copilot.chat.languageContext.fix.typescript.enabled":{type:"boolean",default:!1,scope:"resource",tags:["experimental","onExP"],markdownDescription:"%github.copilot.chat.languageContext.fix.typescript.enabled%"},"github.copilot.chat.languageContext.inline.typescript.enabled":{type:"boolean",default:!1,scope:"resource",tags:["experimental","onExP"],markdownDescription:"%github.copilot.chat.languageContext.inline.typescript.enabled%"},"github.copilot.chat.newWorkspaceCreation.enabled":{type:"boolean",default:!0,tags:["experimental"],description:"%github.copilot.config.newWorkspaceCreation.enabled%"},"github.copilot.chat.newWorkspace.useContext7":{type:"boolean",default:!1,tags:["experimental"],markdownDescription:"%github.copilot.config.newWorkspace.useContext7%"},"github.copilot.chat.notebook.followCellExecution.enabled":{type:"boolean",default:!1,tags:["experimental"],description:"%github.copilot.config.notebook.followCellExecution%"},"github.copilot.chat.notebook.enhancedNextEditSuggestions.enabled":{type:"boolean",default:!1,tags:["experimental","onExp"],description:"%github.copilot.config.notebook.enhancedNextEditSuggestions%"},"github.copilot.chat.summarizeAgentConversationHistory.enabled":{type:"boolean",default:!0,tags:["experimental"],description:"%github.copilot.config.summarizeAgentConversationHistory.enabled%"},"github.copilot.chat.virtualTools.threshold":{type:"number",minimum:0,maximum:128,default:128,tags:["experimental"],markdownDescription:"%github.copilot.config.virtualTools.threshold%"},"github.copilot.chat.alternateGptPrompt.enabled":{type:"boolean",default:!1,tags:["experimental"],description:"%github.copilot.config.alternateGptPrompt.enabled%"},"github.copilot.chat.alternateGeminiModelFPrompt.enabled":{type:"boolean",default:!1,tags:["experimental","onExp"],description:"%github.copilot.config.alternateGeminiModelFPrompt.enabled%"},"github.copilot.chat.gemini35FlashReducedToolUsePrompt.enabled":{type:"boolean",default:!1,tags:["experimental","onExp"],description:"%github.copilot.config.gemini35FlashReducedToolUsePrompt.enabled%"},"github.copilot.chat.anthropic.contextEditing.mode":{type:"string",default:"off",markdownDescription:"%github.copilot.config.anthropic.contextEditing.mode%",tags:["experimental","onExp"],enum:["off","clear-thinking","clear-tooluse","clear-both"]},"github.copilot.chat.responsesApiReasoningSummary":{type:"string",default:"detailed",markdownDescription:"%github.copilot.config.responsesApiReasoningSummary%",tags:["experimental","onExp"],enum:["off","detailed"]},"github.copilot.chat.responsesApiContextManagement.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.responsesApiContextManagement.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.responsesApi.promptCacheKey.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.responsesApi.promptCacheKey.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.responsesApi.persistentCoT.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.responsesApi.persistentCoT.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.updated53CodexPrompt.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.updated53CodexPrompt.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.claude47OpusPrompt.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.claude47OpusPrompt.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.gpt55GetChangedFilesTool.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.gpt55GetChangedFilesTool.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.gemini3GetChangedFilesTool.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.gemini3GetChangedFilesTool.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.gemini3LowReasoningEffort.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.gemini3LowReasoningEffort.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.gpt55ReadFileTool.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.gpt55ReadFileTool.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.anthropic.tools.websearch.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.anthropic.tools.websearch.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.anthropic.tools.websearch.maxUses":{type:"number",default:5,markdownDescription:"%github.copilot.config.anthropic.tools.websearch.maxUses%",minimum:1,maximum:20,tags:["experimental"]},"github.copilot.chat.anthropic.tools.websearch.allowedDomains":{type:"array",default:[],markdownDescription:"%github.copilot.config.anthropic.tools.websearch.allowedDomains%",items:{type:"string"},tags:["experimental"]},"github.copilot.chat.anthropic.tools.websearch.blockedDomains":{type:"array",default:[],markdownDescription:"%github.copilot.config.anthropic.tools.websearch.blockedDomains%",items:{type:"string"},tags:["experimental"]},"github.copilot.chat.anthropic.tools.websearch.userLocation":{type:["object","null"],default:null,markdownDescription:"%github.copilot.config.anthropic.tools.websearch.userLocation%",properties:{city:{type:"string",description:"City name (e.g., 'San Francisco')"},region:{type:"string",description:"State or region (e.g., 'California')"},country:{type:"string",description:"ISO country code (e.g., 'US')"},timezone:{type:"string",description:"IANA timezone identifier (e.g., 'America/Los_Angeles')"}},tags:["experimental"]},"github.copilot.chat.completionsFetcher":{type:["string","null"],markdownDescription:"%github.copilot.config.completionsFetcher%",tags:["experimental","onExp"],enum:["electron-fetch","node-fetch"]},"github.copilot.chat.nesFetcher":{type:["string","null"],markdownDescription:"%github.copilot.config.nesFetcher%",tags:["experimental","onExp"],enum:["electron-fetch","node-fetch"]},"github.copilot.chat.planAgent.additionalTools":{type:"array",items:{type:"string"},default:[],scope:"resource",markdownDescription:"%github.copilot.config.planAgent.additionalTools%",tags:["experimental"]},"github.copilot.chat.implementAgent.model":{type:"string",default:"",scope:"resource",markdownDescription:"%github.copilot.config.implementAgent.model%",tags:["experimental"]},"github.copilot.chat.askAgent.additionalTools":{type:"array",items:{type:"string"},default:[],scope:"resource",markdownDescription:"%github.copilot.config.askAgent.additionalTools%",tags:["experimental"]},"github.copilot.chat.askAgent.model":{type:"string",default:"",scope:"resource",markdownDescription:"%github.copilot.config.askAgent.model%",tags:["experimental"]},"github.copilot.chat.exploreAgent.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.exploreAgent.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.exploreAgent.model":{type:"string",default:"",scope:"resource",markdownDescription:"%github.copilot.config.exploreAgent.model%",tags:["experimental"]},"github.copilot.chat.localIndex.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.localIndex.enabled%",tags:["experimental","onExp"]},"github.copilot.chat.conversationCompaction.usePrismCompaction":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.conversationCompaction.usePrismCompaction%",tags:["experimental","onExp"]},"github.copilot.chat.conversationCompaction.model":{type:"string",default:"",markdownDescription:"%github.copilot.config.conversationCompaction.model%",tags:["experimental","onExp"]},"github.copilot.chat.conversationCompaction.prismModelFilter":{type:"string",default:"claude-haiku-4.5,claude-sonnet-4.5,claude-sonnet-4.6,gemini-2.5-pro,gemini-3-flash,gemini-3.5-flash",markdownDescription:"%github.copilot.config.conversationCompaction.prismModelFilter%",tags:["experimental","onExp"]},"github.copilot.chat.tools.grepSearch.outputFormat":{type:"string",default:"tag",enum:["grep","tag"],markdownDescription:"%github.copilot.chat.tools.grepSearch.outputFormat%",tags:["experimental","onExp"]}}},{id:"advanced",properties:{"github.copilot.chat.inlineEdits.xtabProvider.modelConfiguration":{type:["object","null"],default:null,markdownDescription:`Advanced model configuration for the next edit suggestions xtab provider. **Note**: This is an advanced setting.`,tags:["advanced","experimental"]},"github.copilot.chat.reasoningEffortOverride":{type:["string","null"],default:null,markdownDescription:"Overrides the reasoning/thinking effort sent to model APIs. The configured value must match a reasoning-effort value supported by the selected model or endpoint (for example, `low`, `medium`, `high`, or other model-specific values). Used by evals.\n\n**Note**: This is an advanced debugging setting.",tags:["advanced"]},"github.copilot.chat.anthropic.promptCaching.extendedTtl":{type:"boolean",default:!1,tags:["advanced","experimental","onExp"],description:"%github.copilot.config.anthropic.promptCaching.extendedTtl%"},"github.copilot.chat.anthropic.promptCaching.extendedTtlMessages":{type:"boolean",default:!1,tags:["advanced","experimental","onExp"],description:"%github.copilot.config.anthropic.promptCaching.extendedTtlMessages%"},"github.copilot.chat.modelCapabilityOverrides":{type:"object",default:{},markdownDescription:"%github.copilot.config.modelCapabilityOverrides%",additionalProperties:{type:"object",properties:{family:{type:"string",description:"Alias the model's family for capability routing (e.g. 'claude-opus-4.7')."}},additionalProperties:!1},tags:["advanced"]},"github.copilot.chat.installExtensionSkill.enabled":{type:"boolean",default:!1,tags:["advanced","experimental","onExp"],description:"%github.copilot.config.installExtensionSkill.enabled%"},"github.copilot.chat.debug.promptOverrideString":{type:["string","null"],default:null,markdownDescription:"YAML string that overrides the system prompt and/or tool descriptions sent to the model. When both this setting and `github.copilot.chat.debug.promptOverrideFile` are configured, this setting takes precedence.\n\n**Note**: This is an advanced debugging setting.",tags:["advanced","experimental"]},"github.copilot.chat.debug.promptOverrideFile":{type:["string","null"],default:null,markdownDescription:`Path to a YAML file that overrides the system prompt and/or tool descriptions sent to the model. -**Note**: This is an advanced debugging setting.`,tags:["advanced","experimental"]},"github.copilot.chat.edits.gemini3MultiReplaceString":{type:"boolean",default:!1,markdownDescription:"Enable the modern `multi_replace_string_in_file` edit tool when generating edits with Gemini 3 models.",tags:["advanced","experimental","onExp"]},"github.copilot.chat.edits.batchReplaceStringDescriptions":{type:"boolean",default:!1,markdownDescription:"Update tool descriptions to promote `multi_replace_string_in_file` as the primary multi-edit tool.",tags:["advanced","experimental","onExp"]},"github.copilot.chat.projectLabels.expanded":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.projectLabels.expanded%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.projectLabels.chat":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.projectLabels.chat%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.projectLabels.inline":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.projectLabels.inline%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.maxLocalIndexSize":{type:"number",default:1e5,markdownDescription:"%github.copilot.config.workspace.maxLocalIndexSize%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.enableCodeSearch":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.workspace.enableCodeSearch%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.preferredEmbeddingsModel":{type:"string",default:"",markdownDescription:"%github.copilot.config.workspace.preferredEmbeddingsModel%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.prototypeAdoCodeSearchEndpointOverride":{type:"string",default:"",markdownDescription:"%github.copilot.config.workspace.prototypeAdoCodeSearchEndpointOverride%",tags:["advanced","experimental"]},"github.copilot.chat.feedback.onChange":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.feedback.onChange%",tags:["advanced","experimental"]},"github.copilot.chat.review.intent":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.review.intent%",tags:["advanced","experimental"]},"github.copilot.chat.notebook.summaryExperimentEnabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.notebook.summaryExperimentEnabled%",tags:["advanced","experimental"]},"github.copilot.chat.notebook.variableFilteringEnabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.notebook.variableFilteringEnabled%",tags:["advanced","experimental"]},"github.copilot.chat.notebook.alternativeFormat":{type:"string",default:"xml",enum:["xml","markdown"],markdownDescription:"%github.copilot.config.notebook.alternativeFormat%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.notebook.alternativeNESFormat.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.notebook.alternativeNESFormat.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.debugTerminalCommandPatterns":{type:"array",default:[],items:{type:"string"},markdownDescription:"%github.copilot.config.debugTerminalCommandPatterns%",tags:["advanced","experimental"]},"github.copilot.chat.localWorkspaceRecording.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.localWorkspaceRecording.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.editRecording.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.editRecording.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.inlineChat.reasoningEffort":{type:"string",default:"low",enum:["none","minimal","low","medium","high"],markdownDescription:"%github.copilot.config.inlineChat.reasoningEffort%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineChat.enableThinking":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.inlineChat.enableThinking%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.debug.requestLogger.maxEntries":{type:"number",default:100,markdownDescription:"%github.copilot.config.debug.requestLogger.maxEntries%",tags:["advanced","experimental"]},"github.copilot.chat.inlineEdits.diagnosticsContextProvider.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.inlineEdits.diagnosticsContextProvider.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.chatSessionContextProvider.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.inlineEdits.chatSessionContextProvider.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.codesearch.agent.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.codesearch.agent.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.agent.temperature":{type:["number","null"],markdownDescription:"%github.copilot.config.agent.temperature%",tags:["advanced","experimental"]},"github.copilot.chat.agent.omitFileAttachmentContents":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.agent.omitFileAttachmentContents%",tags:["advanced","experimental"]},"github.copilot.chat.agent.backgroundTodoAgent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.agent.backgroundTodoAgent.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.longToolCallCachePreservation.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.agent.longToolCallCachePreservation.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.longToolCallCachePreservation.maxProbes":{type:"number",default:1,markdownDescription:"%github.copilot.config.agent.longToolCallCachePreservation.maxProbes%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.largeToolResultsToDisk.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.agent.largeToolResultsToDisk.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.largeToolResultsToDisk.thresholdBytes":{type:"number",default:8192,markdownDescription:"%github.copilot.config.agent.largeToolResultsToDisk.thresholdBytes%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.instantApply.shortContextModelName":{type:"string",default:"gpt-4o-instant-apply-full-ft-v66-short",markdownDescription:"%github.copilot.config.instantApply.shortContextModelName%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.instantApply.shortContextLimit":{type:"number",default:8e3,markdownDescription:"%github.copilot.config.instantApply.shortContextLimit%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.enableUserPreferences":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.enableUserPreferences%",tags:["advanced","experimental"]},"github.copilot.chat.skillTool.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.skill.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.getChangedFilesTool.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.getChangedFilesTool.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.executionSubagent.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.model":{type:"string",default:"gemini-3-flash",markdownDescription:"%github.copilot.config.executionSubagent.model%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.useAgenticProxy":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.executionSubagent.useAgenticProxy%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.toolCallLimit":{type:"number",default:10,markdownDescription:"%github.copilot.config.executionSubagent.toolCallLimit%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.summarizeAgentConversationHistoryThreshold":{type:["number","null"],markdownDescription:"%github.copilot.config.summarizeAgentConversationHistoryThreshold%",tags:["advanced","experimental"]},"github.copilot.chat.agentHistorySummarizationMode":{type:["string","null"],markdownDescription:"%github.copilot.config.agentHistorySummarizationMode%",tags:["advanced","experimental"]},"github.copilot.chat.useResponsesApiTruncation":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.useResponsesApiTruncation%",tags:["advanced","experimental"]},"github.copilot.chat.omitBaseAgentInstructions":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.omitBaseAgentInstructions%",tags:["advanced","experimental"]},"github.copilot.chat.promptFileContextProvider.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.promptFileContextProvider.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.tools.defaultToolsGrouped":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.tools.defaultToolsGrouped%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.gpt5AlternativePatch":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.gpt5AlternativePatch%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.triggerOnEditorChangeAfterSeconds":{type:["number","null"],default:10,markdownDescription:"%github.copilot.config.inlineEdits.triggerOnEditorChangeAfterSeconds%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.nextCursorPrediction.displayLine":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.inlineEdits.nextCursorPrediction.displayLine%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens":{type:"number",default:3e3,markdownDescription:"%github.copilot.config.inlineEdits.nextCursorPrediction.currentFileMaxTokens%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.renameSymbolSuggestions":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.inlineEdits.renameSymbolSuggestions%",tags:["advanced","experimental","onExp"]},"github.copilot.nextEditSuggestions.preferredModel":{type:"string",default:"none",markdownDescription:"%github.copilot.config.nextEditSuggestions.preferredModel%",tags:["advanced","experimental","onExp"]},"github.copilot.nextEditSuggestions.eagerness":{type:"string",default:"auto",enum:["auto","low","medium","high"],enumItemLabels:["%github.copilot.config.nextEditSuggestions.eagerness.auto.label%","%github.copilot.config.nextEditSuggestions.eagerness.low.label%","%github.copilot.config.nextEditSuggestions.eagerness.medium.label%","%github.copilot.config.nextEditSuggestions.eagerness.high.label%"],enumDescriptions:["%github.copilot.config.nextEditSuggestions.eagerness.auto%","%github.copilot.config.nextEditSuggestions.eagerness.low%","%github.copilot.config.nextEditSuggestions.eagerness.medium%","%github.copilot.config.nextEditSuggestions.eagerness.high%"],markdownDescription:"%github.copilot.config.nextEditSuggestions.eagerness%",tags:["advanced","experimental"]},"github.copilot.chat.cli.mcp.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.mcp.enabled%",tags:["advanced","experimental"],agentsWindow:{default:!0}},"github.copilot.chat.cli.branchSupport.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.branchSupport.enabled%",tags:["advanced"],agentsWindow:{default:!0}},"github.copilot.chat.cli.showExternalSessions":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.showExternalSessions%",tags:["advanced"],agentsWindow:{default:!1}},"github.copilot.chat.cli.planExitMode.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.planExitMode.enabled%",tags:["advanced"]},"github.copilot.chat.cli.autoModel.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.autoModel.enabled%",tags:["advanced"]},"github.copilot.chat.agent.modelDetails.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.chat.agent.modelDetails.enabled%",tags:["advanced"]},"github.copilot.chat.cli.planCommand.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.planCommand.enabled%",tags:["advanced"]},"github.copilot.chat.cli.lazyLoadSessionItem.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.lazyLoadSessionItem.enabled%",tags:["advanced"],agentsWindow:{default:!1}},"github.copilot.chat.cli.aiGenerateBranchNames.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.aiGenerateBranchNames.enabled%",tags:["advanced"]},"github.copilot.chat.cli.forkSessions.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.forkSessions.enabled%",tags:["advanced"]},"github.copilot.chat.cli.isolationOption.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.isolationOption.enabled%",tags:["advanced"],agentsWindow:{default:!0}},"github.copilot.chat.cli.autoCommit.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.autoCommit.enabled%",tags:["advanced","experimental"],agentsWindow:{default:!1}},"github.copilot.chat.cli.sessionController.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.sessionController.enabled%",tags:["advanced"],agentsWindow:{default:!1,readOnly:!0}},"github.copilot.chat.cli.thinkingEffort.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.thinkingEffort.enabled%",tags:["advanced"]},"github.copilot.chat.cli.sessionControllerForSessionsApp.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.sessionControllerForSessionsApp.enabled%",tags:["advanced"]},"github.copilot.chat.cli.terminalLinks.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.terminalLinks.enabled%",tags:["advanced"]},"github.copilot.chat.cli.remote.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.remote.enabled%",tags:["advanced"],agentsWindow:{default:!1}},"github.copilot.chat.searchSubagent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.searchSubagent.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.searchSubagent.useAgenticProxy":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.searchSubagent.useAgenticProxy%",tags:["advanced"]},"github.copilot.chat.searchSubagent.model":{type:"string",default:"",markdownDescription:"%github.copilot.config.searchSubagent.model%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.searchSubagent.toolCallLimit":{type:"number",default:4,markdownDescription:"%github.copilot.config.searchSubagent.toolCallLimit%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.searchSubagent.thoroughnessEnabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.searchSubagent.thoroughnessEnabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agentDebugLog.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.enabled%",deprecationMessage:"%github.copilot.config.chat.agentDebugLog.enabled.deprecated%",tags:["advanced","experimental"]},"github.copilot.chat.agentDebugLog.fileLogging.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agentDebugLog.fileLogging.flushIntervalMs":{type:"number",default:4e3,minimum:2e3,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.flushIntervalMs%",tags:["advanced","experimental"]},"github.copilot.chat.agentDebugLog.fileLogging.maxRetainedSessionLogs":{type:"number",default:50,minimum:1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.maxRetainedSessionLogs%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agentDebugLog.fileLogging.maxSessionLogSizeMB":{type:"number",default:100,minimum:1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.maxSessionLogSizeMB%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.otel.enabled":{type:"boolean",default:!1,markdownDescription:"Enable OpenTelemetry trace/metric/log emission for Copilot Chat operations. Env var `COPILOT_OTEL_ENABLED` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.exporterType":{type:"string",enum:["otlp-grpc","otlp-http","console","file"],default:"otlp-http",markdownDescription:"OTel exporter type for Copilot Chat telemetry. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.otlpEndpoint":{type:"string",default:"http://localhost:4318",markdownDescription:"OTLP collector endpoint URL for Copilot Chat OTel data. Env var `OTEL_EXPORTER_OTLP_ENDPOINT` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.captureContent":{type:"boolean",default:!1,markdownDescription:"Capture input/output messages, system instructions, and tool definitions in OTel telemetry. **Contains potentially sensitive data.** Env var `COPILOT_OTEL_CAPTURE_CONTENT` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.maxAttributeSizeChars":{type:"integer",default:0,minimum:0,markdownDescription:"Maximum size **in characters** for free-form OTel content attributes (prompts, responses, tool arguments/results, hook input/output). `0` (the default) disables truncation so backends without per-attribute size limits receive full JSON payloads. Set to a positive value when your OTel backend caps attribute size \u2014 consult your backend's documentation for its per-attribute limit. Truncated values are suffixed with `...[truncated, original N chars]`. Env var `COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.outfile":{type:"string",default:"",markdownDescription:"File path for file-based OTel exporter output (JSON-lines). When set, overrides exporter type to `file`. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.dbSpanExporter.enabled":{type:"boolean",default:!1,markdownDescription:"Enable SQLite DB span exporter. Persists OTel spans to a local SQLite database. Automatically enables OTel when set to true. Requires window reload.",tags:["advanced"]},"github.copilot.chat.workspace.codeSearchExternalIngest.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.workspace.codeSearchExternalIngest.enabled%",tags:["advanced","onExp"]}}}],submenus:[{id:"copilot/reviewComment/additionalActions/applyAndNext",label:"%github.copilot.submenu.reviewComment.applyAndNext.label%"},{id:"copilot/reviewComment/additionalActions/discardAndNext",label:"%github.copilot.submenu.reviewComment.discardAndNext.label%"},{id:"copilot/reviewComment/additionalActions/discard",label:"%github.copilot.submenu.reviewComment.discard.label%"},{id:"github.copilot.chat.debug.filter",label:"Filter",icon:"$(filter)"},{id:"github.copilot.chat.debug.exportAllPromptLogsAsJson",label:"Export All Logs as JSON",icon:"$(file-export)"}],menus:{"editor/title":[{command:"github.copilot.debug.generateInlineEditTests",when:"resourceScheme == 'ccreq'"},{command:"github.copilot.chat.notebook.enableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && !github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && !config.notebook.globalToolbar",group:"navigation@10"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && !config.notebook.globalToolbar",group:"navigation@10"},{command:"github.copilot.chat.copilotCLI.acceptDiff",group:"navigation@1",when:"github.copilot.chat.copilotCLI.hasActiveDiff"},{command:"github.copilot.chat.copilotCLI.rejectDiff",group:"navigation@2",when:"github.copilot.chat.copilotCLI.hasActiveDiff"}],"editor/title/context":[{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"}],"explorer/context":[{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !explorerResourceIsFolder"}],"editor/context":[{command:"github.copilot.chat.fix",when:"!github.copilot.interactiveSession.disabled && chatSetupCompleted && !editorReadonly && editorSelectionHasDiagnostics",group:"1_chat@4"},{command:"github.copilot.chat.explain",when:"!github.copilot.interactiveSession.disabled && chatSetupCompleted",group:"1_chat@5"},{command:"github.copilot.chat.review",when:"config.github.copilot.chat.reviewSelection.enabled && !github.copilot.interactiveSession.disabled && chatSetupCompleted && resourceScheme != 'vscode-chat-code-block'",group:"1_chat@6"},{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"},{command:"github.copilot.chat.copilotCLI.addSelection",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && editorHasSelection && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"}],"chat/editor/inlineGutter":[{command:"github.copilot.chat.explain",when:"!github.copilot.interactiveSession.disabled && editor.hasSelection && !inlineChatFileBelongsToChat",group:"2_chat@2"},{command:"github.copilot.chat.review",when:"!github.copilot.interactiveSession.disabled && editor.hasSelection && config.github.copilot.chat.reviewSelection.enabled && !inlineChatFileBelongsToChat",group:"2_chat@3"}],"chat/input/editing/sessionToolbar":[{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply",when:"chatSessionType == copilotcli && workbenchState != empty && !isSessionsWindow",group:"navigation@0"},{command:"github.copilot.chat.checkoutPullRequestReroute",when:"chatSessionType == copilot-cloud-agent && !github.vscode-pull-request-github.activated && gitOpenRepositoryCount != 0",group:"navigation@0"}],"agents/changes/actions/primary":[{command:"github.copilot.sessions.initializeRepository",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == workspace && !sessions.hasGitRepository && !sessions.isAgentHostSession",group:"0_init@1"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && !sessions.isMergeBaseBranchProtected && !sessions.hasPullRequest && (sessions.hasUncommittedChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"1_merge@1"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && !sessions.isMergeBaseBranchProtected && !sessions.hasPullRequest && (sessions.hasUncommittedChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"1_merge@2"},{command:"github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && sessions.hasGitHubRemote && !sessions.hasPullRequest && sessions.hasBranchChanges && !sessions.isAgentHostSession",group:"2_pull_request@1"},{command:"github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && sessions.hasGitHubRemote && !sessions.hasPullRequest && sessions.hasBranchChanges && !sessions.isAgentHostSession",group:"2_pull_request@2"},{command:"github.copilot.sessions.commit",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && !sessions.isAgentHostSession",group:"3_commit@1"},{command:"github.copilot.sessions.commitAndSync",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && !sessions.isAgentHostSession",group:"3_commit@2"},{command:"github.copilot.sessions.sync",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUpstream && !sessions.hasUncommittedChanges && (sessions.hasIncomingChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"4_sync@1"},{command:"github.copilot.claude.sessions.initializeRepository",when:"chatSessionType == claude-code && isSessionsWindow && !sessions.hasGitRepository",group:"init@1"},{command:"github.copilot.claude.sessions.commit",when:"chatSessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges",group:"commit@1"},{command:"github.copilot.claude.sessions.commitAndSync",when:"chatSessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && sessions.hasUpstream",group:"commit@2"},{command:"github.copilot.claude.sessions.sync",when:"chatSessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && !sessions.hasUncommittedChanges && sessions.hasUpstream",group:"sync@1"}],"agents/change/inline":[{command:"github.copilot.sessions.discardChanges",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && !isActiveSessionArchived && !sessions.isAgentHostSession",group:"navigation@2"}],"chat/contextUsage/actions":[{command:"github.copilot.chat.compact"}],"chat/newSession":[{command:"github.copilot.cli.newSession",group:"4_recommendations@0"}],"testing/item/result":[{command:"github.copilot.tests.fixTestFailure.fromInline",when:"testResultState == failed && !testResultOutdated",group:"inline@2"}],"testing/item/context":[{command:"github.copilot.tests.fixTestFailure.fromInline",when:"testResultState == failed && !testResultOutdated",group:"inline@2"}],commandPalette:[{command:"github.copilot.cli.openInCopilotCLI",when:"false"},{command:"github.copilot.debug.extensionState",when:"false"},{command:"github.copilot.cli.sessions.commitToWorktree",when:"false"},{command:"github.copilot.cli.sessions.commitToRepository",when:"false"},{command:"github.copilot.chat.triggerPermissiveSignIn",when:"false"},{command:"github.copilot.interactiveSession.feedback",when:"github.copilot-chat.activated && !github.copilot.interactiveSession.disabled"},{command:"github.copilot.debug.workbenchState",when:"true"},{command:"github.copilot.chat.rerunWithCopilotDebug",when:"false"},{command:"github.copilot.chat.startCopilotDebugCommand",when:"false"},{command:"github.copilot.git.generateCommitMessage",when:"false"},{command:"github.copilot.git.resolveMergeConflicts",when:"false"},{command:"github.copilot.chat.explain",when:"false"},{command:"github.copilot.chat.review",when:"!github.copilot.interactiveSession.disabled"},{command:"github.copilot.chat.review.apply",when:"false"},{command:"github.copilot.chat.review.applyAndNext",when:"false"},{command:"github.copilot.chat.review.discard",when:"false"},{command:"github.copilot.chat.review.discardAndNext",when:"false"},{command:"github.copilot.chat.review.discardAll",when:"false"},{command:"github.copilot.chat.review.stagedChanges",when:"false"},{command:"github.copilot.chat.review.unstagedChanges",when:"false"},{command:"github.copilot.chat.review.changes",when:"false"},{command:"github.copilot.chat.review.stagedFileChange",when:"false"},{command:"github.copilot.chat.review.unstagedFileChange",when:"false"},{command:"github.copilot.chat.review.previous",when:"false"},{command:"github.copilot.chat.review.next",when:"false"},{command:"github.copilot.chat.review.continueInInlineChat",when:"false"},{command:"github.copilot.chat.review.continueInChat",when:"false"},{command:"github.copilot.chat.review.markHelpful",when:"false"},{command:"github.copilot.chat.review.markUnhelpful",when:"false"},{command:"github.copilot.devcontainer.generateDevContainerConfig",when:"false"},{command:"github.copilot.tests.fixTestFailure",when:"false"},{command:"github.copilot.tests.fixTestFailure.fromInline",when:"false"},{command:"github.copilot.search.markHelpful",when:"false"},{command:"github.copilot.search.markUnhelpful",when:"false"},{command:"github.copilot.search.feedback",when:"false"},{command:"github.copilot.chat.debug.showElements",when:"false"},{command:"github.copilot.chat.debug.hideElements",when:"false"},{command:"github.copilot.chat.debug.showTools",when:"false"},{command:"github.copilot.chat.debug.hideTools",when:"false"},{command:"github.copilot.chat.debug.showNesRequests",when:"false"},{command:"github.copilot.chat.debug.hideNesRequests",when:"false"},{command:"github.copilot.chat.debug.showGhostRequests",when:"false"},{command:"github.copilot.chat.debug.hideGhostRequests",when:"false"},{command:"github.copilot.chat.debug.exportLogItem",when:"false"},{command:"github.copilot.chat.debug.exportPromptArchive",when:"false"},{command:"github.copilot.chat.debug.exportPromptLogsAsJson",when:"false"},{command:"github.copilot.chat.debug.exportAllPromptLogsAsJson",when:"false"},{command:"github.copilot.chat.mcp.setup.check",when:"false"},{command:"github.copilot.chat.mcp.setup.validatePackage",when:"false"},{command:"github.copilot.chat.mcp.setup.flow",when:"false"},{command:"github.copilot.chat.debug.showRawRequestBody",when:"false"},{command:"github.copilot.debug.showOutputChannel",when:"false"},{command:"github.copilot.cli.sessions.delete",when:"false"},{command:"github.copilot.cli.sessions.resumeInTerminal",when:"false"},{command:"github.copilot.cli.sessions.rename",when:"false"},{command:"github.copilot.claude.sessions.rename",when:"false"},{command:"github.copilot.cli.sessions.setTitle",when:"false"},{command:"github.copilot.cli.sessions.openRepository",when:"false"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",when:"false"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",when:"false"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",when:"false"},{command:"github.copilot.cloud.sessions.openInBrowser",when:"false"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",when:"false"},{command:"github.copilot.cloud.sessions.installPRExtension",when:"false"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"false"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply",when:"false"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",when:"false"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync",when:"false"},{command:"github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR",when:"false"},{command:"github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR",when:"false"},{command:"github.copilot.chat.checkoutPullRequestReroute",when:"false"},{command:"github.copilot.chat.cloudSessions.openRepository",when:"false"},{command:"github.copilot.nes.captureExpected.start",when:"github.copilot.inlineEditsEnabled"},{command:"github.copilot.nes.captureExpected.submit",when:"github.copilot.inlineEditsEnabled"},{command:"github.copilot.sessions.commit",when:"false"},{command:"github.copilot.sessions.commitAndSync",when:"false"},{command:"github.copilot.sessions.sync",when:"false"},{command:"github.copilot.sessions.discardChanges",when:"false"},{command:"github.copilot.sessions.refreshChanges",when:"false"},{command:"github.copilot.sessions.initializeRepository",when:"false"},{command:"github.copilot.claude.sessions.commit",when:"false"},{command:"github.copilot.claude.sessions.commitAndSync",when:"false"},{command:"github.copilot.claude.sessions.sync",when:"false"},{command:"github.copilot.claude.sessions.initializeRepository",when:"false"}],"view/title":[{submenu:"github.copilot.chat.debug.filter",when:"view == copilot-chat",group:"navigation"},{command:"github.copilot.chat.debug.exportAllPromptLogsAsJson",when:"view == copilot-chat",group:"export@1"},{command:"workbench.action.chat.openAgentDebugPanel",when:"view == copilot-chat",group:"3_show@0"},{command:"github.copilot.debug.showOutputChannel",when:"view == copilot-chat",group:"3_show@1"},{command:"github.copilot.debug.showChatLogView",when:"view == workbench.panel.chat.view.copilot",group:"3_show"}],"view/item/context":[{command:"github.copilot.chat.debug.showRawRequestBody",when:"view == copilot-chat && viewItem == request",group:"export@0"},{command:"github.copilot.chat.debug.exportLogItem",when:"view == copilot-chat && (viewItem == toolcall || viewItem == request)",group:"export@1"},{command:"github.copilot.chat.debug.exportPromptArchive",when:"view == copilot-chat && viewItem == chatprompt",group:"export@2"},{command:"github.copilot.chat.debug.exportPromptLogsAsJson",when:"view == copilot-chat && viewItem == chatprompt",group:"export@3"}],"searchPanel/aiResults/commands":[{command:"github.copilot.search.markHelpful",group:"inline@0",when:"aiResultsTitle && aiResultsRequested"},{command:"github.copilot.search.markUnhelpful",group:"inline@1",when:"aiResultsTitle && aiResultsRequested"},{command:"github.copilot.search.feedback",group:"inline@2",when:"aiResultsTitle && aiResultsRequested && github.copilot.debugReportFeedback"}],"comments/comment/title":[{command:"github.copilot.chat.review.markHelpful",group:"inline@0",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.markUnhelpful",group:"inline@1",when:"commentController == github-copilot-review"}],"commentsView/commentThread/context":[{command:"github.copilot.chat.review.apply",group:"context@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discard",group:"context@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discardAll",group:"context@3",when:"commentController == github-copilot-review"}],"comments/commentThread/additionalActions":[{submenu:"copilot/reviewComment/additionalActions/applyAndNext",group:"inline@1",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments > 1"},{command:"github.copilot.chat.review.apply",group:"inline@1",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"},{submenu:"copilot/reviewComment/additionalActions/discardAndNext",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments > 1"},{submenu:"copilot/reviewComment/additionalActions/discard",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"}],"copilot/reviewComment/additionalActions/applyAndNext":[{command:"github.copilot.chat.review.applyAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.apply",group:"inline@2",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discardAndNext":[{command:"github.copilot.chat.review.discardAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discard":[{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"comments/commentThread/title":[{command:"github.copilot.chat.review.previous",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.next",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInChat",group:"inline@3",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discardAll",group:"inline@4",when:"commentController == github-copilot-review"}],"scm/title":[{command:"github.copilot.chat.review.changes",group:"navigation",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmProviderRootUri in github.copilot.chat.reviewDiff.enabledRootUris"}],"scm/sourceControl":[{command:"github.copilot.cli.openInCopilotCLI",group:"3_worktree@1",when:"scmProvider == git"}],"scm/resourceGroup/context":[{command:"github.copilot.chat.review.stagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index",group:"inline@-3"},{command:"github.copilot.chat.review.unstagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree",group:"inline@-3"}],"scm/resourceState/context":[{command:"github.copilot.git.resolveMergeConflicts",when:"scmProvider == git && scmResourceGroup == merge && git.activeResourceHasMergeConflicts",group:"z_chat@1"},{command:"github.copilot.chat.review.stagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index"},{command:"github.copilot.chat.review.unstagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree"}],"scm/inputBox":[{command:"github.copilot.git.generateCommitMessage",when:"scmProvider == git && chatSetupCompleted"}],"testing/message/context":[{command:"github.copilot.tests.fixTestFailure",when:"testing.testItemHasUri",group:"inline@1"}],"issue/reporter":[{command:"github.copilot.report"}],"github.copilot.chat.debug.filter":[{command:"github.copilot.chat.debug.showElements",when:"github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.hideElements",when:"!github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.showTools",when:"github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.hideTools",when:"!github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.showNesRequests",when:"github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.hideNesRequests",when:"!github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.showGhostRequests",when:"github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"},{command:"github.copilot.chat.debug.hideGhostRequests",when:"!github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"}],"notebook/toolbar":[{command:"github.copilot.chat.notebook.enableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && !github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"}],"editor/content":[{command:"github.copilot.git.resolveMergeConflicts",group:"z_chat@1",when:"config.git.enabled && !git.missing && !isInDiffEditor && !isMergeEditor && resource in git.mergeChanges && git.activeResourceHasMergeConflicts && chatSetupCompleted"}],"multiDiffEditor/content":[{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"resourceScheme == copilotcli-worktree-changes && workbenchState != empty && !isSessionsWindow"}],"chat/chatSessions":[{command:"github.copilot.claude.sessions.rename",when:"chatSessionType == claude-code",group:"1_edit@4"},{command:"github.copilot.cli.sessions.delete",when:"chatSessionType == copilotcli",group:"1_edit@10"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli",group:"1_edit@4"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",when:"chatSessionType == copilotcli && !isSessionsWindow",group:"2_open@1"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@2"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",when:"chatSessionType == copilotcli",group:"2_open@3"},{command:"github.copilot.cli.sessions.resumeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@4"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"chatSessionType == copilotcli && workbenchState != empty && !isSessionsWindow",group:"3_apply@0"},{command:"github.copilot.cloud.sessions.openInBrowser",when:"chatSessionType == copilot-cloud-agent",group:"navigation@10"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",when:"chatSessionType == copilot-cloud-agent",group:"1_edit@10"}],"chatSessions/item/context":[{command:"github.copilot.claude.sessions.rename",when:"chatSessionType == claude-code",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli",group:"1_edit@4"}],"chat/multiDiff/context":[{command:"github.copilot.cloud.sessions.installPRExtension",when:"chatSessionType == copilot-cloud-agent && !github.copilot.prExtensionInstalled",group:"inline@1"}],"chat/input/editing/sessionTitleToolbar":[{command:"github.copilot.sessions.refreshChanges",when:"chatSessionType == copilotcli && isSessionsWindow && !sessions.isAgentHostSession",group:"9_refresh@1"}],"chat/customizations/create":[{command:"copilot.claude.agents",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == agents",group:"navigation@1"},{command:"copilot.claude.hooks",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == hooks",group:"navigation@1"},{command:"copilot.claude.memory",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == instructions",group:"navigation@1"}]},icons:{"copilot-logo":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0041"}},"copilot-warning":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0042"}},"copilot-notconnected":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0043"}}},iconFonts:[{id:"copilot-font",src:[{path:"assets/copilot.woff",format:"woff"}]}],terminalQuickFixes:[{id:"copilot-chat.fixWithCopilot",commandLineMatcher:".+",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0},kind:"explain"},{id:"copilot-chat.generateCommitMessage",commandLineMatcher:"git add .+",commandExitResult:"success",kind:"explain",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0}},{id:"copilot-chat.terminalToDebugging",commandLineMatcher:".+",kind:"explain",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}},{id:"copilot-chat.terminalToDebuggingSuccess",commandLineMatcher:".+",kind:"explain",commandExitResult:"success",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}}],languages:[{id:"ignore",filenamePatterns:[".copilotignore"],aliases:[]},{id:"markdown",extensions:[".copilotmd"]}],views:{"copilot-chat":[{id:"copilot-chat",name:"Chat Debug",icon:"assets/debug-icon.svg",when:"github.copilot.chat.showLogView"}],"context-inspector":[{id:"context-inspector",name:"Language Context Inspector",icon:"$(inspect)",when:"github.copilot.chat.showContextInspectorView"}]},viewsContainers:{activitybar:[{id:"copilot-chat",title:"Chat Debug",icon:"assets/debug-icon.svg"},{id:"context-inspector",title:"Language Context Inspector",icon:"$(inspect)"}]},configurationDefaults:{"workbench.editorAssociations":{"*.copilotmd":"vscode.markdown.preview.editor"}},keybindings:[{command:"github.copilot.chat.copilotCLI.addFileReference",key:"ctrl+shift+.",mac:"cmd+shift+.",when:"github.copilot.chat.copilotCLI.hasSession && editorTextFocus"},{command:"github.copilot.chat.rerunWithCopilotDebug",key:"ctrl+alt+.",mac:"cmd+alt+.",when:"github.copilot-chat.activated && terminalShellIntegrationEnabled && terminalFocus && !terminalAltBufferActive"},{command:"github.copilot.nes.captureExpected.confirm",key:"ctrl+enter",mac:"cmd+enter",when:"copilotNesCaptureMode && editorTextFocus"},{command:"github.copilot.nes.captureExpected.abort",key:"escape",when:"copilotNesCaptureMode && editorTextFocus"}],walkthroughs:[{id:"copilotWelcome",title:"%github.copilot.walkthrough.title%",description:"%github.copilot.walkthrough.description%",when:"!isWeb",steps:[{id:"copilot.setup.signIn",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.signIn.description%",when:"chatEntitlementSignedOut && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signInNoAction",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatEntitlementSignedOut && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUp",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.signUp.description%",when:"chatPlanCanSignUp && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUpNoAction",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatPlanCanSignUp && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.panelChat",title:"%github.copilot.walkthrough.panelChat.title%",description:"%github.copilot.walkthrough.panelChat.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.edits",title:"%github.copilot.walkthrough.edits.title%",description:"%github.copilot.walkthrough.edits.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hclight.mp4"},altText:"%github.copilot.walkthrough.edits.media.altText%"}},{id:"copilot.firstSuggest",title:"%github.copilot.walkthrough.firstSuggest.title%",description:"%github.copilot.walkthrough.firstSuggest.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hclight.mp4"},altText:"%github.copilot.walkthrough.firstSuggest.media.altText%"}},{id:"copilot.inlineChatNotMac",title:"%github.copilot.walkthrough.inlineChatNotMac.title%",description:"%github.copilot.walkthrough.inlineChatNotMac.description%",when:"!isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatNotMac.media.altText%"}},{id:"copilot.inlineChatMac",title:"%github.copilot.walkthrough.inlineChatMac.title%",description:"%github.copilot.walkthrough.inlineChatMac.description%",when:"isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatMac.media.altText%"}},{id:"copilot.sparkle",title:"%github.copilot.walkthrough.sparkle.title%",description:"%github.copilot.walkthrough.sparkle.description%",when:"!chatEntitlementSignedOut || chatIsEnabled",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hclight.mp4"},altText:"%github.copilot.walkthrough.sparkle.media.altText%"}}]}],jsonValidation:[{fileMatch:"settings.json",url:"ccsettings://root/schema.json"}],typescriptServerPlugins:[{name:"@vscode/copilot-typescript-server-plugin",enableForWorkspaceTypeScriptVersions:!0}],chatSessions:[{type:"claude-code",name:"claude",displayName:"Claude",icon:"$(claude)",welcomeTitle:"Claude Agent",welcomeMessage:"Powered by the same agent as Claude Code",inputPlaceholder:"Run local tasks with Claude, type `#` for adding context",order:3,description:"%github.copilot.session.providerDescription.claude%",when:"config.github.copilot.chat.claudeAgent.enabled",canDelegate:!0,requiresCustomModels:!0,capabilities:{supportsFileAttachments:!0,supportsImageAttachments:!0},commands:[{name:"init",description:"Initialize a new CLAUDE.md file with codebase documentation"},{name:"pr-comments",description:"Get comments from a GitHub pull request"},{name:"review",description:"Review a pull request"},{name:"security-review",description:"Complete a security review of the pending changes on the current branch"},{name:"simplify",description:"Review changed code for reuse, quality, and efficiency"},{name:"claude-api",description:"Help building with Claude API or Anthropic SDK"},{name:"agents",description:"Create and manage specialized Claude agents"},{name:"hooks",description:"Configure Claude Code hooks for tool execution and events"},{name:"memory",description:"Open memory files (CLAUDE.md) for editing"},{name:"compact",description:"Compact the conversation history to save context tokens"}]},{type:"copilotcli",name:"cli",displayName:"Copilot CLI",icon:"$(copilot)",welcomeTitle:"Copilot CLI",welcomeMessage:"Run tasks in the background with the Copilot CLI",inputPlaceholder:"Run tasks in the background with the Copilot CLI, type `#` for adding context",order:1,canDelegate:!0,description:"%github.copilot.session.providerDescription.background%",when:"config.github.copilot.chat.backgroundAgent.enabled",capabilities:{supportsFileAttachments:!0,supportsProblemAttachments:!0,supportsToolAttachments:!1,supportsImageAttachments:!0,supportsSymbolAttachments:!0,supportsSearchResultAttachments:!0,supportsSourceControlAttachments:!0,supportsPromptAttachments:!0,supportsHandOffs:!0},commands:[{name:"delegate",description:"Delegate chat session to cloud agent and create associated PR",when:"config.github.copilot.chat.cloudAgent.enabled"},{name:"compact",description:"%github.copilot.command.cli.compact.description%"},{name:"plan",description:"%github.copilot.command.cli.plan.description%",when:"config.github.copilot.chat.cli.planCommand.enabled"},{name:"fleet",description:"%github.copilot.command.cli.fleet.description%",when:"false"},{name:"remote",description:"%github.copilot.command.cli.remote.description%",when:"config.github.copilot.chat.cli.remote.enabled"}],customAgentTarget:"github-copilot",requiresCustomModels:!0,autoAttachReferences:!0,useRequestToPopulateBuiltInPickers:!0},{type:"copilot-cloud-agent",alternativeIds:["copilot-swe-agent"],name:"cloud",displayName:"Cloud",icon:"$(cloud)",welcomeTitle:"Cloud Agent",welcomeMessage:"Delegate tasks to the cloud",inputPlaceholder:"Delegate tasks to the cloud, type `#` for adding context",order:2,canDelegate:!0,description:"%github.copilot.session.providerDescription.cloud%",when:"config.github.copilot.chat.cloudAgent.enabled",capabilities:{supportsFileAttachments:!0},autoAttachReferences:!0}],chatAgents:[],chatPromptFiles:[{path:"./assets/prompts/plan.prompt.md",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-standup.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-cost-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-improve.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-reindex.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-search.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],chatSkills:[{path:"./assets/prompts/skills/project-setup-info-local/SKILL.md",when:"!config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/project-setup-info-context7/SKILL.md",when:"config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/install-vscode-extension/SKILL.md",when:"config.github.copilot.chat.installExtensionSkill.enabled && config.github.copilot.chat.newWorkspaceCreation.enabled",sessionTypes:["local"]},{path:"./assets/prompts/skills/get-search-view-results/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/troubleshoot/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/agent-customization/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/init/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-prompt/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-instructions/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-skill/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-agent/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-hook/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/chronicle/SKILL.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],terminal:{profiles:[{icon:"copilot",id:"copilot-cli",title:"GitHub Copilot CLI",titleTemplate:"${sequence}"}]}},prettier:{useTabs:!0,tabWidth:4,singleQuote:!0},scripts:{postinstall:"tsx ./script/postinstall.ts",build:"node .esbuild.mts --sourcemaps",compile:"node .esbuild.mts --dev",watch:"npm-run-all -lp watch:esbuild watch:typecheck","watch:esbuild":"node .esbuild.mts --watch --dev","watch:typecheck":"npx tsgo --noEmit --watch --preserveWatchOutput --project tsconfig.json","watch:typecheck-extension":"npx tsgo --noEmit --watch --project tsconfig.json","watch:typecheck-extension-web":"npx tsgo --noEmit --watch --project tsconfig.worker.json","watch:typecheck-simulation-workbench":"npx tsgo --noEmit --watch --project test/simulation/workbench/tsconfig.json",typecheck:"npx tsgo --noEmit --project tsconfig.json && npx tsgo --noEmit --project test/simulation/workbench/tsconfig.json && npx tsgo --noEmit --project tsconfig.worker.json && npx tsgo --noEmit --project src/extension/completions-core/vscode-node/extension/src/copilotPanel/webView/tsconfig.json",lint:"npx eslint . --max-warnings=0","lint-staged":"npx eslint --max-warnings=0",tsfmt:"npx tsfmt -r --verify",test:"npm-run-all test:*","test:extension":"vscode-test","test:sanity":"vscode-test --sanity","test:unit":"vitest --run --pool=forks",vitest:"vitest",bench:"vitest bench",get_env:"tsx script/setup/getEnv.mts",get_token:"tsx script/setup/getToken.mts",prettier:"prettier --list-different --write --cache .",simulate:"node dist/simulationMain.js","simulate-require-cache":"node dist/simulationMain.js --require-cache","simulate-ci":"node dist/simulationMain.js --ci --require-cache","simulate-update-baseline":"node dist/simulationMain.js --update-baseline","simulate-gc":"node dist/simulationMain.js --require-cache --gc",setup:"npm run get_env && npm run get_token","setup:dotnet":"run-script-os","setup:dotnet:darwin:linux":"curl -O https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.sh && chmod u+x dotnet-install.sh && ./dotnet-install.sh --channel 10.0 && rm dotnet-install.sh","setup:dotnet:win32":'powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.ps1 -OutFile dotnet-install.ps1; ./dotnet-install.ps1 -channel 10.0; Remove-Item dotnet-install.ps1"',"analyze-edits":"tsx script/analyzeEdits.ts","extract-chat-lib":"tsx script/build/extractChatLib.ts",create_venv:"tsx script/setup/createVenv.mts",package:"vsce package",web:"vscode-test-web --headless --extensionDevelopmentPath=. .","test:prompt":'mocha "src/extension/completions-core/vscode-node/prompt/**/test/**/*.test.{ts,tsx}"',"test:completions-core":"tsx src/extension/completions-core/vscode-node/extension/test/runTest.ts"},devDependencies:{"@azure/identity":"4.9.1","@azure/keyvault-secrets":"^4.10.0","@azure/msal-node":"^3.6.3","@c4312/scip":"^0.1.0","@fluentui/react-components":"^9.66.6","@fluentui/react-icons":"^2.0.305","@hediet/node-reload":"^0.8.0","@keyv/sqlite":"^4.0.5","@octokit/types":"^14.1.0","@stylistic/eslint-plugin":"^3.0.1","@types/eslint":"^9.0.0","@types/express":"^5.0.6","@types/google-protobuf":"^3.15.12","@types/js-yaml":"^4.0.9","@types/markdown-it":"^14.0.0","@types/minimist":"^1.2.5","@types/mocha":"^10.0.10","@types/node":"^22.16.3","@types/picomatch":"^4.0.0","@types/react":"17.0.44","@types/react-dom":"^18.2.17","@types/sinon":"^17.0.4","@types/source-map-support":"^0.5.10","@types/tar":"^6.1.13","@types/vinyl":"^2.0.12","@types/vscode-webview":"^1.57.5","@types/ws":"^8.5.3","@types/yargs":"^17.0.24","@typescript-eslint/eslint-plugin":"^8.35.0","@typescript-eslint/parser":"^8.32.0","@typescript-eslint/typescript-estree":"^8.26.1","@vitest/coverage-v8":"^3.2.4","@vitest/snapshot":"^1.5.0","@vscode/debugadapter":"^1.68.0","@vscode/debugprotocol":"^1.68.0","@vscode/dts":"^0.4.1","@vscode/lsif-language-service":"^0.1.0-pre.4","@vscode/test-cli":"^0.0.11","@vscode/test-electron":"^2.5.2","@vscode/test-web":"^0.0.80","@vscode/vsce":"3.6.0",copyfiles:"^2.4.1","csv-parse":"^6.0.0",dotenv:"^17.2.0",electron:"^39.8.5",esbuild:"0.27.2",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.1.1",keyv:"^5.3.2",minimist:"^1.2.8",mobx:"^6.13.7","mobx-react-lite":"^4.1.0",mocha:"^11.7.1","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","monaco-editor":"0.44.0","npm-run-all":"^4.1.5",open:"^10.1.2",openai:"^6.7.0",outdent:"^0.8.0",picomatch:"^4.0.4",playwright:"^1.58.2",prettier:"^3.6.2",react:"^17.0.2","react-dom":"17.0.2",rimraf:"^6.0.1","run-script-os":"^1.1.6",shiki:"~1.15.0",sinon:"^21.0.0","source-map-support":"^0.5.21",tar:"^7.5.11","ts-dedent":"^2.2.0",tsx:"^4.20.3",typescript:"^5.8.3","vite-plugin-top-level-await":"^1.5.0","vite-plugin-wasm":"^3.5.0",vitest:"^3.0.5","vscode-languageserver-protocol":"^3.17.5","vscode-languageserver-textdocument":"^1.0.12","vscode-languageserver-types":"^3.17.5",yaml:"^2.8.0",yargs:"^17.7.2",zod:"3.25.76"},dependencies:{"@anthropic-ai/claude-agent-sdk":"0.2.112","@anthropic-ai/sdk":"^0.82.0","@github/blackbird-external-ingest-utils":"^0.3.0","@github/copilot":"1.0.49","@google/genai":"^1.22.0","@humanwhocodes/gitignore-to-minimatch":"1.0.2","@microsoft/tiktokenizer":"^1.0.10","@modelcontextprotocol/sdk":"^1.25.2","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.212.0","@opentelemetry/exporter-logs-otlp-grpc":"^0.214.0","@opentelemetry/exporter-logs-otlp-http":"^0.214.0","@opentelemetry/exporter-metrics-otlp-grpc":"^0.214.0","@opentelemetry/exporter-metrics-otlp-http":"^0.214.0","@opentelemetry/exporter-trace-otlp-grpc":"^0.214.0","@opentelemetry/exporter-trace-otlp-http":"^0.214.0","@opentelemetry/resources":"^2.5.1","@opentelemetry/sdk-logs":"^0.212.0","@opentelemetry/sdk-metrics":"^2.5.1","@opentelemetry/sdk-trace-node":"^2.5.1","@opentelemetry/semantic-conventions":"^1.39.0","@sinclair/typebox":"^0.34.41","@vscode/copilot-api":"^0.4.3","@vscode/extension-telemetry":"^1.5.1","@vscode/l10n":"^0.0.18","@vscode/prompt-tsx":"^0.4.0-alpha.8","@vscode/tree-sitter-wasm":"0.0.5-php.2","@vscode/webview-ui-toolkit":"^1.3.1","@xterm/headless":"^5.5.0",ajv:"^8.18.0",applicationinsights:"^2.9.7","best-effort-json-parser":"^1.2.1",diff:"^8.0.3",dompurify:"^3.4.1",express:"^5.2.1",ignore:"^7.0.5",isbinaryfile:"^5.0.4","jsonc-parser":"^3.3.1","lru-cache":"^11.1.0","markdown-it":"^14.1.1",minimatch:"^10.2.1",undici:"^7.24.1","vscode-tas-client":"^0.1.84","web-tree-sitter":"^0.23.0"},overrides:{"@aminya/node-gyp-build":"npm:node-gyp-build@4.8.1",string_decoder:"npm:string_decoder@1.2.0","node-gyp":"npm:node-gyp@10.3.1",zod:"3.25.76"},vscodeCommit:"94c8e2adc50e26ef70af85a0de3a9efed757acaa",__metadata:{id:"7ec7d6e6-b89e-4cc5-a59b-d6c4d238246f",publisherId:{publisherId:"7c1c19cd-78eb-4dfb-8999-99caf7679002",publisherName:"github",displayName:"GitHub",flags:"verified"},publisherDisplayName:"GitHub"}}});var KOe=I(Qb=>{"use strict";p();Object.defineProperty(Qb,"__esModule",{value:!0});Qb.vscodeEngineVersion=Qb.isPreRelease=Qb.isProduction=Qb.packageJson=void 0;Qb.packageJson=ITi();Qb.isProduction=Qb.packageJson.buildType!=="dev";Qb.isPreRelease=Qb.packageJson.isPreRelease||!Qb.isProduction;Qb.vscodeEngineVersion=Qb.packageJson.engines.vscode});var k4=I(qb=>{"use strict";p();Object.defineProperty(qb,"__esModule",{value:!0});qb.isScenarioAutomation=qb.AbstractEnvService=qb.INativeEnvService=qb.IEnvService=qb.NameAndVersion=qb.OperatingSystem=void 0;var wTi=rn(),RTi=mIe(),uge=KOe(),xTi;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(xTi||(qb.OperatingSystem=xTi={}));var Svr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};qb.NameAndVersion=Svr;qb.IEnvService=(0,wTi.createServiceIdentifier)("IEnvService");qb.INativeEnvService=(0,wTi.createServiceIdentifier)("INativeEnvService");var Tvr=class{static{a(this,"AbstractEnvService")}isProduction(){return uge.isProduction}isPreRelease(){return uge.isPreRelease}isSimulation(){return RTi.env.SIMULATION==="1"}getBuildType(){return uge.packageJson.buildType}getVersion(){return uge.packageJson.version}getBuild(){return uge.packageJson.build}getName(){return uge.packageJson.name}getEditorVersionHeaders(){return{"Editor-Version":this.getEditorInfo().format(),"Editor-Plugin-Version":this.getEditorPluginInfo().format()}}};qb.AbstractEnvService=Tvr;qb.isScenarioAutomation=RTi.env.IS_SCENARIO_AUTOMATION==="1"});var y0=I(ate=>{"use strict";p();Object.defineProperty(ate,"__esModule",{value:!0});ate.generateUuid=void 0;ate.isUUID=fPa;ate.prefixedUuid=pPa;var dPa=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function fPa(t){return dPa.test(t)}a(fPa,"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 pPa(t){return`${t}-${(0,ate.generateUuid)()}`}a(pPa,"prefixedUuid")});var PTi=I(k0t=>{"use strict";p();Object.defineProperty(k0t,"__esModule",{value:!0});k0t.CopilotConfigPrefix=void 0;k0t.CopilotConfigPrefix="github.copilot"});var xvr=I(iD=>{"use strict";p();var hPa=iD&&iD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mPa=iD&&iD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gPa=iD&&iD.__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(yPa,"transformEvent")});var RE=I(dn=>{"use strict";p();Object.defineProperty(dn,"__esModule",{value:!0});dn.apiVersion=dn.ICompletionsEditorAndPluginInfo=dn.BuildInfo=dn.InMemoryConfigProvider=dn.DefaultsOnlyConfigProvider=dn.ConfigProvider=dn.ICompletionsConfigProvider=dn.BuildType=dn.BlockMode=dn.ConfigKey=dn.packageJson=void 0;dn.shouldDoServerTrimming=vPa;dn.getConfigKeyRecursively=CPa;dn.getConfigDefaultForKey=DTi;dn.getOptionalConfigDefaultForKey=NTi;dn.getConfig=bPa;dn.dumpForTelemetry=SPa;dn.formatNameAndVersion=kvr;dn.editorVersionHeaders=TPa;var D0t=KOe();Object.defineProperty(dn,"packageJson",{enumerable:!0,get:a(function(){return D0t.packageJson},"get")});var kTi=rn(),EPa=PTi(),_Pa=xvr();dn.ConfigKey={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",UseSplitContextPrompt:"internal.useSplitContextPrompt"};var N0t;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(N0t||(dn.BlockMode=N0t={}));function vPa(t){return[N0t.Server,N0t.ParsingAndServer].includes(t)}a(vPa,"shouldDoServerTrimming");var cte;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(cte||(dn.BuildType=cte={}));dn.ICompletionsConfigProvider=(0,kTi.createServiceIdentifier)("ICompletionsConfigProvider");var JOe=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};dn.ConfigProvider=JOe;var wvr=class extends JOe{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return DTi(e)}getOptionalConfig(e){return NTi(e)}dumpForTelemetry(){return{}}};dn.DefaultsOnlyConfigProvider=wvr;var Rvr=class extends JOe{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new _Pa.Emitter,this.onDidChangeCopilotSettings=this.copilotEmitter.event,this.overrides=new Map}setOverrides(e){this.overrides=e}clearOverrides(){this.overrides.clear()}getOptionalOverride(e){return this.overrides.get(e)}getConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getConfig(e)}getOptionalConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getOptionalConfig(e)}setConfig(e,r){this.setCopilotSettings({[e]:r})}setCopilotSettings(e){for(let[r,n]of Object.entries(e))n!==void 0?this.overrides.set(r,n):this.overrides.delete(r);this.copilotEmitter.fire(this)}dumpForTelemetry(){let e=this.baseConfigProvider.dumpForTelemetry();for(let r of[dn.ConfigKey.ShowEditorCompletions,dn.ConfigKey.EnableAutoCompletions,dn.ConfigKey.DelayCompletions,dn.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};dn.InMemoryConfigProvider=Rvr;function CPa(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(CPa,"getConfigKeyRecursively");function DTi(t){if(Pvr.has(t))return Pvr.get(t);throw new Error(`Missing config default value: ${EPa.CopilotConfigPrefix}.${t}`)}a(DTi,"getConfigDefaultForKey");function NTi(t){return Pvr.get(t)}a(NTi,"getOptionalConfigDefaultForKey");var Pvr=new Map([[dn.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[dn.ConfigKey.RelatedFilesVSCodeCSharp,!1],[dn.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[dn.ConfigKey.RelatedFilesVSCode,!1],[dn.ConfigKey.IncludeNeighboringFiles,!1],[dn.ConfigKey.ExcludeRelatedFiles,!1],[dn.ConfigKey.ContextProviders,[]],[dn.ConfigKey.DebugSnippyOverrideUrl,""],[dn.ConfigKey.UseSubsetMatching,null],[dn.ConfigKey.ContextProviderTimeBudget,void 0],[dn.ConfigKey.DebugOverrideCapiUrl,""],[dn.ConfigKey.DebugTestOverrideCapiUrl,""],[dn.ConfigKey.DebugOverrideProxyUrl,""],[dn.ConfigKey.DebugTestOverrideProxyUrl,""],[dn.ConfigKey.DebugOverrideEngine,""],[dn.ConfigKey.AlwaysRequestMultiline,void 0],[dn.ConfigKey.CompletionsDebounce,void 0],[dn.ConfigKey.CompletionsDelay,void 0],[dn.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[dn.ConfigKey.UseWorkspaceContextCoordinator,void 0],[dn.ConfigKey.ShowEditorCompletions,void 0],[dn.ConfigKey.EnableAutoCompletions,void 0],[dn.ConfigKey.DelayCompletions,void 0],[dn.ConfigKey.FilterCompletions,void 0],[dn.ConfigKey.UseSplitContextPrompt,!0],[dn.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[dn.ConfigKey.UserSelectedCompletionModel,""],[dn.ConfigKey.DebugOverrideEngineLegacy,""],[dn.ConfigKey.DebugOverrideProxyUrlLegacy,""],[dn.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[dn.ConfigKey.DebugOverrideCapiUrlLegacy,""],[dn.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[dn.ConfigKey.DebugFilterLogCategories,[]]]);function bPa(t,e){return t.get(dn.ICompletionsConfigProvider).getConfig(e)}a(bPa,"getConfig");function SPa(t){try{return t.get(dn.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(SPa,"dumpForTelemetry");var M0t=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===cte.NIGHTLY}static isProduction(){return this.getBuildType()!==cte.DEV}static getBuildType(){return D0t.packageJson.buildType==="prod"?t.getVersion().length===15?cte.NIGHTLY:cte.PROD:cte.DEV}static getVersion(){return D0t.packageJson.version}static getBuild(){return D0t.packageJson.build}};dn.BuildInfo=M0t;function kvr({name:t,version:e}){return`${t}/${e}`}a(kvr,"formatNameAndVersion");dn.ICompletionsEditorAndPluginInfo=(0,kTi.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");dn.apiVersion="2025-05-01";function TPa(t){let e=t.get(dn.ICompletionsEditorAndPluginInfo);return{"Editor-Version":kvr(e.getEditorInfo()),"Editor-Plugin-Version":kvr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":M0t.getVersion()}}a(TPa,"editorVersionHeaders")});var Dvr=I(O0t=>{"use strict";p();Object.defineProperty(O0t,"__esModule",{value:!0});O0t.ExpServiceTelemetryNames=void 0;var MTi;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(MTi||(O0t.ExpServiceTelemetryNames=MTi={}))});var B0t=I(dge=>{"use strict";p();Object.defineProperty(dge,"__esModule",{value:!0});dge.ExpConfig=dge.ExpTreatmentVariables=void 0;var IPa=Og(),xPa=Dvr(),OTi;(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"})(OTi||(dge.ExpTreatmentVariables=OTi={}));var Nvr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,IPa.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[xPa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};dge.ExpConfig=Nvr});var oy=I(L0t=>{"use strict";p();Object.defineProperty(L0t,"__esModule",{value:!0});L0t.ICompletionsFeaturesService=void 0;var wPa=rn();L0t.ICompletionsFeaturesService=(0,wPa.createServiceIdentifier)("ICompletionsFeaturesService")});var F0t=I(CG=>{"use strict";p();Object.defineProperty(CG,"__esModule",{value:!0});CG.FilterSettings=CG.Release=CG.Filter=void 0;var lte;(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"})(lte||(CG.Filter=lte={}));var BTi;(function(t){t.Stable="stable",t.Nightly="nightly"})(BTi||(CG.Release=BTi={}));var RPa={[lte.CopilotClientTimeBucket]:"timeBucket",[lte.CopilotOverrideEngine]:"engine",[lte.CopilotRepository]:"repo",[lte.CopilotFileType]:"fileType",[lte.CopilotUserKind]:"userKind"},Mvr=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=RPa[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};CG.FilterSettings=Mvr});var bG=I(E0=>{"use strict";p();Object.defineProperty(E0,"__esModule",{value:!0});E0.vString=kPa;E0.vNumber=NPa;E0.vBoolean=OPa;E0.vObjAny=LPa;E0.vUndefined=UPa;E0.vNull=QPa;E0.vNullable=qPa;E0.vUnchecked=FTi;E0.vUnknown=jPa;E0.vRequired=HPa;E0.vObj=GPa;E0.vArray=$Pa;E0.vTuple=VPa;E0.vUnion=UTi;E0.vEnum=WPa;E0.vLiteral=zPa;E0.vLazy=YPa;var ute=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}}},PPa=new ute("string");function kPa(){return PPa}a(kPa,"vString");var DPa=new ute("number");function NPa(){return DPa}a(NPa,"vNumber");var MPa=new ute("boolean");function OPa(){return MPa}a(OPa,"vBoolean");var BPa=new ute("object");function LPa(){return BPa}a(LPa,"vObjAny");var FPa=new ute("undefined");function UPa(){return FPa}a(UPa,"vUndefined");var Ovr=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"}}},LTi=new Ovr;function QPa(){return LTi}a(QPa,"vNull");function qPa(t){return UTi(t,LTi)}a(qPa,"vNullable");function FTi(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(FTi,"vUnchecked");function jPa(){return FTi()}a(jPa,"vUnknown");function HPa(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(HPa,"vRequired");function GPa(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(GPa,"vObj");function $Pa(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(VPa,"vTuple");function UTi(...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(UTi,"vUnion");function WPa(...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(WPa,"vEnum");function zPa(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(zPa,"vLiteral");function YPa(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(YPa,"vLazy")});var Bvr=I(ZOe=>{"use strict";p();Object.defineProperty(ZOe,"__esModule",{value:!0});ZOe.ImportChanges=void 0;var KPa=bG(),U0t;(function(t){t.All="all",t.None="none"})(U0t||(ZOe.ImportChanges=U0t={}));(function(t){t.VALIDATOR=(0,KPa.vEnum)(t.All,t.None)})(U0t||(ZOe.ImportChanges=U0t={}))});var jTi=I(fge=>{"use strict";p();Object.defineProperty(fge,"__esModule",{value:!0});fge.JointCompletionsProviderTriggerChangeStrategy=fge.JointCompletionsProviderStrategy=void 0;var QTi;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(QTi||(fge.JointCompletionsProviderStrategy=QTi={}));var qTi;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(qTi||(fge.JointCompletionsProviderTriggerChangeStrategy=qTi={}))});var HTi=I(XOe=>{"use strict";p();Object.defineProperty(XOe,"__esModule",{value:!0});XOe.DocumentSwitchTriggerStrategy=void 0;var JPa=bG(),Q0t;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(Q0t||(XOe.DocumentSwitchTriggerStrategy=Q0t={}));(function(t){t.VALIDATOR=(0,JPa.vEnum)(t.Always,t.AfterAcceptance)})(Q0t||(XOe.DocumentSwitchTriggerStrategy=Q0t={}))});var Lvr=I(e5e=>{"use strict";p();Object.defineProperty(e5e,"__esModule",{value:!0});e5e.DiffHistoryMergeStrategy=void 0;var ZPa=bG(),q0t;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(q0t||(e5e.DiffHistoryMergeStrategy=q0t={}));(function(t){t.VALIDATOR=(0,ZPa.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(q0t||(e5e.DiffHistoryMergeStrategy=q0t={}))});var sy=I(_n=>{"use strict";p();Object.defineProperty(_n,"__esModule",{value:!0});_n.SpeculativeRequestsAutoExpandEditWindowLines=_n.SpeculativeRequestsCursorPlacement=_n.DuplicateAdditionsMode=_n.SpeculativeRequestsEnablement=_n.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=_n.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=_n.MODEL_CONFIGURATION_VALIDATOR=_n.LINT_OPTIONS_VALIDATOR=_n.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=_n.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=_n.DEFAULT_OPTIONS=_n.ResponseFormat=_n.PromptingStrategy=_n.EditIntent=_n.EarlyDivergenceCancellationMode=_n.AggressivenessLevel=_n.AggressivenessSetting=_n.LintOptionShowCode=_n.LintOptionWarning=_n.CurrentFileOptions=_n.GlobalBudgetOptions=_n.NeighborFilesOptions=_n.RecentlyViewedDocumentsOptions=_n.RecentFileClippingStrategy=_n.IncludeLineNumbersOption=void 0;_n.isPromptingStrategy=XPa;_n.isAggressivenessStrategy=eka;_n.applyStrategyConfig=rka;_n.parseLintOptionString=nka;_n.parseUserHappinessScoreConfigurationString=ika;var WTi=zu(),xn=bG(),jb;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(jb||(_n.IncludeLineNumbersOption=jb={}));var dte;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(dte||(_n.RecentFileClippingStrategy=dte={}));(function(t){t.VALIDATOR=(0,xn.vEnum)(t.AroundEditRange,t.Proportional)})(dte||(_n.RecentFileClippingStrategy=dte={}));var Fvr;(function(t){t.VALIDATOR=(0,xn.vObj)({nDocuments:(0,xn.vNumber)(),maxTokens:(0,xn.vNumber)(),includeViewedFiles:(0,xn.vBoolean)(),includeLineNumbers:(0,xn.vEnum)(jb.WithSpaceAfter,jb.WithoutSpace,jb.None),clippingStrategy:(0,xn.vEnum)(dte.AroundEditRange,dte.Proportional)})})(Fvr||(_n.RecentlyViewedDocumentsOptions=Fvr={}));var GTi;(function(t){t.VALIDATOR=(0,xn.vObj)({enabled:(0,xn.vBoolean)(),maxTokens:(0,xn.vNumber)()})})(GTi||(_n.NeighborFilesOptions=GTi={}));var $Ti;(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})($Ti||(_n.GlobalBudgetOptions=$Ti={}));var Uvr;(function(t){t.VALIDATOR=(0,xn.vObj)({maxTokens:(0,xn.vNumber)(),includeTags:(0,xn.vBoolean)(),includeLineNumbers:(0,xn.vEnum)(jb.WithSpaceAfter,jb.WithoutSpace,jb.None),includeCursorTag:(0,xn.vBoolean)(),prioritizeAboveCursor:(0,xn.vBoolean)()})})(Uvr||(_n.CurrentFileOptions=Uvr={}));var pge;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(pge||(_n.LintOptionWarning=pge={}));var hge;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})(hge||(_n.LintOptionShowCode=hge={}));var j0t;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})(j0t||(_n.AggressivenessSetting=j0t={}));var SG;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(SG||(_n.AggressivenessLevel=SG={}));var H0t;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(H0t||(_n.EarlyDivergenceCancellationMode=H0t={}));(function(t){t.VALIDATOR=(0,xn.vEnum)(t.Cursor,t.EditWindow,t.Off)})(H0t||(_n.EarlyDivergenceCancellationMode=H0t={}));(function(t){t.VALIDATOR=(0,xn.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return SG.Low;case t.Medium:return SG.Medium;case t.High:return SG.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})(j0t||(_n.AggressivenessSetting=j0t={}));var G0t;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(G0t||(_n.EditIntent=G0t={}));(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===SG.Medium||s===SG.High;case t.Low:return s===SG.High;default:(0,WTi.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(G0t||(_n.EditIntent=G0t={}));var Sl;(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"})(Sl||(_n.PromptingStrategy=Sl={}));function XPa(t){return Object.values(Sl).includes(t)}a(XPa,"isPromptingStrategy");function eka(t){return t===Sl.XtabAggressiveness||t===Sl.Xtab275Aggressiveness||t===Sl.Xtab275AggressivenessHighLow||t===Sl.Xtab275EditIntent||t===Sl.Xtab275EditIntentShort}a(eka,"isAggressivenessStrategy");var $0t;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})($0t||(_n.ResponseFormat=$0t={}));(function(t){function e(r){switch(r){case Sl.UnifiedModel:case Sl.Codexv21NesUnified:case Sl.Nes41Miniv3:return t.UnifiedWithXml;case Sl.Xtab275:case Sl.XtabAggressiveness:case Sl.Xtab275Aggressiveness:case Sl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case Sl.PatchBased:case Sl.PatchBased01:case Sl.PatchBased02:case Sl.PatchBased02WithRecentLineNumbers:case Sl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case Sl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case Sl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case Sl.SimplifiedSystemPrompt:case Sl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,WTi.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})($0t||(_n.ResponseFormat=$0t={}));_n.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:2e3,includeTags:!0,includeLineNumbers:jb.None,includeCursorTag:!1,prioritizeAboveCursor:!1},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:jb.None,clippingStrategy:dte.AroundEditRange},languageContext:{enabled:!1,maxTokens:2e3,traitPosition:"after"},neighborFiles:{enabled:!1,maxTokens:1e3},diffHistory:{nEntries:25,maxTokens:1e3,onlyForDocsInPrompt:!1,useRelativePaths:!1},lintOptions:void 0,includePostScript:!0};_n.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:hge.YES_WITH_SURROUNDING,tagName:"linter",warnings:pge.YES_IF_NO_ERRORS,nRecentFiles:0};_n.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var tka={[Sl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[Sl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:jb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:jb.WithoutSpace},supportsNextCursorLinePrediction:!1},[Sl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:jb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:jb.None},supportsNextCursorLinePrediction:!1}};function rka(t){let e=t.promptingStrategy===void 0?void 0:tka[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(rka,"applyStrategyConfig");_n.LINT_OPTIONS_VALIDATOR=(0,xn.vObj)({tagName:(0,xn.vString)(),warnings:(0,xn.vEnum)(pge.YES,pge.NO,pge.YES_IF_NO_ERRORS),showCode:(0,xn.vEnum)(hge.NO,hge.YES,hge.YES_WITH_SURROUNDING),maxLints:(0,xn.vNumber)(),maxLineDistance:(0,xn.vNumber)(),nRecentFiles:(0,xn.vNumber)()});_n.MODEL_CONFIGURATION_VALIDATOR=(0,xn.vObj)({modelName:(0,xn.vRequired)((0,xn.vString)()),promptingStrategy:(0,xn.vUnion)((0,xn.vEnum)(...Object.values(Sl)),(0,xn.vUndefined)()),includeTagsInCurrentFile:(0,xn.vRequired)((0,xn.vBoolean)()),includePostScript:(0,xn.vUnion)((0,xn.vBoolean)(),(0,xn.vUndefined)()),currentFile:(0,xn.vUnion)(Uvr.VALIDATOR,(0,xn.vUndefined)()),recentlyViewedDocuments:(0,xn.vUnion)(Fvr.VALIDATOR,(0,xn.vUndefined)()),lintOptions:(0,xn.vUnion)(_n.LINT_OPTIONS_VALIDATOR,(0,xn.vUndefined)()),supportsNextCursorLinePrediction:(0,xn.vUnion)((0,xn.vBoolean)(),(0,xn.vUndefined)())});function nka(t,e){try{let r=JSON.parse(t),n=_n.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(nka,"parseLintOptionString");_n.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var VTi=(0,xn.vObj)({acceptedScore:(0,xn.vRequired)((0,xn.vNumber)()),rejectedScore:(0,xn.vRequired)((0,xn.vNumber)()),ignoredScore:(0,xn.vRequired)((0,xn.vNumber)()),highThreshold:(0,xn.vRequired)((0,xn.vNumber)()),mediumThreshold:(0,xn.vRequired)((0,xn.vNumber)()),includeIgnored:(0,xn.vRequired)((0,xn.vBoolean)()),ignoredLimit:(0,xn.vRequired)((0,xn.vNumber)()),limitConsecutiveIgnored:(0,xn.vRequired)((0,xn.vBoolean)()),limitTotalIgnored:(0,xn.vRequired)((0,xn.vBoolean)())});function t5e(t,e,r){return t>=e&&t<=r}a(t5e,"isInRange");_n.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=VTi.validate(t);if(e.error)return e;let r=e.content;return t5e(r.acceptedScore,0,1)?t5e(r.rejectedScore,0,1)?t5e(r.ignoredScore,0,1)?t5e(r.highThreshold,0,1)?t5e(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(mge,"__esModule",{value:!0});mge.TextReplacement=mge.TextEdit=void 0;var zTi=Al(),YTi=zu(),Z0t=Is(),K0t=Qh(),TG=O_(),gm=zp(),X0t=mme(),KTi=OT(),egt=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>gv.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new gv(e,r)])}static delete(e){return new t([new gv(e,"")])}static insert(e,r){return new t([new gv(gm.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,zTi.compareBy)(n=>n.range,gm.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,YTi.assertFn)(()=>(0,YTi.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 gv(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 TG.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 TG.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof TG.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof TG.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 TG.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 KTi.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new gv(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=TG.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 KTi.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=gm.Range.fromPositions(new TG.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=gm.Range.fromPositions(r.range.getEndPosition(),new TG.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(` -`)}};mge.TextEdit=egt;var gv=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 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 ${r.lineNumber},${r.column}): "${this.text}"`}};mge.TextReplacement=gv;function J0t(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return gm.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Z0t.BugIndicatingError("start must be before end");return new gm.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(J0t,"rangeFromPositions")});var xG=I(IG=>{"use strict";p();Object.defineProperty(IG,"__esModule",{value:!0});IG.SerializedLineReplacement=IG.LineReplacement=IG.LineEdit=void 0;var Qvr=Al(),JTi=zu(),oka=Qh(),n5e=Q2(),XTi=bE(),gge=O_(),Age=zp(),yge=r5e(),tgt=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>fte.deserialize(r)))}static fromStringEdit(e,r){let n=yge.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,Qvr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,JTi.assert)((0,JTi.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 XTi.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(n5e.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 n5e.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 fte(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,Qvr.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 fte(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};IG.LineEdit=tgt;var fte=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(n5e.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,oka.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Age.Range.fromPositions(new gge.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(Age.Range.fromPositions(e.range.getEndPosition(),new gge.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 gge.Position(s,c)}else n=new gge.Position(1,1);let o=r.addToPosition(new gge.Position(1,1));return new yge.TextReplacement(Age.Range.fromPositions(n,o),"")}else return new yge.TextReplacement(new Age.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,K0t.commonPrefixLength)(r,n);r=r.substring(o),n=n.substring(o);let s=(0,K0t.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}"`}};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=>` `+c).join("")):(r=s,n=1,o=this.newLines.map(c=>c+` -`).join("")),new yge.TextReplacement(Age.Range.fromPositions(new gge.Position(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Age.Range(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` -`);return new yge.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new XTi.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})(ZTi||(IG.SerializedLineReplacement=ZTi={}))});var qvr=I(Ege=>{"use strict";p();Object.defineProperty(Ege,"__esModule",{value:!0});Ege.ArrayMap=Ege.ResponseProcessor=void 0;var ska=Is(),rgt=xG(),ngt=Q2(),eIi;(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[L,L]);if(A.length===0){if(m.emitFastCursorLineChange==="off"||h!==u||f.newLines.length>1)return;let L=l[h],j=f.newLines[0];if(L.trim()===""&&h+10&&v[0]-f.startLineIdx===f.newLines.length-1&&(_="found_significant_matches");g>=0&&(A=A.map(([L,j])=>[L,j-1]),A=A.filter(([L,j])=>j>=0&&h<=j),A=A.filter(([L,j])=>l[j]===f.newLines[g]),A.length!==0);--g)if(++y,n(f.newLines[g])&&++E,E===m.nSignificantLinesToConverge&&(_="found_significant_matches",v=A[0]),y===m.nLinesToConverge){_="found_matches",v=A[0];break}if(!_)return;let b=v[1],T=v[0],w=T-b+1,R=b-f.startLineIdx,x=f.newLines.slice(0,f.newLines.length-w),P=x.length;if(R-P>1&&P>0)return;let D=[f.startLineIdx,b],N=new ngt.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new rgt.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(eIi||(Ege.ResponseProcessor=eIi={}));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)||[]}};Ege.ArrayMap=igt});var rIi=I(ogt=>{"use strict";p();Object.defineProperty(ogt,"__esModule",{value:!0});ogt.AlternativeNotebookFormat=void 0;var tIi;(function(t){t.json="json",t.xml="xml",t.text="text"})(tIi||(ogt.AlternativeNotebookFormat=tIi={}))});var Tl=I(Qo=>{"use strict";p();var aka=Qo&&Qo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Qo&&Qo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o5e=Qo&&Qo.__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):nIi.isObject(r)&&nIi.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 Qo.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,fka.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){}};Qo.AbstractConfigurationService=Hvr;var sgt;function mka(){if(!sgt){sgt=new Map;let e=pka.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)sgt.set(n,r[n].default)}return sgt}a(mka,"getPackageJsonDefaults");function lIi(t,e,r){let n=`${Qo.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Qo.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=mka(),c=s.has(n),l=s.get(n);if(c&&!dka.equals(e,l))throw new jvr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new jvr.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(lIi,"toBaseConfig");var Gvr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Qo.globalConfigRegistry=new Gvr;var $vr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new uIi.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Qo.ConfigurationMigrationRegistry=new $vr;function dt(t,e,r,n,o,s){if(e===1){let l={...lIi(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new jvr.BugIndicatingError("Shared settings cannot be experiment based");return Qo.globalConfigRegistry.registerConfig(l),l}let c={...lIi(t,r,o),configType:0,validator:n};return Qo.globalConfigRegistry.registerConfig(c),c}a(dt,"defineSetting");function Nt(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?dt(t,e,r,n,o):dt(t,e,r,n,o,s)}a(Nt,"defineTeamInternalSetting");function Yvr(t,e){Qo.ConfigurationMigrationRegistry.registerConfigurationMigrations([{key:`${Qo.CopilotConfigPrefix}.${e}`,migrateFn:a(async r=>[[`${Qo.CopilotConfigPrefix}.${t}`,{value:r}],[`${Qo.CopilotConfigPrefix}.${e}`,{value:void 0}]],"migrateFn")}])}a(Yvr,"migrateSetting");function Lg(t,e,r,n){return Yvr(e,t),dt(e,0,r,void 0,{...n,oldKey:t})}a(Lg,"defineAndMigrateSetting");function _0(t,e,r,n,o){return Yvr(e,t),dt(e,1,r,void 0,{...n,oldKey:t},o)}a(_0,"defineAndMigrateExpSetting");Qo.HARD_TOOL_LIMIT=128;var Vvr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(Vvr||(Qo.AuthProviderId=Vvr={}));var Wvr;(function(t){t.Default="default",t.Minimal="minimal"})(Wvr||(Qo.AuthPermissionMode=Wvr={}));var i5e;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(i5e||(Qo.AzureAuthMode=i5e={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(i5e||(Qo.AzureAuthMode=i5e={}));Qo.XTabProviderId="XtabProvider";var zvr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=dt("advanced.debug.overrideProxyUrl",0,void 0),s.DebugOverrideCAPIUrl=dt("advanced.debug.overrideCapiUrl",0,void 0),s.DebugUseNodeFetchFetcher=dt("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=dt("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=dt("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=dt("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=dt("advanced.authProvider",0,Vvr.GitHub),s.AuthPermissions=dt("advanced.authPermissions",0,Wvr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=dt("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=dt("chat.debug.promptOverrideFile",0,null),s.WorkspacePrototypeAdoCodeSearchEndpointOverride=Lg("chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride","chat.workspace.prototypeAdoCodeSearchEndpointOverride",""),s.FeedbackOnChange=Lg("chat.advanced.feedback.onChange","chat.feedback.onChange",!1),s.ReviewIntent=Lg("chat.advanced.review.intent","chat.review.intent",!1),s.NotebookSummaryExperimentEnabled=Lg("chat.advanced.notebook.summaryExperimentEnabled","chat.notebook.summaryExperimentEnabled",!1),s.NotebookVariableFilteringEnabled=Lg("chat.advanced.notebook.variableFilteringEnabled","chat.notebook.variableFilteringEnabled",!1),s.TerminalToDebuggerPatterns=Lg("chat.advanced.debugTerminalCommandPatterns","chat.debugTerminalCommandPatterns",[]),s.WorkspaceRecordingEnabled=Lg("chat.advanced.localWorkspaceRecording.enabled","chat.localWorkspaceRecording.enabled",!1),s.EditRecordingEnabled=Lg("chat.advanced.editRecording.enabled","chat.editRecording.enabled",!1),s.CodeSearchAgentEnabled=Lg("chat.advanced.codesearch.agent.enabled","chat.codesearch.agent.enabled",!0),s.AgentTemperature=Lg("chat.advanced.agent.temperature","chat.agent.temperature",void 0),s.EnableUserPreferences=Lg("chat.advanced.enableUserPreferences","chat.enableUserPreferences",!1),s.SummarizeAgentConversationHistoryThreshold=Lg("chat.advanced.summarizeAgentConversationHistoryThreshold","chat.summarizeAgentConversationHistoryThreshold",void 0),s.AgentHistorySummarizationMode=Lg("chat.advanced.agentHistorySummarizationMode","chat.agentHistorySummarizationMode",void 0),s.UseResponsesApiTruncation=Lg("chat.advanced.useResponsesApiTruncation","chat.useResponsesApiTruncation",!1),s.OmitBaseAgentInstructions=Lg("chat.advanced.omitBaseAgentInstructions","chat.omitBaseAgentInstructions",!1),s.CLIShowExternalSessions=dt("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=dt("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=dt("chat.cli.autoModel.enabled",0,!1),s.CLIModelDetailsEnabled=dt("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=dt("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=dt("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=dt("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=dt("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=Lg("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLIBranchSupport=dt("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=dt("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=dt("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=dt("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=dt("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=dt("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=dt("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=dt("chat.cli.terminalLinks.enabled",0,!0),s.RequestLoggerMaxEntries=Lg("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=_0("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=_0("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=_0("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=_0("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=_0("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=dt("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=_0("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=_0("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",hka.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=_0("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=dt("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=dt("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=_0("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=_0("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=_0("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=_0("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=_0("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=dt("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=dt("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=dt("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=dt("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=dt("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=dt("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=dt("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=dt("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=dt("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=dt("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=dt("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=dt("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=_0("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=_0("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=_0("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=dt("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=dt("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=dt("nextEditSuggestions.eagerness",1,Ru.AggressivenessSetting.Default,Ru.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=_0("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=dt("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=dt("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=dt("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=dt("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=dt("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=dt("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=dt("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=dt("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=_0("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=_0("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=Lg("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=dt("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=dt("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=dt("chat.otel.enabled",0,!1),s.OTelExporterType=dt("chat.otel.exporterType",0,"otlp-http"),s.OTelOtlpEndpoint=dt("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=dt("chat.otel.captureContent",0,!1),s.OTelMaxAttributeSizeChars=dt("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=dt("chat.otel.outfile",0,""),s.OTelDbSpanExporter=dt("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=dt("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=dt("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=dt("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=dt("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=dt("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=dt("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return Yvr(l,c),dt(l,0,null,Ru.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=Nt("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=Nt("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=Nt("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=Nt("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,Bg.vBoolean)()),s.InlineEditsModelPickerEnabled=Nt("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,Bg.vBoolean)()),s.InlineEditsUseSlashModels=Nt("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=Nt("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=Nt("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,Bg.vBoolean)()),s.InlineEditsLogCancelledRequests=Nt("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,Bg.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=Nt("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,Bg.vString)()),s.InlineEditsNextCursorPredictionApiKey=Nt("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,Bg.vString)()),s.InlineEditsXtabProviderUrl=Nt("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,Bg.vString)()),s.InlineEditsXtabProviderApiKey=Nt("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,Bg.vString)()),s.InlineEditsNextCursorPredictionLintOptions=Nt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,Ru.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=Nt("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,Bg.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=Nt("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,Bg.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=Nt("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,Bg.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=Nt("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,Bg.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=Nt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,oD.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=Nt("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=Nt("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=Nt("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=Nt("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=Nt("chat.advanced.promptRenderer.trace",0,!1),s.AgentSandboxEnabled=Nt("chat.advanced.agent.sandbox.enabled",1,!1),s.DebugCollectFetcherTelemetry=Nt("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=Nt("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=Nt("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=Nt("chat.advanced.modelProviderPreference",0,void 0,(0,Bg.vString)()),s.UseVSCodeTelemetryLibForGH=Nt("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=Nt("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=Nt("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=Nt("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=Nt("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsEagerBackupRequest=Nt("chat.advanced.inlineEdits.eagerBackupRequest",1,!1),s.InlineEditsDebounceUseCoreRequestTime=Nt("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=Nt("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=Nt("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=Nt("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=Nt("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=Nt("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=Nt("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=Nt("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=Nt("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=Nt("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=Nt("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=Nt("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=Nt("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=Nt("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,5,(0,Bg.vNumber)()),s.InlineEditsBackoffDebounceEnabled=Nt("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=Nt("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=Nt("chat.advanced.inlineEdits.speculativeRequests",1,oD.SpeculativeRequestsEnablement.Off,oD.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=Nt("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,oD.SpeculativeRequestsCursorPlacement.AfterEditApplied,oD.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=Nt("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,oD.SpeculativeRequestsAutoExpandEditWindowLines.Off,oD.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=Nt("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=Nt("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=Nt("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,sIi.DocumentSwitchTriggerStrategy.AfterAcceptance,sIi.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=Nt("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=Nt("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=Nt("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=Nt("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,Bg.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=Nt("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=Nt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=Nt("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=Nt("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=Nt("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=Nt("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=Nt("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=Nt("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=Nt("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,Ru.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,Ru.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=Nt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,Ru.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=Nt("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,Ru.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=Nt("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,Ru.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,Ru.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=Nt("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,aIi.DiffHistoryMergeStrategy.SameStartLine,aIi.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=Nt("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,Bg.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=Nt("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,Bg.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=Nt("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=Nt("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,Ru.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=Nt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,Ru.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,Ru.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabPageSize=Nt("chat.advanced.inlineEdits.xtabProvider.pageSize",1,Ru.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=Nt("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,Ru.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=Nt("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,Ru.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=Nt("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,Ru.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,Ru.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=Nt("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,Ru.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabDiffOnlyForDocsInPrompt=Nt("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,Ru.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=Nt("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,Ru.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=Nt("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,cIi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=Nt("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,cIi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=Nt("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,oD.EarlyDivergenceCancellationMode.Off,oD.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=Nt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,Ru.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,Ru.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=Nt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,Ru.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,Ru.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudgetEnabled=Nt("chat.advanced.inlineEdits.xtabProvider.globalBudget.enabled",1,!1),s.InlineEditsXtabGlobalBudgetTotalTokens=Nt("chat.advanced.inlineEdits.xtabProvider.globalBudget.totalTokens",1,Ru.GlobalBudgetOptions.DEFAULT_TOTAL_TOKENS),s.InlineEditsXtabMaxMergeConflictLines=Nt("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=Nt("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=Nt("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,oD.DuplicateAdditionsMode.Off,oD.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabAggressivenessLevel=Nt("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=Nt("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=Nt("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=Nt("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=Nt("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=Nt("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=Nt("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsAllowImportChanges=Nt("chat.advanced.inlineEdits.allowImportChanges",1,iIi.ImportChanges.None,iIi.ImportChanges.VALIDATOR),s.InlineEditsIgnoreWhenSuggestVisible=Nt("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=Nt("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=Nt("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,oIi.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=Nt("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,oIi.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=Nt("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=Nt("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.UseAutoModeRouting=Nt("chat.advanced.useAutoModeRouter",1,!1),s.AutoModeRoutingMethod=Nt("chat.advanced.autoModeRoutingMethod",1,"",void 0,void 0,{experimentName:"copilotchat.autoModeRoutingMethod"}),s.InlineCompletionsDefaultDiagnosticsOptions=Nt("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=Nt("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=Nt("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=Nt("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=dt("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=dt("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=dt("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=dt("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=dt("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=Nt("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=Nt("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=Nt("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=Nt("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=Nt("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=dt("chat.planAgent.model",0,""),s.OllamaEndpoint=dt("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=dt("chat.azureModels",0,{}),s.CustomOAIModels=dt("chat.customOAIModels",0,{}),s.AzureAuthType=dt("chat.azureAuthType",0,i5e.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=dt("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=dt("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=dt("chat.rateLimitAutoSwitchToAuto",0,!1,(0,Bg.vBoolean)()),t.UseAnthropicMessagesApi=dt("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=dt("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiReasoningSummary=dt("chat.responsesApiReasoningSummary",1,"detailed"),t.ResponsesApiContextManagementEnabled=dt("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=dt("chat.responsesApi.promptCacheKey.enabled",1,!1),t.Updated53CodexPromptEnabled=dt("chat.updated53CodexPrompt.enabled",1,!0),t.Claude47OpusPromptEnabled=dt("chat.claude47OpusPrompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=dt("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=dt("chat.gemini3GetChangedFilesTool.enabled",1,!0),t.EnableGpt55ReadFileTool=dt("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableGpt55EconomicalSearchAndEdit=dt("chat.gpt55EconomicalSearchAndEdit.enabled",1,!1),t.EnableGpt55LargePromptSections=dt("chat.gpt55LargePromptSections.enabled",1,!1),t.EnableChatImageUpload=dt("chat.imageUpload.enabled",1,!0),t.AnthropicWebSearchToolEnabled=dt("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=dt("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=dt("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=dt("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=dt("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=dt("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=dt("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=dt("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=dt("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=dt("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=dt("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=dt("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=dt("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=dt("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=dt("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=dt("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=dt("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=dt("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=dt("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=dt("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=dt("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=dt("chat.scopeSelection",0,!1),t.EnableCodeActions=dt("editor.enableCodeActions",0,!0),t.LocaleOverride=dt("chat.localeOverride",0,"auto"),t.TerminalChatLocation=dt("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=dt("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=dt("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=dt("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=dt("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=dt("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=dt("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=dt("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=dt("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=dt("nextEditSuggestions.enabled",1,!0),t.InlineEditsEnableDiagnosticsProvider=dt("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=dt("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=dt("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=dt("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=dt("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=dt("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=dt("chat.virtualTools.threshold",1,Qo.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=dt("chat.agent.currentEditorContext.enabled",0,!0),t.AutoFixDiagnostics=dt("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=dt("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=dt("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=dt("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=dt("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=dt("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableOrganizationCustomAgents=dt("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=dt("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=dt("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=dt("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=dt("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=dt("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=dt("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=dt("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=dt("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=dt("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=dt("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=dt("chat.cloudAgentBackend.version",0,"v1"),t.AdditionalReadAccessPaths=dt("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=dt("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=dt("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=dt("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=dt("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=dt("chat.askAgent.model",0,""),t.ExploreAgentEnabled=dt("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=dt("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=dt("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=dt("chat.localIndex.enabled",1,!1)})(zvr||(Qo.ConfigKey=zvr={}));function gka(){return Object.values(zvr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(gka,"getAllConfigKeys");var Aka=[];function yka(t){return Aka.push(t),t}a(yka,"registerNextEditProviderId")});var Ep=I(ay=>{"use strict";p();Object.defineProperty(ay,"__esModule",{value:!0});ay.LogMemory=ay.LogServiceImpl=ay.ConsoleLog=ay.LogTarget=ay.LogLevel=ay.ILogService=void 0;ay.collectErrorMessages=fIi;ay.collectSingleLineErrorMessage=vka;ay.sanitizeNetworkErrorForTelemetry=Cka;var Eka=rn(),_ka=Io();ay.ILogService=(0,Eka.createServiceIdentifier)("ILogService");var PE;(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"})(PE||(ay.LogLevel=PE={}));var dIi;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(dIi||(ay.LogTarget=dIi={}));var Kvr=class{static{a(this,"ConsoleLog")}constructor(e,r=PE.Warning){this.prefix=e,this.minLogLevel=r}logIt(e,r,...n){this.prefix&&(r=`${this.prefix}${r}`),e===PE.Error?console.error(r,...n):e===PE.Warning?console.warn(r,...n):e>=this.minLogLevel&&console.log(r,...n)}};ay.ConsoleLog=Kvr;var Jvr=class extends _ka.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new Zvr(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)}};ay.LogServiceImpl=Jvr;var Zvr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){cgt.addLog(PE[e],r),this._logTargets.forEach(n=>n.logIt(e,r))}trace(e){this._logIt(PE.Trace,e)}debug(e){this._logIt(PE.Debug,e)}info(e){this._logIt(PE.Info,e)}warn(e){this._logIt(PE.Warning,e)}error(e,r){this._logIt(PE.Error,fIi(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new Xvr(this,e)}withExtraTarget(e){return new agt(this,[e])}},Xvr=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 agt(this,[e],this._prefix)}},agt=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(PE.Trace,e),this._parent.trace(e)}debug(e){this._notifyExtraTargets(PE.Debug,e),this._parent.debug(e)}info(e){this._notifyExtraTargets(PE.Info,e),this._parent.info(e)}warn(e){this._notifyExtraTargets(PE.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(PE.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 fIi(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 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(` `).map(l=>`${o}${l}`).join(` `)} -`:"",n.chromiumDetails?`${o}${JSON.stringify(pIi(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(fIi,"collectErrorMessages");function vka(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(pIi(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(vka,"collectSingleLineErrorMessage");function Cka(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(Cka,"sanitizeNetworkErrorForTelemetry");function pIi(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(pIi,"extractChromiumDetails");var cgt=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}};ay.LogMemory=cgt});var a5e=I(s5e=>{"use strict";p();Object.defineProperty(s5e,"__esModule",{value:!0});s5e.ICopilotTokenManager=void 0;s5e.nowSeconds=Ska;var bka=rn();s5e.ICopilotTokenManager=(0,bka.createServiceIdentifier)("ICopilotTokenManager");function Ska(){return Math.floor(Date.now()/1e3)}a(Ska,"nowSeconds")});var kE=I(Am=>{"use strict";p();var Tka=Am&&Am.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},lgt=Am&&Am.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Am,"__esModule",{value:!0});Am.BaseAuthenticationService=Am.IAuthenticationService=Am.MinimalModeError=Am.GITHUB_SCOPE_ALIGNED=Am.GITHUB_SCOPE_READ_USER=Am.GITHUB_SCOPE_USER_EMAIL=void 0;Am.authProviderId=Dka;var Ika=rn(),eCr=bc(),xka=Io(),wka=l8(),pte=Tl(),Rka=Ep(),Pka=a5e(),kka=wQ();Am.GITHUB_SCOPE_USER_EMAIL=["user:email"];Am.GITHUB_SCOPE_READ_USER=["read:user"];Am.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var tCr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};Am.MinimalModeError=tCr;Am.IAuthenticationService=(0,Ika.createServiceIdentifier)("IAuthenticationService");var rCr=class extends xka.Disposable{static{a(this,"BaseAuthenticationService")}fireAuthenticationChange(e){let r=!!this.copilotToken;this._logService.info(`AuthenticationService: firing onDidAuthenticationChange from ${e}. Has token: ${r}`),this._onDidAuthenticationChange.fire()}constructor(e,r,n,o){super(),this._logService=e,this._tokenStore=r,this._tokenManager=n,this._configurationService=o,this._onDidAuthenticationChange=this._register(new eCr.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidAccessTokenChange=this._register(new eCr.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new eCr.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,wka.derived)(s=>this._configurationService.getConfigObservable(pte.ConfigKey.Shared.AuthPermissions).read(s)===pte.AuthPermissionMode.Minimal),this._register(n.onDidCopilotTokenRefresh(()=>{this._logService.debug("Handling CopilotToken refresh."),this._handleAuthChangeEvent()}))}get isMinimalMode(){return this._isMinimalMode.get()}get anyGitHubSession(){return this._anyGitHubSession}get hasCopilotTokenSource(){return!!this._anyGitHubSession}get permissiveGitHubSession(){return this._permissiveGitHubSession}get anyAdoSession(){return this._anyAdoSession}get copilotToken(){return this._tokenStore.copilotToken}async getCopilotToken(e){try{let r=await this._tokenManager.getCopilotToken(e);return this._tokenStore.copilotToken=r,this._copilotTokenError=void 0,r}catch(r){this._tokenStore.copilotToken=void 0;let n=this._copilotTokenError;throw this._copilotTokenError=r,n&&r&&n.message!==r.message&&this.fireAuthenticationChange("getCopilotToken error change"),r}}resetCopilotToken(e){this._tokenStore.copilotToken=void 0,this._tokenManager.resetCopilotToken(e)}async _handleAuthChangeEvent(){let e=this._anyGitHubSession,r=this._permissiveGitHubSession,n=this._anyAdoSession,o=this._tokenStore.copilotToken,s=this._copilotTokenError,c=await Promise.allSettled([this.getGitHubSession("any",{silent:!0}),this.getGitHubSession("permissive",{silent:!0}),this.getAnyAdoSession({silent:!0})]);for(let l of c)l.status==="rejected"&&this._logService.error(`Error getting a session: ${l.reason}`);if(e?.accessToken!==this._anyGitHubSession?.accessToken||r?.accessToken!==this._permissiveGitHubSession?.accessToken){this._onDidAccessTokenChange.fire(),this._logService.debug("Auth state changed, minting a new CopilotToken...");try{await this.getCopilotToken(!0)}catch{}this._logService.debug("Minted a new CopilotToken.");return}n?.accessToken!==this._anyAdoSession?.accessToken&&(this._logService.debug(`Ado auth state changed, firing event. Had token before: ${!!n?.accessToken}. Has token now: ${!!this._anyAdoSession?.accessToken}.`),this._onDidAdoAuthenticationChange.fire());try{await this.getCopilotToken()}catch{}(o?.token!==this._tokenStore.copilotToken?.token||s?.message!==this._copilotTokenError?.message)&&(this._logService.debug("CopilotToken state changed, firing event."),this.fireAuthenticationChange("handleAuthChangeEvent")),this._logService.debug("Finished handling auth change event.")}};Am.BaseAuthenticationService=rCr;Am.BaseAuthenticationService=rCr=Tka([lgt(0,Rka.ILogService),lgt(1,kka.ICopilotTokenStore),lgt(2,Pka.ICopilotTokenManager),lgt(3,pte.IConfigurationService)],rCr);function Dka(t){return t.getConfig(pte.ConfigKey.Shared.AuthProvider)===pte.AuthProviderId.GitHubEnterprise?pte.AuthProviderId.GitHubEnterprise:pte.AuthProviderId.GitHub}a(Dka,"authProviderId")});var ugt=I(nCr=>{"use strict";p();Object.defineProperty(nCr,"__esModule",{value:!0});nCr.onCopilotToken=Nka;function Nka(t,e){return t.onDidAuthenticationChange(()=>{let r=t.copilotToken;r&&e(r)})}a(Nka,"onCopilotToken")});var oCr=I(sD=>{"use strict";p();var Mka=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},Oka=sD&&sD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(sD,"__esModule",{value:!0});sD.TelemetryUserConfig=sD.ICompletionsTelemetryUserConfigService=void 0;var Bka=kE(),Lka=rn(),Fka=Io(),Uka=ugt();function Qka(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(Qka,"propertiesFromCopilotToken");sD.ICompletionsTelemetryUserConfigService=(0,Lka.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var iCr=class extends Fka.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,Uka.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=Qka(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};sD.TelemetryUserConfig=iCr;sD.TelemetryUserConfig=iCr=Mka([Oka(0,Bka.IAuthenticationService)],iCr)});var c5e=I(_ge=>{"use strict";p();Object.defineProperty(_ge,"__esModule",{value:!0});_ge.PromiseQueue=_ge.ICompletionsPromiseQueueService=void 0;var qka=rn();_ge.ICompletionsPromiseQueueService=(0,qka.createServiceIdentifier)("completionsPromiseQueueService");var sCr=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)}};_ge.PromiseQueue=sCr});var Og=I(md=>{"use strict";p();Object.defineProperty(md,"__esModule",{value:!0});md.TelemetryReporters=md.ICompletionsTelemetryReporters=md.CopilotTelemetryReporter=md.TelemetryWithExp=md.TelemetryData=md.TelemetryStore=void 0;md.telemetrizePromptLength=Xka;md.now=Cge;md.telemetry=mCr;md.telemetryExpProblem=r2a;md.telemetryRaw=i2a;md.telemetryException=gIi;md.telemetryCatch=o2a;md.telemetryError=s2a;md.logEngineCompletion=c2a;md.logEnginePrompt=l2a;var jka=k4(),Hka=rn(),Gka=y0(),uCr=Fs(),dgt=hte(),D4=RE(),$ka=B0t(),Vka=oy(),Wka=F0t(),zka=Dvr(),dCr=oCr(),fCr=c5e(),GT;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(GT||(md.TelemetryStore=GT={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(GT||(md.TelemetryStore=GT={}));function vge(t){return t===GT.Enhanced}a(vge,"isEnhanced");var Yka=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],l5e=8192,Kka=21,N4=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[zka.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Cge())}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=Cge())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(Vka.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(jka.IEnvService),n=e.get(D4.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,D4.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,D4.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${D4.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,D4.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,D4.dumpForTelemetry)(e);r["copilot.build"]=D4.BuildInfo.getBuild(),r["copilot.buildType"]=D4.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(vge(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>l5e){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+l5e;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(Xka,"telemetrizePromptLength");function Cge(){return performance.now()}a(Cge,"now");function e2a(t){return Math.floor(t/1e3)}a(e2a,"nowSeconds");function hCr(t){return t.get(dCr.ICompletionsTelemetryUserConfigService).optedIn}a(hCr,"shouldSendEnhanced");function hIi(t){return t.get(dCr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(hIi,"shouldSendFinetuningTelemetry");function mCr(t,e,r,n){return t.get(fCr.ICompletionsPromiseQueueService).register(t2a(t,e,Cge(),r?.extendedBy(),n))}a(mCr,"telemetry");async function t2a(t,e,r,n,o=GT.Standard){let s=t.get(dgt.ICompletionsTelemetryService),c=t.get(uCr.IInstantiationService),l=n||N4.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!vge(o)||c.invokeFunction(hCr))&&pCr(s,o,e,l),vge(o)&&Yka.includes(e)&&c.invokeFunction(hIi)&&c.invokeFunction(Zka,o,e,l)}a(t2a,"_telemetry");function r2a(t,e){return t.get(fCr.ICompletionsPromiseQueueService).register(n2a(t,e,Cge()))}a(r2a,"telemetryExpProblem");async function n2a(t,e,r){let n=t.get(dgt.ICompletionsTelemetryService),o="expProblem",s=N4.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,GT.Standard,"SkipExp",r),pCr(n,GT.Standard,o,s)}a(n2a,"_telemetryExpProblem");function i2a(t,e,r,n){let o=t.get(dgt.ICompletionsTelemetryService),s={...r,...mIi(t)};pCr(o,GT.Standard,e,{properties:s,measurements:n})}a(i2a,"telemetryRaw");function mIi(t){let e=t.get(D4.ICompletionsEditorAndPluginInfo),r={unique_id:(0,Gka.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,D4.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(dCr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(mIi,"createRequiredProperties");function gIi(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(gIi,"telemetryException");function o2a(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){gIi(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(o2a,"telemetryCatch");function s2a(t,e,r,n){return t.get(fCr.ICompletionsPromiseQueueService).register(a2a(t,e,Cge(),r?.extendedBy(),n))}a(s2a,"telemetryError");async function a2a(t,e,r,n,o=GT.Standard){if(vge(o)&&!hCr(t))return;let s=t.get(uCr.IInstantiationService),c=n||N4.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(Jka,o,e,c)}a(a2a,"_telemetryError");function c2a(t,e,r,n,o){let s=N4.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),mCr(t,"engine.completion",s,GT.Enhanced)}a(c2a,"logEngineCompletion");function l2a(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 mCr(t,"engine.prompt",o,GT.Enhanced)}a(l2a,"logEnginePrompt");var cCr=class{static{a(this,"CopilotTelemetryReporter")}};md.CopilotTelemetryReporter=cCr;md.ICompletionsTelemetryReporters=(0,Hka.createServiceIdentifier)("ICompletionsTelemetryReporters");var lCr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=GT.Standard){return vge(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(hCr(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()))}};md.TelemetryReporters=lCr});var hte=I(aD=>{"use strict";p();var u2a=aD&&aD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},d2a=aD&&aD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(aD,"__esModule",{value:!0});aD.CompletionsTelemetryServiceBridge=aD.ICompletionsTelemetryService=void 0;var f2a=qh(),gCr=bvr(),p2a=rn(),u5e=Og();aD.ICompletionsTelemetryService=(0,p2a.createServiceIdentifier)("completionsTelemetryService");var ACr=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,gCr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??u5e.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,gCr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??u5e.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,gCr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??u5e.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??u5e.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 u5e.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};aD.CompletionsTelemetryServiceBridge=ACr;aD.CompletionsTelemetryServiceBridge=ACr=u2a([d2a(0,f2a.ITelemetryService)],ACr)});var AIi=I(bge=>{"use strict";p();Object.defineProperty(bge,"__esModule",{value:!0});bge.CopilotExtensionStatus=bge.ICompletionsExtensionStatus=void 0;var h2a=rn();bge.ICompletionsExtensionStatus=(0,h2a.createServiceIdentifier)("ICompletionsExtensionStatus");var yCr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};bge.CopilotExtensionStatus=yCr});var fgt=I(cD=>{"use strict";p();Object.defineProperty(cD,"__esModule",{value:!0});cD.CopilotToken=void 0;cD.containsInternalOrg=yIi;cD.containsVSCodeOrg=vIi;cD.validateTokenEnvelope=CIi;cD.isTokenEnvelope=_2a;cD.isErrorEnvelope=v2a;cD.isStandardErrorEnvelope=C2a;cD.createTestExtendedTokenInfo=b2a;var Un=bG();function yIi(t){return EIi(t)||_Ii(t)}a(yIi,"containsInternalOrg");function EIi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(EIi,"containsGitHubOrg");function _Ii(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(_Ii,"containsMicrosoftOrg");function vIi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(vIi,"containsVSCodeOrg");var ECr=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 yIi(this.organizationList)}get isMicrosoftInternal(){return _Ii(this.organizationList)}get isGitHubInternal(){return EIi(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||vIi(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"}};cD.CopilotToken=ECr;var m2a=(0,Un.vObj)({message:(0,Un.vRequired)((0,Un.vString)()),notification_id:(0,Un.vRequired)((0,Un.vString)()),title:(0,Un.vRequired)((0,Un.vString)()),url:(0,Un.vRequired)((0,Un.vString)())}),g2a=(0,Un.vObj)({can_signup_for_limited:(0,Un.vNullable)((0,Un.vBoolean)()),error_details:(0,Un.vRequired)(m2a),message:(0,Un.vRequired)((0,Un.vString)()),reason:(0,Un.vString)()}),A2a=(0,Un.vObj)({token:(0,Un.vRequired)((0,Un.vString)()),expires_at:(0,Un.vRequired)((0,Un.vNumber)()),refresh_in:(0,Un.vRequired)((0,Un.vNumber)()),sku:(0,Un.vString)(),individual:(0,Un.vBoolean)(),blackbird_clientside_indexing:(0,Un.vBoolean)(),code_quote_enabled:(0,Un.vBoolean)(),code_review_enabled:(0,Un.vBoolean)(),codesearch:(0,Un.vBoolean)(),copilotignore_enabled:(0,Un.vBoolean)(),public_suggestions:(0,Un.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Un.vEnum)("enabled","disabled"),endpoints:(0,Un.vObj)({api:(0,Un.vString)(),"origin-tracker":(0,Un.vString)(),proxy:(0,Un.vString)(),telemetry:(0,Un.vString)()}),enterprise_list:(0,Un.vNullable)((0,Un.vArray)((0,Un.vNumber)())),limited_user_quotas:(0,Un.vNullable)((0,Un.vObj)({chat:(0,Un.vRequired)((0,Un.vNumber)()),completions:(0,Un.vRequired)((0,Un.vNumber)())})),limited_user_reset_date:(0,Un.vNullable)((0,Un.vNumber)()),organization_list:(0,Un.vArray)((0,Un.vString)())}),y2a=(0,Un.vObj)({message:(0,Un.vRequired)((0,Un.vString)()),documentation_url:(0,Un.vRequired)((0,Un.vString)()),status:(0,Un.vRequired)((0,Un.vString)())}),E2a=(0,Un.vObj)({token:(0,Un.vRequired)((0,Un.vString)()),expires_at:(0,Un.vRequired)((0,Un.vNumber)()),refresh_in:(0,Un.vRequired)((0,Un.vNumber)())});function CIi(t){let e=A2a.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=E2a.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(CIi,"validateTokenEnvelope");function _2a(t){return CIi(t).valid}a(_2a,"isTokenEnvelope");function v2a(t){return g2a.validate(t).error===void 0}a(v2a,"isErrorEnvelope");function C2a(t){return y2a.validate(t).error===void 0}a(C2a,"isStandardErrorEnvelope");function b2a(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(b2a,"createTestExtendedTokenInfo")});var Sge=I($T=>{"use strict";p();var S2a=$T&&$T.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},T2a=$T&&$T.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty($T,"__esModule",{value:!0});$T.CopilotTokenManagerImpl=$T.ICompletionsCopilotTokenManager=$T.CopilotToken=void 0;var I2a=kE(),x2a=rn(),w2a=Yc(),R2a=Io(),P2a=fgt();Object.defineProperty($T,"CopilotToken",{enumerable:!0,get:a(function(){return P2a.CopilotToken},"get")});$T.ICompletionsCopilotTokenManager=(0,x2a.createServiceIdentifier)("ICompletionsCopilotTokenManager");var _Cr=class extends R2a.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 w2a.ThrottledDelayer(5e3),this.updateCachedToken(),this._register(this.authenticationService.onDidAuthenticationChange(()=>this.updateCachedToken()))}primeToken(){try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async getToken(){return this.updateCachedToken()}async updateCachedToken(){return this._token=await this.authenticationService.getCopilotToken(),this._token}resetToken(e){this.authenticationService.resetCopilotToken()}getLastToken(){return this.authenticationService.copilotToken}};$T.CopilotTokenManagerImpl=_Cr;$T.CopilotTokenManagerImpl=_Cr=S2a([T2a(1,I2a.IAuthenticationService)],_Cr)});var pgt=I(Tge=>{"use strict";p();Object.defineProperty(Tge,"__esModule",{value:!0});Tge.NoOpCitationManager=Tge.ICompletionsCitationManager=void 0;var k2a=rn(),D2a=Io();Tge.ICompletionsCitationManager=(0,k2a.createServiceIdentifier)("ICompletionsCitationManager");var vCr=class{static{a(this,"NoOpCitationManager")}register(){return D2a.Disposable.None}async handleIPCodeCitation(e){}};Tge.NoOpCitationManager=vCr});var Av=I(Fg=>{"use strict";p();Object.defineProperty(Fg,"__esModule",{value:!0});Fg.HasPropertyKey=N2a;Fg.IsAsyncIterator=M2a;Fg.IsArray=CCr;Fg.IsBigInt=O2a;Fg.IsBoolean=B2a;Fg.IsDate=L2a;Fg.IsFunction=F2a;Fg.IsIterator=U2a;Fg.IsNull=Q2a;Fg.IsNumber=q2a;Fg.IsObject=bCr;Fg.IsRegExp=j2a;Fg.IsString=H2a;Fg.IsSymbol=G2a;Fg.IsUint8Array=SCr;Fg.IsUndefined=$2a;function N2a(t,e){return e in t}a(N2a,"HasPropertyKey");function M2a(t){return bCr(t)&&!CCr(t)&&!SCr(t)&&Symbol.asyncIterator in t}a(M2a,"IsAsyncIterator");function CCr(t){return Array.isArray(t)}a(CCr,"IsArray");function O2a(t){return typeof t=="bigint"}a(O2a,"IsBigInt");function B2a(t){return typeof t=="boolean"}a(B2a,"IsBoolean");function L2a(t){return t instanceof globalThis.Date}a(L2a,"IsDate");function F2a(t){return typeof t=="function"}a(F2a,"IsFunction");function U2a(t){return bCr(t)&&!CCr(t)&&!SCr(t)&&Symbol.iterator in t}a(U2a,"IsIterator");function Q2a(t){return t===null}a(Q2a,"IsNull");function q2a(t){return typeof t=="number"}a(q2a,"IsNumber");function bCr(t){return typeof t=="object"&&t!==null}a(bCr,"IsObject");function j2a(t){return t instanceof globalThis.RegExp}a(j2a,"IsRegExp");function H2a(t){return typeof t=="string"}a(H2a,"IsString");function G2a(t){return typeof t=="symbol"}a(G2a,"IsSymbol");function SCr(t){return t instanceof globalThis.Uint8Array}a(SCr,"IsUint8Array");function $2a(t){return t===void 0}a($2a,"IsUndefined")});var Hb=I(U8=>{"use strict";p();var V2a=U8&&U8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),W2a=U8&&U8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),z2a=U8&&U8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ohgt(e))}a(Y2a,"ArrayType");function K2a(t){return new Date(t.getTime())}a(K2a,"DateType");function J2a(t){return new Uint8Array(t)}a(J2a,"Uint8ArrayType");function Z2a(t){return new RegExp(t.source,t.flags)}a(Z2a,"RegExpType");function X2a(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=hgt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=hgt(t[r]);return e}a(X2a,"ObjectType");function hgt(t){return d5e.IsArray(t)?Y2a(t):d5e.IsDate(t)?K2a(t):d5e.IsUint8Array(t)?J2a(t):d5e.IsRegExp(t)?Z2a(t):d5e.IsObject(t)?X2a(t):t}a(hgt,"Visit");function eDa(t){return hgt(t)}a(eDa,"Clone")});var ggt=I(mgt=>{"use strict";p();Object.defineProperty(mgt,"__esModule",{value:!0});mgt.CloneRest=tDa;mgt.CloneType=SIi;var bIi=Hb();function tDa(t){return t.map(e=>SIi(e))}a(tDa,"CloneRest");function SIi(t,e){return e===void 0?(0,bIi.Clone)(t):(0,bIi.Clone)({...e,...t})}a(SIi,"CloneType")});var TCr=I(wG=>{"use strict";p();var rDa=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]})),TIi=wG&&wG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rDa(e,t,r)};Object.defineProperty(wG,"__esModule",{value:!0});TIi(ggt(),wG);TIi(Hb(),wG)});var Agt=I(ma=>{"use strict";p();Object.defineProperty(ma,"__esModule",{value:!0});ma.IsAsyncIterator=nDa;ma.IsIterator=iDa;ma.IsStandardObject=oDa;ma.IsInstanceObject=sDa;ma.IsPromise=aDa;ma.IsDate=cDa;ma.IsMap=lDa;ma.IsSet=uDa;ma.IsRegExp=dDa;ma.IsTypedArray=fDa;ma.IsInt8Array=pDa;ma.IsUint8Array=hDa;ma.IsUint8ClampedArray=mDa;ma.IsInt16Array=gDa;ma.IsUint16Array=ADa;ma.IsInt32Array=yDa;ma.IsUint32Array=EDa;ma.IsFloat32Array=_Da;ma.IsFloat64Array=vDa;ma.IsBigInt64Array=CDa;ma.IsBigUint64Array=bDa;ma.HasPropertyKey=SDa;ma.IsObject=f5e;ma.IsArray=IIi;ma.IsUndefined=xIi;ma.IsNull=wIi;ma.IsBoolean=RIi;ma.IsNumber=PIi;ma.IsInteger=TDa;ma.IsBigInt=kIi;ma.IsString=DIi;ma.IsFunction=NIi;ma.IsSymbol=MIi;ma.IsValueType=IDa;function nDa(t){return f5e(t)&&globalThis.Symbol.asyncIterator in t}a(nDa,"IsAsyncIterator");function iDa(t){return f5e(t)&&globalThis.Symbol.iterator in t}a(iDa,"IsIterator");function oDa(t){return f5e(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(oDa,"IsStandardObject");function sDa(t){return f5e(t)&&!IIi(t)&&NIi(t.constructor)&&t.constructor.name!=="Object"}a(sDa,"IsInstanceObject");function aDa(t){return t instanceof globalThis.Promise}a(aDa,"IsPromise");function cDa(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(cDa,"IsDate");function lDa(t){return t instanceof globalThis.Map}a(lDa,"IsMap");function uDa(t){return t instanceof globalThis.Set}a(uDa,"IsSet");function dDa(t){return t instanceof globalThis.RegExp}a(dDa,"IsRegExp");function fDa(t){return globalThis.ArrayBuffer.isView(t)}a(fDa,"IsTypedArray");function pDa(t){return t instanceof globalThis.Int8Array}a(pDa,"IsInt8Array");function hDa(t){return t instanceof globalThis.Uint8Array}a(hDa,"IsUint8Array");function mDa(t){return t instanceof globalThis.Uint8ClampedArray}a(mDa,"IsUint8ClampedArray");function gDa(t){return t instanceof globalThis.Int16Array}a(gDa,"IsInt16Array");function ADa(t){return t instanceof globalThis.Uint16Array}a(ADa,"IsUint16Array");function yDa(t){return t instanceof globalThis.Int32Array}a(yDa,"IsInt32Array");function EDa(t){return t instanceof globalThis.Uint32Array}a(EDa,"IsUint32Array");function _Da(t){return t instanceof globalThis.Float32Array}a(_Da,"IsFloat32Array");function vDa(t){return t instanceof globalThis.Float64Array}a(vDa,"IsFloat64Array");function CDa(t){return t instanceof globalThis.BigInt64Array}a(CDa,"IsBigInt64Array");function bDa(t){return t instanceof globalThis.BigUint64Array}a(bDa,"IsBigUint64Array");function SDa(t,e){return e in t}a(SDa,"HasPropertyKey");function f5e(t){return t!==null&&typeof t=="object"}a(f5e,"IsObject");function IIi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(IIi,"IsArray");function xIi(t){return t===void 0}a(xIi,"IsUndefined");function wIi(t){return t===null}a(wIi,"IsNull");function RIi(t){return typeof t=="boolean"}a(RIi,"IsBoolean");function PIi(t){return typeof t=="number"}a(PIi,"IsNumber");function TDa(t){return globalThis.Number.isInteger(t)}a(TDa,"IsInteger");function kIi(t){return typeof t=="bigint"}a(kIi,"IsBigInt");function DIi(t){return typeof t=="string"}a(DIi,"IsString");function NIi(t){return typeof t=="function"}a(NIi,"IsFunction");function MIi(t){return typeof t=="symbol"}a(MIi,"IsSymbol");function IDa(t){return kIi(t)||RIi(t)||wIi(t)||PIi(t)||DIi(t)||MIi(t)||xIi(t)}a(IDa,"IsValueType")});var v0=I(mte=>{"use strict";p();var xDa=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]})),wDa=mte&&mte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xDa(e,t,r)};Object.defineProperty(mte,"__esModule",{value:!0});wDa(Agt(),mte)});var p5e=I(Egt=>{"use strict";p();Object.defineProperty(Egt,"__esModule",{value:!0});Egt.TypeSystemPolicy=void 0;var ygt=v0(),OIi;(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,ygt.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,ygt.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,ygt.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,ygt.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(OIi||(Egt.TypeSystemPolicy=OIi={}))});var BIi=I(Q8=>{"use strict";p();var RDa=Q8&&Q8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),PDa=Q8&&Q8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kDa=Q8&&Q8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o_gt(e))}a(DDa,"ImmutableArray");function NDa(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 globalThis.Object.freeze(e)}a(NDa,"ImmutableObject");function _gt(t){return h5e.IsArray(t)?DDa(t):h5e.IsDate(t)?t:h5e.IsUint8Array(t)?t:h5e.IsRegExp(t)?t:h5e.IsObject(t)?NDa(t):t}a(_gt,"Immutable")});var Ii=I(ICr=>{"use strict";p();Object.defineProperty(ICr,"__esModule",{value:!0});ICr.CreateType=LDa;var MDa=p5e(),ODa=BIi(),BDa=Hb();function LDa(t,e){let r=e!==void 0?{...e,...t}:t;switch(MDa.TypeSystemPolicy.InstanceMode){case"freeze":return(0,ODa.Immutable)(r);case"clone":return(0,BDa.Clone)(r);default:return r}}a(LDa,"CreateType")});var q8=I(gte=>{"use strict";p();var FDa=gte&>e.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UDa=gte&>e.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&FDa(e,t,r)};Object.defineProperty(gte,"__esModule",{value:!0});UDa(Ii(),gte)});var wCr=I(vgt=>{"use strict";p();Object.defineProperty(vgt,"__esModule",{value:!0});vgt.TypeBoxError=void 0;var xCr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};vgt.TypeBoxError=xCr});var Rf=I(Ate=>{"use strict";p();var QDa=Ate&&Ate.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qDa=Ate&&Ate.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&QDa(e,t,r)};Object.defineProperty(Ate,"__esModule",{value:!0});qDa(wCr(),Ate)});var m5e=I(SR=>{"use strict";p();Object.defineProperty(SR,"__esModule",{value:!0});SR.Kind=SR.Hint=SR.OptionalKind=SR.ReadonlyKind=SR.TransformKind=void 0;SR.TransformKind=Symbol.for("TypeBox.Transform");SR.ReadonlyKind=Symbol.for("TypeBox.Readonly");SR.OptionalKind=Symbol.for("TypeBox.Optional");SR.Hint=Symbol.for("TypeBox.Hint");SR.Kind=Symbol.for("TypeBox.Kind")});var vn=I(yte=>{"use strict";p();var jDa=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]})),HDa=yte&&yte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jDa(e,t,r)};Object.defineProperty(yte,"__esModule",{value:!0});HDa(m5e(),yte)});var As=I(ui=>{"use strict";p();var GDa=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]})),$Da=ui&&ui.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),VDa=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 iNa=Kn&&Kn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oNa=Kn&&Kn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),sNa=Kn&&Kn.__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 _xi(t){return kCr(t)||Ug(t)}a(_xi,"IsAdditionalProperties");function A5e(t){return si.IsUndefined(t)||si.IsBigInt(t)}a(A5e,"IsOptionalBigInt");function zl(t){return si.IsUndefined(t)||si.IsNumber(t)}a(zl,"IsOptionalNumber");function kCr(t){return si.IsUndefined(t)||si.IsBoolean(t)}a(kCr,"IsOptionalBoolean");function ll(t){return si.IsUndefined(t)||si.IsString(t)}a(ll,"IsOptionalString");function lNa(t){return si.IsUndefined(t)||si.IsString(t)&&PCr(t)&&Exi(t)}a(lNa,"IsOptionalPattern");function uNa(t){return si.IsUndefined(t)||si.IsString(t)&&PCr(t)}a(uNa,"IsOptionalFormat");function vxi(t){return si.IsUndefined(t)||Ug(t)}a(vxi,"IsOptionalSchema");function dNa(t){return si.IsObject(t)&&t[M4.ReadonlyKind]==="Readonly"}a(dNa,"IsReadonly");function fNa(t){return si.IsObject(t)&&t[M4.OptionalKind]==="Optional"}a(fNa,"IsOptional");function Cxi(t){return Hs(t,"Any")&&ll(t.$id)}a(Cxi,"IsAny");function bxi(t){return Hs(t,"Argument")&&si.IsNumber(t.index)}a(bxi,"IsArgument");function Sxi(t){return Hs(t,"Array")&&t.type==="array"&&ll(t.$id)&&Ug(t.items)&&zl(t.minItems)&&zl(t.maxItems)&&kCr(t.uniqueItems)&&vxi(t.contains)&&zl(t.minContains)&&zl(t.maxContains)}a(Sxi,"IsArray");function Txi(t){return Hs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&ll(t.$id)&&Ug(t.items)}a(Txi,"IsAsyncIterator");function Ixi(t){return Hs(t,"BigInt")&&t.type==="bigint"&&ll(t.$id)&&A5e(t.exclusiveMaximum)&&A5e(t.exclusiveMinimum)&&A5e(t.maximum)&&A5e(t.minimum)&&A5e(t.multipleOf)}a(Ixi,"IsBigInt");function xxi(t){return Hs(t,"Boolean")&&t.type==="boolean"&&ll(t.$id)}a(xxi,"IsBoolean");function wxi(t){return Hs(t,"Computed")&&si.IsString(t.target)&&si.IsArray(t.parameters)&&t.parameters.every(e=>Ug(e))}a(wxi,"IsComputed");function Rxi(t){return Hs(t,"Constructor")&&t.type==="Constructor"&&ll(t.$id)&&si.IsArray(t.parameters)&&t.parameters.every(e=>Ug(e))&&Ug(t.returns)}a(Rxi,"IsConstructor");function Pxi(t){return Hs(t,"Date")&&t.type==="Date"&&ll(t.$id)&&zl(t.exclusiveMaximumTimestamp)&&zl(t.exclusiveMinimumTimestamp)&&zl(t.maximumTimestamp)&&zl(t.minimumTimestamp)&&zl(t.multipleOfTimestamp)}a(Pxi,"IsDate");function kxi(t){return Hs(t,"Function")&&t.type==="Function"&&ll(t.$id)&&si.IsArray(t.parameters)&&t.parameters.every(e=>Ug(e))&&Ug(t.returns)}a(kxi,"IsFunction");function pNa(t){return Hs(t,"Import")&&si.HasPropertyKey(t,"$defs")&&si.IsObject(t.$defs)&&Cgt(t.$defs)&&si.HasPropertyKey(t,"$ref")&&si.IsString(t.$ref)&&t.$ref in t.$defs}a(pNa,"IsImport");function Dxi(t){return Hs(t,"Integer")&&t.type==="integer"&&ll(t.$id)&&zl(t.exclusiveMaximum)&&zl(t.exclusiveMinimum)&&zl(t.maximum)&&zl(t.minimum)&&zl(t.multipleOf)}a(Dxi,"IsInteger");function Cgt(t){return si.IsObject(t)&&Object.entries(t).every(([e,r])=>PCr(e)&&Ug(r))}a(Cgt,"IsProperties");function Nxi(t){return Hs(t,"Intersect")&&!(si.IsString(t.type)&&t.type!=="object")&&si.IsArray(t.allOf)&&t.allOf.every(e=>Ug(e)&&!Xxi(e))&&ll(t.type)&&(kCr(t.unevaluatedProperties)||vxi(t.unevaluatedProperties))&&ll(t.$id)}a(Nxi,"IsIntersect");function Mxi(t){return Hs(t,"Iterator")&&t.type==="Iterator"&&ll(t.$id)&&Ug(t.items)}a(Mxi,"IsIterator");function Hs(t,e){return si.IsObject(t)&&M4.Kind in t&&t[M4.Kind]===e}a(Hs,"IsKindOf");function Oxi(t){return y5e(t)&&si.IsString(t.const)}a(Oxi,"IsLiteralString");function Bxi(t){return y5e(t)&&si.IsNumber(t.const)}a(Bxi,"IsLiteralNumber");function hNa(t){return y5e(t)&&si.IsBoolean(t.const)}a(hNa,"IsLiteralBoolean");function y5e(t){return Hs(t,"Literal")&&ll(t.$id)&&Lxi(t.const)}a(y5e,"IsLiteral");function Lxi(t){return si.IsBoolean(t)||si.IsNumber(t)||si.IsString(t)}a(Lxi,"IsLiteralValue");function Fxi(t){return Hs(t,"MappedKey")&&si.IsArray(t.keys)&&t.keys.every(e=>si.IsNumber(e)||si.IsString(e))}a(Fxi,"IsMappedKey");function Uxi(t){return Hs(t,"MappedResult")&&Cgt(t.properties)}a(Uxi,"IsMappedResult");function Qxi(t){return Hs(t,"Never")&&si.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(Qxi,"IsNever");function qxi(t){return Hs(t,"Not")&&Ug(t.not)}a(qxi,"IsNot");function jxi(t){return Hs(t,"Null")&&t.type==="null"&&ll(t.$id)}a(jxi,"IsNull");function Hxi(t){return Hs(t,"Number")&&t.type==="number"&&ll(t.$id)&&zl(t.exclusiveMaximum)&&zl(t.exclusiveMinimum)&&zl(t.maximum)&&zl(t.minimum)&&zl(t.multipleOf)}a(Hxi,"IsNumber");function Gxi(t){return Hs(t,"Object")&&t.type==="object"&&ll(t.$id)&&Cgt(t.properties)&&_xi(t.additionalProperties)&&zl(t.minProperties)&&zl(t.maxProperties)}a(Gxi,"IsObject");function $xi(t){return Hs(t,"Promise")&&t.type==="Promise"&&ll(t.$id)&&Ug(t.item)}a($xi,"IsPromise");function Vxi(t){return Hs(t,"Record")&&t.type==="object"&&ll(t.$id)&&_xi(t.additionalProperties)&&si.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&Exi(r[0])&&si.IsObject(e.patternProperties)&&Ug(e.patternProperties[r[0]])})(t)}a(Vxi,"IsRecord");function mNa(t){return si.IsObject(t)&&M4.Hint in t&&t[M4.Hint]==="Recursive"}a(mNa,"IsRecursive");function Wxi(t){return Hs(t,"Ref")&&ll(t.$id)&&si.IsString(t.$ref)}a(Wxi,"IsRef");function zxi(t){return Hs(t,"RegExp")&&ll(t.$id)&&si.IsString(t.source)&&si.IsString(t.flags)&&zl(t.maxLength)&&zl(t.minLength)}a(zxi,"IsRegExp");function Yxi(t){return Hs(t,"String")&&t.type==="string"&&ll(t.$id)&&zl(t.minLength)&&zl(t.maxLength)&&lNa(t.pattern)&&uNa(t.format)}a(Yxi,"IsString");function Kxi(t){return Hs(t,"Symbol")&&t.type==="symbol"&&ll(t.$id)}a(Kxi,"IsSymbol");function Jxi(t){return Hs(t,"TemplateLiteral")&&t.type==="string"&&si.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(Jxi,"IsTemplateLiteral");function Zxi(t){return Hs(t,"This")&&ll(t.$id)&&si.IsString(t.$ref)}a(Zxi,"IsThis");function Xxi(t){return si.IsObject(t)&&M4.TransformKind in t}a(Xxi,"IsTransform");function ewi(t){return Hs(t,"Tuple")&&t.type==="array"&&ll(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=>Ug(e)))}a(ewi,"IsTuple");function twi(t){return Hs(t,"Undefined")&&t.type==="undefined"&&ll(t.$id)}a(twi,"IsUndefined");function gNa(t){return DCr(t)&&t.anyOf.every(e=>Oxi(e)||Bxi(e))}a(gNa,"IsUnionLiteral");function DCr(t){return Hs(t,"Union")&&ll(t.$id)&&si.IsObject(t)&&si.IsArray(t.anyOf)&&t.anyOf.every(e=>Ug(e))}a(DCr,"IsUnion");function rwi(t){return Hs(t,"Uint8Array")&&t.type==="Uint8Array"&&ll(t.$id)&&zl(t.minByteLength)&&zl(t.maxByteLength)}a(rwi,"IsUint8Array");function nwi(t){return Hs(t,"Unknown")&&ll(t.$id)}a(nwi,"IsUnknown");function iwi(t){return Hs(t,"Unsafe")}a(iwi,"IsUnsafe");function owi(t){return Hs(t,"Void")&&t.type==="void"&&ll(t.$id)}a(owi,"IsVoid");function swi(t){return si.IsObject(t)&&M4.Kind in t&&si.IsString(t[M4.Kind])&&!cNa.includes(t[M4.Kind])}a(swi,"IsKind");function Ug(t){return si.IsObject(t)&&(Cxi(t)||bxi(t)||Sxi(t)||xxi(t)||Ixi(t)||Txi(t)||wxi(t)||Rxi(t)||Pxi(t)||kxi(t)||Dxi(t)||Nxi(t)||Mxi(t)||y5e(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)||Kxi(t)||Jxi(t)||Zxi(t)||ewi(t)||twi(t)||DCr(t)||rwi(t)||nwi(t)||iwi(t)||owi(t)||swi(t))}a(Ug,"IsSchema")});var MCr=I($b=>{"use strict";p();var ANa=$b&&$b.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=$b&&$b.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),NCr=$b&&$b.__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(OCr,"__esModule",{value:!0});OCr.Increment=ENa;function ENa(t){return(parseInt(t)+1).toString()}a(ENa,"Increment")});var lwi=I(Ete=>{"use strict";p();var _Na=Ete&&Ete.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vNa=Ete&&Ete.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Na(e,t,r)};Object.defineProperty(Ete,"__esModule",{value:!0});vNa(cwi(),Ete)});var uwi=I(_p=>{"use strict";p();Object.defineProperty(_p,"__esModule",{value:!0});_p.PatternNeverExact=_p.PatternStringExact=_p.PatternNumberExact=_p.PatternBooleanExact=_p.PatternNever=_p.PatternString=_p.PatternNumber=_p.PatternBoolean=void 0;_p.PatternBoolean="(true|false)";_p.PatternNumber="(0|[1-9][0-9]*)";_p.PatternString="(.*)";_p.PatternNever="(?!.*)";_p.PatternBooleanExact=`^${_p.PatternBoolean}$`;_p.PatternNumberExact=`^${_p.PatternNumber}$`;_p.PatternStringExact=`^${_p.PatternString}$`;_p.PatternNeverExact=`^${_p.PatternNever}$`});var E5e=I(_te=>{"use strict";p();var CNa=_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]})),bNa=_te&&_te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CNa(e,t,r)};Object.defineProperty(_te,"__esModule",{value:!0});bNa(uwi(),_te)});var dwi=I(RG=>{"use strict";p();Object.defineProperty(RG,"__esModule",{value:!0});RG.Entries=SNa;RG.Clear=TNa;RG.Delete=INa;RG.Has=xNa;RG.Set=wNa;RG.Get=RNa;var Ige=new Map;function SNa(){return new Map(Ige)}a(SNa,"Entries");function TNa(){return Ige.clear()}a(TNa,"Clear");function INa(t){return Ige.delete(t)}a(INa,"Delete");function xNa(t){return Ige.has(t)}a(xNa,"Has");function wNa(t,e){Ige.set(t,e)}a(wNa,"Set");function RNa(t){return Ige.get(t)}a(RNa,"Get")});var fwi=I(PG=>{"use strict";p();Object.defineProperty(PG,"__esModule",{value:!0});PG.Entries=PNa;PG.Clear=kNa;PG.Delete=DNa;PG.Has=NNa;PG.Set=MNa;PG.Get=ONa;var xge=new Map;function PNa(){return new Map(xge)}a(PNa,"Entries");function kNa(){return xge.clear()}a(kNa,"Clear");function DNa(t){return xge.delete(t)}a(DNa,"Delete");function NNa(t){return xge.has(t)}a(NNa,"Has");function MNa(t,e){xge.set(t,e)}a(MNa,"Set");function ONa(t){return xge.get(t)}a(ONa,"Get")});var wge=I(TR=>{"use strict";p();var BNa=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]})),LNa=TR&&TR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pwi=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{"use strict";p();Object.defineProperty(O4,"__esModule",{value:!0});O4.SetIncludes=hwi;O4.SetIsSubset=FNa;O4.SetDistinct=UNa;O4.SetIntersect=mwi;O4.SetUnion=QNa;O4.SetComplement=qNa;O4.SetIntersectMany=HNa;O4.SetUnionMany=GNa;function hwi(t,e){return t.includes(e)}a(hwi,"SetIncludes");function FNa(t,e){return t.every(r=>hwi(e,r))}a(FNa,"SetIsSubset");function UNa(t){return[...new Set(t)]}a(UNa,"SetDistinct");function mwi(t,e){return t.filter(r=>e.includes(r))}a(mwi,"SetIntersect");function QNa(t,e){return[...t,...e]}a(QNa,"SetUnion");function qNa(t,e){return t.filter(r=>!e.includes(r))}a(qNa,"SetComplement");function jNa(t,e){return t.reduce((r,n)=>mwi(r,n),e)}a(jNa,"SetIntersectManyResolve");function HNa(t){return t.length===1?t[0]:t.length>1?jNa(t.slice(1),t[0]):[]}a(HNa,"SetIntersectMany");function GNa(t){let e=[];for(let r of t)e.push(...r);return e}a(GNa,"SetUnionMany")});var _5e=I(vte=>{"use strict";p();var $Na=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]})),VNa=vte&&vte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Na(e,t,r)};Object.defineProperty(vte,"__esModule",{value:!0});VNa(gwi(),vte)});var Awi=I(BCr=>{"use strict";p();Object.defineProperty(BCr,"__esModule",{value:!0});BCr.Any=YNa;var WNa=q8(),zNa=vn();function YNa(t){return(0,WNa.CreateType)({[zNa.Kind]:"Any"},t)}a(YNa,"Any")});var Rge=I(Cte=>{"use strict";p();var KNa=Cte&&Cte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JNa=Cte&&Cte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&KNa(e,t,r)};Object.defineProperty(Cte,"__esModule",{value:!0});JNa(Awi(),Cte)});var ywi=I(LCr=>{"use strict";p();Object.defineProperty(LCr,"__esModule",{value:!0});LCr.Array=eMa;var ZNa=Ii(),XNa=vn();function eMa(t,e){return(0,ZNa.CreateType)({[XNa.Kind]:"Array",type:"array",items:t},e)}a(eMa,"Array")});var Pge=I(bte=>{"use strict";p();var tMa=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]})),rMa=bte&&bte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tMa(e,t,r)};Object.defineProperty(bte,"__esModule",{value:!0});rMa(ywi(),bte)});var Ewi=I(FCr=>{"use strict";p();Object.defineProperty(FCr,"__esModule",{value:!0});FCr.Argument=oMa;var nMa=Ii(),iMa=vn();function oMa(t){return(0,nMa.CreateType)({[iMa.Kind]:"Argument",index:t})}a(oMa,"Argument")});var bgt=I(Ste=>{"use strict";p();var sMa=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]})),aMa=Ste&&Ste.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sMa(e,t,r)};Object.defineProperty(Ste,"__esModule",{value:!0});aMa(Ewi(),Ste)});var _wi=I(UCr=>{"use strict";p();Object.defineProperty(UCr,"__esModule",{value:!0});UCr.AsyncIterator=uMa;var cMa=vn(),lMa=Ii();function uMa(t,e){return(0,lMa.CreateType)({[cMa.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(uMa,"AsyncIterator")});var kge=I(Tte=>{"use strict";p();var dMa=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]})),fMa=Tte&&Tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dMa(e,t,r)};Object.defineProperty(Tte,"__esModule",{value:!0});fMa(_wi(),Tte)});var vwi=I(QCr=>{"use strict";p();Object.defineProperty(QCr,"__esModule",{value:!0});QCr.Computed=mMa;var pMa=q8(),hMa=m5e();function mMa(t,e,r){return(0,pMa.CreateType)({[hMa.Kind]:"Computed",target:t,parameters:e},r)}a(mMa,"Computed")});var kG=I(Ite=>{"use strict";p();var gMa=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]})),AMa=Ite&&Ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gMa(e,t,r)};Object.defineProperty(Ite,"__esModule",{value:!0});AMa(vwi(),Ite)});var Sgt=I(qCr=>{"use strict";p();Object.defineProperty(qCr,"__esModule",{value:!0});qCr.Discard=EMa;function yMa(t,e){let{[e]:r,...n}=t;return n}a(yMa,"DiscardKey");function EMa(t,e){return e.reduce((r,n)=>yMa(r,n),t)}a(EMa,"Discard")});var H8=I(xte=>{"use strict";p();var _Ma=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]})),vMa=xte&&xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Ma(e,t,r)};Object.defineProperty(xte,"__esModule",{value:!0});vMa(Sgt(),xte)});var Cwi=I(jCr=>{"use strict";p();Object.defineProperty(jCr,"__esModule",{value:!0});jCr.Never=SMa;var CMa=Ii(),bMa=vn();function SMa(t){return(0,CMa.CreateType)({[bMa.Kind]:"Never",not:{}},t)}a(SMa,"Never")});var ym=I(wte=>{"use strict";p();var TMa=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]})),IMa=wte&&wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TMa(e,t,r)};Object.defineProperty(wte,"__esModule",{value:!0});IMa(Cwi(),wte)});var bwi=I(HCr=>{"use strict";p();Object.defineProperty(HCr,"__esModule",{value:!0});HCr.MappedKey=RMa;var xMa=Ii(),wMa=vn();function RMa(t){return(0,xMa.CreateType)({[wMa.Kind]:"MappedKey",keys:t})}a(RMa,"MappedKey")});var $Cr=I(GCr=>{"use strict";p();Object.defineProperty(GCr,"__esModule",{value:!0});GCr.MappedResult=DMa;var PMa=Ii(),kMa=vn();function DMa(t){return(0,PMa.CreateType)({[kMa.Kind]:"MappedResult",properties:t})}a(DMa,"MappedResult")});var Swi=I(VCr=>{"use strict";p();Object.defineProperty(VCr,"__esModule",{value:!0});VCr.Constructor=OMa;var NMa=Ii(),MMa=vn();function OMa(t,e,r){return(0,NMa.CreateType)({[MMa.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(OMa,"Constructor")});var Dge=I(Rte=>{"use strict";p();var BMa=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]})),LMa=Rte&&Rte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&BMa(e,t,r)};Object.defineProperty(Rte,"__esModule",{value:!0});LMa(Swi(),Rte)});var Twi=I(WCr=>{"use strict";p();Object.defineProperty(WCr,"__esModule",{value:!0});WCr.Function=QMa;var FMa=Ii(),UMa=vn();function QMa(t,e,r){return(0,FMa.CreateType)({[UMa.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(QMa,"Function")});var DG=I(Pte=>{"use strict";p();var qMa=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]})),jMa=Pte&&Pte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qMa(e,t,r)};Object.defineProperty(Pte,"__esModule",{value:!0});jMa(Twi(),Pte)});var YCr=I(zCr=>{"use strict";p();Object.defineProperty(zCr,"__esModule",{value:!0});zCr.UnionCreate=$Ma;var HMa=Ii(),GMa=vn();function $Ma(t,e){return(0,HMa.CreateType)({[GMa.Kind]:"Union",anyOf:t},e)}a($Ma,"UnionCreate")});var Rwi=I(KCr=>{"use strict";p();Object.defineProperty(KCr,"__esModule",{value:!0});KCr.UnionEvaluated=eOa;var VMa=Ii(),WMa=vn(),zMa=H8(),YMa=ym(),KMa=B4(),Iwi=YCr(),wwi=As();function JMa(t){return t.some(e=>(0,wwi.IsOptional)(e))}a(JMa,"IsUnionOptional");function xwi(t){return t.map(e=>(0,wwi.IsOptional)(e)?ZMa(e):e)}a(xwi,"RemoveOptionalFromRest");function ZMa(t){return(0,zMa.Discard)(t,[WMa.OptionalKind])}a(ZMa,"RemoveOptionalFromType");function XMa(t,e){return JMa(t)?(0,KMa.Optional)((0,Iwi.UnionCreate)(xwi(t),e)):(0,Iwi.UnionCreate)(xwi(t),e)}a(XMa,"ResolveUnion");function eOa(t,e){return t.length===1?(0,VMa.CreateType)(t[0],e):t.length===0?(0,YMa.Never)(e):XMa(t,e)}a(eOa,"UnionEvaluated")});var kwi=I(Pwi=>{"use strict";p();Object.defineProperty(Pwi,"__esModule",{value:!0});var lSp=vn()});var Dwi=I(JCr=>{"use strict";p();Object.defineProperty(JCr,"__esModule",{value:!0});JCr.Union=iOa;var tOa=ym(),rOa=Ii(),nOa=YCr();function iOa(t,e){return t.length===0?(0,tOa.Never)(e):t.length===1?(0,rOa.CreateType)(t[0],e):(0,nOa.UnionCreate)(t,e)}a(iOa,"Union")});var vp=I(G8=>{"use strict";p();var oOa=G8&&G8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZCr=G8&&G8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&oOa(e,t,r)};Object.defineProperty(G8,"__esModule",{value:!0});ZCr(Rwi(),G8);ZCr(kwi(),G8);ZCr(Dwi(),G8)});var Tgt=I(Nge=>{"use strict";p();Object.defineProperty(Nge,"__esModule",{value:!0});Nge.TemplateLiteralParserError=void 0;Nge.TemplateLiteralParse=kte;Nge.TemplateLiteralParseExact=hOa;var sOa=Rf(),v5e=class extends sOa.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};Nge.TemplateLiteralParserError=v5e;function aOa(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(aOa,"Unescape");function XCr(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(XCr,"IsNonEscaped");function $8(t,e){return XCr(t,e,"(")}a($8,"IsOpenParen");function C5e(t,e){return XCr(t,e,")")}a(C5e,"IsCloseParen");function Nwi(t,e){return XCr(t,e,"|")}a(Nwi,"IsSeparator");function cOa(t){if(!($8(t,0)&&C5e(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(kte(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(kte(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(fOa,"Or");function pOa(t){function e(o,s){if(!$8(o,s))throw new v5e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(kte(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(pOa,"And");function kte(t){return cOa(t)?kte(lOa(t)):uOa(t)?fOa(t):dOa(t)?pOa(t):{type:"const",const:aOa(t)}}a(kte,"TemplateLiteralParse");function hOa(t){return kte(t.slice(1,t.length-1))}a(hOa,"TemplateLiteralParseExact")});var ebr=I(Mge=>{"use strict";p();Object.defineProperty(Mge,"__esModule",{value:!0});Mge.TemplateLiteralFiniteError=void 0;Mge.IsTemplateLiteralExpressionFinite=xgt;Mge.IsTemplateLiteralFinite=_Oa;var mOa=Tgt(),gOa=Rf(),Igt=class extends gOa.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};Mge.TemplateLiteralFiniteError=Igt;function AOa(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(AOa,"IsNumberExpression");function yOa(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(yOa,"IsBooleanExpression");function EOa(t){return t.type==="const"&&t.const===".*"}a(EOa,"IsStringExpression");function xgt(t){return AOa(t)||EOa(t)?!1:yOa(t)?!0:t.type==="and"?t.expr.every(e=>xgt(e)):t.type==="or"?t.expr.every(e=>xgt(e)):t.type==="const"?!0:(()=>{throw new Igt("Unknown expression type")})()}a(xgt,"IsTemplateLiteralExpressionFinite");function _Oa(t){let e=(0,mOa.TemplateLiteralParseExact)(t.pattern);return xgt(e)}a(_Oa,"IsTemplateLiteralFinite")});var tbr=I(Oge=>{"use strict";p();Object.defineProperty(Oge,"__esModule",{value:!0});Oge.TemplateLiteralGenerateError=void 0;Oge.TemplateLiteralExpressionGenerate=Rgt;Oge.TemplateLiteralGenerate=xOa;var vOa=ebr(),COa=Tgt(),bOa=Rf(),wgt=class extends bOa.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};Oge.TemplateLiteralGenerateError=wgt;function*Mwi(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of Mwi(t.slice(1)))yield`${e}${r}`}a(Mwi,"GenerateReduce");function*SOa(t){return yield*Mwi(t.expr.map(e=>[...Rgt(e)]))}a(SOa,"GenerateAnd");function*TOa(t){for(let e of t.expr)yield*Rgt(e)}a(TOa,"GenerateOr");function*IOa(t){return yield t.const}a(IOa,"GenerateConst");function*Rgt(t){return t.type==="and"?yield*SOa(t):t.type==="or"?yield*TOa(t):t.type==="const"?yield*IOa(t):(()=>{throw new wgt("Unknown expression")})()}a(Rgt,"TemplateLiteralExpressionGenerate");function xOa(t){let e=(0,COa.TemplateLiteralParseExact)(t.pattern);return(0,vOa.IsTemplateLiteralExpressionFinite)(e)?[...Rgt(e)]:[]}a(xOa,"TemplateLiteralGenerate")});var Owi=I(rbr=>{"use strict";p();Object.defineProperty(rbr,"__esModule",{value:!0});rbr.Literal=POa;var wOa=Ii(),ROa=vn();function POa(t,e){return(0,wOa.CreateType)({[ROa.Kind]:"Literal",const:t,type:typeof t},e)}a(POa,"Literal")});var DE=I(Dte=>{"use strict";p();var kOa=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]})),DOa=Dte&&Dte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kOa(e,t,r)};Object.defineProperty(Dte,"__esModule",{value:!0});DOa(Owi(),Dte)});var Bwi=I(nbr=>{"use strict";p();Object.defineProperty(nbr,"__esModule",{value:!0});nbr.Boolean=OOa;var NOa=vn(),MOa=q8();function OOa(t){return(0,MOa.CreateType)({[NOa.Kind]:"Boolean",type:"boolean"},t)}a(OOa,"Boolean")});var b5e=I(Nte=>{"use strict";p();var BOa=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]})),LOa=Nte&&Nte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&BOa(e,t,r)};Object.defineProperty(Nte,"__esModule",{value:!0});LOa(Bwi(),Nte)});var Lwi=I(ibr=>{"use strict";p();Object.defineProperty(ibr,"__esModule",{value:!0});ibr.BigInt=QOa;var FOa=vn(),UOa=q8();function QOa(t){return(0,UOa.CreateType)({[FOa.Kind]:"BigInt",type:"bigint"},t)}a(QOa,"BigInt")});var Bge=I(Mte=>{"use strict";p();var qOa=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]})),jOa=Mte&&Mte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qOa(e,t,r)};Object.defineProperty(Mte,"__esModule",{value:!0});jOa(Lwi(),Mte)});var Fwi=I(obr=>{"use strict";p();Object.defineProperty(obr,"__esModule",{value:!0});obr.Number=$Oa;var HOa=Ii(),GOa=vn();function $Oa(t){return(0,HOa.CreateType)({[GOa.Kind]:"Number",type:"number"},t)}a($Oa,"Number")});var NG=I(Ote=>{"use strict";p();var VOa=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]})),WOa=Ote&&Ote.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&VOa(e,t,r)};Object.defineProperty(Ote,"__esModule",{value:!0});WOa(Fwi(),Ote)});var Uwi=I(sbr=>{"use strict";p();Object.defineProperty(sbr,"__esModule",{value:!0});sbr.String=KOa;var zOa=Ii(),YOa=vn();function KOa(t){return(0,zOa.CreateType)({[YOa.Kind]:"String",type:"string"},t)}a(KOa,"String")});var MG=I(Bte=>{"use strict";p();var JOa=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]})),ZOa=Bte&&Bte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JOa(e,t,r)};Object.defineProperty(Bte,"__esModule",{value:!0});ZOa(Uwi(),Bte)});var lbr=I(cbr=>{"use strict";p();Object.defineProperty(cbr,"__esModule",{value:!0});cbr.TemplateLiteralSyntax=a5a;var S5e=DE(),XOa=b5e(),e5a=Bge(),t5a=NG(),r5a=MG(),n5a=vp(),i5a=ym();function*o5a(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,XOa.Boolean)():e==="number"?yield(0,t5a.Number)():e==="bigint"?yield(0,e5a.BigInt)():e==="string"?yield(0,r5a.String)():yield(()=>{let r=e.split("|").map(n=>(0,S5e.Literal)(n.trim()));return r.length===0?(0,i5a.Never)():r.length===1?r[0]:(0,n5a.UnionEvaluated)(r)})()}a(o5a,"FromUnion");function*s5a(t){if(t[1]!=="{"){let e=(0,S5e.Literal)("$"),r=abr(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(I5e,"__esModule",{value:!0});I5e.TemplateLiteralPatternError=void 0;I5e.TemplateLiteralPattern=d5a;var T5e=E5e(),c5a=vn(),l5a=Rf(),OG=As(),Pgt=class extends l5a.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};I5e.TemplateLiteralPatternError=Pgt;function u5a(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(u5a,"Escape");function Qwi(t,e){return(0,OG.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,OG.IsUnion)(t)?`(${t.anyOf.map(r=>Qwi(r,e)).join("|")})`:(0,OG.IsNumber)(t)?`${e}${T5e.PatternNumber}`:(0,OG.IsInteger)(t)?`${e}${T5e.PatternNumber}`:(0,OG.IsBigInt)(t)?`${e}${T5e.PatternNumber}`:(0,OG.IsString)(t)?`${e}${T5e.PatternString}`:(0,OG.IsLiteral)(t)?`${e}${u5a(t.const.toString())}`:(0,OG.IsBoolean)(t)?`${e}${T5e.PatternBoolean}`:(()=>{throw new Pgt(`Unexpected Kind '${t[c5a.Kind]}'`)})()}a(Qwi,"Visit");function d5a(t){return`^${t.map(e=>Qwi(e,"")).join("")}$`}a(d5a,"TemplateLiteralPattern")});var qwi=I(dbr=>{"use strict";p();Object.defineProperty(dbr,"__esModule",{value:!0});dbr.TemplateLiteralToUnion=m5a;var f5a=vp(),p5a=DE(),h5a=tbr();function m5a(t){let r=(0,h5a.TemplateLiteralGenerate)(t).map(n=>(0,p5a.Literal)(n));return(0,f5a.UnionEvaluated)(r)}a(m5a,"TemplateLiteralToUnion")});var Hwi=I(fbr=>{"use strict";p();Object.defineProperty(fbr,"__esModule",{value:!0});fbr.TemplateLiteral=_5a;var g5a=Ii(),A5a=lbr(),jwi=ubr(),y5a=Av(),E5a=vn();function _5a(t,e){let r=(0,y5a.IsString)(t)?(0,jwi.TemplateLiteralPattern)((0,A5a.TemplateLiteralSyntax)(t)):(0,jwi.TemplateLiteralPattern)(t);return(0,g5a.CreateType)({[E5a.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(_5a,"TemplateLiteral")});var lD=I(VT=>{"use strict";p();var v5a=VT&&VT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lte=VT&&VT.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v5a(e,t,r)};Object.defineProperty(VT,"__esModule",{value:!0});Lte(ebr(),VT);Lte(tbr(),VT);Lte(lbr(),VT);Lte(Tgt(),VT);Lte(ubr(),VT);Lte(qwi(),VT);Lte(Hwi(),VT)});var kgt=I(pbr=>{"use strict";p();Object.defineProperty(pbr,"__esModule",{value:!0});pbr.IndexPropertyKeys=Gwi;var C5a=lD(),x5e=As();function b5a(t){return(0,C5a.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(b5a,"FromTemplateLiteral");function S5a(t){let e=[];for(let r of t)e.push(...Gwi(r));return e}a(S5a,"FromUnion");function T5a(t){return[t.toString()]}a(T5a,"FromLiteral");function Gwi(t){return[...new Set((0,x5e.IsTemplateLiteral)(t)?b5a(t):(0,x5e.IsUnion)(t)?S5a(t.anyOf):(0,x5e.IsLiteral)(t)?T5a(t.const):(0,x5e.IsNumber)(t)?["[number]"]:(0,x5e.IsInteger)(t)?["[number]"]:[])]}a(Gwi,"IndexPropertyKeys")});var mbr=I(hbr=>{"use strict";p();Object.defineProperty(hbr,"__esModule",{value:!0});hbr.IndexFromMappedResult=k5a;var I5a=Em(),x5a=kgt(),w5a=uD();function R5a(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,w5a.Index)(t,(0,x5a.IndexPropertyKeys)(e[o]),r);return n}a(R5a,"FromProperties");function P5a(t,e,r){return R5a(t,e.properties,r)}a(P5a,"FromMappedResult");function k5a(t,e,r){let n=P5a(t,e,r);return(0,I5a.MappedResult)(n)}a(k5a,"IndexFromMappedResult")});var Ngt=I(Lge=>{"use strict";p();Object.defineProperty(Lge,"__esModule",{value:!0});Lge.IndexFromPropertyKey=Abr;Lge.IndexFromPropertyKeys=zwi;Lge.IndexFromComputed=$5a;Lge.Index=V5a;var D5a=Ii(),N5a=Rf(),Vwi=kG(),Dgt=ym(),M5a=WT(),gbr=vp(),O5a=kgt(),B5a=ybr(),L5a=mbr(),Vb=As();function Wwi(t,e){return t.map(r=>Abr(r,e))}a(Wwi,"FromRest");function F5a(t){return t.filter(e=>!(0,Vb.IsNever)(e))}a(F5a,"FromIntersectRest");function U5a(t,e){return(0,M5a.IntersectEvaluated)(F5a(Wwi(t,e)))}a(U5a,"FromIntersect");function Q5a(t){return t.some(e=>(0,Vb.IsNever)(e))?[]:t}a(Q5a,"FromUnionRest");function q5a(t,e){return(0,gbr.UnionEvaluated)(Q5a(Wwi(t,e)))}a(q5a,"FromUnion");function j5a(t,e){return e in t?t[e]:e==="[number]"?(0,gbr.UnionEvaluated)(t):(0,Dgt.Never)()}a(j5a,"FromTuple");function H5a(t,e){return e==="[number]"?t:(0,Dgt.Never)()}a(H5a,"FromArray");function G5a(t,e){return e in t?t[e]:(0,Dgt.Never)()}a(G5a,"FromProperty");function Abr(t,e){return(0,Vb.IsIntersect)(t)?U5a(t.allOf,e):(0,Vb.IsUnion)(t)?q5a(t.anyOf,e):(0,Vb.IsTuple)(t)?j5a(t.items??[],e):(0,Vb.IsArray)(t)?H5a(t.items,e):(0,Vb.IsObject)(t)?G5a(t.properties,e):(0,Dgt.Never)()}a(Abr,"IndexFromPropertyKey");function zwi(t,e){return e.map(r=>Abr(t,r))}a(zwi,"IndexFromPropertyKeys");function $wi(t,e){return(0,gbr.UnionEvaluated)(zwi(t,e))}a($wi,"FromSchema");function $5a(t,e){return(0,Vwi.Computed)("Index",[t,e])}a($5a,"IndexFromComputed");function V5a(t,e,r){if((0,Vb.IsRef)(t)||(0,Vb.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,Vb.IsSchema)(t)||!(0,Vb.IsSchema)(e))throw new N5a.TypeBoxError(n);return(0,Vwi.Computed)("Index",[t,e])}return(0,Vb.IsMappedResult)(e)?(0,L5a.IndexFromMappedResult)(t,e,r):(0,Vb.IsMappedKey)(e)?(0,B5a.IndexFromMappedKey)(t,e,r):(0,D5a.CreateType)((0,Vb.IsSchema)(e)?$wi(t,(0,O5a.IndexPropertyKeys)(e)):$wi(t,e),r)}a(V5a,"Index")});var ybr=I(Ebr=>{"use strict";p();Object.defineProperty(Ebr,"__esModule",{value:!0});Ebr.IndexFromMappedKey=X5a;var W5a=Ngt(),z5a=Em(),Y5a=Hb();function K5a(t,e,r){return{[e]:(0,W5a.Index)(t,[e],(0,Y5a.Clone)(r))}}a(K5a,"MappedIndexPropertyKey");function J5a(t,e,r){return e.reduce((n,o)=>({...n,...K5a(t,o,r)}),{})}a(J5a,"MappedIndexPropertyKeys");function Z5a(t,e,r){return J5a(t,e.keys,r)}a(Z5a,"MappedIndexProperties");function X5a(t,e,r){let n=Z5a(t,e,r);return(0,z5a.MappedResult)(n)}a(X5a,"IndexFromMappedKey")});var uD=I(L4=>{"use strict";p();var e4a=L4&&L4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Mgt=L4&&L4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&e4a(e,t,r)};Object.defineProperty(L4,"__esModule",{value:!0});Mgt(ybr(),L4);Mgt(mbr(),L4);Mgt(kgt(),L4);Mgt(Ngt(),L4)});var Ywi=I(_br=>{"use strict";p();Object.defineProperty(_br,"__esModule",{value:!0});_br.Iterator=n4a;var t4a=Ii(),r4a=vn();function n4a(t,e){return(0,t4a.CreateType)({[r4a.Kind]:"Iterator",type:"Iterator",items:t},e)}a(n4a,"Iterator")});var Fge=I(Fte=>{"use strict";p();var i4a=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]})),o4a=Fte&&Fte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&i4a(e,t,r)};Object.defineProperty(Fte,"__esModule",{value:!0});o4a(Ywi(),Fte)});var Jwi=I(Ogt=>{"use strict";p();Object.defineProperty(Ogt,"__esModule",{value:!0});Ogt.Object=void 0;var s4a=Ii(),Kwi=vn(),a4a=As();function c4a(t){return globalThis.Object.keys(t).filter(e=>!(0,a4a.IsOptional)(t[e]))}a(c4a,"RequiredArray");function l4a(t,e){let r=c4a(t),n=r.length>0?{[Kwi.Kind]:"Object",type:"object",required:r,properties:t}:{[Kwi.Kind]:"Object",type:"object",properties:t};return(0,s4a.CreateType)(n,e)}a(l4a,"_Object");Ogt.Object=l4a});var yv=I(Ute=>{"use strict";p();var u4a=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]})),d4a=Ute&&Ute.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&u4a(e,t,r)};Object.defineProperty(Ute,"__esModule",{value:!0});d4a(Jwi(),Ute)});var Zwi=I(vbr=>{"use strict";p();Object.defineProperty(vbr,"__esModule",{value:!0});vbr.Promise=h4a;var f4a=Ii(),p4a=vn();function h4a(t,e){return(0,f4a.CreateType)({[p4a.Kind]:"Promise",type:"Promise",item:t},e)}a(h4a,"Promise")});var w5e=I(Qte=>{"use strict";p();var m4a=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]})),g4a=Qte&&Qte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&m4a(e,t,r)};Object.defineProperty(Qte,"__esModule",{value:!0});g4a(Zwi(),Qte)});var bbr=I(Cbr=>{"use strict";p();Object.defineProperty(Cbr,"__esModule",{value:!0});Cbr.Readonly=b4a;var Xwi=Ii(),eRi=vn(),A4a=H8(),y4a=Sbr(),E4a=As();function _4a(t){return(0,Xwi.CreateType)((0,A4a.Discard)(t,[eRi.ReadonlyKind]))}a(_4a,"RemoveReadonly");function v4a(t){return(0,Xwi.CreateType)({...t,[eRi.ReadonlyKind]:"Readonly"})}a(v4a,"AddReadonly");function C4a(t,e){return e===!1?_4a(t):v4a(t)}a(C4a,"ReadonlyWithFlag");function b4a(t,e){let r=e??!0;return(0,E4a.IsMappedResult)(t)?(0,y4a.ReadonlyFromMappedResult)(t,r):C4a(t,r)}a(b4a,"Readonly")});var Sbr=I(Tbr=>{"use strict";p();Object.defineProperty(Tbr,"__esModule",{value:!0});Tbr.ReadonlyFromMappedResult=w4a;var S4a=Em(),T4a=bbr();function I4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,T4a.Readonly)(t[n],e);return r}a(I4a,"FromProperties");function x4a(t,e){return I4a(t.properties,e)}a(x4a,"FromMappedResult");function w4a(t,e){let r=x4a(t,e);return(0,S4a.MappedResult)(r)}a(w4a,"ReadonlyFromMappedResult")});var LG=I(BG=>{"use strict";p();var R4a=BG&&BG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=BG&&BG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&R4a(e,t,r)};Object.defineProperty(BG,"__esModule",{value:!0});tRi(Sbr(),BG);tRi(bbr(),BG)});var nRi=I(Ibr=>{"use strict";p();Object.defineProperty(Ibr,"__esModule",{value:!0});Ibr.Tuple=k4a;var P4a=Ii(),rRi=vn();function k4a(t,e){return(0,P4a.CreateType)(t.length>0?{[rRi.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[rRi.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(k4a,"Tuple")});var V8=I(qte=>{"use strict";p();var D4a=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]})),N4a=qte&&qte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&D4a(e,t,r)};Object.defineProperty(qte,"__esModule",{value:!0});N4a(nRi(),qte)});var lRi=I(Bgt=>{"use strict";p();Object.defineProperty(Bgt,"__esModule",{value:!0});Bgt.MappedFunctionReturnType=cRi;Bgt.Mapped=X4a;var xbr=vn(),iRi=H8(),M4a=Pge(),O4a=kge(),B4a=Dge(),L4a=DG(),F4a=uD(),U4a=WT(),Q4a=Fge(),oRi=DE(),sRi=yv(),q4a=B4(),j4a=w5e(),H4a=LG(),G4a=V8(),$4a=vp(),V4a=_5e(),W4a=$Cr(),Ev=As();function aRi(t,e){return t in e?IR(t,e[t]):(0,W4a.MappedResult)(e)}a(aRi,"FromMappedResult");function z4a(t){return{[t]:(0,oRi.Literal)(t)}}a(z4a,"MappedKeyToKnownMappedResultProperties");function Y4a(t){let e={};for(let r of t)e[r]=(0,oRi.Literal)(r);return e}a(Y4a,"MappedKeyToUnknownMappedResultProperties");function K4a(t,e){return(0,V4a.SetIncludes)(e,t)?z4a(t):Y4a(e)}a(K4a,"MappedKeyToMappedResultProperties");function J4a(t,e){let r=K4a(t,e);return aRi(t,r)}a(J4a,"FromMappedKey");function R5e(t,e){return e.map(r=>IR(t,r))}a(R5e,"FromRest");function Z4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=IR(t,e[n]);return r}a(Z4a,"FromProperties");function IR(t,e){let r={...e};return(0,Ev.IsOptional)(e)?(0,q4a.Optional)(IR(t,(0,iRi.Discard)(e,[xbr.OptionalKind]))):(0,Ev.IsReadonly)(e)?(0,H4a.Readonly)(IR(t,(0,iRi.Discard)(e,[xbr.ReadonlyKind]))):(0,Ev.IsMappedResult)(e)?aRi(t,e.properties):(0,Ev.IsMappedKey)(e)?J4a(t,e.keys):(0,Ev.IsConstructor)(e)?(0,B4a.Constructor)(R5e(t,e.parameters),IR(t,e.returns),r):(0,Ev.IsFunction)(e)?(0,L4a.Function)(R5e(t,e.parameters),IR(t,e.returns),r):(0,Ev.IsAsyncIterator)(e)?(0,O4a.AsyncIterator)(IR(t,e.items),r):(0,Ev.IsIterator)(e)?(0,Q4a.Iterator)(IR(t,e.items),r):(0,Ev.IsIntersect)(e)?(0,U4a.Intersect)(R5e(t,e.allOf),r):(0,Ev.IsUnion)(e)?(0,$4a.Union)(R5e(t,e.anyOf),r):(0,Ev.IsTuple)(e)?(0,G4a.Tuple)(R5e(t,e.items??[]),r):(0,Ev.IsObject)(e)?(0,sRi.Object)(Z4a(t,e.properties),r):(0,Ev.IsArray)(e)?(0,M4a.Array)(IR(t,e.items),r):(0,Ev.IsPromise)(e)?(0,j4a.Promise)(IR(t,e.item),r):e}a(IR,"FromSchemaType");function cRi(t,e){let r={};for(let n of t)r[n]=IR(n,e);return r}a(cRi,"MappedFunctionReturnType");function X4a(t,e,r){let n=(0,Ev.IsSchema)(t)?(0,F4a.IndexPropertyKeys)(t):t,o=e({[xbr.Kind]:"MappedKey",keys:n}),s=cRi(n,o);return(0,sRi.Object)(s,r)}a(X4a,"Mapped")});var Em=I(W8=>{"use strict";p();var eBa=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]})),wbr=W8&&W8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eBa(e,t,r)};Object.defineProperty(W8,"__esModule",{value:!0});wbr(bwi(),W8);wbr($Cr(),W8);wbr(lRi(),W8)});var Pbr=I(Rbr=>{"use strict";p();Object.defineProperty(Rbr,"__esModule",{value:!0});Rbr.Optional=aBa;var uRi=Ii(),dRi=vn(),tBa=H8(),rBa=kbr(),nBa=As();function iBa(t){return(0,uRi.CreateType)((0,tBa.Discard)(t,[dRi.OptionalKind]))}a(iBa,"RemoveOptional");function oBa(t){return(0,uRi.CreateType)({...t,[dRi.OptionalKind]:"Optional"})}a(oBa,"AddOptional");function sBa(t,e){return e===!1?iBa(t):oBa(t)}a(sBa,"OptionalWithFlag");function aBa(t,e){let r=e??!0;return(0,nBa.IsMappedResult)(t)?(0,rBa.OptionalFromMappedResult)(t,r):sBa(t,r)}a(aBa,"Optional")});var kbr=I(Dbr=>{"use strict";p();Object.defineProperty(Dbr,"__esModule",{value:!0});Dbr.OptionalFromMappedResult=fBa;var cBa=Em(),lBa=Pbr();function uBa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,lBa.Optional)(t[n],e);return r}a(uBa,"FromProperties");function dBa(t,e){return uBa(t.properties,e)}a(dBa,"FromMappedResult");function fBa(t,e){let r=dBa(t,e);return(0,cBa.MappedResult)(r)}a(fBa,"OptionalFromMappedResult")});var B4=I(FG=>{"use strict";p();var pBa=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]})),fRi=FG&&FG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pBa(e,t,r)};Object.defineProperty(FG,"__esModule",{value:!0});fRi(kbr(),FG);fRi(Pbr(),FG)});var Obr=I(Mbr=>{"use strict";p();Object.defineProperty(Mbr,"__esModule",{value:!0});Mbr.IntersectCreate=mBa;var hBa=Ii(),pRi=vn(),Nbr=As();function mBa(t,e={}){let r=t.every(o=>(0,Nbr.IsObject)(o)),n=(0,Nbr.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,hBa.CreateType)(e.unevaluatedProperties===!1||(0,Nbr.IsSchema)(e.unevaluatedProperties)||r?{...n,[pRi.Kind]:"Intersect",type:"object",allOf:t}:{...n,[pRi.Kind]:"Intersect",allOf:t},e)}a(mBa,"IntersectCreate")});var gRi=I(Lbr=>{"use strict";p();Object.defineProperty(Lbr,"__esModule",{value:!0});Lbr.IntersectEvaluated=SBa;var gBa=vn(),ABa=Ii(),yBa=H8(),EBa=ym(),_Ba=B4(),hRi=Obr(),Bbr=As();function vBa(t){return t.every(e=>(0,Bbr.IsOptional)(e))}a(vBa,"IsIntersectOptional");function CBa(t){return(0,yBa.Discard)(t,[gBa.OptionalKind])}a(CBa,"RemoveOptionalFromType");function mRi(t){return t.map(e=>(0,Bbr.IsOptional)(e)?CBa(e):e)}a(mRi,"RemoveOptionalFromRest");function bBa(t,e){return vBa(t)?(0,_Ba.Optional)((0,hRi.IntersectCreate)(mRi(t),e)):(0,hRi.IntersectCreate)(mRi(t),e)}a(bBa,"ResolveIntersect");function SBa(t,e={}){if(t.length===1)return(0,ABa.CreateType)(t[0],e);if(t.length===0)return(0,EBa.Never)(e);if(t.some(r=>(0,Bbr.IsTransform)(r)))throw new Error("Cannot intersect transform types");return bBa(t,e)}a(SBa,"IntersectEvaluated")});var yRi=I(ARi=>{"use strict";p();Object.defineProperty(ARi,"__esModule",{value:!0});var NIp=vn()});var ERi=I(Fbr=>{"use strict";p();Object.defineProperty(Fbr,"__esModule",{value:!0});Fbr.Intersect=RBa;var TBa=Ii(),IBa=ym(),xBa=Obr(),wBa=As();function RBa(t,e){if(t.length===1)return(0,TBa.CreateType)(t[0],e);if(t.length===0)return(0,IBa.Never)(e);if(t.some(r=>(0,wBa.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,xBa.IntersectCreate)(t,e)}a(RBa,"Intersect")});var WT=I(z8=>{"use strict";p();var PBa=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]})),Ubr=z8&&z8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&PBa(e,t,r)};Object.defineProperty(z8,"__esModule",{value:!0});Ubr(gRi(),z8);Ubr(yRi(),z8);Ubr(ERi(),z8)});var _Ri=I(Qbr=>{"use strict";p();Object.defineProperty(Qbr,"__esModule",{value:!0});Qbr.Ref=MBa;var kBa=Rf(),DBa=Ii(),NBa=vn();function MBa(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new kBa.TypeBoxError("Ref: $ref must be a string");return(0,DBa.CreateType)({[NBa.Kind]:"Ref",$ref:e},r)}a(MBa,"Ref")});var UG=I(jte=>{"use strict";p();var OBa=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]})),BBa=jte&&jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OBa(e,t,r)};Object.defineProperty(jte,"__esModule",{value:!0});BBa(_Ri(),jte)});var CRi=I(Hbr=>{"use strict";p();Object.defineProperty(Hbr,"__esModule",{value:!0});Hbr.Awaited=jbr;var LBa=Ii(),qbr=kG(),FBa=WT(),UBa=vp(),QBa=UG(),P5e=As();function qBa(t,e){return(0,qbr.Computed)("Awaited",[(0,qbr.Computed)(t,e)])}a(qBa,"FromComputed");function jBa(t){return(0,qbr.Computed)("Awaited",[(0,QBa.Ref)(t)])}a(jBa,"FromRef");function HBa(t){return(0,FBa.Intersect)(vRi(t))}a(HBa,"FromIntersect");function GBa(t){return(0,UBa.Union)(vRi(t))}a(GBa,"FromUnion");function $Ba(t){return jbr(t)}a($Ba,"FromPromise");function vRi(t){return t.map(e=>jbr(e))}a(vRi,"FromRest");function jbr(t,e){return(0,LBa.CreateType)((0,P5e.IsComputed)(t)?qBa(t.target,t.parameters):(0,P5e.IsIntersect)(t)?HBa(t.allOf):(0,P5e.IsUnion)(t)?GBa(t.anyOf):(0,P5e.IsPromise)(t)?$Ba(t.item):(0,P5e.IsRef)(t)?jBa(t.$ref):t,e)}a(jbr,"Awaited")});var k5e=I(Hte=>{"use strict";p();var VBa=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]})),WBa=Hte&&Hte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&VBa(e,t,r)};Object.defineProperty(Hte,"__esModule",{value:!0});WBa(CRi(),Hte)});var Fgt=I(Lgt=>{"use strict";p();Object.defineProperty(Lgt,"__esModule",{value:!0});Lgt.KeyOfPropertyKeys=$br;Lgt.KeyOfPattern=eLa;var bRi=_5e(),Uge=As();function SRi(t){let e=[];for(let r of t)e.push($br(r));return e}a(SRi,"FromRest");function zBa(t){let e=SRi(t);return(0,bRi.SetUnionMany)(e)}a(zBa,"FromIntersect");function YBa(t){let e=SRi(t);return(0,bRi.SetIntersectMany)(e)}a(YBa,"FromUnion");function KBa(t){return t.map((e,r)=>r.toString())}a(KBa,"FromTuple");function JBa(t){return["[number]"]}a(JBa,"FromArray");function ZBa(t){return globalThis.Object.getOwnPropertyNames(t)}a(ZBa,"FromProperties");function XBa(t){return Gbr?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(XBa,"FromPatternProperties");function $br(t){return(0,Uge.IsIntersect)(t)?zBa(t.allOf):(0,Uge.IsUnion)(t)?YBa(t.anyOf):(0,Uge.IsTuple)(t)?KBa(t.items??[]):(0,Uge.IsArray)(t)?JBa(t.items):(0,Uge.IsObject)(t)?ZBa(t.properties):(0,Uge.IsRecord)(t)?XBa(t.patternProperties):[]}a($br,"KeyOfPropertyKeys");var Gbr=!1;function eLa(t){Gbr=!0;let e=$br(t);return Gbr=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(eLa,"KeyOfPattern")});var zbr=I(Ugt=>{"use strict";p();Object.defineProperty(Ugt,"__esModule",{value:!0});Ugt.KeyOfPropertyKeysToRest=TRi;Ugt.KeyOf=dLa;var tLa=Ii(),rLa=DE(),nLa=NG(),Wbr=kG(),iLa=UG(),oLa=Fgt(),sLa=vp(),aLa=Ybr(),Vbr=As();function cLa(t,e){return(0,Wbr.Computed)("KeyOf",[(0,Wbr.Computed)(t,e)])}a(cLa,"FromComputed");function lLa(t){return(0,Wbr.Computed)("KeyOf",[(0,iLa.Ref)(t)])}a(lLa,"FromRef");function uLa(t,e){let r=(0,oLa.KeyOfPropertyKeys)(t),n=TRi(r),o=(0,sLa.UnionEvaluated)(n);return(0,tLa.CreateType)(o,e)}a(uLa,"KeyOfFromType");function TRi(t){return t.map(e=>e==="[number]"?(0,nLa.Number)():(0,rLa.Literal)(e))}a(TRi,"KeyOfPropertyKeysToRest");function dLa(t,e){return(0,Vbr.IsComputed)(t)?cLa(t.target,t.parameters):(0,Vbr.IsRef)(t)?lLa(t.$ref):(0,Vbr.IsMappedResult)(t)?(0,aLa.KeyOfFromMappedResult)(t,e):uLa(t,e)}a(dLa,"KeyOf")});var Ybr=I(Kbr=>{"use strict";p();Object.defineProperty(Kbr,"__esModule",{value:!0});Kbr.KeyOfFromMappedResult=ALa;var fLa=Em(),pLa=zbr(),hLa=Hb();function mLa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,pLa.KeyOf)(t[n],(0,hLa.Clone)(e));return r}a(mLa,"FromProperties");function gLa(t,e){return mLa(t.properties,e)}a(gLa,"FromMappedResult");function ALa(t,e){let r=gLa(t,e);return(0,fLa.MappedResult)(r)}a(ALa,"KeyOfFromMappedResult")});var IRi=I(Jbr=>{"use strict";p();Object.defineProperty(Jbr,"__esModule",{value:!0});Jbr.KeyOfPropertyEntries=_La;var yLa=Ngt(),ELa=Fgt();function _La(t){let e=(0,ELa.KeyOfPropertyKeys)(t),r=(0,yLa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(_La,"KeyOfPropertyEntries")});var dD=I(F4=>{"use strict";p();var vLa=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]})),Qgt=F4&&F4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vLa(e,t,r)};Object.defineProperty(F4,"__esModule",{value:!0});Qgt(Ybr(),F4);Qgt(IRi(),F4);Qgt(Fgt(),F4);Qgt(zbr(),F4)});var xRi=I(Zbr=>{"use strict";p();Object.defineProperty(Zbr,"__esModule",{value:!0});Zbr.Composite=DLa;var CLa=WT(),bLa=uD(),SLa=dD(),TLa=yv(),ILa=_5e(),xLa=As();function wLa(t){let e=[];for(let r of t)e.push(...(0,SLa.KeyOfPropertyKeys)(r));return(0,ILa.SetDistinct)(e)}a(wLa,"CompositeKeys");function RLa(t){return t.filter(e=>!(0,xLa.IsNever)(e))}a(RLa,"FilterNever");function PLa(t,e){let r=[];for(let n of t)r.push(...(0,bLa.IndexFromPropertyKeys)(n,[e]));return RLa(r)}a(PLa,"CompositeProperty");function kLa(t,e){let r={};for(let n of e)r[n]=(0,CLa.IntersectEvaluated)(PLa(t,n));return r}a(kLa,"CompositeProperties");function DLa(t,e){let r=wLa(t),n=kLa(t,r);return(0,TLa.Object)(n,e)}a(DLa,"Composite")});var qgt=I(Gte=>{"use strict";p();var NLa=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]})),MLa=Gte&&Gte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NLa(e,t,r)};Object.defineProperty(Gte,"__esModule",{value:!0});MLa(xRi(),Gte)});var wRi=I(Xbr=>{"use strict";p();Object.defineProperty(Xbr,"__esModule",{value:!0});Xbr.Date=LLa;var OLa=vn(),BLa=Ii();function LLa(t){return(0,BLa.CreateType)({[OLa.Kind]:"Date",type:"Date"},t)}a(LLa,"Date")});var D5e=I($te=>{"use strict";p();var FLa=$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]})),ULa=$te&&$te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&FLa(e,t,r)};Object.defineProperty($te,"__esModule",{value:!0});ULa(wRi(),$te)});var RRi=I(e1r=>{"use strict";p();Object.defineProperty(e1r,"__esModule",{value:!0});e1r.Null=jLa;var QLa=Ii(),qLa=vn();function jLa(t){return(0,QLa.CreateType)({[qLa.Kind]:"Null",type:"null"},t)}a(jLa,"Null")});var N5e=I(Vte=>{"use strict";p();var HLa=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]})),GLa=Vte&&Vte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&HLa(e,t,r)};Object.defineProperty(Vte,"__esModule",{value:!0});GLa(RRi(),Vte)});var PRi=I(t1r=>{"use strict";p();Object.defineProperty(t1r,"__esModule",{value:!0});t1r.Symbol=WLa;var $La=Ii(),VLa=vn();function WLa(t){return(0,$La.CreateType)({[VLa.Kind]:"Symbol",type:"symbol"},t)}a(WLa,"Symbol")});var M5e=I(Wte=>{"use strict";p();var zLa=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]})),YLa=Wte&&Wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zLa(e,t,r)};Object.defineProperty(Wte,"__esModule",{value:!0});YLa(PRi(),Wte)});var kRi=I(r1r=>{"use strict";p();Object.defineProperty(r1r,"__esModule",{value:!0});r1r.Undefined=ZLa;var KLa=Ii(),JLa=vn();function ZLa(t){return(0,KLa.CreateType)({[JLa.Kind]:"Undefined",type:"undefined"},t)}a(ZLa,"Undefined")});var O5e=I(zte=>{"use strict";p();var XLa=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]})),e3a=zte&&zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XLa(e,t,r)};Object.defineProperty(zte,"__esModule",{value:!0});e3a(kRi(),zte)});var DRi=I(n1r=>{"use strict";p();Object.defineProperty(n1r,"__esModule",{value:!0});n1r.Uint8Array=n3a;var t3a=Ii(),r3a=vn();function n3a(t){return(0,t3a.CreateType)({[r3a.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(n3a,"Uint8Array")});var B5e=I(Yte=>{"use strict";p();var i3a=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]})),o3a=Yte&&Yte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&i3a(e,t,r)};Object.defineProperty(Yte,"__esModule",{value:!0});o3a(DRi(),Yte)});var NRi=I(i1r=>{"use strict";p();Object.defineProperty(i1r,"__esModule",{value:!0});i1r.Unknown=c3a;var s3a=Ii(),a3a=vn();function c3a(t){return(0,s3a.CreateType)({[a3a.Kind]:"Unknown"},t)}a(c3a,"Unknown")});var QG=I(Kte=>{"use strict";p();var l3a=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]})),u3a=Kte&&Kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&l3a(e,t,r)};Object.defineProperty(Kte,"__esModule",{value:!0});u3a(NRi(),Kte)});var BRi=I(c1r=>{"use strict";p();Object.defineProperty(c1r,"__esModule",{value:!0});c1r.Const=b3a;var MRi=Rge(),d3a=Bge(),f3a=D5e(),p3a=DG(),o1r=DE(),h3a=N5e(),ORi=yv(),m3a=M5e(),g3a=V8(),s1r=LG(),A3a=O5e(),y3a=B5e(),E3a=QG(),_3a=q8(),Wb=Av();function v3a(t){return t.map(e=>a1r(e,!1))}a(v3a,"FromArray");function C3a(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,s1r.Readonly)(a1r(t[r],!1));return e}a(C3a,"FromProperties");function jgt(t,e){return e===!0?t:(0,s1r.Readonly)(t)}a(jgt,"ConditionalReadonly");function a1r(t,e){return(0,Wb.IsAsyncIterator)(t)||(0,Wb.IsIterator)(t)?jgt((0,MRi.Any)(),e):(0,Wb.IsArray)(t)?(0,s1r.Readonly)((0,g3a.Tuple)(v3a(t))):(0,Wb.IsUint8Array)(t)?(0,y3a.Uint8Array)():(0,Wb.IsDate)(t)?(0,f3a.Date)():(0,Wb.IsObject)(t)?jgt((0,ORi.Object)(C3a(t)),e):(0,Wb.IsFunction)(t)?jgt((0,p3a.Function)([],(0,E3a.Unknown)()),e):(0,Wb.IsUndefined)(t)?(0,A3a.Undefined)():(0,Wb.IsNull)(t)?(0,h3a.Null)():(0,Wb.IsSymbol)(t)?(0,m3a.Symbol)():(0,Wb.IsBigInt)(t)?(0,d3a.BigInt)():(0,Wb.IsNumber)(t)||(0,Wb.IsBoolean)(t)||(0,Wb.IsString)(t)?(0,o1r.Literal)(t):(0,ORi.Object)({})}a(a1r,"FromValue");function b3a(t,e){return(0,_3a.CreateType)(a1r(t,!0),e)}a(b3a,"Const")});var Hgt=I(Jte=>{"use strict";p();var S3a=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]})),T3a=Jte&&Jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&S3a(e,t,r)};Object.defineProperty(Jte,"__esModule",{value:!0});T3a(BRi(),Jte)});var LRi=I(Y8=>{"use strict";p();var I3a=Y8&&Y8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Y8&&Y8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w3a=Y8&&Y8.__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 N3a=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]})),M3a=Zte&&Zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&N3a(e,t,r)};Object.defineProperty(Zte,"__esModule",{value:!0});M3a(LRi(),Zte)});var FRi=I(l1r=>{"use strict";p();Object.defineProperty(l1r,"__esModule",{value:!0});l1r.Enum=U3a;var O3a=DE(),B3a=vn(),L3a=vp(),F3a=Av();function U3a(t,e){if((0,F3a.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,O3a.Literal)(s));return(0,L3a.Union)(o,{...e,[B3a.Hint]:"Enum"})}a(U3a,"Enum")});var $gt=I(Xte=>{"use strict";p();var Q3a=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]})),q3a=Xte&&Xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Q3a(e,t,r)};Object.defineProperty(Xte,"__esModule",{value:!0});q3a(FRi(),Xte)});var A1r=I(ere=>{"use strict";p();Object.defineProperty(ere,"__esModule",{value:!0});ere.ExtendsResult=ere.ExtendsResolverError=void 0;ere.ExtendsCheck=PFa;var URi=Rge(),j3a=DG(),h1r=NG(),d1r=MG(),H3a=QG(),QRi=lD(),Qge=E5e(),$Ri=vn(),G3a=Rf(),tt=MCr(),Vgt=class extends G3a.TypeBoxError{static{a(this,"ExtendsResolverError")}};ere.ExtendsResolverError=Vgt;var Ot;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Ot||(ere.ExtendsResult=Ot={}));function xR(t){return t===Ot.False?t:Ot.True}a(xR,"IntoBooleanResult");function qge(t){throw new Vgt(t)}a(qge,"Throw");function _m(t){return tt.TypeGuard.IsNever(t)||tt.TypeGuard.IsIntersect(t)||tt.TypeGuard.IsUnion(t)||tt.TypeGuard.IsUnknown(t)||tt.TypeGuard.IsAny(t)}a(_m,"IsStructuralRight");function vm(t,e){return tt.TypeGuard.IsNever(e)?zRi(t,e):tt.TypeGuard.IsIntersect(e)?Wgt(t,e):tt.TypeGuard.IsUnion(e)?g1r(t,e):tt.TypeGuard.IsUnknown(e)?ZRi(t,e):tt.TypeGuard.IsAny(e)?m1r(t,e):qge("StructuralRight")}a(vm,"StructuralRight");function m1r(t,e){return Ot.True}a(m1r,"FromAnyRight");function $3a(t,e){return tt.TypeGuard.IsIntersect(e)?Wgt(t,e):tt.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>tt.TypeGuard.IsAny(r)||tt.TypeGuard.IsUnknown(r))?Ot.True:tt.TypeGuard.IsUnion(e)?Ot.Union:tt.TypeGuard.IsUnknown(e)||tt.TypeGuard.IsAny(e)?Ot.True:Ot.Union}a($3a,"FromAny");function V3a(t,e){return tt.TypeGuard.IsUnknown(t)?Ot.False:tt.TypeGuard.IsAny(t)?Ot.Union:tt.TypeGuard.IsNever(t)?Ot.True:Ot.False}a(V3a,"FromArrayRight");function W3a(t,e){return tt.TypeGuard.IsObject(e)&&zgt(e)?Ot.True:_m(e)?vm(t,e):tt.TypeGuard.IsArray(e)?xR(ul(t.items,e.items)):Ot.False}a(W3a,"FromArray");function z3a(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsAsyncIterator(e)?xR(ul(t.items,e.items)):Ot.False}a(z3a,"FromAsyncIterator");function Y3a(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsRecord(e)?wR(t,e):tt.TypeGuard.IsBigInt(e)?Ot.True:Ot.False}a(Y3a,"FromBigInt");function VRi(t,e){return tt.TypeGuard.IsLiteralBoolean(t)||tt.TypeGuard.IsBoolean(t)?Ot.True:Ot.False}a(VRi,"FromBooleanRight");function K3a(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsRecord(e)?wR(t,e):tt.TypeGuard.IsBoolean(e)?Ot.True:Ot.False}a(K3a,"FromBoolean");function J3a(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Ot.False:t.parameters.every((r,n)=>xR(ul(e.parameters[n],r))===Ot.True)?xR(ul(t.returns,e.returns)):Ot.False:Ot.False}a(J3a,"FromConstructor");function Z3a(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsRecord(e)?wR(t,e):tt.TypeGuard.IsDate(e)?Ot.True:Ot.False}a(Z3a,"FromDate");function X3a(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Ot.False:t.parameters.every((r,n)=>xR(ul(e.parameters[n],r))===Ot.True)?xR(ul(t.returns,e.returns)):Ot.False:Ot.False}a(X3a,"FromFunction");function WRi(t,e){return tt.TypeGuard.IsLiteral(t)&&tt.ValueGuard.IsNumber(t.const)||tt.TypeGuard.IsNumber(t)||tt.TypeGuard.IsInteger(t)?Ot.True:Ot.False}a(WRi,"FromIntegerRight");function eFa(t,e){return tt.TypeGuard.IsInteger(e)||tt.TypeGuard.IsNumber(e)?Ot.True:_m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsRecord(e)?wR(t,e):Ot.False}a(eFa,"FromInteger");function Wgt(t,e){return e.allOf.every(r=>ul(t,r)===Ot.True)?Ot.True:Ot.False}a(Wgt,"FromIntersectRight");function tFa(t,e){return t.allOf.some(r=>ul(r,e)===Ot.True)?Ot.True:Ot.False}a(tFa,"FromIntersect");function rFa(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsIterator(e)?xR(ul(t.items,e.items)):Ot.False}a(rFa,"FromIterator");function nFa(t,e){return tt.TypeGuard.IsLiteral(e)&&e.const===t.const?Ot.True:_m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsRecord(e)?wR(t,e):tt.TypeGuard.IsString(e)?JRi(t,e):tt.TypeGuard.IsNumber(e)?YRi(t,e):tt.TypeGuard.IsInteger(e)?WRi(t,e):tt.TypeGuard.IsBoolean(e)?VRi(t,e):Ot.False}a(nFa,"FromLiteral");function zRi(t,e){return Ot.False}a(zRi,"FromNeverRight");function iFa(t,e){return Ot.True}a(iFa,"FromNever");function qRi(t){let[e,r]=[t,0];for(;tt.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,H3a.Unknown)()}a(qRi,"UnwrapTNot");function oFa(t,e){return tt.TypeGuard.IsNot(t)?ul(qRi(t),e):tt.TypeGuard.IsNot(e)?ul(t,qRi(e)):qge("Invalid fallthrough for Not")}a(oFa,"FromNot");function sFa(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsRecord(e)?wR(t,e):tt.TypeGuard.IsNull(e)?Ot.True:Ot.False}a(sFa,"FromNull");function YRi(t,e){return tt.TypeGuard.IsLiteralNumber(t)||tt.TypeGuard.IsNumber(t)||tt.TypeGuard.IsInteger(t)?Ot.True:Ot.False}a(YRi,"FromNumberRight");function aFa(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsRecord(e)?wR(t,e):tt.TypeGuard.IsInteger(e)||tt.TypeGuard.IsNumber(e)?Ot.True:Ot.False}a(aFa,"FromNumber");function zb(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(zb,"IsObjectPropertyCount");function jRi(t){return zgt(t)}a(jRi,"IsObjectStringLike");function HRi(t){return zb(t,0)||zb(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(HRi,"IsObjectSymbolLike");function u1r(t){return zb(t,0)}a(u1r,"IsObjectNumberLike");function GRi(t){return zb(t,0)}a(GRi,"IsObjectBooleanLike");function cFa(t){return zb(t,0)}a(cFa,"IsObjectBigIntLike");function lFa(t){return zb(t,0)}a(lFa,"IsObjectDateLike");function uFa(t){return zgt(t)}a(uFa,"IsObjectUint8ArrayLike");function dFa(t){let e=(0,h1r.Number)();return zb(t,0)||zb(t,1)&&"length"in t.properties&&xR(ul(t.properties.length,e))===Ot.True}a(dFa,"IsObjectFunctionLike");function fFa(t){return zb(t,0)}a(fFa,"IsObjectConstructorLike");function zgt(t){let e=(0,h1r.Number)();return zb(t,0)||zb(t,1)&&"length"in t.properties&&xR(ul(t.properties.length,e))===Ot.True}a(zgt,"IsObjectArrayLike");function pFa(t){let e=(0,j3a.Function)([(0,URi.Any)()],(0,URi.Any)());return zb(t,0)||zb(t,1)&&"then"in t.properties&&xR(ul(t.properties.then,e))===Ot.True}a(pFa,"IsObjectPromiseLike");function KRi(t,e){return ul(t,e)===Ot.False||tt.TypeGuard.IsOptional(t)&&!tt.TypeGuard.IsOptional(e)?Ot.False:Ot.True}a(KRi,"Property");function NE(t,e){return tt.TypeGuard.IsUnknown(t)?Ot.False:tt.TypeGuard.IsAny(t)?Ot.Union:tt.TypeGuard.IsNever(t)||tt.TypeGuard.IsLiteralString(t)&&jRi(e)||tt.TypeGuard.IsLiteralNumber(t)&&u1r(e)||tt.TypeGuard.IsLiteralBoolean(t)&&GRi(e)||tt.TypeGuard.IsSymbol(t)&&HRi(e)||tt.TypeGuard.IsBigInt(t)&&cFa(e)||tt.TypeGuard.IsString(t)&&jRi(e)||tt.TypeGuard.IsSymbol(t)&&HRi(e)||tt.TypeGuard.IsNumber(t)&&u1r(e)||tt.TypeGuard.IsInteger(t)&&u1r(e)||tt.TypeGuard.IsBoolean(t)&&GRi(e)||tt.TypeGuard.IsUint8Array(t)&&uFa(e)||tt.TypeGuard.IsDate(t)&&lFa(e)||tt.TypeGuard.IsConstructor(t)&&fFa(e)||tt.TypeGuard.IsFunction(t)&&dFa(e)?Ot.True:tt.TypeGuard.IsRecord(t)&&tt.TypeGuard.IsString(f1r(t))?e[$Ri.Hint]==="Record"?Ot.True:Ot.False:tt.TypeGuard.IsRecord(t)&&tt.TypeGuard.IsNumber(f1r(t))&&zb(e,0)?Ot.True:Ot.False}a(NE,"FromObjectRight");function hFa(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsRecord(e)?wR(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 Ot.False;if(tt.TypeGuard.IsOptional(e.properties[r]))return Ot.True;if(KRi(t.properties[r],e.properties[r])===Ot.False)return Ot.False}return Ot.True})():Ot.False}a(hFa,"FromObject");function mFa(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)&&pFa(e)?Ot.True:tt.TypeGuard.IsPromise(e)?xR(ul(t.item,e.item)):Ot.False}a(mFa,"FromPromise");function f1r(t){return Qge.PatternNumberExact in t.patternProperties?(0,h1r.Number)():Qge.PatternStringExact in t.patternProperties?(0,d1r.String)():qge("Unknown record key pattern")}a(f1r,"RecordKey");function p1r(t){return Qge.PatternNumberExact in t.patternProperties?t.patternProperties[Qge.PatternNumberExact]:Qge.PatternStringExact in t.patternProperties?t.patternProperties[Qge.PatternStringExact]:qge("Unable to get record value schema")}a(p1r,"RecordValue");function wR(t,e){let[r,n]=[f1r(e),p1r(e)];return tt.TypeGuard.IsLiteralString(t)&&tt.TypeGuard.IsNumber(r)&&xR(ul(t,n))===Ot.True?Ot.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)?ul(t,n):tt.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(KRi(n,t.properties[o])===Ot.False)return Ot.False;return Ot.True})():Ot.False}a(wR,"FromRecordRight");function gFa(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsRecord(e)?ul(p1r(t),p1r(e)):Ot.False}a(gFa,"FromRecord");function AFa(t,e){let r=tt.TypeGuard.IsRegExp(t)?(0,d1r.String)():t,n=tt.TypeGuard.IsRegExp(e)?(0,d1r.String)():e;return ul(r,n)}a(AFa,"FromRegExp");function JRi(t,e){return tt.TypeGuard.IsLiteral(t)&&tt.ValueGuard.IsString(t.const)||tt.TypeGuard.IsString(t)?Ot.True:Ot.False}a(JRi,"FromStringRight");function yFa(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsRecord(e)?wR(t,e):tt.TypeGuard.IsString(e)?Ot.True:Ot.False}a(yFa,"FromString");function EFa(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsRecord(e)?wR(t,e):tt.TypeGuard.IsSymbol(e)?Ot.True:Ot.False}a(EFa,"FromSymbol");function _Fa(t,e){return tt.TypeGuard.IsTemplateLiteral(t)?ul((0,QRi.TemplateLiteralToUnion)(t),e):tt.TypeGuard.IsTemplateLiteral(e)?ul(t,(0,QRi.TemplateLiteralToUnion)(e)):qge("Invalid fallthrough for TemplateLiteral")}a(_Fa,"FromTemplateLiteral");function vFa(t,e){return tt.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>ul(r,e.items)===Ot.True)}a(vFa,"IsArrayOfTuple");function CFa(t,e){return tt.TypeGuard.IsNever(t)?Ot.True:tt.TypeGuard.IsUnknown(t)?Ot.False:tt.TypeGuard.IsAny(t)?Ot.Union:Ot.False}a(CFa,"FromTupleRight");function bFa(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)&&zgt(e)||tt.TypeGuard.IsArray(e)&&vFa(t,e)?Ot.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)?Ot.False:tt.ValueGuard.IsUndefined(t.items)&&!tt.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>ul(r,e.items[n])===Ot.True)?Ot.True:Ot.False:Ot.False}a(bFa,"FromTuple");function SFa(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsRecord(e)?wR(t,e):tt.TypeGuard.IsUint8Array(e)?Ot.True:Ot.False}a(SFa,"FromUint8Array");function TFa(t,e){return _m(e)?vm(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsRecord(e)?wR(t,e):tt.TypeGuard.IsVoid(e)?wFa(t,e):tt.TypeGuard.IsUndefined(e)?Ot.True:Ot.False}a(TFa,"FromUndefined");function g1r(t,e){return e.anyOf.some(r=>ul(t,r)===Ot.True)?Ot.True:Ot.False}a(g1r,"FromUnionRight");function IFa(t,e){return t.anyOf.every(r=>ul(r,e)===Ot.True)?Ot.True:Ot.False}a(IFa,"FromUnion");function ZRi(t,e){return Ot.True}a(ZRi,"FromUnknownRight");function xFa(t,e){return tt.TypeGuard.IsNever(e)?zRi(t,e):tt.TypeGuard.IsIntersect(e)?Wgt(t,e):tt.TypeGuard.IsUnion(e)?g1r(t,e):tt.TypeGuard.IsAny(e)?m1r(t,e):tt.TypeGuard.IsString(e)?JRi(t,e):tt.TypeGuard.IsNumber(e)?YRi(t,e):tt.TypeGuard.IsInteger(e)?WRi(t,e):tt.TypeGuard.IsBoolean(e)?VRi(t,e):tt.TypeGuard.IsArray(e)?V3a(t,e):tt.TypeGuard.IsTuple(e)?CFa(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsUnknown(e)?Ot.True:Ot.False}a(xFa,"FromUnknown");function wFa(t,e){return tt.TypeGuard.IsUndefined(t)||tt.TypeGuard.IsUndefined(t)?Ot.True:Ot.False}a(wFa,"FromVoidRight");function RFa(t,e){return tt.TypeGuard.IsIntersect(e)?Wgt(t,e):tt.TypeGuard.IsUnion(e)?g1r(t,e):tt.TypeGuard.IsUnknown(e)?ZRi(t,e):tt.TypeGuard.IsAny(e)?m1r(t,e):tt.TypeGuard.IsObject(e)?NE(t,e):tt.TypeGuard.IsVoid(e)?Ot.True:Ot.False}a(RFa,"FromVoid");function ul(t,e){return tt.TypeGuard.IsTemplateLiteral(t)||tt.TypeGuard.IsTemplateLiteral(e)?_Fa(t,e):tt.TypeGuard.IsRegExp(t)||tt.TypeGuard.IsRegExp(e)?AFa(t,e):tt.TypeGuard.IsNot(t)||tt.TypeGuard.IsNot(e)?oFa(t,e):tt.TypeGuard.IsAny(t)?$3a(t,e):tt.TypeGuard.IsArray(t)?W3a(t,e):tt.TypeGuard.IsBigInt(t)?Y3a(t,e):tt.TypeGuard.IsBoolean(t)?K3a(t,e):tt.TypeGuard.IsAsyncIterator(t)?z3a(t,e):tt.TypeGuard.IsConstructor(t)?J3a(t,e):tt.TypeGuard.IsDate(t)?Z3a(t,e):tt.TypeGuard.IsFunction(t)?X3a(t,e):tt.TypeGuard.IsInteger(t)?eFa(t,e):tt.TypeGuard.IsIntersect(t)?tFa(t,e):tt.TypeGuard.IsIterator(t)?rFa(t,e):tt.TypeGuard.IsLiteral(t)?nFa(t,e):tt.TypeGuard.IsNever(t)?iFa(t,e):tt.TypeGuard.IsNull(t)?sFa(t,e):tt.TypeGuard.IsNumber(t)?aFa(t,e):tt.TypeGuard.IsObject(t)?hFa(t,e):tt.TypeGuard.IsRecord(t)?gFa(t,e):tt.TypeGuard.IsString(t)?yFa(t,e):tt.TypeGuard.IsSymbol(t)?EFa(t,e):tt.TypeGuard.IsTuple(t)?bFa(t,e):tt.TypeGuard.IsPromise(t)?mFa(t,e):tt.TypeGuard.IsUint8Array(t)?SFa(t,e):tt.TypeGuard.IsUndefined(t)?TFa(t,e):tt.TypeGuard.IsUnion(t)?IFa(t,e):tt.TypeGuard.IsUnknown(t)?xFa(t,e):tt.TypeGuard.IsVoid(t)?RFa(t,e):qge(`Unknown left type operand '${t[$Ri.Kind]}'`)}a(ul,"Visit");function PFa(t,e){return ul(t,e)}a(PFa,"ExtendsCheck")});var E1r=I(y1r=>{"use strict";p();Object.defineProperty(y1r,"__esModule",{value:!0});y1r.ExtendsFromMappedResult=BFa;var kFa=Em(),DFa=Ygt(),NFa=Hb();function MFa(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,DFa.Extends)(t[c],e,r,n,(0,NFa.Clone)(o));return s}a(MFa,"FromProperties");function OFa(t,e,r,n,o){return MFa(t.properties,e,r,n,o)}a(OFa,"FromMappedResult");function BFa(t,e,r,n,o){let s=OFa(t,e,r,n,o);return(0,kFa.MappedResult)(s)}a(BFa,"ExtendsFromMappedResult")});var Ygt=I(v1r=>{"use strict";p();Object.defineProperty(v1r,"__esModule",{value:!0});v1r.Extends=qFa;var XRi=Ii(),LFa=vp(),_1r=A1r(),FFa=C1r(),UFa=E1r(),ePi=As();function QFa(t,e,r,n){let o=(0,_1r.ExtendsCheck)(t,e);return o===_1r.ExtendsResult.Union?(0,LFa.Union)([r,n]):o===_1r.ExtendsResult.True?r:n}a(QFa,"ExtendsResolve");function qFa(t,e,r,n,o){return(0,ePi.IsMappedResult)(t)?(0,UFa.ExtendsFromMappedResult)(t,e,r,n,o):(0,ePi.IsMappedKey)(t)?(0,XRi.CreateType)((0,FFa.ExtendsFromMappedKey)(t,e,r,n,o)):(0,XRi.CreateType)(QFa(t,e,r,n),o)}a(qFa,"Extends")});var C1r=I(b1r=>{"use strict";p();Object.defineProperty(b1r,"__esModule",{value:!0});b1r.ExtendsFromMappedKey=YFa;var jFa=Em(),HFa=DE(),GFa=Ygt(),$Fa=Hb();function VFa(t,e,r,n,o){return{[t]:(0,GFa.Extends)((0,HFa.Literal)(t),e,r,n,(0,$Fa.Clone)(o))}}a(VFa,"FromPropertyKey");function WFa(t,e,r,n,o){return t.reduce((s,c)=>({...s,...VFa(c,e,r,n,o)}),{})}a(WFa,"FromPropertyKeys");function zFa(t,e,r,n,o){return WFa(t.keys,e,r,n,o)}a(zFa,"FromMappedKey");function YFa(t,e,r,n,o){let s=zFa(t,e,r,n,o);return(0,jFa.MappedResult)(s)}a(YFa,"ExtendsFromMappedKey")});var T1r=I(S1r=>{"use strict";p();Object.defineProperty(S1r,"__esModule",{value:!0});S1r.ExtendsUndefinedCheck=Jgt;var Kgt=vn();function KFa(t){return t.allOf.every(e=>Jgt(e))}a(KFa,"Intersect");function JFa(t){return t.anyOf.some(e=>Jgt(e))}a(JFa,"Union");function ZFa(t){return!Jgt(t.not)}a(ZFa,"Not");function Jgt(t){return t[Kgt.Kind]==="Intersect"?KFa(t):t[Kgt.Kind]==="Union"?JFa(t):t[Kgt.Kind]==="Not"?ZFa(t):t[Kgt.Kind]==="Undefined"}a(Jgt,"ExtendsUndefinedCheck")});var tre=I(fD=>{"use strict";p();var XFa=fD&&fD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L5e=fD&&fD.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XFa(e,t,r)};Object.defineProperty(fD,"__esModule",{value:!0});L5e(A1r(),fD);L5e(C1r(),fD);L5e(E1r(),fD);L5e(T1r(),fD);L5e(Ygt(),fD)});var x1r=I(I1r=>{"use strict";p();Object.defineProperty(I1r,"__esModule",{value:!0});I1r.ExcludeFromTemplateLiteral=r8a;var e8a=Zgt(),t8a=lD();function r8a(t,e){return(0,e8a.Exclude)((0,t8a.TemplateLiteralToUnion)(t),e)}a(r8a,"ExcludeFromTemplateLiteral")});var Zgt=I(P1r=>{"use strict";p();Object.defineProperty(P1r,"__esModule",{value:!0});P1r.Exclude=c8a;var w1r=Ii(),n8a=vp(),i8a=ym(),Xgt=tre(),o8a=k1r(),s8a=x1r(),R1r=As();function a8a(t,e){let r=t.filter(n=>(0,Xgt.ExtendsCheck)(n,e)===Xgt.ExtendsResult.False);return r.length===1?r[0]:(0,n8a.Union)(r)}a(a8a,"ExcludeRest");function c8a(t,e,r={}){return(0,R1r.IsTemplateLiteral)(t)?(0,w1r.CreateType)((0,s8a.ExcludeFromTemplateLiteral)(t,e),r):(0,R1r.IsMappedResult)(t)?(0,w1r.CreateType)((0,o8a.ExcludeFromMappedResult)(t,e),r):(0,w1r.CreateType)((0,R1r.IsUnion)(t)?a8a(t.anyOf,e):(0,Xgt.ExtendsCheck)(t,e)!==Xgt.ExtendsResult.False?(0,i8a.Never)():t,r)}a(c8a,"Exclude")});var k1r=I(D1r=>{"use strict";p();Object.defineProperty(D1r,"__esModule",{value:!0});D1r.ExcludeFromMappedResult=p8a;var l8a=Em(),u8a=Zgt();function d8a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,u8a.Exclude)(t[n],e);return r}a(d8a,"FromProperties");function f8a(t,e){return d8a(t.properties,e)}a(f8a,"FromMappedResult");function p8a(t,e){let r=f8a(t,e);return(0,l8a.MappedResult)(r)}a(p8a,"ExcludeFromMappedResult")});var eAt=I(K8=>{"use strict";p();var h8a=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]})),N1r=K8&&K8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&h8a(e,t,r)};Object.defineProperty(K8,"__esModule",{value:!0});N1r(k1r(),K8);N1r(x1r(),K8);N1r(Zgt(),K8)});var O1r=I(M1r=>{"use strict";p();Object.defineProperty(M1r,"__esModule",{value:!0});M1r.ExtractFromTemplateLiteral=A8a;var m8a=tAt(),g8a=lD();function A8a(t,e){return(0,m8a.Extract)((0,g8a.TemplateLiteralToUnion)(t),e)}a(A8a,"ExtractFromTemplateLiteral")});var tAt=I(F1r=>{"use strict";p();Object.defineProperty(F1r,"__esModule",{value:!0});F1r.Extract=b8a;var B1r=Ii(),y8a=vp(),E8a=ym(),rAt=tre(),_8a=U1r(),v8a=O1r(),L1r=As();function C8a(t,e){let r=t.filter(n=>(0,rAt.ExtendsCheck)(n,e)!==rAt.ExtendsResult.False);return r.length===1?r[0]:(0,y8a.Union)(r)}a(C8a,"ExtractRest");function b8a(t,e,r){return(0,L1r.IsTemplateLiteral)(t)?(0,B1r.CreateType)((0,v8a.ExtractFromTemplateLiteral)(t,e),r):(0,L1r.IsMappedResult)(t)?(0,B1r.CreateType)((0,_8a.ExtractFromMappedResult)(t,e),r):(0,B1r.CreateType)((0,L1r.IsUnion)(t)?C8a(t.anyOf,e):(0,rAt.ExtendsCheck)(t,e)!==rAt.ExtendsResult.False?t:(0,E8a.Never)(),r)}a(b8a,"Extract")});var U1r=I(Q1r=>{"use strict";p();Object.defineProperty(Q1r,"__esModule",{value:!0});Q1r.ExtractFromMappedResult=w8a;var S8a=Em(),T8a=tAt();function I8a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,T8a.Extract)(t[n],e);return r}a(I8a,"FromProperties");function x8a(t,e){return I8a(t.properties,e)}a(x8a,"FromMappedResult");function w8a(t,e){let r=x8a(t,e);return(0,S8a.MappedResult)(r)}a(w8a,"ExtractFromMappedResult")});var nAt=I(J8=>{"use strict";p();var R8a=J8&&J8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),q1r=J8&&J8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&R8a(e,t,r)};Object.defineProperty(J8,"__esModule",{value:!0});q1r(U1r(),J8);q1r(O1r(),J8);q1r(tAt(),J8)});var tPi=I(Z8=>{"use strict";p();var P8a=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]})),k8a=Z8&&Z8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),D8a=Z8&&Z8.__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 L8a=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]})),F8a=rre&&rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&L8a(e,t,r)};Object.defineProperty(rre,"__esModule",{value:!0});F8a(tPi(),rre)});var rPi=I(j1r=>{"use strict";p();Object.defineProperty(j1r,"__esModule",{value:!0});j1r.ReadonlyOptional=q8a;var U8a=LG(),Q8a=B4();function q8a(t){return(0,U8a.Readonly)((0,Q8a.Optional)(t))}a(q8a,"ReadonlyOptional")});var F5e=I(nre=>{"use strict";p();var j8a=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]})),H8a=nre&&nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j8a(e,t,r)};Object.defineProperty(nre,"__esModule",{value:!0});H8a(rPi(),nre)});var aPi=I(jge=>{"use strict";p();Object.defineProperty(jge,"__esModule",{value:!0});jge.Record=s6a;jge.RecordPattern=G1r;jge.RecordKey=a6a;jge.RecordValue=c6a;var G8a=Ii(),iPi=vn(),$8a=ym(),V8a=NG(),oPi=yv(),nPi=MG(),W8a=vp(),z8a=lD(),ire=E5e(),sPi=uD(),Y8a=Av(),U4=As();function ore(t,e,r){return(0,G8a.CreateType)({[iPi.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(ore,"RecordCreateFromPattern");function H1r(t,e,r){let n={};for(let o of t)n[o]=e;return(0,oPi.Object)(n,{...r,[iPi.Hint]:"Record"})}a(H1r,"RecordCreateFromKeys");function K8a(t,e,r){return(0,z8a.IsTemplateLiteralFinite)(t)?H1r((0,sPi.IndexPropertyKeys)(t),e,r):ore(t.pattern,e,r)}a(K8a,"FromTemplateLiteralKey");function J8a(t,e,r){return H1r((0,sPi.IndexPropertyKeys)((0,W8a.Union)(t)),e,r)}a(J8a,"FromUnionKey");function Z8a(t,e,r){return H1r([t.toString()],e,r)}a(Z8a,"FromLiteralKey");function X8a(t,e,r){return ore(t.source,e,r)}a(X8a,"FromRegExpKey");function e6a(t,e,r){let n=(0,Y8a.IsUndefined)(t.pattern)?ire.PatternStringExact:t.pattern;return ore(n,e,r)}a(e6a,"FromStringKey");function t6a(t,e,r){return ore(ire.PatternStringExact,e,r)}a(t6a,"FromAnyKey");function r6a(t,e,r){return ore(ire.PatternNeverExact,e,r)}a(r6a,"FromNeverKey");function n6a(t,e,r){return(0,oPi.Object)({true:e,false:e},r)}a(n6a,"FromBooleanKey");function i6a(t,e,r){return ore(ire.PatternNumberExact,e,r)}a(i6a,"FromIntegerKey");function o6a(t,e,r){return ore(ire.PatternNumberExact,e,r)}a(o6a,"FromNumberKey");function s6a(t,e,r={}){return(0,U4.IsUnion)(t)?J8a(t.anyOf,e,r):(0,U4.IsTemplateLiteral)(t)?K8a(t,e,r):(0,U4.IsLiteral)(t)?Z8a(t.const,e,r):(0,U4.IsBoolean)(t)?n6a(t,e,r):(0,U4.IsInteger)(t)?i6a(t,e,r):(0,U4.IsNumber)(t)?o6a(t,e,r):(0,U4.IsRegExp)(t)?X8a(t,e,r):(0,U4.IsString)(t)?e6a(t,e,r):(0,U4.IsAny)(t)?t6a(t,e,r):(0,U4.IsNever)(t)?r6a(t,e,r):(0,$8a.Never)(r)}a(s6a,"Record");function G1r(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(G1r,"RecordPattern");function a6a(t){let e=G1r(t);return e===ire.PatternStringExact?(0,nPi.String)():e===ire.PatternNumberExact?(0,V8a.Number)():(0,nPi.String)({pattern:e})}a(a6a,"RecordKey");function c6a(t){return t.patternProperties[G1r(t)]}a(c6a,"RecordValue")});var Hge=I(sre=>{"use strict";p();var l6a=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]})),u6a=sre&&sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&l6a(e,t,r)};Object.defineProperty(sre,"__esModule",{value:!0});u6a(aPi(),sre)});var lPi=I(Q4=>{"use strict";p();var d6a=Q4&&Q4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),f6a=Q4&&Q4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cPi=Q4&&Q4.__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]:D6a(t,e[n])}),{})}a(N6a,"FromProperties");function Gge(t,e){return e.map(r=>pD(t,r))}a(Gge,"FromTypes");function pD(t,e){return Yb.IsConstructor(e)?_6a(t,e):Yb.IsFunction(e)?v6a(t,e):Yb.IsIntersect(e)?C6a(t,e):Yb.IsUnion(e)?b6a(t,e):Yb.IsTuple(e)?S6a(t,e):Yb.IsArray(e)?T6a(t,e):Yb.IsAsyncIterator(e)?I6a(t,e):Yb.IsIterator(e)?x6a(t,e):Yb.IsPromise(e)?w6a(t,e):Yb.IsObject(e)?R6a(t,e):Yb.IsRecord(e)?P6a(t,e):Yb.IsArgument(e)?k6a(t,e):e}a(pD,"FromType");function M6a(t,e){return pD(e,(0,p6a.CloneType)(t))}a(M6a,"Instantiate")});var oAt=I(are=>{"use strict";p();var O6a=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]})),B6a=are&&are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&O6a(e,t,r)};Object.defineProperty(are,"__esModule",{value:!0});B6a(lPi(),are)});var uPi=I(V1r=>{"use strict";p();Object.defineProperty(V1r,"__esModule",{value:!0});V1r.Integer=U6a;var L6a=Ii(),F6a=vn();function U6a(t){return(0,L6a.CreateType)({[F6a.Kind]:"Integer",type:"integer"},t)}a(U6a,"Integer")});var sAt=I(cre=>{"use strict";p();var Q6a=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]})),q6a=cre&&cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Q6a(e,t,r)};Object.defineProperty(cre,"__esModule",{value:!0});q6a(uPi(),cre)});var z1r=I(W1r=>{"use strict";p();Object.defineProperty(W1r,"__esModule",{value:!0});W1r.IntrinsicFromMappedKey=Y6a;var j6a=Em(),H6a=lre(),G6a=DE(),$6a=Hb();function V6a(t,e,r){return{[t]:(0,H6a.Intrinsic)((0,G6a.Literal)(t),e,(0,$6a.Clone)(r))}}a(V6a,"MappedIntrinsicPropertyKey");function W6a(t,e,r){return t.reduce((o,s)=>({...o,...V6a(s,e,r)}),{})}a(W6a,"MappedIntrinsicPropertyKeys");function z6a(t,e,r){return W6a(t.keys,e,r)}a(z6a,"MappedIntrinsicProperties");function Y6a(t,e,r){let n=z6a(t,e,r);return(0,j6a.MappedResult)(n)}a(Y6a,"IntrinsicFromMappedKey")});var lre=I(Y1r=>{"use strict";p();Object.defineProperty(Y1r,"__esModule",{value:!0});Y1r.Intrinsic=mPi;var K6a=Ii(),aAt=lD(),J6a=z1r(),dPi=DE(),fPi=vp(),cAt=As();function Z6a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(Z6a,"ApplyUncapitalize");function X6a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(X6a,"ApplyCapitalize");function e9a(t){return t.toUpperCase()}a(e9a,"ApplyUppercase");function t9a(t){return t.toLowerCase()}a(t9a,"ApplyLowercase");function r9a(t,e,r){let n=(0,aAt.TemplateLiteralParseExact)(t.pattern);if(!(0,aAt.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:pPi(t.pattern,e)};let c=[...(0,aAt.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,dPi.Literal)(d)),l=hPi(c,e),u=(0,fPi.Union)(l);return(0,aAt.TemplateLiteral)([u],r)}a(r9a,"FromTemplateLiteral");function pPi(t,e){return typeof t=="string"?e==="Uncapitalize"?Z6a(t):e==="Capitalize"?X6a(t):e==="Uppercase"?e9a(t):e==="Lowercase"?t9a(t):t:t.toString()}a(pPi,"FromLiteralValue");function hPi(t,e){return t.map(r=>mPi(r,e))}a(hPi,"FromRest");function mPi(t,e,r={}){return(0,cAt.IsMappedKey)(t)?(0,J6a.IntrinsicFromMappedKey)(t,e,r):(0,cAt.IsTemplateLiteral)(t)?r9a(t,e,r):(0,cAt.IsUnion)(t)?(0,fPi.Union)(hPi(t.anyOf,e),r):(0,cAt.IsLiteral)(t)?(0,dPi.Literal)(pPi(t.const,e),r):(0,K6a.CreateType)(t,r)}a(mPi,"Intrinsic")});var gPi=I(K1r=>{"use strict";p();Object.defineProperty(K1r,"__esModule",{value:!0});K1r.Capitalize=i9a;var n9a=lre();function i9a(t,e={}){return(0,n9a.Intrinsic)(t,"Capitalize",e)}a(i9a,"Capitalize")});var APi=I(J1r=>{"use strict";p();Object.defineProperty(J1r,"__esModule",{value:!0});J1r.Lowercase=s9a;var o9a=lre();function s9a(t,e={}){return(0,o9a.Intrinsic)(t,"Lowercase",e)}a(s9a,"Lowercase")});var yPi=I(Z1r=>{"use strict";p();Object.defineProperty(Z1r,"__esModule",{value:!0});Z1r.Uncapitalize=c9a;var a9a=lre();function c9a(t,e={}){return(0,a9a.Intrinsic)(t,"Uncapitalize",e)}a(c9a,"Uncapitalize")});var EPi=I(X1r=>{"use strict";p();Object.defineProperty(X1r,"__esModule",{value:!0});X1r.Uppercase=u9a;var l9a=lre();function u9a(t,e={}){return(0,l9a.Intrinsic)(t,"Uppercase",e)}a(u9a,"Uppercase")});var lAt=I(RR=>{"use strict";p();var d9a=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]})),$ge=RR&&RR.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&d9a(e,t,r)};Object.defineProperty(RR,"__esModule",{value:!0});$ge(gPi(),RR);$ge(z1r(),RR);$ge(lre(),RR);$ge(APi(),RR);$ge(yPi(),RR);$ge(EPi(),RR)});var tSr=I(eSr=>{"use strict";p();Object.defineProperty(eSr,"__esModule",{value:!0});eSr.OmitFromMappedResult=A9a;var f9a=Em(),p9a=uAt(),h9a=Hb();function m9a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,p9a.Omit)(t[o],e,(0,h9a.Clone)(r));return n}a(m9a,"FromProperties");function g9a(t,e,r){return m9a(t.properties,e,r)}a(g9a,"FromMappedResult");function A9a(t,e,r){let n=g9a(t,e,r);return(0,f9a.MappedResult)(n)}a(A9a,"OmitFromMappedResult")});var uAt=I(iSr=>{"use strict";p();Object.defineProperty(iSr,"__esModule",{value:!0});iSr.Omit=N9a;var y9a=Ii(),E9a=Sgt(),_9a=m5e(),rSr=kG(),v9a=DE(),C9a=uD(),b9a=WT(),_Pi=vp(),vPi=yv(),S9a=oSr(),T9a=tSr(),X8=As(),I9a=Av();function x9a(t,e){return t.map(r=>nSr(r,e))}a(x9a,"FromIntersect");function w9a(t,e){return t.map(r=>nSr(r,e))}a(w9a,"FromUnion");function R9a(t,e){let{[e]:r,...n}=t;return n}a(R9a,"FromProperty");function P9a(t,e){return e.reduce((r,n)=>R9a(r,n),t)}a(P9a,"FromProperties");function k9a(t,e,r){let n=(0,E9a.Discard)(t,[_9a.TransformKind,"$id","required","properties"]),o=P9a(r,e);return(0,vPi.Object)(o,n)}a(k9a,"FromObject");function D9a(t){let e=t.reduce((r,n)=>(0,X8.IsLiteralValue)(n)?[...r,(0,v9a.Literal)(n)]:r,[]);return(0,_Pi.Union)(e)}a(D9a,"UnionFromPropertyKeys");function nSr(t,e){return(0,X8.IsIntersect)(t)?(0,b9a.Intersect)(x9a(t.allOf,e)):(0,X8.IsUnion)(t)?(0,_Pi.Union)(w9a(t.anyOf,e)):(0,X8.IsObject)(t)?k9a(t,e,t.properties):(0,vPi.Object)({})}a(nSr,"OmitResolve");function N9a(t,e,r){let n=(0,I9a.IsArray)(e)?D9a(e):e,o=(0,X8.IsSchema)(e)?(0,C9a.IndexPropertyKeys)(e):e,s=(0,X8.IsRef)(t),c=(0,X8.IsRef)(e);return(0,X8.IsMappedResult)(t)?(0,T9a.OmitFromMappedResult)(t,o,r):(0,X8.IsMappedKey)(e)?(0,S9a.OmitFromMappedKey)(t,e,r):s&&c?(0,rSr.Computed)("Omit",[t,n],r):!s&&c?(0,rSr.Computed)("Omit",[t,n],r):s&&!c?(0,rSr.Computed)("Omit",[t,n],r):(0,y9a.CreateType)({...nSr(t,o),...r})}a(N9a,"Omit")});var oSr=I(sSr=>{"use strict";p();Object.defineProperty(sSr,"__esModule",{value:!0});sSr.OmitFromMappedKey=Q9a;var M9a=Em(),O9a=uAt(),B9a=Hb();function L9a(t,e,r){return{[e]:(0,O9a.Omit)(t,[e],(0,B9a.Clone)(r))}}a(L9a,"FromPropertyKey");function F9a(t,e,r){return e.reduce((n,o)=>({...n,...L9a(t,o,r)}),{})}a(F9a,"FromPropertyKeys");function U9a(t,e,r){return F9a(t,e.keys,r)}a(U9a,"FromMappedKey");function Q9a(t,e,r){let n=U9a(t,e,r);return(0,M9a.MappedResult)(n)}a(Q9a,"OmitFromMappedKey")});var U5e=I(e6=>{"use strict";p();var q9a=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]})),aSr=e6&&e6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&q9a(e,t,r)};Object.defineProperty(e6,"__esModule",{value:!0});aSr(oSr(),e6);aSr(tSr(),e6);aSr(uAt(),e6)});var lSr=I(cSr=>{"use strict";p();Object.defineProperty(cSr,"__esModule",{value:!0});cSr.PickFromMappedResult=W9a;var j9a=Em(),H9a=dAt(),G9a=Hb();function $9a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,H9a.Pick)(t[o],e,(0,G9a.Clone)(r));return n}a($9a,"FromProperties");function V9a(t,e,r){return $9a(t.properties,e,r)}a(V9a,"FromMappedResult");function W9a(t,e,r){let n=V9a(t,e,r);return(0,j9a.MappedResult)(n)}a(W9a,"PickFromMappedResult")});var dAt=I(fSr=>{"use strict";p();Object.defineProperty(fSr,"__esModule",{value:!0});fSr.Pick=cUa;var z9a=Ii(),Y9a=Sgt(),uSr=kG(),K9a=WT(),J9a=DE(),CPi=yv(),bPi=vp(),Z9a=uD(),X9a=m5e(),t6=As(),eUa=Av(),tUa=pSr(),rUa=lSr();function nUa(t,e){return t.map(r=>dSr(r,e))}a(nUa,"FromIntersect");function iUa(t,e){return t.map(r=>dSr(r,e))}a(iUa,"FromUnion");function oUa(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(oUa,"FromProperties");function sUa(t,e,r){let n=(0,Y9a.Discard)(t,[X9a.TransformKind,"$id","required","properties"]),o=oUa(r,e);return(0,CPi.Object)(o,n)}a(sUa,"FromObject");function aUa(t){let e=t.reduce((r,n)=>(0,t6.IsLiteralValue)(n)?[...r,(0,J9a.Literal)(n)]:r,[]);return(0,bPi.Union)(e)}a(aUa,"UnionFromPropertyKeys");function dSr(t,e){return(0,t6.IsIntersect)(t)?(0,K9a.Intersect)(nUa(t.allOf,e)):(0,t6.IsUnion)(t)?(0,bPi.Union)(iUa(t.anyOf,e)):(0,t6.IsObject)(t)?sUa(t,e,t.properties):(0,CPi.Object)({})}a(dSr,"PickResolve");function cUa(t,e,r){let n=(0,eUa.IsArray)(e)?aUa(e):e,o=(0,t6.IsSchema)(e)?(0,Z9a.IndexPropertyKeys)(e):e,s=(0,t6.IsRef)(t),c=(0,t6.IsRef)(e);return(0,t6.IsMappedResult)(t)?(0,rUa.PickFromMappedResult)(t,o,r):(0,t6.IsMappedKey)(e)?(0,tUa.PickFromMappedKey)(t,e,r):s&&c?(0,uSr.Computed)("Pick",[t,n],r):!s&&c?(0,uSr.Computed)("Pick",[t,n],r):s&&!c?(0,uSr.Computed)("Pick",[t,n],r):(0,z9a.CreateType)({...dSr(t,o),...r})}a(cUa,"Pick")});var pSr=I(hSr=>{"use strict";p();Object.defineProperty(hSr,"__esModule",{value:!0});hSr.PickFromMappedKey=mUa;var lUa=Em(),uUa=dAt(),dUa=Hb();function fUa(t,e,r){return{[e]:(0,uUa.Pick)(t,[e],(0,dUa.Clone)(r))}}a(fUa,"FromPropertyKey");function pUa(t,e,r){return e.reduce((n,o)=>({...n,...fUa(t,o,r)}),{})}a(pUa,"FromPropertyKeys");function hUa(t,e,r){return pUa(t,e.keys,r)}a(hUa,"FromMappedKey");function mUa(t,e,r){let n=hUa(t,e,r);return(0,lUa.MappedResult)(n)}a(mUa,"PickFromMappedKey")});var Q5e=I(r6=>{"use strict";p();var gUa=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]})),mSr=r6&&r6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gUa(e,t,r)};Object.defineProperty(r6,"__esModule",{value:!0});mSr(pSr(),r6);mSr(lSr(),r6);mSr(dAt(),r6)});var ASr=I(n6=>{"use strict";p();var AUa=n6&&n6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=n6&&n6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),EUa=n6&&n6.__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;oIPi(e))}a(SPi,"FromRest");function IPi(t){return _v.IsComputed(t)?wUa(t.target,t.parameters):_v.IsRef(t)?RUa(t.$ref):_v.IsIntersect(t)?(0,CUa.Intersect)(SPi(t.allOf)):_v.IsUnion(t)?(0,bUa.Union)(SPi(t.anyOf)):_v.IsObject(t)?kUa(t,t.properties):_v.IsBigInt(t)||_v.IsBoolean(t)||_v.IsInteger(t)||_v.IsLiteral(t)||_v.IsNull(t)||_v.IsNumber(t)||_v.IsString(t)||_v.IsSymbol(t)||_v.IsUndefined(t)?t:(0,TPi.Object)({})}a(IPi,"PartialResolve");function DUa(t,e){return _v.IsMappedResult(t)?(0,xUa.PartialFromMappedResult)(t,e):(0,_Ua.CreateType)({...IPi(t),...e})}a(DUa,"Partial")});var ySr=I(ESr=>{"use strict";p();Object.defineProperty(ESr,"__esModule",{value:!0});ESr.PartialFromMappedResult=FUa;var NUa=Em(),MUa=ASr(),OUa=Hb();function BUa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,MUa.Partial)(t[n],(0,OUa.Clone)(e));return r}a(BUa,"FromProperties");function LUa(t,e){return BUa(t.properties,e)}a(LUa,"FromMappedResult");function FUa(t,e){let r=LUa(t,e);return(0,NUa.MappedResult)(r)}a(FUa,"PartialFromMappedResult")});var q5e=I(qG=>{"use strict";p();var UUa=qG&&qG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xPi=qG&&qG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UUa(e,t,r)};Object.defineProperty(qG,"__esModule",{value:!0});xPi(ySr(),qG);xPi(ASr(),qG)});var vSr=I(i6=>{"use strict";p();var QUa=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]})),qUa=i6&&i6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jUa=i6&&i6.__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;oDPi(e))}a(wPi,"FromRest");function DPi(t){return vv.IsComputed(t)?zUa(t.target,t.parameters):vv.IsRef(t)?YUa(t.$ref):vv.IsIntersect(t)?(0,GUa.Intersect)(wPi(t.allOf)):vv.IsUnion(t)?(0,$Ua.Union)(wPi(t.anyOf)):vv.IsObject(t)?JUa(t,t.properties):vv.IsBigInt(t)||vv.IsBoolean(t)||vv.IsInteger(t)||vv.IsLiteral(t)||vv.IsNull(t)||vv.IsNumber(t)||vv.IsString(t)||vv.IsSymbol(t)||vv.IsUndefined(t)?t:(0,RPi.Object)({})}a(DPi,"RequiredResolve");function ZUa(t,e){return vv.IsMappedResult(t)?(0,WUa.RequiredFromMappedResult)(t,e):(0,HUa.CreateType)({...DPi(t),...e})}a(ZUa,"Required")});var CSr=I(bSr=>{"use strict";p();Object.defineProperty(bSr,"__esModule",{value:!0});bSr.RequiredFromMappedResult=n7a;var XUa=Em(),e7a=vSr();function t7a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,e7a.Required)(t[n],e);return r}a(t7a,"FromProperties");function r7a(t,e){return t7a(t.properties,e)}a(r7a,"FromMappedResult");function n7a(t,e){let r=r7a(t,e);return(0,XUa.MappedResult)(r)}a(n7a,"RequiredFromMappedResult")});var j5e=I(jG=>{"use strict";p();var i7a=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]})),NPi=jG&&jG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&i7a(e,t,r)};Object.defineProperty(jG,"__esModule",{value:!0});NPi(CSr(),jG);NPi(vSr(),jG)});var LPi=I(hD=>{"use strict";p();var o7a=hD&&hD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),s7a=hD&&hD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),a7a=hD&&hD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ocy.IsRef(r)?TSr(t,r.$ref):Jb(t,r))}a(T7a,"DereferenceParameters");function TSr(t,e){return e in t?cy.IsRef(t[e])?TSr(t,t[e].$ref):Jb(t,t[e]):(0,SSr.Never)()}a(TSr,"Dereference");function I7a(t){return(0,u7a.Awaited)(t[0])}a(I7a,"FromAwaited");function x7a(t){return(0,p7a.Index)(t[0],t[1])}a(x7a,"FromIndex");function w7a(t){return(0,A7a.KeyOf)(t[0])}a(w7a,"FromKeyOf");function R7a(t){return(0,v7a.Partial)(t[0])}a(R7a,"FromPartial");function P7a(t){return(0,E7a.Omit)(t[0],t[1])}a(P7a,"FromOmit");function k7a(t){return(0,_7a.Pick)(t[0],t[1])}a(k7a,"FromPick");function D7a(t){return(0,C7a.Required)(t[0])}a(D7a,"FromRequired");function N7a(t,e,r){let n=T7a(t,r);return e==="Awaited"?I7a(n):e==="Index"?x7a(n):e==="KeyOf"?w7a(n):e==="Partial"?R7a(n):e==="Omit"?P7a(n):e==="Pick"?k7a(n):e==="Required"?D7a(n):(0,SSr.Never)()}a(N7a,"FromComputed");function M7a(t,e){return(0,l7a.Array)(Jb(t,e))}a(M7a,"FromArray");function O7a(t,e){return(0,d7a.AsyncIterator)(Jb(t,e))}a(O7a,"FromAsyncIterator");function B7a(t,e,r){return(0,f7a.Constructor)(H5e(t,e),Jb(t,r))}a(B7a,"FromConstructor");function L7a(t,e,r){return(0,h7a.Function)(H5e(t,e),Jb(t,r))}a(L7a,"FromFunction");function F7a(t,e){return(0,m7a.Intersect)(H5e(t,e))}a(F7a,"FromIntersect");function U7a(t,e){return(0,g7a.Iterator)(Jb(t,e))}a(U7a,"FromIterator");function Q7a(t,e){return(0,y7a.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:Jb(t,e[n])}),{}))}a(Q7a,"FromObject");function q7a(t,e){let[r,n]=[Jb(t,(0,OPi.RecordValue)(e)),(0,OPi.RecordPattern)(e)],o=(0,c7a.CloneType)(e);return o.patternProperties[n]=r,o}a(q7a,"FromRecord");function j7a(t,e){return cy.IsRef(e)?{...TSr(t,e.$ref),[fAt.TransformKind]:e[fAt.TransformKind]}:e}a(j7a,"FromTransform");function H7a(t,e){return(0,b7a.Tuple)(H5e(t,e))}a(H7a,"FromTuple");function G7a(t,e){return(0,S7a.Union)(H5e(t,e))}a(G7a,"FromUnion");function H5e(t,e){return e.map(r=>Jb(t,r))}a(H5e,"FromTypes");function Jb(t,e){return cy.IsOptional(e)?(0,Kb.CreateType)(Jb(t,(0,MPi.Discard)(e,[fAt.OptionalKind])),e):cy.IsReadonly(e)?(0,Kb.CreateType)(Jb(t,(0,MPi.Discard)(e,[fAt.ReadonlyKind])),e):cy.IsTransform(e)?(0,Kb.CreateType)(j7a(t,e),e):cy.IsArray(e)?(0,Kb.CreateType)(M7a(t,e.items),e):cy.IsAsyncIterator(e)?(0,Kb.CreateType)(O7a(t,e.items),e):cy.IsComputed(e)?(0,Kb.CreateType)(N7a(t,e.target,e.parameters)):cy.IsConstructor(e)?(0,Kb.CreateType)(B7a(t,e.parameters,e.returns),e):cy.IsFunction(e)?(0,Kb.CreateType)(L7a(t,e.parameters,e.returns),e):cy.IsIntersect(e)?(0,Kb.CreateType)(F7a(t,e.allOf),e):cy.IsIterator(e)?(0,Kb.CreateType)(U7a(t,e.items),e):cy.IsObject(e)?(0,Kb.CreateType)(Q7a(t,e.properties),e):cy.IsRecord(e)?(0,Kb.CreateType)(q7a(t,e)):cy.IsTuple(e)?(0,Kb.CreateType)(H7a(t,e.items||[]),e):cy.IsUnion(e)?(0,Kb.CreateType)(G7a(t,e.anyOf),e):e}a(Jb,"FromType");function BPi(t,e){return e in t?Jb(t,t[e]):(0,SSr.Never)()}a(BPi,"ComputeType");function $7a(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:BPi(t,r)}),{})}a($7a,"ComputeModuleProperties")});var UPi=I(G5e=>{"use strict";p();Object.defineProperty(G5e,"__esModule",{value:!0});G5e.TModule=void 0;G5e.Module=z7a;var FPi=q8(),V7a=vn(),W7a=LPi(),pAt=class{static{a(this,"TModule")}constructor(e){let r=(0,W7a.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,FPi.CreateType)(this.$defs[e],r)};return(0,FPi.CreateType)({[V7a.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};G5e.TModule=pAt;function z7a(t){return new pAt(t)}a(z7a,"Module")});var hAt=I(ure=>{"use strict";p();var Y7a=ure&&ure.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),K7a=ure&&ure.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Y7a(e,t,r)};Object.defineProperty(ure,"__esModule",{value:!0});K7a(UPi(),ure)});var QPi=I(ISr=>{"use strict";p();Object.defineProperty(ISr,"__esModule",{value:!0});ISr.Not=X7a;var J7a=Ii(),Z7a=vn();function X7a(t,e){return(0,J7a.CreateType)({[Z7a.Kind]:"Not",not:t},e)}a(X7a,"Not")});var mAt=I(dre=>{"use strict";p();var eQa=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]})),tQa=dre&&dre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eQa(e,t,r)};Object.defineProperty(dre,"__esModule",{value:!0});tQa(QPi(),dre)});var qPi=I(o6=>{"use strict";p();var rQa=o6&&o6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nQa=o6&&o6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),iQa=o6&&o6.__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 lQa=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]})),uQa=fre&&fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lQa(e,t,r)};Object.defineProperty(fre,"__esModule",{value:!0});uQa(qPi(),fre)});var HPi=I(xSr=>{"use strict";p();Object.defineProperty(xSr,"__esModule",{value:!0});xSr.Recursive=mQa;var dQa=ggt(),fQa=Ii(),pQa=Av(),jPi=vn(),hQa=0;function mQa(t,e={}){(0,pQa.IsUndefined)(e.$id)&&(e.$id=`T${hQa++}`);let r=(0,dQa.CloneType)(t({[jPi.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,fQa.CreateType)({[jPi.Hint]:"Recursive",...r},e)}a(mQa,"Recursive")});var AAt=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]})),AQa=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});AQa(HPi(),pre)});var GPi=I(wSr=>{"use strict";p();Object.defineProperty(wSr,"__esModule",{value:!0});wSr.RegExp=vQa;var yQa=Ii(),EQa=Av(),_Qa=vn();function vQa(t,e){let r=(0,EQa.IsString)(t)?new globalThis.RegExp(t):t;return(0,yQa.CreateType)({[_Qa.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(vQa,"RegExp")});var yAt=I(hre=>{"use strict";p();var CQa=hre&&hre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bQa=hre&&hre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CQa(e,t,r)};Object.defineProperty(hre,"__esModule",{value:!0});bQa(GPi(),hre)});var $Pi=I(PSr=>{"use strict";p();Object.defineProperty(PSr,"__esModule",{value:!0});PSr.Rest=TQa;var RSr=As();function SQa(t){return(0,RSr.IsIntersect)(t)?t.allOf:(0,RSr.IsUnion)(t)?t.anyOf:(0,RSr.IsTuple)(t)?t.items??[]:[]}a(SQa,"RestResolve");function TQa(t){return SQa(t)}a(TQa,"Rest")});var EAt=I(mre=>{"use strict";p();var IQa=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]})),xQa=mre&&mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IQa(e,t,r)};Object.defineProperty(mre,"__esModule",{value:!0});xQa($Pi(),mre)});var VPi=I(s6=>{"use strict";p();var wQa=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]})),RQa=s6&&s6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PQa=s6&&s6.__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 OQa=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]})),BQa=gre&&gre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OQa(e,t,r)};Object.defineProperty(gre,"__esModule",{value:!0});BQa(VPi(),gre)});var zPi=I(WPi=>{"use strict";p();Object.defineProperty(WPi,"__esModule",{value:!0})});var KPi=I(YPi=>{"use strict";p();Object.defineProperty(YPi,"__esModule",{value:!0});var qkp=vn()});var ZPi=I(HG=>{"use strict";p();var LQa=HG&&HG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JPi=HG&&HG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LQa(e,t,r)};Object.defineProperty(HG,"__esModule",{value:!0});JPi(zPi(),HG);JPi(KPi(),HG)});var eki=I(XPi=>{"use strict";p();Object.defineProperty(XPi,"__esModule",{value:!0})});var tki=I(Are=>{"use strict";p();var FQa=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]})),UQa=Are&&Are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&FQa(e,t,r)};Object.defineProperty(Are,"__esModule",{value:!0});UQa(eki(),Are)});var rki=I(yre=>{"use strict";p();Object.defineProperty(yre,"__esModule",{value:!0});yre.TransformEncodeBuilder=yre.TransformDecodeBuilder=void 0;yre.Transform=qQa;var vAt=vn(),QQa=As(),CAt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new bAt(this.schema,e)}};yre.TransformDecodeBuilder=CAt;var bAt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[vAt.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[vAt.TransformKind].Decode(c)),"Decode")};return{...r,[vAt.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[vAt.TransformKind]:n}}Encode(e){return(0,QQa.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};yre.TransformEncodeBuilder=bAt;function qQa(t){return new CAt(t)}a(qQa,"Transform")});var SAt=I(Ere=>{"use strict";p();var jQa=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]})),HQa=Ere&&Ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jQa(e,t,r)};Object.defineProperty(Ere,"__esModule",{value:!0});HQa(rki(),Ere)});var iki=I(kSr=>{"use strict";p();Object.defineProperty(kSr,"__esModule",{value:!0});kSr.Unsafe=$Qa;var GQa=Ii(),nki=vn();function $Qa(t={}){return(0,GQa.CreateType)({[nki.Kind]:t[nki.Kind]??"Unsafe"},t)}a($Qa,"Unsafe")});var $5e=I(_re=>{"use strict";p();var VQa=_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]})),WQa=_re&&_re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&VQa(e,t,r)};Object.defineProperty(_re,"__esModule",{value:!0});WQa(iki(),_re)});var oki=I(DSr=>{"use strict";p();Object.defineProperty(DSr,"__esModule",{value:!0});DSr.Void=KQa;var zQa=Ii(),YQa=vn();function KQa(t){return(0,zQa.CreateType)({[YQa.Kind]:"Void",type:"void"},t)}a(KQa,"Void")});var TAt=I(vre=>{"use strict";p();var JQa=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]})),ZQa=vre&&vre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JQa(e,t,r)};Object.defineProperty(vre,"__esModule",{value:!0});ZQa(oki(),vre)});var MSr=I(xAt=>{"use strict";p();Object.defineProperty(xAt,"__esModule",{value:!0});xAt.JsonTypeBuilder=void 0;var XQa=Rge(),eqa=Pge(),tqa=b5e(),rqa=qgt(),nqa=Hgt(),iqa=$gt(),oqa=eAt(),sqa=tre(),aqa=nAt(),cqa=uD(),lqa=sAt(),uqa=WT(),IAt=lAt(),dqa=dD(),fqa=DE(),pqa=Em(),hqa=ym(),mqa=mAt(),gqa=N5e(),Aqa=hAt(),yqa=NG(),Eqa=yv(),_qa=U5e(),vqa=B4(),Cqa=q5e(),bqa=Q5e(),Sqa=LG(),Tqa=F5e(),Iqa=Hge(),xqa=AAt(),wqa=UG(),Rqa=j5e(),Pqa=EAt(),kqa=MG(),Dqa=lD(),Nqa=SAt(),Mqa=V8(),Oqa=vp(),Bqa=QG(),Lqa=$5e(),NSr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,Tqa.ReadonlyOptional)(e)}Readonly(e,r){return(0,Sqa.Readonly)(e,r??!0)}Optional(e,r){return(0,vqa.Optional)(e,r??!0)}Any(e){return(0,XQa.Any)(e)}Array(e,r){return(0,eqa.Array)(e,r)}Boolean(e){return(0,tqa.Boolean)(e)}Capitalize(e,r){return(0,IAt.Capitalize)(e,r)}Composite(e,r){return(0,rqa.Composite)(e,r)}Const(e,r){return(0,nqa.Const)(e,r)}Enum(e,r){return(0,iqa.Enum)(e,r)}Exclude(e,r,n){return(0,oqa.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,sqa.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,aqa.Extract)(e,r,n)}Index(e,r,n){return(0,cqa.Index)(e,r,n)}Integer(e){return(0,lqa.Integer)(e)}Intersect(e,r){return(0,uqa.Intersect)(e,r)}KeyOf(e,r){return(0,dqa.KeyOf)(e,r)}Literal(e,r){return(0,fqa.Literal)(e,r)}Lowercase(e,r){return(0,IAt.Lowercase)(e,r)}Mapped(e,r,n){return(0,pqa.Mapped)(e,r,n)}Module(e){return(0,Aqa.Module)(e)}Never(e){return(0,hqa.Never)(e)}Not(e,r){return(0,mqa.Not)(e,r)}Null(e){return(0,gqa.Null)(e)}Number(e){return(0,yqa.Number)(e)}Object(e,r){return(0,Eqa.Object)(e,r)}Omit(e,r,n){return(0,_qa.Omit)(e,r,n)}Partial(e,r){return(0,Cqa.Partial)(e,r)}Pick(e,r,n){return(0,bqa.Pick)(e,r,n)}Record(e,r,n){return(0,Iqa.Record)(e,r,n)}Recursive(e,r){return(0,xqa.Recursive)(e,r)}Ref(...e){return(0,wqa.Ref)(e[0],e[1])}Required(e,r){return(0,Rqa.Required)(e,r)}Rest(e){return(0,Pqa.Rest)(e)}String(e){return(0,kqa.String)(e)}TemplateLiteral(e,r){return(0,Dqa.TemplateLiteral)(e,r)}Transform(e){return(0,Nqa.Transform)(e)}Tuple(e,r){return(0,Mqa.Tuple)(e,r)}Uncapitalize(e,r){return(0,IAt.Uncapitalize)(e,r)}Union(e,r){return(0,Oqa.Union)(e,r)}Unknown(e){return(0,Bqa.Unknown)(e)}Unsafe(e){return(0,Lqa.Unsafe)(e)}Uppercase(e,r){return(0,IAt.Uppercase)(e,r)}};xAt.JsonTypeBuilder=NSr});var ski=I(Mt=>{"use strict";p();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.Rest=Mt.Required=Mt.RegExp=Mt.Ref=Mt.Recursive=Mt.Record=Mt.ReadonlyOptional=Mt.Readonly=Mt.Promise=Mt.Pick=Mt.Partial=Mt.Parameters=Mt.Optional=Mt.Omit=Mt.Object=Mt.Number=Mt.Null=Mt.Not=Mt.Never=Mt.Module=Mt.Mapped=Mt.Literal=Mt.KeyOf=Mt.Iterator=Mt.Uppercase=Mt.Lowercase=Mt.Uncapitalize=Mt.Capitalize=Mt.Intersect=Mt.Integer=Mt.Instantiate=Mt.InstanceType=Mt.Index=Mt.Function=Mt.Extract=Mt.Extends=Mt.Exclude=Mt.Enum=Mt.Date=Mt.ConstructorParameters=Mt.Constructor=Mt.Const=Mt.Composite=Mt.Boolean=Mt.BigInt=Mt.Awaited=Mt.AsyncIterator=Mt.Array=Mt.Argument=Mt.Any=void 0;Mt.Void=Mt.Unsafe=Mt.Unknown=Mt.Union=Mt.Undefined=Mt.Uint8Array=Mt.Tuple=Mt.Transform=Mt.TemplateLiteral=Mt.Symbol=Mt.String=Mt.ReturnType=void 0;var Fqa=Rge();Object.defineProperty(Mt,"Any",{enumerable:!0,get:a(function(){return Fqa.Any},"get")});var Uqa=bgt();Object.defineProperty(Mt,"Argument",{enumerable:!0,get:a(function(){return Uqa.Argument},"get")});var Qqa=Pge();Object.defineProperty(Mt,"Array",{enumerable:!0,get:a(function(){return Qqa.Array},"get")});var qqa=kge();Object.defineProperty(Mt,"AsyncIterator",{enumerable:!0,get:a(function(){return qqa.AsyncIterator},"get")});var jqa=k5e();Object.defineProperty(Mt,"Awaited",{enumerable:!0,get:a(function(){return jqa.Awaited},"get")});var Hqa=Bge();Object.defineProperty(Mt,"BigInt",{enumerable:!0,get:a(function(){return Hqa.BigInt},"get")});var Gqa=b5e();Object.defineProperty(Mt,"Boolean",{enumerable:!0,get:a(function(){return Gqa.Boolean},"get")});var $qa=qgt();Object.defineProperty(Mt,"Composite",{enumerable:!0,get:a(function(){return $qa.Composite},"get")});var Vqa=Hgt();Object.defineProperty(Mt,"Const",{enumerable:!0,get:a(function(){return Vqa.Const},"get")});var Wqa=Dge();Object.defineProperty(Mt,"Constructor",{enumerable:!0,get:a(function(){return Wqa.Constructor},"get")});var zqa=Ggt();Object.defineProperty(Mt,"ConstructorParameters",{enumerable:!0,get:a(function(){return zqa.ConstructorParameters},"get")});var Yqa=D5e();Object.defineProperty(Mt,"Date",{enumerable:!0,get:a(function(){return Yqa.Date},"get")});var Kqa=$gt();Object.defineProperty(Mt,"Enum",{enumerable:!0,get:a(function(){return Kqa.Enum},"get")});var Jqa=eAt();Object.defineProperty(Mt,"Exclude",{enumerable:!0,get:a(function(){return Jqa.Exclude},"get")});var Zqa=tre();Object.defineProperty(Mt,"Extends",{enumerable:!0,get:a(function(){return Zqa.Extends},"get")});var Xqa=nAt();Object.defineProperty(Mt,"Extract",{enumerable:!0,get:a(function(){return Xqa.Extract},"get")});var eja=DG();Object.defineProperty(Mt,"Function",{enumerable:!0,get:a(function(){return eja.Function},"get")});var tja=uD();Object.defineProperty(Mt,"Index",{enumerable:!0,get:a(function(){return tja.Index},"get")});var rja=iAt();Object.defineProperty(Mt,"InstanceType",{enumerable:!0,get:a(function(){return rja.InstanceType},"get")});var nja=oAt();Object.defineProperty(Mt,"Instantiate",{enumerable:!0,get:a(function(){return nja.Instantiate},"get")});var ija=sAt();Object.defineProperty(Mt,"Integer",{enumerable:!0,get:a(function(){return ija.Integer},"get")});var oja=WT();Object.defineProperty(Mt,"Intersect",{enumerable:!0,get:a(function(){return oja.Intersect},"get")});var wAt=lAt();Object.defineProperty(Mt,"Capitalize",{enumerable:!0,get:a(function(){return wAt.Capitalize},"get")});Object.defineProperty(Mt,"Uncapitalize",{enumerable:!0,get:a(function(){return wAt.Uncapitalize},"get")});Object.defineProperty(Mt,"Lowercase",{enumerable:!0,get:a(function(){return wAt.Lowercase},"get")});Object.defineProperty(Mt,"Uppercase",{enumerable:!0,get:a(function(){return wAt.Uppercase},"get")});var sja=Fge();Object.defineProperty(Mt,"Iterator",{enumerable:!0,get:a(function(){return sja.Iterator},"get")});var aja=dD();Object.defineProperty(Mt,"KeyOf",{enumerable:!0,get:a(function(){return aja.KeyOf},"get")});var cja=DE();Object.defineProperty(Mt,"Literal",{enumerable:!0,get:a(function(){return cja.Literal},"get")});var lja=Em();Object.defineProperty(Mt,"Mapped",{enumerable:!0,get:a(function(){return lja.Mapped},"get")});var uja=hAt();Object.defineProperty(Mt,"Module",{enumerable:!0,get:a(function(){return uja.Module},"get")});var dja=ym();Object.defineProperty(Mt,"Never",{enumerable:!0,get:a(function(){return dja.Never},"get")});var fja=mAt();Object.defineProperty(Mt,"Not",{enumerable:!0,get:a(function(){return fja.Not},"get")});var pja=N5e();Object.defineProperty(Mt,"Null",{enumerable:!0,get:a(function(){return pja.Null},"get")});var hja=NG();Object.defineProperty(Mt,"Number",{enumerable:!0,get:a(function(){return hja.Number},"get")});var mja=yv();Object.defineProperty(Mt,"Object",{enumerable:!0,get:a(function(){return mja.Object},"get")});var gja=U5e();Object.defineProperty(Mt,"Omit",{enumerable:!0,get:a(function(){return gja.Omit},"get")});var Aja=B4();Object.defineProperty(Mt,"Optional",{enumerable:!0,get:a(function(){return Aja.Optional},"get")});var yja=gAt();Object.defineProperty(Mt,"Parameters",{enumerable:!0,get:a(function(){return yja.Parameters},"get")});var Eja=q5e();Object.defineProperty(Mt,"Partial",{enumerable:!0,get:a(function(){return Eja.Partial},"get")});var _ja=Q5e();Object.defineProperty(Mt,"Pick",{enumerable:!0,get:a(function(){return _ja.Pick},"get")});var vja=w5e();Object.defineProperty(Mt,"Promise",{enumerable:!0,get:a(function(){return vja.Promise},"get")});var Cja=LG();Object.defineProperty(Mt,"Readonly",{enumerable:!0,get:a(function(){return Cja.Readonly},"get")});var bja=F5e();Object.defineProperty(Mt,"ReadonlyOptional",{enumerable:!0,get:a(function(){return bja.ReadonlyOptional},"get")});var Sja=Hge();Object.defineProperty(Mt,"Record",{enumerable:!0,get:a(function(){return Sja.Record},"get")});var Tja=AAt();Object.defineProperty(Mt,"Recursive",{enumerable:!0,get:a(function(){return Tja.Recursive},"get")});var Ija=UG();Object.defineProperty(Mt,"Ref",{enumerable:!0,get:a(function(){return Ija.Ref},"get")});var xja=yAt();Object.defineProperty(Mt,"RegExp",{enumerable:!0,get:a(function(){return xja.RegExp},"get")});var wja=j5e();Object.defineProperty(Mt,"Required",{enumerable:!0,get:a(function(){return wja.Required},"get")});var Rja=EAt();Object.defineProperty(Mt,"Rest",{enumerable:!0,get:a(function(){return Rja.Rest},"get")});var Pja=_At();Object.defineProperty(Mt,"ReturnType",{enumerable:!0,get:a(function(){return Pja.ReturnType},"get")});var kja=MG();Object.defineProperty(Mt,"String",{enumerable:!0,get:a(function(){return kja.String},"get")});var Dja=M5e();Object.defineProperty(Mt,"Symbol",{enumerable:!0,get:a(function(){return Dja.Symbol},"get")});var Nja=lD();Object.defineProperty(Mt,"TemplateLiteral",{enumerable:!0,get:a(function(){return Nja.TemplateLiteral},"get")});var Mja=SAt();Object.defineProperty(Mt,"Transform",{enumerable:!0,get:a(function(){return Mja.Transform},"get")});var Oja=V8();Object.defineProperty(Mt,"Tuple",{enumerable:!0,get:a(function(){return Oja.Tuple},"get")});var Bja=B5e();Object.defineProperty(Mt,"Uint8Array",{enumerable:!0,get:a(function(){return Bja.Uint8Array},"get")});var Lja=O5e();Object.defineProperty(Mt,"Undefined",{enumerable:!0,get:a(function(){return Lja.Undefined},"get")});var Fja=vp();Object.defineProperty(Mt,"Union",{enumerable:!0,get:a(function(){return Fja.Union},"get")});var Uja=QG();Object.defineProperty(Mt,"Unknown",{enumerable:!0,get:a(function(){return Uja.Unknown},"get")});var Qja=$5e();Object.defineProperty(Mt,"Unsafe",{enumerable:!0,get:a(function(){return Qja.Unsafe},"get")});var qja=TAt();Object.defineProperty(Mt,"Void",{enumerable:!0,get:a(function(){return qja.Void},"get")})});var aki=I(RAt=>{"use strict";p();Object.defineProperty(RAt,"__esModule",{value:!0});RAt.JavaScriptTypeBuilder=void 0;var jja=MSr(),Hja=bgt(),Gja=kge(),$ja=k5e(),Vja=Bge(),Wja=Dge(),zja=Ggt(),Yja=D5e(),Kja=DG(),Jja=iAt(),Zja=oAt(),Xja=Fge(),eHa=gAt(),tHa=w5e(),rHa=yAt(),nHa=_At(),iHa=M5e(),oHa=B5e(),sHa=O5e(),aHa=TAt(),OSr=class extends jja.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,Hja.Argument)(e)}AsyncIterator(e,r){return(0,Gja.AsyncIterator)(e,r)}Awaited(e,r){return(0,$ja.Awaited)(e,r)}BigInt(e){return(0,Vja.BigInt)(e)}ConstructorParameters(e,r){return(0,zja.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,Wja.Constructor)(e,r,n)}Date(e={}){return(0,Yja.Date)(e)}Function(e,r,n){return(0,Kja.Function)(e,r,n)}InstanceType(e,r){return(0,Jja.InstanceType)(e,r)}Instantiate(e,r){return(0,Zja.Instantiate)(e,r)}Iterator(e,r){return(0,Xja.Iterator)(e,r)}Parameters(e,r){return(0,eHa.Parameters)(e,r)}Promise(e,r){return(0,tHa.Promise)(e,r)}RegExp(e,r){return(0,rHa.RegExp)(e,r)}ReturnType(e,r){return(0,nHa.ReturnType)(e,r)}Symbol(e){return(0,iHa.Symbol)(e)}Undefined(e){return(0,sHa.Undefined)(e)}Uint8Array(e){return(0,oHa.Uint8Array)(e)}Void(e){return(0,aHa.Void)(e)}};RAt.JavaScriptTypeBuilder=OSr});var cki=I(Zb=>{"use strict";p();var cHa=Zb&&Zb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lHa=Zb&&Zb.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),uHa=Zb&&Zb.__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 mHa=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]})),hn=en&&en.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mHa(e,t,r)};Object.defineProperty(en,"__esModule",{value:!0});hn(TCr(),en);hn(q8(),en);hn(Rf(),en);hn(MCr(),en);hn(lwi(),en);hn(E5e(),en);hn(wge(),en);hn(_5e(),en);hn(vn(),en);hn(Rge(),en);hn(Pge(),en);hn(bgt(),en);hn(kge(),en);hn(k5e(),en);hn(Bge(),en);hn(b5e(),en);hn(qgt(),en);hn(Hgt(),en);hn(Dge(),en);hn(Ggt(),en);hn(D5e(),en);hn($gt(),en);hn(eAt(),en);hn(tre(),en);hn(nAt(),en);hn(DG(),en);hn(uD(),en);hn(iAt(),en);hn(oAt(),en);hn(sAt(),en);hn(WT(),en);hn(Fge(),en);hn(lAt(),en);hn(dD(),en);hn(DE(),en);hn(hAt(),en);hn(Em(),en);hn(ym(),en);hn(mAt(),en);hn(N5e(),en);hn(NG(),en);hn(yv(),en);hn(U5e(),en);hn(B4(),en);hn(gAt(),en);hn(q5e(),en);hn(Q5e(),en);hn(w5e(),en);hn(LG(),en);hn(F5e(),en);hn(Hge(),en);hn(AAt(),en);hn(UG(),en);hn(yAt(),en);hn(j5e(),en);hn(EAt(),en);hn(_At(),en);hn(ZPi(),en);hn(tki(),en);hn(MG(),en);hn(M5e(),en);hn(lD(),en);hn(SAt(),en);hn(V8(),en);hn(B5e(),en);hn(O5e(),en);hn(vp(),en);hn(QG(),en);hn($5e(),en);hn(TAt(),en);hn(cki(),en)});var uki=I(PR=>{"use strict";p();var gHa=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]})),AHa=PR&&PR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),yHa=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{"use strict";p();var _Ha=q4&&q4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vHa=q4&&q4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),CHa=q4&&q4.__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(kAt,"__esModule",{value:!0});kAt.ContextItemOrigin=void 0;var pki;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(pki||(kAt.ContextItemOrigin=pki={}))});var gki=I(Pu=>{"use strict";p();Object.defineProperty(Pu,"__esModule",{value:!0});Pu.RangeSchema=Pu.WorkspaceFolder=Pu.VersionedTextDocumentIdentifier=Pu.TextEdit=Pu.TextDocumentItem=Pu.Range=Pu.Position=Pu.DocumentUri=Pu.Disposable=Pu.Command=Pu.CancellationTokenSource=Pu.CancellationToken=void 0;var DAt=PAt(),mD=ri();Object.defineProperty(Pu,"CancellationToken",{enumerable:!0,get:a(function(){return mD.CancellationToken},"get")});Object.defineProperty(Pu,"CancellationTokenSource",{enumerable:!0,get:a(function(){return mD.CancellationTokenSource},"get")});Object.defineProperty(Pu,"Command",{enumerable:!0,get:a(function(){return mD.Command},"get")});Object.defineProperty(Pu,"Disposable",{enumerable:!0,get:a(function(){return mD.Disposable},"get")});Object.defineProperty(Pu,"DocumentUri",{enumerable:!0,get:a(function(){return mD.DocumentUri},"get")});Object.defineProperty(Pu,"Position",{enumerable:!0,get:a(function(){return mD.Position},"get")});Object.defineProperty(Pu,"Range",{enumerable:!0,get:a(function(){return mD.Range},"get")});Object.defineProperty(Pu,"TextDocumentItem",{enumerable:!0,get:a(function(){return mD.TextDocumentItem},"get")});Object.defineProperty(Pu,"TextEdit",{enumerable:!0,get:a(function(){return mD.TextEdit},"get")});Object.defineProperty(Pu,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return mD.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(Pu,"WorkspaceFolder",{enumerable:!0,get:a(function(){return mD.WorkspaceFolder},"get")});var mki=DAt.Type.Object({line:DAt.Type.Integer({minimum:0}),character:DAt.Type.Integer({minimum:0})});Pu.RangeSchema=DAt.Type.Object({start:mki,end:mki})});var yki=I(Aki=>{"use strict";p();Object.defineProperty(Aki,"__esModule",{value:!0})});var W5e=I(Pf=>{"use strict";p();var SHa=Pf&&Pf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),V5e=Pf&&Pf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&SHa(e,t,r)};Object.defineProperty(Pf,"__esModule",{value:!0});Pf.TextEdit=Pf.Range=Pf.Position=Pf.Disposable=Pf.CancellationTokenSource=Pf.CancellationToken=void 0;var Vge=ri();Object.defineProperty(Pf,"CancellationToken",{enumerable:!0,get:a(function(){return Vge.CancellationToken},"get")});Object.defineProperty(Pf,"CancellationTokenSource",{enumerable:!0,get:a(function(){return Vge.CancellationTokenSource},"get")});Object.defineProperty(Pf,"Disposable",{enumerable:!0,get:a(function(){return Vge.Disposable},"get")});Object.defineProperty(Pf,"Position",{enumerable:!0,get:a(function(){return Vge.Position},"get")});Object.defineProperty(Pf,"Range",{enumerable:!0,get:a(function(){return Vge.Range},"get")});Object.defineProperty(Pf,"TextEdit",{enumerable:!0,get:a(function(){return Vge.TextEdit},"get")});V5e(uki(),Pf);V5e(fki(),Pf);V5e(hki(),Pf);V5e(gki(),Pf);V5e(yki(),Pf)});var LSr=I(zT=>{"use strict";p();var THa=zT&&zT.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Eki=zT&&zT.__param||function(t,e){return function(r,n){e(r,n,t)}},IHa=zT&&zT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zT,"__esModule",{value:!0});zT.CompletionNotifier=zT.ICompletionsNotifierService=void 0;var xHa=IHa(require("events")),wHa=rn(),RHa=hte(),PHa=W5e(),kHa=Og(),DHa=c5e(),NAt="CompletionRequested";zT.ICompletionsNotifierService=(0,wHa.createServiceIdentifier)("ICompletionsNotifierService");var BSr=class{static{a(this,"CompletionNotifier")}#e=new xHa.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(NAt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,kHa.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${NAt}`);return this.#e.on(NAt,r),PHa.Disposable.create(()=>this.#e.off(NAt,r))}};zT.CompletionNotifier=BSr;zT.CompletionNotifier=BSr=THa([Eki(0,DHa.ICompletionsPromiseQueueService),Eki(1,RHa.ICompletionsTelemetryService)],BSr)});var FSr=I(MAt=>{"use strict";p();Object.defineProperty(MAt,"__esModule",{value:!0});MAt.ICompletionsObservableWorkspace=void 0;var NHa=Fs();MAt.ICompletionsObservableWorkspace=(0,NHa.createDecorator)("ICompletionsObservableWorkspace")});var Il=I(gD=>{"use strict";p();Object.defineProperty(gD,"__esModule",{value:!0});gD.logger=gD.Logger=gD.ICompletionsLogTargetService=gD.LogLevel=void 0;var MHa=rn(),OHa=hte(),BHa=Og(),Cre;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(Cre||(gD.LogLevel=Cre={}));gD.ICompletionsLogTargetService=(0,MHa.createServiceIdentifier)("ICompletionsLogTargetService");var OAt=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,Cre.DEBUG,...r)}info(e,...r){this.log(e,Cre.INFO,...r)}warn(e,...r){this.log(e,Cre.WARN,...r)}error(e,...r){this.log(e,Cre.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,BHa.telemetryException)(e.get(OHa.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(gD.ICompletionsLogTargetService),Cre.ERROR,`${o}:`,s)}};gD.Logger=OAt;gD.logger=new OAt("default")});var vki=I(GG=>{"use strict";p();Object.defineProperty(GG,"__esModule",{value:!0});GG.INotificationService=GG.NullNotificationService=GG.ProgressLocation=void 0;var LHa=rn(),FHa=wk(),_ki;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(_ki||(GG.ProgressLocation=_ki={}));var USr=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")},FHa.CancellationToken.None))}};GG.NullNotificationService=USr;GG.INotificationService=(0,LHa.createServiceIdentifier)("INotificationService")});var qSr=I(AD=>{"use strict";p();var UHa=AD&&AD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},QHa=AD&&AD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(AD,"__esModule",{value:!0});AD.ExtensionNotificationSender=AD.ICompletionsNotificationSender=void 0;var qHa=vki(),jHa=rn();AD.ICompletionsNotificationSender=(0,jHa.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}}};AD.ExtensionNotificationSender=QSr;AD.ExtensionNotificationSender=QSr=UHa([QHa(0,qHa.INotificationService)],QSr)});var GSr=I(yD=>{"use strict";p();var HHa=yD&&yD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},jSr=yD&&yD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(yD,"__esModule",{value:!0});yD.UserErrorNotifier=yD.ICompletionsUserErrorNotifierService=void 0;var GHa=k4(),$Ha=rn(),VHa=Ku(),Ski=Il(),WHa=qSr(),zHa=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],Cki="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.",bki="https://gh.io/copilot-network-errors";yD.ICompletionsUserErrorNotifierService=(0,$Ha.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var HSr=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&&zHa.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new Ski.Logger("certificates").error(this._logTarget,`${Cki} Please visit ${bki} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(Cki,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(VHa.URI.parse(bki))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};yD.UserErrorNotifier=HSr;yD.UserErrorNotifier=HSr=HHa([jSr(0,Ski.ICompletionsLogTargetService),jSr(1,WHa.ICompletionsNotificationSender),jSr(2,GHa.IEnvService)],HSr)});var Cp=I(Wge=>{"use strict";p();Object.defineProperty(Wge,"__esModule",{value:!0});Wge.NullExperimentationService=Wge.IExperimentationService=void 0;var YHa=rn(),KHa=bc();Wge.IExperimentationService=(0,YHa.createServiceIdentifier)("IExperimentationService");var $Sr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new KHa.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};Wge.NullExperimentationService=$Sr});var $G=I(Xb=>{"use strict";p();Object.defineProperty(Xb,"__esModule",{value:!0});Xb.DEFAULT_PROMPT_ALLOCATION_PERCENT=Xb.DEFAULT_SUFFIX_MATCH_THRESHOLD=Xb.DEFAULT_NUM_SNIPPETS=Xb.DEFAULT_MAX_PROMPT_LENGTH=Xb.DEFAULT_MAX_COMPLETION_LENGTH=void 0;Xb.normalizeLanguageId=ZHa;Xb.DEFAULT_MAX_COMPLETION_LENGTH=500;Xb.DEFAULT_MAX_PROMPT_LENGTH=8192-Xb.DEFAULT_MAX_COMPLETION_LENGTH;Xb.DEFAULT_NUM_SNIPPETS=4;Xb.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;Xb.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var JHa={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function ZHa(t){return t=t.toLowerCase(),JHa[t]??t}a(ZHa,"normalizeLanguageId")});var Tki=I(VSr=>{"use strict";p();Object.defineProperty(VSr,"__esModule",{value:!0});VSr.getUserKind=eGa;function XHa(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(XHa,"findKnownOrg");function eGa(t){let e=t.organizationList??[];return XHa(e)??""}a(eGa,"getUserKind")});var z5e=I(j4=>{"use strict";p();Object.defineProperty(j4,"__esModule",{value:!0});j4.IEndpointProvider=j4.ModelSupportedEndpoint=void 0;j4.isEndpointEditToolName=nGa;j4.isChatModelInformation=iGa;j4.isEmbeddingModelInformation=oGa;j4.isCompletionModelInformation=sGa;var tGa=rn(),rGa=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function nGa(t){return rGa.has(t)}a(nGa,"isEndpointEditToolName");var Iki;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(Iki||(j4.ModelSupportedEndpoint=Iki={}));function iGa(t){return t.capabilities.type==="chat"}a(iGa,"isChatModelInformation");function oGa(t){return t.capabilities.type==="embeddings"}a(oGa,"isEmbeddingModelInformation");function sGa(t){return t.capabilities.type==="completion"}a(sGa,"isCompletionModelInformation");j4.IEndpointProvider=(0,tGa.createServiceIdentifier)("IEndpointProvider")});var wki=I(WSr=>{"use strict";p();Object.defineProperty(WSr,"__esModule",{value:!0});WSr.getUserSelectedModelConfiguration=aGa;var xki=RE();function aGa(t){let e=(0,xki.getConfig)(t,xki.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(aGa,"getUserSelectedModelConfiguration")});var zge=I(bre=>{"use strict";p();var cGa=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]})),lGa=bre&&bre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cGa(e,t,r)};Object.defineProperty(bre,"__esModule",{value:!0});lGa(g6t(),bre)});var YSr=I(ED=>{"use strict";p();var uGa=ED&&ED.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Y5e=ED&&ED.__param||function(t,e){return function(r,n){e(r,n,t)}},K5e;Object.defineProperty(ED,"__esModule",{value:!0});ED.AvailableModelsManager=ED.ICompletionsModelManagerService=void 0;var dGa=kE(),fGa=z5e(),pGa=rn(),hGa=Io(),mGa=Fs(),gGa=wki(),AGa=zge(),yGa=xvr(),EGa=ugt(),BAt=RE(),_Ga=oy(),Rki=Il();ED.ICompletionsModelManagerService=(0,pGa.createServiceIdentifier)("ICompletionsModelManagerService");var vGa="gpt-41-copilot",zSr=K5e=class extends hGa.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 yGa.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,EGa.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=K5e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return vGa}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=K5e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return K5e.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:AGa.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(gGa.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(Rki.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(BAt.getConfig,BAt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(BAt.getConfig,BAt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new VG(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 VG(s,"exp"):new VG(n,"modelpicker"):s?new VG(s,"exp"):this.customModels.length>0?new VG(this.customModels[0],"custommodel"):new VG(r,"default")}};ED.AvailableModelsManager=zSr;ED.AvailableModelsManager=zSr=K5e=uGa([Y5e(1,mGa.IInstantiationService),Y5e(2,_Ga.ICompletionsFeaturesService),Y5e(3,fGa.IEndpointProvider),Y5e(4,dGa.IAuthenticationService),Y5e(5,Rki.ICompletionsLogTargetService)],zSr);var VG=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var JSr=I(KSr=>{"use strict";p();Object.defineProperty(KSr,"__esModule",{value:!0});KSr.getEngineRequestInfo=bGa;var CGa=YSr();function bGa(t,e=void 0){let r=t.get(CGa.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(bGa,"getEngineRequestInfo")});var Nki=I(LAt=>{"use strict";p();Object.defineProperty(LAt,"__esModule",{value:!0});LAt.setupCompletionsExperimentationService=wGa;LAt.createCompletionsFilters=Dki;var SGa=kE(),TGa=Cp(),IGa=Fs(),Pki=Tki(),WG=RE(),xGa=JSr(),kR=F0t();function wGa(t){let e=t.get(SGa.IAuthenticationService),r=t.get(IGa.IInstantiationService),n=e.onDidAuthenticationChange(()=>{r.invokeFunction(kki,e.copilotToken)});return kki(t,e.copilotToken),n}a(wGa,"setupCompletionsExperimentationService");function RGa(t){return WG.BuildInfo.getBuildType()===WG.BuildType.NIGHTLY?kR.Release.Nightly:kR.Release.Stable}a(RGa,"getPluginRelease");function kki(t,e){let r=t.get(TGa.IExperimentationService),n=Dki(t,e);r.setCompletionsFilters(n)}a(kki,"updateCompletionsFilters");function Dki(t,e){let r=new Map;if(r.set(kR.Filter.ExtensionRelease,RGa(t)),r.set(kR.Filter.CopilotOverrideEngine,(0,WG.getConfig)(t,WG.ConfigKey.DebugOverrideEngine)||(0,WG.getConfig)(t,WG.ConfigKey.DebugOverrideEngineLegacy)),r.set(kR.Filter.CopilotClientVersion,WG.BuildInfo.isProduction()?WG.BuildInfo.getVersion():"1.999.0"),e){let o=(0,Pki.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(kR.Filter.CopilotUserKind,o),r.set(kR.Filter.CopilotCustomModel,s),r.set(kR.Filter.CopilotOrgs,c),r.set(kR.Filter.CopilotCustomModelNames,l),r.set(kR.Filter.CopilotTrackingId,u),r.set(kR.Filter.CopilotUserKind,(0,Pki.getUserKind)(e))}let n=(0,xGa.getEngineRequestInfo)(t).modelId;return r.set(kR.Filter.CopilotEngine,n),r}a(Dki,"createCompletionsFilters")});var Mki=I(a6=>{"use strict";p();var PGa=a6&&a6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ZSr=a6&&a6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(a6,"__esModule",{value:!0});a6.Features=void 0;var kGa=Ep(),DGa=Cp(),NGa=Fs(),Yge=$G(),MGa=Sge(),XSr=Og(),OGa=Nki(),Ma=B0t(),BGa=F0t(),eTr=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=XSr.TelemetryData.createAndMarkAsIssued()){if(r instanceof XSr.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 XSr.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(Ma.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 Ma.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(OGa.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new BGa.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[Ma.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.SuffixPercent]??Yge.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.SuffixMatchThreshold]??Yge.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[Ma.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[Ma.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[Ma.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(kGa.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[Ma.ExpTreatmentVariables.MaxPromptCompletionTokens]??Yge.DEFAULT_MAX_PROMPT_LENGTH+Yge.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.StableContextPercent]??Yge.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.VolatileContextPercent]??Yge.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[Ma.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};a6.Features=eTr;a6.Features=eTr=PGa([ZSr(0,NGa.IInstantiationService),ZSr(1,DGa.IExperimentationService),ZSr(2,MGa.ICompletionsCopilotTokenManager)],eTr)});var zG=I(Kge=>{"use strict";p();Object.defineProperty(Kge,"__esModule",{value:!0});Kge.ICompletionsFileSystemService=Kge.FileType=void 0;var LGa=rn(),Oki;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(Oki||(Kge.FileType=Oki={}));Kge.ICompletionsFileSystemService=(0,LGa.createServiceIdentifier)("ICompletionsFileSystemService")});var tTr=I(FAt=>{"use strict";p();Object.defineProperty(FAt,"__esModule",{value:!0});FAt.knownLanguages=void 0;FAt.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 Lki=I(YG=>{"use strict";p();Object.defineProperty(YG,"__esModule",{value:!0});YG.knownFileExtensions=YG.templateLanguageLimitations=YG.knownTemplateLanguageExtensions=void 0;var Bki=tTr();YG.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];YG.templateLanguageLimitations={".php":[".blade"]};YG.knownFileExtensions=Object.keys(Bki.knownLanguages).flatMap(t=>Bki.knownLanguages[t].extensions)});var KG=I(_D=>{"use strict";p();Object.defineProperty(_D,"__esModule",{value:!0});_D.makeFsUri=jGa;_D.validateUri=HGa;_D.normalizeUri=GGa;_D.fsPath=qki;_D.getFsPath=jki;_D.getFsUri=$Ga;_D.joinPath=VGa;_D.basename=YGa;_D.dirname=KGa;var FGa=require("os"),UGa=require("path"),QGa=kk(),J5e=Ku();function Uki(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+Uki(t.substring(3)):t}}a(Uki,"decodeURIComponentGraceful");var Fki=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function qGa(t){return t.match(Fki)?t.replace(Fki,e=>Uki(e)):t}a(qGa,"percentDecode");function jGa(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 J5e.URI.file(t).toString()}a(jGa,"makeFsUri");function Z5e(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?J5e.URI.parse(e[1]+e[2],!0):J5e.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(Z5e,"parseUri");function HGa(t){return Z5e(t),t}a(HGa,"validateUri");function GGa(t){try{return Z5e(t).toString()}catch{return t}}a(GGa,"normalizeUri");var Qki=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function qki(t){let e=Z5e(t);if(!Qki.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,FGa.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,UGa.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(qki,"fsPath");function jki(t){try{return qki(t)}catch{return}}a(jki,"getFsPath");function $Ga(t){let e=jki(t);if(e)return J5e.URI.file(e).toString()}a($Ga,"getFsUri");function VGa(t,...e){let r=J5e.URI.joinPath(Z5e(t),...e.map(WGa)).toString();return typeof t=="string"?r:{uri:r}}a(VGa,"joinPath");function WGa(t){return zGa(t)?t.replaceAll("\\","/"):t}a(WGa,"pathToURIPath");function zGa(t){return/^[^/\\]*\\/.test(t)}a(zGa,"isWinPath");function YGa(t){return qGa((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(YGa,"basename");function KGa(t){let e=(0,QGa.dirname)(Z5e(t)),r;return Qki.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(KGa,"dirname")});var Gki=I(ME=>{"use strict";p();var JGa=ME&&ME.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZGa=ME&&ME.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),XGa=ME&&ME.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0&&rTr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=rTr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(Jge.has(e))return{languageId:Jge.get(e)[0],isGuess:!1};let n=nTr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),Jge.has(e))return{languageId:Jge.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},oTr=class extends Zge{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 Sre("cpp",r.isGuess,r.fileExtension):r}},sTr=class extends Zge{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new Sre(e.languageId,!0,""):this.delegate.detectLanguage(e)}};ME.languageDetection=new oTr(new sTr(new iTr));function r$a({uri:t,languageId:e}){let r=ME.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(r$a,"detectLanguage")});var eAe=I(Xge=>{"use strict";p();Object.defineProperty(Xge,"__esModule",{value:!0});Xge.CopilotTextDocument=Xge.LocationFactory=void 0;var n$a=Gki(),i$a=KG(),X5e=(h7t(),_a(m0n)),JG=LCe(),aTr=class{static{a(this,"LocationFactory")}static{this.range=JG.Range.create.bind(JG.Range)}static{this.position=JG.Position.create.bind(JG.Position)}};Xge.LocationFactory=aTr;var cTr=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=X5e.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return X5e.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=X5e.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return X5e.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,n$a.detectLanguage)({uri:e,languageId:r})){return new t((0,i$a.normalizeUri)(e),X5e.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=JG.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=JG.Range.create(JG.Position.create(r,0),JG.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};Xge.CopilotTextDocument=cTr});var t4e=I((aNp,zki)=>{"use strict";p();var lTr=Object.defineProperty,o$a=Object.getOwnPropertyDescriptor,s$a=Object.getOwnPropertyNames,a$a=Object.prototype.hasOwnProperty,c$a=a((t,e)=>{for(var r in e)lTr(t,r,{get:e[r],enumerable:!0})},"__export"),l$a=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of s$a(e))!a$a.call(t,o)&&o!==r&&lTr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=o$a(e,o))||n.enumerable});return t},"__copyProps"),u$a=a(t=>l$a(lTr({},"__esModule",{value:!0}),t),"__toCommonJS"),Vki={};c$a(Vki,{config:a(()=>m$a,"config"),t:a(()=>Wki,"t")});zki.exports=u$a(Vki);var d$a=require("fs"),f$a=require("fs/promises");async function p$a(t){if(t.protocol==="file:")return await(0,f$a.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(p$a,"readFileFromUri");function h$a(t){return(0,d$a.readFileSync)(t,"utf8")}a(h$a,"readFileFromFsPath");var e4e;function m$a(t){if("contents"in t){typeof t.contents=="string"?e4e=JSON.parse(t.contents):e4e=t.contents;return}if("fsPath"in t){let e=h$a(t.fsPath),r=JSON.parse(e);e4e=$ki(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)=>{p$a(e).then(o=>{try{let s=JSON.parse(o);e4e=$ki(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(m$a,"config");function Wki(...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=e4e?.[r];return s?typeof s=="string"?UAt(s,o):s.comment?UAt(s.message,o):UAt(n,o):UAt(n,o)}a(Wki,"t");var g$a=/{([^}]+)}/g;function UAt(t,e){return Object.keys(e).length===0?t:t.replace(g$a,(r,n)=>e[n]??r)}a(UAt,"format");function $ki(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a($ki,"isBuiltinExtension")});var Tre=I(bv=>{"use strict";p();var A$a=bv&&bv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=bv&&bv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),E$a=bv&&bv.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;or(l,o+" ")):[]].join("")}return a(r,"collect"),r(t,"").trim()}a(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 +\\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{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;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;o{"use strict";p();Object.defineProperty(dTr,"__esModule",{value:!0});dTr.isDocumentValid=T$a;var b$a=Tre(),S$a=Ku();async function T$a(t,e){return await t.get(b$a.IIgnoreService).isCopilotIgnored(S$a.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(T$a,"isDocumentValid")});var e1=I(vD=>{"use strict";p();var I$a=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},Yki=vD&&vD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vD,"__esModule",{value:!0});vD.TextDocumentManager=vD.ICompletionsTextDocumentManagerService=void 0;var x$a=rn(),w$a=Fs(),R$a=zG(),Kki=fTr(),tAe=KG();vD.ICompletionsTextDocumentManagerService=(0,x$a.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var pTr=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(Kki.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,tAe.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(Kki.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,tAe.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,tAe.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,tAe.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,tAe.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,tAe.basename)(r)}};vD.TextDocumentManager=pTr;vD.TextDocumentManager=pTr=I$a([Yki(0,w$a.IInstantiationService),Yki(1,R$a.ICompletionsFileSystemService)],pTr)});var gTr=I(CD=>{"use strict";p();var P$a=CD&&CD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},hTr=CD&&CD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(CD,"__esModule",{value:!0});CD.FileReader=CD.ICompletionsFileReaderService=void 0;var k$a=rn(),D$a=Fs(),N$a=zG(),M$a=eAe(),O$a=e1(),B$a=fTr(),L$a=KG();CD.ICompletionsFileReaderService=(0,k$a.createServiceIdentifier)("ICompletionsFileReaderService");var mTr=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,L$a.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(B$a.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:M$a.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}};CD.FileReader=mTr;CD.FileReader=mTr=P$a([hTr(0,O$a.ICompletionsTextDocumentManagerService),hTr(1,D$a.IInstantiationService),hTr(2,N$a.ICompletionsFileSystemService)],mTr)});var c6=I(QAt=>{"use strict";p();Object.defineProperty(QAt,"__esModule",{value:!0});QAt.LRUCacheMap=void 0;var ATr=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)}};QAt.LRUCacheMap=ATr});var n4e=I(r4e=>{"use strict";p();Object.defineProperty(r4e,"__esModule",{value:!0});r4e.Deferred=void 0;r4e.delay=F$a;var yTr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};r4e.Deferred=yTr;function F$a(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(F$a,"delay")});var Jki=I(rAe=>{"use strict";p();Object.defineProperty(rAe,"__esModule",{value:!0});rAe.ReplaySubject=rAe.Subject=void 0;var qAt=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?.()}};rAe.Subject=qAt;var ETr=class extends qAt{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)}};rAe.ReplaySubject=ETr});var CTr=I(bD=>{"use strict";p();var U$a=bD&&bD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Zki=bD&&bD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(bD,"__esModule",{value:!0});bD.AsyncCompletionManager=bD.ICompletionsAsyncManagerService=void 0;var Q$a=rn(),q$a=oy(),j$a=c6(),Xki=Il(),H$a=n4e(),G$a=Jki(),Ire;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(Ire||(Ire={}));bD.ICompletionsAsyncManagerService=(0,Q$a.createServiceIdentifier)("ICompletionsAsyncManagerService");var vTr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new Xki.Logger("AsyncCompletionManager"),this.requests=new j$a.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(_Tr(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 G$a.ReplaySubject;return this.requests.set(e,{state:Ire.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:Ire.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 H$a.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(_Tr(r,n,f)){if(f.state===Ire.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)_Tr(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!==Ire.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};bD.AsyncCompletionManager=vTr;bD.AsyncCompletionManager=vTr=U$a([Zki(0,q$a.ICompletionsFeaturesService),Zki(1,Xki.ICompletionsLogTargetService)],vTr);function _Tr(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===Ire.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(_Tr,"isCandidate")});var e2i=I(jAt=>{"use strict";p();Object.defineProperty(jAt,"__esModule",{value:!0});jAt.LRURadixTrie=void 0;var bTr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new i4e,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 i4e;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 i4e;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(nAe,"__esModule",{value:!0});nAe.CompletionsCache=nAe.ICompletionsCacheService=void 0;var $$a=rn(),t2i=e2i();nAe.ICompletionsCacheService=(0,$$a.createServiceIdentifier)("ICompletionsCacheService");var STr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new t2i.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 t2i.LRURadixTrie(100)}};nAe.CompletionsCache=STr});var r2i=I(iAe=>{"use strict";p();Object.defineProperty(iAe,"__esModule",{value:!0});iAe.BlockMode=void 0;iAe.shouldDoParsingTrimming=V$a;iAe.shouldDoServerTrimming=W$a;var xre;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(xre||(iAe.BlockMode=xre={}));function V$a(t){return[xre.Parsing,xre.ParsingAndServer,xre.MoreMultiline].includes(t)}a(V$a,"shouldDoParsingTrimming");function W$a(t){return[xre.Server,xre.ParsingAndServer].includes(t)}a(W$a,"shouldDoServerTrimming")});var wre=I(YT=>{"use strict";p();var z$a=YT&&YT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(YT,"__esModule",{value:!0});YT.WASMLanguage=void 0;YT.isSupportedLanguageId=K$a;YT.languageIdToWasmLanguage=RTr;YT.getLanguage=i2i;YT.parseTreeSitter=Z$a;YT.parseTreeSitterIncludingVersion=o2i;YT.getBlockCloseToken=X$a;YT.queryPythonIsDocstring=rVa;var ITr=z$a($ce()),Y$a=d6t(),n2i=f6t(),gd;(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"})(gd||(YT.WASMLanguage=gd={}));var xTr={python:gd.Python,javascript:gd.JavaScript,javascriptreact:gd.JavaScript,jsx:gd.JavaScript,typescript:gd.TypeScript,typescriptreact:gd.TSX,go:gd.Go,ruby:gd.Ruby,csharp:gd.CSharp,java:gd.Java,php:gd.Php,c:gd.Cpp,cpp:gd.Cpp};function K$a(t){return t in xTr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(K$a,"isSupportedLanguageId");function RTr(t){if(!(t in xTr))throw new Error(`Unrecognized language: ${t}`);return xTr[t]}a(RTr,"languageIdToWasmLanguage");var TTr=new Map;async function J$a(t){let e;try{e=await(0,n2i.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new Y$a.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return ITr.default.Language.load(e)}a(J$a,"loadWasmLanguage");function i2i(t){let e=RTr(t);if(!TTr.has(e)){let r=J$a(e);TTr.set(e,r)}return TTr.get(e)}a(i2i,"getLanguage");var wTr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function Z$a(t,e){return(await o2i(t,e))[0]}a(Z$a,"parseTreeSitter");async function o2i(t,e){await ITr.default.init({locateFile:a(s=>(0,n2i.locateFile)(s),"locateFile")});let r;try{r=new ITr.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 wTr(`Could not init Parse for language <${t}>`,s):s}let n=await i2i(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(o2i,"parseTreeSitterIncludingVersion");function X$a(t){switch(RTr(t)){case gd.Python:return null;case gd.JavaScript:case gd.TypeScript:case gd.TSX:case gd.Go:case gd.CSharp:case gd.Java:case gd.Php:case gd.Cpp:return"}";case gd.Ruby:return"end"}}a(X$a,"getBlockCloseToken");function eVa(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(eVa,"innerQuery");var tVa=[`[ +**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.`);Nv.IIgnoreService=(0,hVa.createServiceIdentifier)("IIgnoreService");var kTr=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(){}};Nv.NullIgnoreService=kTr;async function mVa(t,e){let r=[];for(let n of e)await t.isCopilotIgnored(n)||r.push(n);return r}a(mVa,"filterIngoredResources")});var DTr=I(PTr=>{"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=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function rVa(t){return eVa([tVa],t).length===1}a(rVa,"queryPythonIsDocstring")});var LTr=I(cAe=>{"use strict";p();Object.defineProperty(cAe,"__esModule",{value:!0});cAe.StatementTree=cAe.StatementNode=void 0;var nVa=wre(),SD=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 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(` `)}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}}};cAe.StatementNode=SD;var DR=class{static{a(this,"StatementTree")}static isSupported(e){return oAe.languageIds.has(e)||sAe.languageIds.has(e)||s4e.languageIds.has(e)||aAe.languageIds.has(e)||a4e.languageIds.has(e)||c4e.languageIds.has(e)||l4e.languageIds.has(e)||u4e.languageIds.has(e)||d4e.languageIds.has(e)}static isTrimmedByDefault(e){return oAe.languageIds.has(e)||sAe.languageIds.has(e)||aAe.languageIds.has(e)}static create(e,r,n,o){if(oAe.languageIds.has(e))return new oAe(e,r,n,o);if(sAe.languageIds.has(e))return new sAe(e,r,n,o);if(s4e.languageIds.has(e))return new s4e(e,r,n,o);if(aAe.languageIds.has(e))return new aAe(e,r,n,o);if(l4e.languageIds.has(e))return new l4e(e,r,n,o);if(a4e.languageIds.has(e))return new a4e(e,r,n,o);if(c4e.languageIds.has(e))return new c4e(e,r,n,o);if(u4e.languageIds.has(e))return new u4e(e,r,n,o);if(d4e.languageIds.has(e))return new d4e(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,nVa.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}}};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(` `),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(` -`)}};cAe.StatementTree=DR;var HAt=class t extends SD{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"}},oAe=class extends DR{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new HAt(e)}getStatementQueryText(){return`[ +`)}};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`[ (export_statement) (import_statement) (debugger_statement) @@ -825,7 +827,7 @@ ${r}+- `:"";return e+this.description+o}}};cAe.StatementNode=SD;var DR=class{sta (labeled_statement) (method_definition) (field_definition) - ] @statement`}},sAe=class extends DR{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new HAt(e)}getStatementQueryText(){return`[ + ] @statement`}},vAe=class extends LR{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new syt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -848,7 +850,7 @@ ${r}+- `:"";return e+this.description+o}}};cAe.StatementNode=SD;var DR=class{sta (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},PTr=class t extends SD{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}},s4e=class extends DR{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new PTr(e)}getStatementQueryText(){return`[ + ] @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`[ (future_import_statement) (import_statement) (import_from_statement) @@ -874,24 +876,24 @@ ${r}+- `:"";return e+this.description+o}}};cAe.StatementNode=SD;var DR=class{sta (decorated_definition) (match_statement) (block) - ] @statement`}},kTr=class t extends SD{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)}},aAe=class extends DR{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new kTr(e)}getStatementQueryText(){return`[ + ] @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`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},DTr=class t extends SD{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)}},a4e=class extends DR{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new DTr(e)}getStatementQueryText(){return`[ + ] @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) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},NTr=class t extends SD{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)}},c4e=class extends DR{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new NTr(e)}getStatementQueryText(){return`[ + ] @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) (when) - ] @statement`}},MTr=class t extends SD{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"}},l4e=class extends DR{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new MTr(e)}getStatementQueryText(){return`[ + ] @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) (field_declaration) (record_declaration) @@ -904,7 +906,7 @@ ${r}+- `:"";return e+this.description+o}}};cAe.StatementNode=SD;var DR=class{sta (block) (static_initializer) (constructor_declaration) - ] @statement`}},OTr=class t extends SD{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"}},u4e=class extends DR{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new OTr(e)}getStatementQueryText(){return`[ + ] @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`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -916,7 +918,7 @@ ${r}+- `:"";return e+this.description+o}}};cAe.StatementNode=SD;var DR=class{sta (declaration) (accessor_declaration) (block) - ] @statement`}},BTr=class t extends SD{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)}},d4e=class extends DR{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new BTr(e)}getStatementQueryText(){return`[ + ] @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`[ (declaration) (function_definition) (type_definition) @@ -953,30 +955,30 @@ ${r}+- `:"";return e+this.description+o}}};cAe.StatementNode=SD;var DR=class{sta (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}}});var lAe=I(TD=>{"use strict";p();Object.defineProperty(TD,"__esModule",{value:!0});TD.BlockPositionType=TD.TerseBlockTrimmer=TD.VerboseBlockTrimmer=TD.BlockTrimmer=void 0;TD.getBlockPositionType=iVa;var GAt=LTr(),f4e=class{static{a(this,"BlockTrimmer")}static isSupported(e){return GAt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return GAt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=GAt.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}};TD.BlockTrimmer=f4e;var FTr=class extends f4e{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}};TD.VerboseBlockTrimmer=FTr;var UTr=class extends f4e{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 oVa=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},s2i=ID&&ID.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ID,"__esModule",{value:!0});ID.ConfigBlockModeConfig=ID.ICompletionsBlockModeConfig=void 0;var sVa=rn(),aVa=Fs(),H4=r2i(),c2i=wre(),a2i=RE(),cVa=oy(),lVa=lAe(),uVa=LTr();ID.ICompletionsBlockModeConfig=(0,sVa.createServiceIdentifier)("ICompletionsBlockModeConfig");var qTr=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 QTr(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(a2i.getConfig,a2i.ConfigKey.AlwaysRequestMultiline)??o)||lVa.BlockTrimmer.isTrimmedByDefault(e)?QTr(H4.BlockMode.MoreMultiline,e):e==="ruby"?H4.BlockMode.Parsing:(0,c2i.isSupportedLanguageId)(e)?H4.BlockMode.ParsingAndServer:H4.BlockMode.Server}};ID.ConfigBlockModeConfig=qTr;ID.ConfigBlockModeConfig=qTr=oVa([s2i(0,aVa.IInstantiationService),s2i(1,cVa.ICompletionsFeaturesService)],qTr);function dVa(t){return[H4.BlockMode.Parsing,H4.BlockMode.ParsingAndServer,H4.BlockMode.MoreMultiline].includes(t)}a(dVa,"blockModeRequiresTreeSitter");function QTr(t,e){return t===H4.BlockMode.MoreMultiline&&uVa.StatementTree.isSupported(e)?t:dVa(t)&&!(0,c2i.isSupportedLanguageId)(e)?H4.BlockMode.Server:t}a(QTr,"toApplicableBlockMode")});var ZG=I($At=>{"use strict";p();Object.defineProperty($At,"__esModule",{value:!0});$At.ResultType=void 0;var l2i;(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"})(l2i||($At.ResultType=l2i={}))});var GTr=I(uAe=>{"use strict";p();Object.defineProperty(uAe,"__esModule",{value:!0});uAe.CurrentGhostText=uAe.ICompletionsCurrentGhostText=void 0;var fVa=rn(),pVa=ZG();uAe.ICompletionsCurrentGhostText=(0,fVa.createServiceIdentifier)("ICompletionsCurrentGhostText");var HTr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==pVa.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&u2i(this.choices[0].completionText,n))return hVa(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)}};uAe.CurrentGhostText=HTr;function hVa(t,e){return t.filter(r=>u2i(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(hVa,"adjustChoicesStart");function u2i(t,e){return t.startsWith(e)&&t.length>e.length}a(u2i,"startsWithAndExceeds")});var d2i=I(u6=>{"use strict";p();var mVa=u6&&u6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},gVa=u6&&u6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(u6,"__esModule",{value:!0});u6.ChangeTracker=void 0;var AVa=e1(),$Tr=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)}};u6.ChangeTracker=$Tr;u6.ChangeTracker=$Tr=mVa([gVa(2,AVa.ICompletionsTextDocumentManagerService)],$Tr)});var WTr=I(p4e=>{"use strict";p();Object.defineProperty(p4e,"__esModule",{value:!0});p4e.CompletionState=void 0;p4e.createCompletionState=yVa;var VTr=W5e(),VAt=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??VTr.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(dAe,"__esModule",{value:!0});dAe.SpeculativeRequestCache=dAe.ICompletionsSpeculativeRequestCache=void 0;var EVa=rn(),_Va=c6();dAe.ICompletionsSpeculativeRequestCache=(0,EVa.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var zTr=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new _Va.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())}};dAe.SpeculativeRequestCache=zTr});var fAe=I(Sv=>{"use strict";p();Object.defineProperty(Sv,"__esModule",{value:!0});Sv.logger=Sv.GHOST_TEXT_CATEGORY=void 0;Sv.telemetryShown=CVa;Sv.telemetryAccepted=bVa;Sv.telemetryRejected=SVa;Sv.mkCanceledResultTelemetry=TVa;Sv.mkBasicResultTelemetry=IVa;Sv.handleGhostTextResultTelemetry=xVa;Sv.resultTypeToString=YTr;var f2i=Il(),Rre=Og(),h4e=ZG(),vVa=WAt();Sv.GHOST_TEXT_CATEGORY="ghostText";Sv.logger=new f2i.Logger("getCompletions");function CVa(t,e){t.get(vVa.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=YTr(e.resultType),(0,Rre.telemetry)(t,"ghostText.shown",e.telemetry)}a(CVa,"telemetryShown");function bVa(t,e,r){let n=e+".accepted";(0,Rre.telemetry)(t,n,r)}a(bVa,"telemetryAccepted");function SVa(t,e,r){let n=e+".rejected";(0,Rre.telemetry)(t,n,r)}a(SVa,"telemetryRejected");function TVa(t,e={}){return{...e,telemetryBlob:t}}a(TVa,"mkCanceledResultTelemetry");function IVa(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(IVa,"mkBasicResultTelemetry");function xVa(t,e){let r=t.get(f2i.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,Rre.now)()-e.telemetryBlob.issuedTime,o=YTr(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 Sv.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,Rre.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(Sv.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,Rre.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,Rre.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(xVa,"handleGhostTextResultTelemetry");function YTr(t){switch(t){case h4e.ResultType.Network:return"network";case h4e.ResultType.Cache:return"cache";case h4e.ResultType.Cycling:return"cycling";case h4e.ResultType.TypingAsSuggested:return"typingAsSuggested";case h4e.ResultType.Async:return"async"}}a(YTr,"resultTypeToString")});var m2i=I(pAe=>{"use strict";p();Object.defineProperty(pAe,"__esModule",{value:!0});pAe.getBlockParser=KAt;pAe.isEmptyBlockStart=kVa;pAe.isBlockBodyFinished=DVa;pAe.getNodeStart=NVa;var XG=wre(),zAt=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,XG.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)}},YAt=class extends zAt{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(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.startIndex0&&/\s/.test(t.charAt(r-1));)r--;return r}a(h2i,"rewindToNearestNonWs");function p2i(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(p2i,"indent");function RVa(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=p2i(t,r),o=p2i(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(RVa,"outdented");var G4=class extends zAt{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,XG.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()}}},PVa={python:new G4("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 G4("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 G4("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 G4("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 YAt("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 YAt("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 G4("csharp",{},new Map([]),[],"block",null,!0),java:new G4("java",{},new Map([]),[],"block",null,!0),php:new G4("php",{},new Map([]),[],"block",null,!0),cpp:new G4("cpp",{},new Map([]),[],"block",null,!0)};function KAt(t){if(!(0,XG.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return PVa[(0,XG.languageIdToWasmLanguage)(t)]}a(KAt,"getBlockParser");async function kVa(t,e,r){return(0,XG.isSupportedLanguageId)(t)?KAt(t).isEmptyBlockStart(e,r):!1}a(kVa,"isEmptyBlockStart");async function DVa(t,e,r,n){if((0,XG.isSupportedLanguageId)(t))return KAt(t).isBlockBodyFinished(e,r,n)}a(DVa,"isBlockBodyFinished");async function NVa(t,e,r){if((0,XG.isSupportedLanguageId)(t))return KAt(t).getNodeStart(e,r)}a(NVa,"getNodeStart")});var XAt=I(e$=>{"use strict";p();Object.defineProperty(e$,"__esModule",{value:!0});e$.parsingBlockFinished=MVa;e$.isEmptyBlockStartUtil=OVa;e$.getNodeStartUtil=BVa;e$.contextIndentation=QVa;e$.contextIndentationFromText=g2i;e$.indentationBlockFinished=HVa;var KTr=m2i(),ZAt=eAe();function MVa(t,e){let r=t.getText(ZAt.LocationFactory.range(ZAt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,KTr.isBlockBodyFinished)(o,r,s,n)}a(MVa,"parsingBlockFinished");function OVa(t,e){return(0,KTr.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(OVa,"isEmptyBlockStartUtil");async function BVa(t,e,r){let o=t.getText(ZAt.LocationFactory.range(ZAt.LocationFactory.position(0,0),e))+r,s=await(0,KTr.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a(BVa,"getNodeStartUtil");var LVa=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),FVa=new RegExp(`^(${LVa.join("|")})`);function UVa(t){return FVa.test(t.trimLeft().toLowerCase())}a(UVa,"isContinuationLine");function JAt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(JAt,"indentationOfLine");function QVa(t,e){let r=t.getText(),n=t.offsetAt(e);return g2i(r,n,t.detectedLanguageId)}a(QVa,"contextIndentation");function g2i(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(vWa,"getLineAtOffset");function M2i(t,e){let r=e;for(;r>0&&/\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(` `),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=JAt(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=JAt(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=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{let n=jVa(r,t,e);return n==="continue"?void 0:n}}a(HVa,"indentationBlockFinished")});var m4e=I(Qg=>{"use strict";p();Object.defineProperty(Qg,"__esModule",{value:!0});Qg.languageMarkers=void 0;Qg.mdCodeBlockLangToLanguageId=GVa;Qg.isShebangLine=WVa;Qg.hasLanguageMarker=y2i;Qg.comment=E2i;Qg.commentBlockAsSingles=zVa;Qg.getLanguageMarker=YVa;Qg.getPathMarker=KVa;Qg.newLineEnded=JVa;Qg.getLanguage=ZVa;Qg.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 JTr={};for(let[t,e]of Object.entries(Qg.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)JTr[r]=t;else JTr[t]=t;function GVa(t){return JTr[t]}a(GVa,"mdCodeBlockLangToLanguageId");var $Va={start:"//",end:""},VVa=["php","plaintext"],ZTr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function WVa(t){return Object.values(ZTr).includes(t.trim())}a(WVa,"isShebangLine");function y2i({source:t}){return t.startsWith("#!")||t.startsWith("{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("E2i(s,e)).join(` +`).map(s=>U2i(s,e)).join(` `);return r?o+` -`:o}a(zVa,"commentBlockAsSingles");function YVa(t){let{languageId:e}=t;return VVa.indexOf(e)===-1&&!y2i(t)?e in ZTr?ZTr[e]:`Language: ${e}`:""}a(YVa,"getLanguageMarker");function KVa(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(KVa,"getPathMarker");function JVa(t){return t===""||t.endsWith(` +`: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(` `)?t:t+` -`}a(JVa,"newLineEnded");function ZVa(t){return A2i(typeof t=="string"?t:"plaintext")}a(ZVa,"getLanguage");function A2i(t){return Qg.languageMarkers[t]!==void 0?{languageId:t,...Qg.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a(A2i,"_getLanguage")});var eIr=I(XTr=>{"use strict";p();Object.defineProperty(XTr,"__esModule",{value:!0});XTr.getCursorContext=tWa;var _2i=zge(),XVa={tokenizerName:_2i.TokenizerName.o200k};function eWa(t){return{...XVa,...t}}a(eWa,"cursorContextOptions");function tWa(t,e={}){let r=eWa(e),n=(0,_2i.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(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(` `).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(tWa,"getCursorContext")});var tIr=I(Pre=>{"use strict";p();Object.defineProperty(Pre,"__esModule",{value:!0});Pre.SnippetSemantics=Pre.SnippetProviderType=void 0;Pre.announceSnippet=nWa;var v2i;(function(t){t.SimilarFiles="similar-files",t.Path="path"})(v2i||(Pre.SnippetProviderType=v2i={}));var t1;(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"})(t1||(Pre.SnippetSemantics=t1={}));var rWa={[t1.Function]:"function",[t1.Snippet]:"snippet",[t1.Snippets]:"snippets",[t1.Variable]:"variable",[t1.Parameter]:"parameter",[t1.Method]:"method",[t1.Class]:"class",[t1.Module]:"module",[t1.Alias]:"alias",[t1.Enum]:"enum member",[t1.Interface]:"interface"};function nWa(t){let e=rWa[t.semantics],r=[t1.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(nWa,"announceSnippet")});var oIr=I(Dre=>{"use strict";p();Object.defineProperty(Dre,"__esModule",{value:!0});Dre.WindowedMatcher=Dre.SortOptions=void 0;Dre.splitIntoWords=S2i;var C2i=tIr(),rIr=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]}},kre;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(kre||(Dre.SortOptions=kre={}));var nIr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=sWa.get(e.languageId)??oWa}tokenize(e){return new Set(S2i(e).filter(r=>!this.stopsForLanguage.has(r)))}},b2i=new rIr(20),iIr=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new nIr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=kre.Descending){return r===kre.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===kre.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=kre.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=b2i.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(S2i,"splitIntoWords");var iWa=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"]),oWa=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",...iWa]),sWa=new Map([])});var sIr=I(NR=>{"use strict";p();Object.defineProperty(NR,"__esModule",{value:!0});NR.virtualNode=aWa;NR.lineNode=cWa;NR.blankNode=lWa;NR.topNode=uWa;NR.isBlank=dWa;NR.isLine=fWa;NR.isVirtual=T2i;NR.isTop=I2i;NR.cutTreeAfterLine=pWa;NR.duplicateTree=hWa;function aWa(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(aWa,"virtualNode");function cWa(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(cWa,"lineNode");function lWa(t){return{type:"blank",lineNumber:t,subs:[]}}a(lWa,"blankNode");function uWa(t){return{type:"top",indentation:-1,subs:t??[]}}a(uWa,"topNode");function dWa(t){return t.type==="blank"}a(dWa,"isBlank");function fWa(t){return t.type==="line"}a(fWa,"isLine");function T2i(t){return t.type==="virtual"}a(T2i,"isVirtual");function I2i(t){return t.type==="top"}a(I2i,"isTop");function pWa(t,e){function r(n){if(!T2i(n)&&!I2i(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty($4,"__esModule",{value:!0});$4.clearLabels=mWa;$4.clearLabelsIf=gWa;$4.mapLabels=cIr;$4.resetLineNumbers=AWa;$4.visitTree=g4e;$4.visitTreeConditionally=yWa;$4.foldTree=EWa;$4.rebuildTree=_Wa;var aIr=sIr();function mWa(t){return g4e(t,e=>{e.label=void 0},"bottomUp"),t}a(mWa,"clearLabels");function gWa(t,e){return g4e(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(gWa,"clearLabelsIf");function cIr(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>cIr(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=>cIr(r,e)),label:t.label?e(t.label):void 0}}}a(cIr,"mapLabels");function AWa(t){let e=0;function r(n){!(0,aIr.isVirtual)(n)&&!(0,aIr.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),g4e(t,r,"topDown")}a(AWa,"resetLineNumbers");function g4e(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(g4e,"visitTree");function yWa(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(yWa,"visitTreeConditionally");function EWa(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),g4e(t,s,n),o}a(EWa,"foldTree");function _Wa(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,aIr.topNode)()}a(_Wa,"rebuildTree")});var D2i=I(xD=>{"use strict";p();Object.defineProperty(xD,"__esModule",{value:!0});xD.parseRaw=x2i;xD.labelLines=w2i;xD.labelVirtualInherited=vWa;xD.buildLabelRules=R2i;xD.combineClosersAndOpeners=P2i;xD.groupBlocks=CWa;xD.flattenVirtual=bWa;xD.registerLanguageSpecificParser=IWa;xD.parseTree=xWa;var qg=sIr(),hAe=lIr();function x2i(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,qg.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,hAe.visitTree)(t,r,"bottomUp")}a(w2i,"labelLines");function vWa(t){function e(r){if((0,qg.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,qg.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,hAe.visitTree)(t,e,"bottomUp")}a(vWa,"labelVirtualInherited");function R2i(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(R2i,"buildLabelRules");function P2i(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,qg.isLine)(l)||(0,qg.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,qg.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,qg.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,qg.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,hAe.rebuildTree)(t,e);return(0,hAe.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(P2i,"combineClosersAndOpeners");function CWa(t,e=qg.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,qg.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(eyt,"__esModule",{value:!0});eyt.getBasicWindowDelineations=RWa;eyt.getIndentationWindowsDelineations=PWa;var N2i=lIr(),wWa=D2i();function RWa(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(PWa,"getIndentationWindowsDelineations")});var O2i=I(A4e=>{"use strict";p();Object.defineProperty(A4e,"__esModule",{value:!0});A4e.FixedWindowSizeJaccardMatcher=void 0;A4e.computeScore=M2i;var kWa=eIr(),DWa=oIr(),NWa=uIr(),dIr=class t extends DWa.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,NWa.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,kWa.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return M2i(e,r)}};A4e.FixedWindowSizeJaccardMatcher=dIr;function M2i(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(M2i,"computeScore")});var L2i=I(tyt=>{"use strict";p();Object.defineProperty(tyt,"__esModule",{value:!0});tyt.BlockTokenSubsetMatcher=void 0;var MWa=wre(),B2i=eIr(),OWa=oIr(),BWa=uIr(),fIr=class t extends OWa.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,BWa.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,B2i.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,B2i.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return LWa(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,MWa.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}}};tyt.BlockTokenSubsetMatcher=fIr;function LWa(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(LWa,"computeScore")});var ryt=I(wD=>{"use strict";p();Object.defineProperty(wD,"__esModule",{value:!0});wD.defaultCppSimilarFilesOptions=wD.nullSimilarFilesOptions=wD.conservativeFilesOptions=wD.defaultSimilarFilesOptions=void 0;wD.getSimilarSnippets=$Wa;var FWa=O2i(),UWa=L2i(),QWa=0,qWa=60,jWa=4,HWa=1,F2i=20,U2i=1e4;wD.defaultSimilarFilesOptions={snippetLength:qWa,threshold:QWa,maxTopSnippets:jWa,maxCharPerFile:U2i,maxNumberOfFiles:F2i,maxSnippetsPerFile:HWa,useSubsetMatching:!1};wD.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:U2i,maxNumberOfFiles:F2i,maxSnippetsPerFile:1};wD.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};wD.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function GWa(t,e){return(e.useSubsetMatching?UWa.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):FWa.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(GWa,"getMatcher");async function $Wa(t,e,r){let n=GWa(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($Wa,"getSimilarSnippets")});var q2i=I(nyt=>{"use strict";p();Object.defineProperty(nyt,"__esModule",{value:!0});nyt.getCppSimilarFilesOptions=WWa;nyt.getCppNumberOfSnippets=zWa;var Q2i=ryt(),VWa=iyt();function WWa(t,e){return{...Q2i.defaultCppSimilarFilesOptions,useSubsetMatching:(0,VWa.useSubsetMatching)(t,e)}}a(WWa,"getCppSimilarFilesOptions");function zWa(t){return Q2i.defaultCppSimilarFilesOptions.maxTopSnippets}a(zWa,"getCppNumberOfSnippets")});var iyt=I(y4e=>{"use strict";p();Object.defineProperty(y4e,"__esModule",{value:!0});y4e.getSimilarFilesOptions=XWa;y4e.getNumberOfSnippets=tza;y4e.useSubsetMatching=G2i;var YWa=$G(),KWa=ryt(),j2i=RE(),JWa=B0t(),H2i=q2i(),ZWa=new Map([["cpp",H2i.getCppSimilarFilesOptions]]);function XWa(t,e,r){let n=ZWa.get(r);return n?n(t,e):{...KWa.defaultSimilarFilesOptions,useSubsetMatching:G2i(t,e)}}a(XWa,"getSimilarFilesOptions");var eza=new Map([["cpp",H2i.getCppNumberOfSnippets]]);function tza(t,e){let r=eza.get(e);return r?r(t):YWa.DEFAULT_NUM_SNIPPETS}a(tza,"getNumberOfSnippets");function G2i(t,e){return(e.filtersAndExp.exp.variables[JWa.ExpTreatmentVariables.UseSubsetMatching]||(0,j2i.getConfig)(t,j2i.ConfigKey.UseSubsetMatching))??!1}a(G2i,"useSubsetMatching")});var E4e=I(Nre=>{"use strict";p();Object.defineProperty(Nre,"__esModule",{value:!0});Nre.convertToAPIChoice=oza;Nre.getTemperatureForSamples=cza;Nre.getStops=uza;Nre.getTopP=dza;Nre.getMaxSolutionTokens=fza;var rza=y0(),nza=$G(),$2i=Il(),iza=Og();function oza(t,e,r,n,o,s,c){return(0,iza.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:sza(t,r),meanAlternativeLogProb:aza(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,rza.generateUuid)(),finishReason:r.finish_reason}}a(oza,"convertToAPIChoice");function sza(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){$2i.logger.exception(t,r,"Error calculating mean prob")}}a(sza,"calculateMeanLogProb");function aza(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){$2i.logger.exception(t,r,"Error calculating mean prob")}}a(aza,"calculateMeanAlternativeLogProb");function cza(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(cza,"getTemperatureForSamples");var lza={markdown:[` +`).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:[` `],python:[` @@ -984,31 +986,31 @@ def `,` class `,` if `,` -#`]};function uza(t){return lza[t??""]??[` +#`]};function nYa(t){return rYa[t??""]??[` -`,"\n```"]}a(uza,"getStops");function dza(){return 1}a(dza,"getTopP");function fza(){return nza.DEFAULT_MAX_COMPLETION_LENGTH}a(fza,"getMaxSolutionTokens")});var V4=I(_4e=>{"use strict";p();Object.defineProperty(_4e,"__esModule",{value:!0});_4e.Fragment=W2i;_4e.jsx=V2i;_4e.jsxs=V2i;function V2i(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(V2i,"functionComponentFunction");function W2i(t){return{type:"f",children:t}}a(W2i,"fragmentFunction");W2i.isFragmentFunction=!0});var RD=I(pIr=>{"use strict";p();Object.defineProperty(pIr,"__esModule",{value:!0});pIr.es5ClassCompat=pza;function pza(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(pza,"es5ClassCompat")});var mAe=I(Ore=>{"use strict";p();var hza=Ore&&Ore.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Mre;Object.defineProperty(Ore,"__esModule",{value:!0});Ore.Position=void 0;var oyt=Is(),mza=RD(),hIr=Mre=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,oyt.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 Mre(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,oyt.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 Mre(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};Ore.Position=hIr;Ore.Position=hIr=Mre=hza([mza.es5ClassCompat],hIr)});var W4=I(t$=>{"use strict";p();var gza=t$&&t$.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},d6;Object.defineProperty(t$,"__esModule",{value:!0});t$.Range=void 0;t$.getDebugDescriptionOfRange=z2i;var Aza=Is(),yza=RD(),Tv=mAe(),mIr=d6=class{static{a(this,"Range")}static isRange(e){return e instanceof d6?!0:!e||typeof e!="object"?!1:Tv.Position.isPosition(e.start)&&Tv.Position.isPosition(e.end)}static of(e){if(e instanceof d6)return e;if(this.isRange(e))return new d6(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 Tv.Position(e,r),c=new Tv.Position(n,o)):Tv.Position.isPosition(e)&&Tv.Position.isPosition(r)&&(s=Tv.Position.of(e),c=Tv.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 d6.isRange(e)?this.contains(e.start)&&this.contains(e.end):Tv.Position.isPosition(e)?!(Tv.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=Tv.Position.Max(e.start,this._start),n=Tv.Position.Min(e.end,this._end);if(!r.isAfter(n))return new d6(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=Tv.Position.Min(e.start,this._start),n=Tv.Position.Max(e.end,this.end);return new d6(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,Aza.illegalArgument)();let n;return e?Tv.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 d6(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return z2i(this)}};t$.Range=mIr;t$.Range=mIr=d6=gza([yza.es5ClassCompat],mIr);function z2i(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a(z2i,"getDebugDescriptionOfRange")});var AIr=I(r1=>{"use strict";p();var J2i=r1&&r1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(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(r1,"__esModule",{value:!0});r1.Diagnostic=r1.DiagnosticRelatedInformation=r1.DiagnosticSeverity=r1.DiagnosticTag=void 0;var Y2i=Al(),Eza=Ku(),Z2i=RD(),X2i=W4(),K2i;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(K2i||(r1.DiagnosticTag=K2i={}));var syt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(syt||(r1.DiagnosticSeverity=syt={}));var ayt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&X2i.Range.isRange(e.location.range)&&Eza.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()}};r1.DiagnosticRelatedInformation=ayt;r1.DiagnosticRelatedInformation=ayt=J2i([Z2i.es5ClassCompat],ayt);var gIr=class{static{a(this,"Diagnostic")}constructor(e,r,n=syt.Error){if(!X2i.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:syt[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,Y2i.equals)(e.tags,r.tags)&&(0,Y2i.equals)(e.relatedInformation,r.relatedInformation,ayt.isEqual)}};r1.Diagnostic=gIr;r1.Diagnostic=gIr=J2i([Z2i.es5ClassCompat],gIr)});var _Ir=I(Bre=>{"use strict";p();var _za=Bre&&Bre.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},yIr;Object.defineProperty(Bre,"__esModule",{value:!0});Bre.Location=void 0;var vza=Ku(),Cza=RD(),bza=mAe(),cyt=W4(),EIr=yIr=class{static{a(this,"Location")}static isLocation(e){return e instanceof yIr?!0:e?cyt.Range.isRange(e.range)&&vza.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(cyt.Range.isRange(r))this.range=cyt.Range.of(r);else if(bza.Position.isPosition(r))this.range=new cyt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};Bre.Location=EIr;Bre.Location=EIr=yIr=_za([Cza.es5ClassCompat],EIr)});var eDi=I(SIr=>{"use strict";p();Object.defineProperty(SIr,"__esModule",{value:!0});SIr.getKoreanAltChars=Sza;function Sza(t){let e=Tza(t);if(e&&e.length>0)return new Uint32Array(e)}a(Sza,"getKoreanAltChars");var n1=0,r$=new Uint32Array(10);function Tza(t){if(n1=0,z4(t,vIr,4352),n1>0||(z4(t,CIr,4449),n1>0)||(z4(t,bIr,4520),n1>0)||(z4(t,Lre,12593),n1))return r$.subarray(0,n1);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 r$.subarray(0,n1)}}a(Tza,"disassembleKorean");function z4(t,e,r){t>=r&&t>8&&(r$[n1++]=t>>8&255),t>>16&&(r$[n1++]=t>>16&255))}a(Iza,"addCodesToBuffer");var vIr=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),CIr=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),bIr=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]),Lre=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 nDi=I(gAe=>{"use strict";p();Object.defineProperty(gAe,"__esModule",{value:!0});gAe.tryNormalizeToBase=void 0;gAe.normalizeNFC=wza;gAe.normalizeNFD=tDi;var TIr=bk(),xza=new TIr.LRUCache(1e4);function wza(t){return rDi(t,"NFC",xza)}a(wza,"normalizeNFC");var Rza=new TIr.LRUCache(1e4);function tDi(t){return rDi(t,"NFD",Rza)}a(tDi,"normalizeNFD");var Pza=/[^\u0000-\u0080]/;function rDi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return Pza.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(rDi,"normalize");gAe.tryNormalizeToBase=(function(){let t=new TIr.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=tDi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var bDi=I(lc=>{"use strict";p();var kza=lc&&lc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Dza=lc&&lc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Nza=lc&&lc.__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(uDi,"_matchesPrefix");function dDi(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(dDi,"matchesContiguousSubString");function Bza(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(Bza,"matchesBaseContiguousSubString");function fDi(t,e){return t.length>e.length?null:wIr(t.toLowerCase(),e.toLowerCase(),0,0)}a(fDi,"matchesSubString");function wIr(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=wIr(t,e,r+1,n+1))?BIr({start:n,end:n+1},o):null}return wIr(t,e,r,n+1)}a(wIr,"_matchesSubString");function MIr(t){return 97<=t&&t<=122}a(MIr,"isLower");function b4e(t){return 65<=t&&t<=90}a(b4e,"isUpper");function OIr(t){return 48<=t&&t<=57}a(OIr,"isNumber");function pDi(t){return t===32||t===9||t===10||t===13}a(pDi,"isWhitespace");var hDi=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>hDi.add(t.charCodeAt(0)));function fyt(t){return pDi(t)||hDi.has(t)}a(fyt,"isWordSeparator");function iDi(t,e){return t===e||fyt(t)&&fyt(e)}a(iDi,"charactersMatch");var IIr=new Map;function oDi(t){if(IIr.has(t))return IIr.get(t);let e,r=(0,Oza.getKoreanAltChars)(t);return r&&(e=r),IIr.set(t,e),e}a(oDi,"getAlternateCodes");function mDi(t){return MIr(t)||b4e(t)||OIr(t)}a(mDi,"isAlphanumeric");function BIr(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(BIr,"join");function gDi(t,e){for(let r=e;r0&&!mDi(t.charCodeAt(r-1)))return r}return t.length}a(gDi,"nextAnchor");function RIr(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=RIr(t,e,r+1,n+1);!o&&(s=gDi(e,s)).6}a(Fza,"isUpperCaseWord");function Uza(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(Uza,"isCamelCaseWord");function Qza(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=Lza(e);if(!Uza(r)){if(!Fza(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&fyt(t.charCodeAt(r-1)))return r;return t.length}a(ADi,"nextWord");var Hza=NIr(lc.matchesPrefix,LIr,dDi),Gza=NIr(lc.matchesPrefix,LIr,fDi),aDi=new Mza.LRUCache(1e4);function $za(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=aDi.get(t);n||(n=new RegExp(DIr.convertSimple2RegExpPattern(t),"i"),aDi.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?Gza(t,e):Hza(t,e)}a($za,"matchesFuzzy");function Vza(t,e){let r=C4e(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?yDi(r):null}a(Vza,"matchesFuzzy2");function Wza(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(yDi,"createMatches");var i$=128;function FIr(){let t=[],e=[];for(let r=0;r<=i$;r++)e[r]=0;for(let r=0;r<=i$;r++)t.push(e.slice(0));return t}a(FIr,"initTable");function EDi(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(EDi,"initArr");var _Di=EDi(2*i$),kIr=EDi(2*i$),Y4=FIr(),n$=FIr(),v4e=FIr(),zza=!1;function xIr(t,e,r,n,o){function s(l,u,d=" "){for(;l.lengths(l,3)).join("|")} +`,"\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("|")} `;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(xIr,"printTable");function Yza(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(xIr(n$,t,t.length,r,r.length)),console.log(xIr(v4e,t,t.length,r,r.length)),console.log(xIr(Y4,t,t.length,r,r.length))}a(Yza,"printTables");function lyt(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!!DIr.isEmojiImprecise(r)}}a(lyt,"isSeparatorAtPos");function cDi(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a(cDi,"isWhitespaceAtPos");function uyt(t,e,r){return e[t]!==r[t]}a(uyt,"isUpperCaseAtPos");function vDi(t,e,r,n,o,s,c=!1){for(;ei$?i$:t.length,u=n.length>i$?i$:n.length;if(r>=l||s>=u||l-r>u-s||!vDi(e,r,l,o,s,u,!0))return;Kza(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?n$[d][f-1]+(Y4[d][f-1]>0?-5:0):0,N=m>v+1&&Y4[d][f-1]>0,B=N?n$[d][f-2]+(Y4[d][f-2]>0?-5:0):0;if(N&&(!P||B>=D)&&(!R||B>=x))n$[d][f]=B,v4e[d][f]=3,Y4[d][f]=0;else if(P&&(!R||D>=x))n$[d][f]=D,v4e[d][f]=2,Y4[d][f]=0;else if(R)n$[d][f]=x,v4e[d][f]=1,Y4[d][f]=Y4[d-1][f-1]+1;else throw new Error("not possible")}}if(zza&&Yza(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[n$[d][f],s],y=0,E=0;for(;d>=1;){let v=f;do{let b=v4e[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]&&!uyt(v+s-1,n,o)&&y+1>Y4[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(C4e,"fuzzyScore");function Kza(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(kIr[c]=l,c--),l--}a(Kza,"_fillInMaxWordMatchPos");function Jza(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:uyt(c,o,s)&&(c===0||!uyt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):lyt(s,c)&&(c===0||!lyt(s,c-1))?h=5:(lyt(s,c-1)||cDi(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=uyt(c,o,s)||lyt(s,c-1)||cDi(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(Jza,"_doScore");function Zza(t,e,r,n,o,s,c){return CDi(t,e,r,n,o,s,!0,c)}a(Zza,"fuzzyScoreGracefulAggressive");function Xza(t,e,r,n,o,s,c){return CDi(t,e,r,n,o,s,!1,c)}a(Xza,"fuzzyScoreGraceful");function CDi(t,e,r,n,o,s,c,l){let u=C4e(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(CDi,"fuzzyScoreWithPermutations");function eYa(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(eYa,"nextTypoPermutation")});var TDi=I(o$=>{"use strict";p();Object.defineProperty(o$,"__esModule",{value:!0});o$.escapeIcons=iYa;o$.markdownEscapeEscapedIcons=sYa;o$.stripIcons=cYa;o$.getCodiconAriaLabel=lYa;o$.parseLabelWithIcons=uYa;o$.matchesFuzzyIconAware=dYa;var SDi=bDi(),tYa=Qh(),QIr=R0r(),rYa="$(",qIr=new RegExp(`\\$\\(${QIr.ThemeIcon.iconNameExpression}(?:${QIr.ThemeIcon.iconModifierExpression})?\\)`,"g"),nYa=new RegExp(`(\\\\)?${qIr.source}`,"g");function iYa(t){return t.replace(nYa,(e,r)=>r?e:`\\${e}`)}a(iYa,"escapeIcons");var oYa=new RegExp(`\\\\${qIr.source}`,"g");function sYa(t){return t.replace(oYa,e=>`\\${e}`)}a(sYa,"markdownEscapeEscapedIcons");var aYa=new RegExp(`(\\s)?(\\\\)?${qIr.source}(\\s)?`,"g");function cYa(t){return t.indexOf(rYa)===-1?t:t.replace(aYa,(e,r,n,o)=>n?e:r||o||"")}a(cYa,"stripIcons");function lYa(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(lYa,"getCodiconAriaLabel");var UIr=new RegExp(`\\$\\(${QIr.ThemeIcon.iconNameCharacter}+\\)`,"g");function uYa(t){UIr.lastIndex=0;let e="",r=[],n=0;for(;;){let o=UIr.lastIndex,s=UIr.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(ly,"__esModule",{value:!0});ly.MarkdownString=void 0;ly.isEmptyMarkdownString=IDi;ly.isMarkdownString=xDi;ly.markdownStringEqual=AYa;ly.escapeMarkdownSyntaxTokens=gyt;ly.escapeMarkdownLinkLabel=yYa;ly.appendEscapedMarkdownCodeBlockFence=wDi;ly.appendEscapedMarkdownInlineCode=EYa;ly.escapeDoubleQuotes=_Ya;ly.removeMarkdownEscapes=vYa;ly.parseHrefAndDimensions=CYa;ly.createMarkdownLink=RDi;ly.createMarkdownCommandLink=bYa;ly.createCommandUri=PDi;var fYa=Is(),pYa=TDi(),hYa=GY(),mYa=kk(),gYa=Qh(),hyt=Ku(),myt=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?hyt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,fYa.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+=gyt(this.supportThemeIcons?(0,pYa.escapeIcons)(e):e).replace(/([ \t]+)/g,(n,o)=>" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,r===1?`\\ +`;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?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,r){return this.value+=` -${wDi(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,gYa.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};ly.MarkdownString=myt;function IDi(t){return xDi(t)?!t.value:Array.isArray(t)?t.every(IDi):!0}a(IDi,"isEmptyMarkdownString");function xDi(t){return t instanceof myt?!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(xDi,"isMarkdownString");function AYa(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,mYa.isEqual)(hyt.URI.from(t.baseUri),hyt.URI.from(e.baseUri)))}a(AYa,"markdownStringEqual");function gyt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(gyt,"escapeMarkdownSyntaxTokens");function yYa(t){return t.replace(/[\\\]]/g,"\\$&")}a(yYa,"escapeMarkdownLinkLabel");function wDi(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(wDi,"appendEscapedMarkdownCodeBlockFence");function EYa(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(EYa,"appendEscapedMarkdownInlineCode");function _Ya(t){return t.replace(/"/g,""")}a(_Ya,"escapeDoubleQuotes");function vYa(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(vYa,"removeMarkdownEscapes");function CYa(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(CYa,"parseHrefAndDimensions");function RDi(t,e,r,n=!0){return`[${n?gyt(t):t}](${e}${r?` "${gyt(r)}"`:""})`}a(RDi,"createMarkdownLink");function bYa(t,e=!0){let r=PDi(t.id,...t.arguments||[]).toString();return RDi(t.text,r,t.tooltip,e)}a(bYa,"createMarkdownCommandLink");function PDi(t,...e){return hyt.URI.from({scheme:hYa.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(PDi,"createCommandUri")});var GIr=I(Fre=>{"use strict";p();var SYa=Fre&&Fre.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(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(Fre,"__esModule",{value:!0});Fre.MarkdownString=void 0;var TYa=kDi(),IYa=RD(),HIr=jIr=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof jIr?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new TYa.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}};Fre.MarkdownString=HIr;Fre.MarkdownString=HIr=jIr=SYa([IYa.es5ClassCompat],HIr)});var MDi=I(f6=>{"use strict";p();Object.defineProperty(f6,"__esModule",{value:!0});f6.Mimes=void 0;f6.getMediaOrTextMime=wYa;f6.getMediaMime=NDi;f6.getExtensionForMimeType=RYa;f6.normalizeMimeType=kYa;f6.isTextStreamMime=DYa;var DDi=EA();f6.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 xYa={".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"},$Ir={".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 wYa(t){let e=(0,DDi.extname)(t),r=xYa[e.toLowerCase()];return r!==void 0?r:NDi(t)}a(wYa,"getMediaOrTextMime");function NDi(t){let e=(0,DDi.extname)(t),r=$Ir[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a(NDi,"getMediaMime");function RYa(t){for(let e in $Ir){let r=$Ir[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(RYa,"getExtensionForMimeType");var PYa=/^(.+)\/(.+?)(;.+)?$/;function kYa(t,e){let r=PYa.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(kYa,"normalizeMimeType");function DYa(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(DYa,"isTextStreamMime")});var LDi=I(C0=>{"use strict";p();var NYa=C0&&C0.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},s$;Object.defineProperty(C0,"__esModule",{value:!0});C0.NotebookCellOutput=C0.NotebookCellOutputItem=C0.NotebookEdit=C0.NotebookData=C0.NotebookCellData=C0.NotebookRange=C0.NotebookCellKind=void 0;var MYa=RD(),ODi=Is(),Ayt=MDi(),OYa=y0(),BDi;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(BDi||(C0.NotebookCellKind=BDi={}));var Ure=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,ODi.illegalArgument)("start must be positive");if(r<0)throw(0,ODi.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)}};C0.NotebookRange=Ure;var VIr=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)}};C0.NotebookCellData=VIr;var WIr=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};C0.NotebookData=WIr;var zIr=s$=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof s$?!0:e?Ure.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new s$(e,r)}static insertCells(e,r){return new s$(new Ure(e,e),r)}static deleteCells(e){return new s$(e,[])}static updateCellMetadata(e,r){let n=new s$(new Ure(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new s$(new Ure(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};C0.NotebookEdit=zIr;C0.NotebookEdit=zIr=s$=NYa([MYa.es5ClassCompat],zIr);var YIr=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=Ayt.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,Ayt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};C0.NotebookCellOutputItem=YIr;var KIr=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,OYa.generateUuid)(),this.metadata=r??n)}};C0.NotebookCellOutput=KIr});var UDi=I(c$=>{"use strict";p();var BYa=c$&&c$.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(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(c$,"__esModule",{value:!0});c$.Selection=void 0;c$.getDebugDescriptionOfSelection=FDi;var LYa=RD(),a$=mAe(),ZIr=W4(),XIr=JIr=class extends ZIr.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof JIr?!0:!e||typeof e!="object"?!1:ZIr.Range.isRange(e)&&a$.Position.isPosition(e.anchor)&&a$.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 a$.Position(e,r),c=new a$.Position(n,o)):a$.Position.isPosition(e)&&a$.Position.isPosition(r)&&(s=a$.Position.of(e),c=a$.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 FDi(this)}};c$.Selection=XIr;c$.Selection=XIr=JIr=BYa([LYa.es5ClassCompat],XIr);function FDi(t){let e=(0,ZIr.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(FDi,"getDebugDescriptionOfSelection")});var txr=I(qre=>{"use strict";p();var FYa=qre&&qre.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Qre;Object.defineProperty(qre,"__esModule",{value:!0});qre.SnippetString=void 0;var UYa=RD(),exr=Qre=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof Qre?!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+=Qre._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 Qre;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Qre._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 Qre;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}};qre.SnippetString=exr;qre.SnippetString=exr=Qre=FYa([UYa.es5ClassCompat],exr)});var nxr=I(yyt=>{"use strict";p();Object.defineProperty(yyt,"__esModule",{value:!0});yyt.SnippetTextEdit=void 0;var QYa=txr(),QDi=W4(),rxr=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?QDi.Range.isRange(e.range)&&QYa.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new QDi.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};yyt.SnippetTextEdit=rxr});var HDi=I(PD=>{"use strict";p();var qYa=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},ixr;Object.defineProperty(PD,"__esModule",{value:!0});PD.SymbolInformation=PD.SymbolTag=PD.SymbolKind=void 0;var jYa=RD(),qDi=_Ir(),HYa=W4(),oxr;(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"})(oxr||(PD.SymbolKind=oxr={}));var jDi;(function(t){t[t.Deprecated=1]="Deprecated"})(jDi||(PD.SymbolTag=jDi={}));var sxr=ixr=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 qDi.Location?this.location=o:n instanceof HYa.Range&&(this.location=new qDi.Location(o,n)),ixr.validate(this)}toJSON(){return{name:this.name,kind:oxr[this.kind],location:this.location,containerName:this.containerName}}};PD.SymbolInformation=sxr;PD.SymbolInformation=sxr=ixr=qYa([jYa.es5ClassCompat],sxr)});var lxr=I(p6=>{"use strict";p();var GYa=p6&&p6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},jre;Object.defineProperty(p6,"__esModule",{value:!0});p6.TextEdit=p6.EndOfLine=void 0;var axr=Is(),$Ya=RD(),GDi=mAe(),Eyt=W4(),$Di;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})($Di||(p6.EndOfLine=$Di={}));var cxr=jre=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof jre?!0:!e||typeof e!="object"?!1:Eyt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new jre(e,r)}static insert(e,r){return jre.replace(new Eyt.Range(e,e),r)}static delete(e){return jre.replace(e,"")}static setEndOfLine(e){let r=new jre(new Eyt.Range(new GDi.Position(0,0),new GDi.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!Eyt.Range.isRange(e))throw(0,axr.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,axr.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,axr.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}}};p6.TextEdit=cxr;p6.TextEdit=cxr=jre=GYa([$Ya.es5ClassCompat],cxr)});var nNi=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 VDi=uQ(),byt=GIr(),uxr=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new byt.MarkdownString(e):e}};xt.ChatResponseMarkdownPart=uxr;var dxr=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};xt.ChatResponseCodeblockUriPart=dxr;var fxr=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};xt.ChatResponseFileTreePart=fxr;var pxr=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};xt.ChatResponseAnchorPart=pxr;var hxr=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};xt.ChatResponseProgressPart=hxr;var mxr=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.ChatResponseThinkingProgressPart=mxr;var gxr=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};xt.ChatResponseHookPart=gxr;var Axr=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};xt.ChatResponseExternalEditPart=Axr;var yxr=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};xt.ChatResponseProgressPart2=yxr;var Exr=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new byt.MarkdownString(e):e}};xt.ChatResponseWarningPart=Exr;var _xr=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new byt.MarkdownString(e):e}};xt.ChatResponseInfoPart=_xr;var vxr=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};xt.ChatResponseReferencePart=vxr;var Cxr=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};xt.ChatResponseReferencePart2=Cxr;var bxr=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};xt.ChatResponseMovePart=bxr;var Sxr=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};xt.ChatResponseExtensionsPart=Sxr;var Txr=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=Txr;var Ixr=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};xt.ChatResponseCodeCitationPart=Ixr;var xxr=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};xt.ChatResponseCommandButtonPart=xxr;var wxr=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new byt.MarkdownString(e):e,this.vulnerabilities=r}};xt.ChatResponseMarkdownWithVulnerabilitiesPart=wxr;var Rxr=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=Rxr;var Pxr=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=Pxr;var kxr=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};xt.ChatResponseWorkspaceEditPart=kxr;var Dxr=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};xt.ChatResponseConfirmationPart=Dxr;var WDi;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(WDi||(xt.ChatQuestionType=WDi={}));var Nxr=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=Nxr;var Mxr=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};xt.ChatResponseQuestionCarouselPart=Mxr;var Oxr=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=Oxr;var Bxr=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=Bxr;var Lxr=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn=Lxr;var Fxr=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};xt.ChatRequestEditorData=Fxr;var Uxr=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};xt.ChatRequestNotebookData=Uxr;var Qxr=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};xt.ChatReferenceDiagnostic=Qxr;var qxr=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};xt.ChatReferenceBinaryData=qxr;var jxr=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};xt.LanguageModelToolResult=jxr;var Hxr=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};xt.LanguageModelToolResult2=Hxr;var _yt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};xt.LanguageModelTextPart=_yt;var zDi;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})(zDi||(xt.LanguageModelPartAudience=zDi={}));var Gxr=class extends _yt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};xt.LanguageModelTextPart2=Gxr;var $xr=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.LanguageModelThinkingPart=$xr;var vyt=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(VDi.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t(VDi.VSBuffer.fromString(e).buffer,"text/plain")}};xt.LanguageModelDataPart=vyt;var Vxr=class extends vyt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};xt.LanguageModelDataPart2=Vxr;var YDi;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(YDi||(xt.ChatImageMimeType=YDi={}));var Wxr=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};xt.LanguageModelPromptTsxPart=Wxr;var KDi;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(KDi||(xt.ExcludeSettingOptions=KDi={}));var zxr=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};xt.TextSearchMatch2=zxr;var Yxr=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};xt.AISearchKeyword=Yxr;var JDi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(JDi||(xt.ChatErrorLevel=JDi={}));var ZDi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(ZDi||(xt.ChatInputNotificationSeverity=ZDi={}));var XDi;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(XDi||(xt.ChatRequestEditedFileEventKind=XDi={}));var eNi;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(eNi||(xt.ChatResponseClearToPreviousToolInvocationReason=eNi={}));var Kxr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};xt.LanguageModelToolExtensionSource=Kxr;var Jxr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};xt.LanguageModelToolMCPSource=Jxr;var Zxr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};xt.LanguageModelToolCallPart=Zxr;var Xxr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart=Xxr;var ewr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart2=ewr;var Cyt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(Cyt||(xt.LanguageModelChatMessageRole=Cyt={}));var tNi;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(tNi||(xt.LanguageModelChatToolMode=tNi={}));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(Cyt.User,e,r)}static Assistant(e,r){return new t(Cyt.Assistant,e,r)}};xt.LanguageModelChatMessage=twr;var rwr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};xt.McpToolInvocationContentData=rwr;var nwr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};xt.ChatToolInvocationPart=nwr;var iwr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};xt.ChatSubagentToolInvocationData=iwr;var owr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn2=owr;var rNi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(rNi||(xt.ChatSessionStatus=rNi={}));var swr=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=swr;var awr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};xt.ChatResource=awr;var cwr=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=cwr;var lwr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};xt.McpHttpServerDefinition=lwr});var sNi=I(l$=>{"use strict";p();Object.defineProperty(l$,"__esModule",{value:!0});l$.TextDocumentChangeReason=l$.TextEditorSelectionChangeKind=l$.WorkspaceEdit=void 0;var VYa=Al(),WYa=bk(),zYa=W4(),YYa=nxr(),KYa=lxr(),uwr=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 KYa.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new zYa.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,YYa.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(bp,"__esModule",{value:!0});bp.FileType=bp.ChatSessionStatus=bp.ChatLocation=bp.ChatVariableLevel=bp.ExtensionMode=bp.DiagnosticSeverity=bp.TextEditorRevealType=bp.TextEditorLineNumbersStyle=bp.TextEditorCursorStyle=bp.InteractiveEditorResponseFeedbackKind=void 0;var aNi;(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"})(aNi||(bp.InteractiveEditorResponseFeedbackKind=aNi={}));var cNi;(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"})(cNi||(bp.TextEditorCursorStyle=cNi={}));var lNi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(lNi||(bp.TextEditorLineNumbersStyle=lNi={}));var uNi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(uNi||(bp.TextEditorRevealType=uNi={}));var dNi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(dNi||(bp.DiagnosticSeverity=dNi={}));var fNi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(fNi||(bp.ExtensionMode=fNi={}));var pNi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(pNi||(bp.ChatVariableLevel=pNi={}));var hNi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(hNi||(bp.ChatLocation=hNi={}));var mNi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(mNi||(bp.ChatSessionStatus=mNi={}));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||(bp.FileType=gNi={}))});var ENi=I(dwr=>{"use strict";p();Object.defineProperty(dwr,"__esModule",{value:!0});dwr.t=JYa;function JYa(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return yNi({message:e,args:r})}return yNi(t[0])}a(JYa,"t");function yNi(t){let{message:e,args:r}=t;return XYa(e,r??{})}a(yNi,"getMessage");var ZYa=/{([^}]+)}/g;function XYa(t,e){return t.replace(ZYa,(r,n)=>e[n]??r)}a(XYa,"format2")});var CNi=I(u$=>{"use strict";p();Object.defineProperty(u$,"__esModule",{value:!0});u$.NewSymbolName=u$.NewSymbolNameTriggerKind=u$.NewSymbolNameTag=void 0;var _Ni;(function(t){t[t.AIGenerated=1]="AIGenerated"})(_Ni||(u$.NewSymbolNameTag=_Ni={}));var vNi;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(vNi||(u$.NewSymbolNameTriggerKind=vNi={}));var fwr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};u$.NewSymbolName=fwr});var SNi=I(Syt=>{"use strict";p();Object.defineProperty(Syt,"__esModule",{value:!0});Syt.TerminalShellExecutionCommandLineConfidence=void 0;var bNi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(bNi||(Syt.TerminalShellExecutionCommandLineConfidence=bNi={}))});var TNi=I(AAe=>{"use strict";p();Object.defineProperty(AAe,"__esModule",{value:!0});AAe.ThemeColor=AAe.ThemeIcon=void 0;var pwr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};AAe.ThemeIcon=pwr;var hwr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};AAe.ThemeColor=hwr});var b0=I((K5p,RNi)=>{"use strict";p();var eKa=wk(),tKa=bc(),rKa=Ku(),INi=AIr(),nKa=_Ir(),iKa=GIr(),S4e=LDi(),oKa=mAe(),sKa=W4(),aKa=UDi(),cKa=txr(),lKa=nxr(),xNi=HDi(),wNi=lxr(),On=nNi(),mwr=sNi(),d$=ANi(),uKa=ENi(),gwr=CNi(),dKa=SNi(),fKa=TNi(),pKa={Position:oKa.Position,Range:sKa.Range,Selection:aKa.Selection,EventEmitter:tKa.Emitter,CancellationTokenSource:eKa.CancellationTokenSource,Diagnostic:INi.Diagnostic,Location:nKa.Location,DiagnosticRelatedInformation:INi.DiagnosticRelatedInformation,TextEdit:wNi.TextEdit,WorkspaceEdit:mwr.WorkspaceEdit,Uri:rKa.URI,MarkdownString:iKa.MarkdownString,DiagnosticSeverity:d$.DiagnosticSeverity,TextEditorCursorStyle:d$.TextEditorCursorStyle,TextEditorLineNumbersStyle:d$.TextEditorLineNumbersStyle,TextEditorRevealType:d$.TextEditorRevealType,EndOfLine:wNi.EndOfLine,l10n:{t:uKa.t},ExtensionMode:d$.ExtensionMode,ChatVariableLevel:d$.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:gwr.NewSymbolName,NewSymbolNameTag:gwr.NewSymbolNameTag,NewSymbolNameTriggerKind:gwr.NewSymbolNameTriggerKind,ChatLocation:d$.ChatLocation,SymbolInformation:xNi.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:S4e.NotebookCellKind,NotebookRange:S4e.NotebookRange,NotebookEdit:S4e.NotebookEdit,NotebookCellData:S4e.NotebookCellData,NotebookData:S4e.NotebookData,ChatErrorLevel:On.ChatErrorLevel,ChatInputNotificationSeverity:On.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:dKa.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:mwr.TextEditorSelectionChangeKind,TextDocumentChangeReason:mwr.TextDocumentChangeReason,ChatToolInvocationPart:On.ChatToolInvocationPart,ChatSubagentToolInvocationData:On.ChatSubagentToolInvocationData,McpToolInvocationContentData:On.McpToolInvocationContentData,ChatResponseTurn2:On.ChatResponseTurn2,ChatRequestTurn2:On.ChatRequestTurn2,LanguageModelError:On.LanguageModelError,SymbolKind:xNi.SymbolKind,SnippetString:cKa.SnippetString,SnippetTextEdit:lKa.SnippetTextEdit,FileType:d$.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:fKa.ThemeIcon};RNi.exports=pKa});var PNi=I(yAe=>{"use strict";p();Object.defineProperty(yAe,"__esModule",{value:!0});yAe.UseData=yAe.UseState=void 0;var Awr=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}};yAe.UseState=Awr;var ywr=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)}}};yAe.UseData=ywr});var DNi=I(Tyt=>{"use strict";p();Object.defineProperty(Tyt,"__esModule",{value:!0});Tyt.VirtualPromptReconciler=void 0;var kNi=PNi(),Ewr=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(hKa(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 vwr(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 _wr([])),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)}};Tyt.VirtualPromptReconciler=Ewr;var _wr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},vwr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new kNi.UseState(e.state),this.dataHook=new kNi.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 hKa(t){return typeof t=="function"&&"isFragmentFunction"in t}a(hKa,"isFragmentFunction")});var NNi=I(Iyt=>{"use strict";p();Object.defineProperty(Iyt,"__esModule",{value:!0});Iyt.VirtualPrompt=void 0;var mKa=DNi(),Cwr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new mKa.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()}};Iyt.VirtualPrompt=Cwr});var h6=I(xyt=>{"use strict";p();Object.defineProperty(xyt,"__esModule",{value:!0});xyt.Text=gKa;xyt.Chunk=AKa;function gKa(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(gKa,"Text");function AKa(t){return t.children}a(AKa,"Chunk")});var f$=I(m6=>{"use strict";p();Object.defineProperty(m6,"__esModule",{value:!0});m6.PerCompletionContextProviderStatistics=m6.ContextProviderStatistics=m6.ICompletionsContextProviderService=void 0;m6.componentStatisticsToPromptMatcher=_Ka;var yKa=rn(),EKa=c6();m6.ICompletionsContextProviderService=(0,yKa.createServiceIdentifier)("ICompletionsContextProviderService");var bwr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new wyt){this.createStatistics=e,this.statistics=new EKa.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)}}};m6.ContextProviderStatistics=bwr;var wyt=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()}}};m6.PerCompletionContextProviderStatistics=wyt;function _Ka(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(_Ka,"componentStatisticsToPromptMatcher")});var x4e=I(I4e=>{"use strict";p();Object.defineProperty(I4e,"__esModule",{value:!0});I4e.filterContextItemsByType=SKa;I4e.filterSupportedContextItems=TKa;I4e.addOrValidateContextItemsIDs=xKa;var vKa=b0(),CKa=Ku(),Swr=y0(),bKa=W5e(),Twr=Il(),T4e;(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&&!bKa.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})(T4e||(T4e={}));var Iwr;(function(t){function e(r){if(!T4e.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(Iwr||(Iwr={}));var xwr;(function(t){function e(r){if(!T4e.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})(xwr||(xwr={}));var wwr;(function(t){function e(r){if(!T4e.is(r))return!1;let n=r;if(!CKa.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof vKa.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(wwr||(wwr={}));var Rwr;(function(t){function e(r){if(Iwr.is(r))return"Trait";if(xwr.is(r))return"CodeSnippet";if(wwr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(Rwr||(Rwr={}));function SKa(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(SKa,"filterContextItemsByType");function TKa(t){let e=[],r=0;return t.forEach(n=>{let o=Rwr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(TKa,"filterSupportedContextItems");function IKa(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(IKa,"validateContextItemId");function xKa(t,e){let r=new Set,n=t.get(Twr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,Swr.generateUuid)();if(!IKa(c)){let l=(0,Swr.generateUuid)();Twr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,Swr.generateUuid)();Twr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(xKa,"addOrValidateContextItemsIDs")});var Pwr=I(Ryt=>{"use strict";p();Object.defineProperty(Ryt,"__esModule",{value:!0});Ryt.getCodeSnippetsFromContextItems=DKa;Ryt.addRelativePathToCodeSnippets=NKa;var wKa=e1(),RKa=f$(),PKa=x4e(),kKa="content_excluded";async function DKa(t,e,r,n){let o=(0,PKa.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(RKa.ICompletionsContextProviderService),u=t.get(wKa.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,kKa]]),g}).map(h=>h.data)}a(DKa,"getCodeSnippetsFromContextItems");function NKa(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(NKa,"addRelativePathToCodeSnippets")});var kwr=I(Dyt=>{"use strict";p();Object.defineProperty(Dyt,"__esModule",{value:!0});Dyt.CodeSnippets=void 0;var Pyt=V4(),kyt=h6(),MKa=g6(),OKa=Pwr(),BKa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(MKa.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,OKa.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,Pyt.jsx)(kyt.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,Pyt.jsx)(kyt.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(EAe,"__esModule",{value:!0});EAe.CompletionsContext=MNi;EAe.StableCompletionsContext=ONi;EAe.AdditionalCompletionsContext=BNi;EAe.isContextNode=LKa;function MNi(t){return t.children}a(MNi,"CompletionsContext");function ONi(t){return t.children}a(ONi,"StableCompletionsContext");function BNi(t){return t.children}a(BNi,"AdditionalCompletionsContext");function LKa(t){return t.name===MNi.name||t.name===ONi.name||t.name===BNi.name}a(LKa,"isContextNode")});var Nwr=I(R4e=>{"use strict";p();Object.defineProperty(R4e,"__esModule",{value:!0});R4e.SnapshotWalker=void 0;R4e.defaultTransformers=LNi;var FKa=h6(),Dwr=class{static{a(this,"SnapshotWalker")}constructor(e,r=LNi()){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)}};R4e.SnapshotWalker=Dwr;function LNi(){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===FKa.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(LNi,"defaultTransformers")});var FNi=I(Mwr=>{"use strict";p();Object.defineProperty(Mwr,"__esModule",{value:!0});Mwr.findEditDistanceScore=UKa;function UKa(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(kD,"__esModule",{value:!0});kD.MAX_EDIT_DISTANCE_LENGTH=void 0;kD.CurrentFile=HKa;kD.BeforeCursor=Lwr;kD.AfterCursor=Fwr;kD.DocumentPrefix=GKa;kD.DocumentSuffix=$Ka;var MR=V4(),_Ae=h6(),QKa=$G(),qKa=FNi(),jKa=zge(),Owr=g6();kD.MAX_EDIT_DISTANCE_LENGTH=50;function Bwr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(Bwr,"approximateMaxCharacters");function HKa(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(Owr.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=Bwr(c);return(0,MR.jsxs)(MR.Fragment,{children:[(0,MR.jsx)(Lwr,{document:r,position:o,maxCharacters:m}),(0,MR.jsx)(Fwr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(HKa,"CurrentFile");function Lwr(t){if(t.document===void 0||t.position===void 0)return(0,MR.jsx)(_Ae.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,MR.jsx)(_Ae.Text,{children:e})}a(Lwr,"BeforeCursor");function Fwr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,MR.jsx)(_Ae.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,MR.jsx)(_Ae.Text,{});if(r===s)return(0,MR.jsx)(_Ae.Text,{children:r});let c=s;if(r!==""){let l=(0,jKa.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,kD.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,kD.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,qKa.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??QKa.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,MR.jsx)(_Ae.Text,{children:c})}a(Fwr,"AfterCursor");function GKa(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(Owr.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=Bwr(c);return(0,MR.jsx)(Lwr,{document:r,position:o,maxCharacters:u})}a(GKa,"DocumentPrefix");function $Ka(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(Owr.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=Bwr(c);return(0,MR.jsx)(Fwr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a($Ka,"DocumentSuffix")});var Qwr=I(Hre=>{"use strict";p();Object.defineProperty(Hre,"__esModule",{value:!0});Hre.WishlistElision=void 0;Hre.makePrompt=VKa;Hre.makePrefixPrompt=WKa;Hre.makeContextPrompt=zKa;var Uwr=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]}};Hre.WishlistElision=Uwr;function VKa(t){return t.map(e=>e.elidedValue).join("")}a(VKa,"makePrompt");function WKa(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(WKa,"makePrefixPrompt");function zKa(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(zKa,"makeContextPrompt")});var Hwr=I(p$=>{"use strict";p();Object.defineProperty(p$,"__esModule",{value:!0});p$.transformers=p$.CompletionsPromptRenderer=void 0;p$.normalizeLineEndings=jwr;var jNi=Nwr(),UNi=m4e(),QNi=zge(),YKa=w4e(),Nyt=P4e(),qNi=Qwr(),KKa=5,qwr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=qNi.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??QNi.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 qNi.WishlistElision,{blocks:[y,...E]}=A.elide(u,h,d,m,(0,QNi.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(...JKa([...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-KKa: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 jNi.SnapshotWalker(e,p$.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===Nyt.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:jwr(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,UNi.isShebangLine)(f.value)?y=A:y=(0,UNi.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:jwr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${Nyt.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}}};p$.CompletionsPromptRenderer=qwr;p$.transformers=[...(0,jNi.defaultTransformers)(),(t,e,r)=>(0,YKa.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===Nyt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===Nyt.AfterCursor.name?{...r,type:"suffix"}:r];function JKa(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(JKa,"computeComponentStatistics");function jwr(t){return t.replace(/\r\n?/g,` -`)}a(jwr,"normalizeLineEndings")});var Myt=I(vAe=>{"use strict";p();Object.defineProperty(vAe,"__esModule",{value:!0});vAe.ILanguageContextProviderService=vAe.ProviderTarget=void 0;var ZKa=rn(),HNi;(function(t){t.NES="nes",t.Completions="completions"})(HNi||(vAe.ProviderTarget=HNi={}));vAe.ILanguageContextProviderService=(0,ZKa.createServiceIdentifier)("ILanguageContextProviderService")});var Gre=I(CAe=>{"use strict";p();Object.defineProperty(CAe,"__esModule",{value:!0});CAe.RuntimeMode=CAe.ICompletionsRuntimeModeService=void 0;var XKa=rn();CAe.ICompletionsRuntimeModeService=(0,XKa.createServiceIdentifier)("completionsRuntimeModeService");var Gwr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:GNi(r,n),verboseLogging:tJa(r,n),testMode:e,simulation:eJa(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}};CAe.RuntimeMode=Gwr;function GNi(t,e){return t.includes("--debug")||$wr(e,"DEBUG")}a(GNi,"determineDebugFlag");function eJa(t){return $wr(t,"SIMULATION")}a(eJa,"determineSimulationFlag");function tJa(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||$wr(e,"VERBOSE")||GNi(t,e)}a(tJa,"determineVerboseLoggingEnabled");function $wr(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($wr,"determineEnvFlagEnabled")});var zNi=I(k4e=>{"use strict";p();Object.defineProperty(k4e,"__esModule",{value:!0});k4e.eventToPromise=rJa;k4e.isArrayOfT=WNi;k4e.resolveAll=iJa;var $Ni=n4e();async function rJa(t){let e=new $Ni.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(rJa,"eventToPromise");async function nJa(t){if(t.isCancellationRequested)return;let e=new $Ni.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(nJa,"cancellationTokenToPromise");async function VNi(t,e){if(e){let r=nJa(e);await Promise.race([t,r])}else await t}a(VNi,"raceCancellation");function WNi(t){return Array.isArray(t)}a(WNi,"isArrayOfT");async function iJa(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await oJa(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(iJa,"resolveAll");async function oJa(t,e){let r;return t instanceof Promise?r=await sJa(t,e):r=await aJa(t,e),r}a(oJa,"resolve");async function sJa(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:WNi(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await VNi(o,e),n.resolutionTime=performance.now()-r,n}a(sJa,"resolvePromise");async function aJa(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 VNi(o,e),n.resolutionTime=performance.now()-r,n}a(aJa,"resolveIterable")});var YNi=I(Wwr=>{"use strict";p();Object.defineProperty(Wwr,"__esModule",{value:!0});Wwr.fillInCppVSCodeActiveExperiments=dJa;var cJa=oy(),Vwr=Il(),lJa={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},uJa="ms-vscode.cpptools";function dJa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(uJa))&&fJa(t,r,n)}a(dJa,"fillInCppVSCodeActiveExperiments");function fJa(t,e,r){try{let n=t.get(cJa.ICompletionsFeaturesService),o=t.get(Vwr.ICompletionsLogTargetService),s=lJa,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){Vwr.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){Vwr.logger.exception(t,n,"fillInCppActiveExperiments")}}a(fJa,"addActiveExperiments")});var JNi=I(zwr=>{"use strict";p();Object.defineProperty(zwr,"__esModule",{value:!0});zwr.fillInCSharpActiveExperiments=hJa;var pJa=oy(),KNi=Il();function hJa(t,e,r){let n=t.get(pJa.ICompletionsFeaturesService),o=t.get(KNi.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 KNi.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a(hJa,"fillInCSharpActiveExperiments")});var ZNi=I(h$=>{"use strict";p();Object.defineProperty(h$,"__esModule",{value:!0});h$.multiLanguageContextProviderParamsDefault=void 0;h$.fillInMultiLanguageActiveExperiments=AJa;h$.getMultiLanguageContextProviderParamsFromActiveExperiments=_Ja;var mJa=oy(),Ywr=Il(),gJa="fallbackContextProvider";h$.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function AJa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(gJa))&&yJa(t,r,n)}a(AJa,"fillInMultiLanguageActiveExperiments");function yJa(t,e,r){try{let n=EJa(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Ywr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(yJa,"addActiveExperiments");function EJa(t,e){let r=h$.multiLanguageContextProviderParamsDefault,n=t.get(Ywr.ICompletionsLogTargetService),s=t.get(mJa.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){Ywr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(EJa,"getMultiLanguageContextProviderParamsFromExp");function _Ja(t){let e={...h$.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(_Ja,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var eMi=I(bAe=>{"use strict";p();Object.defineProperty(bAe,"__esModule",{value:!0});bAe.TS_CONTEXT_PROVIDER_ID=void 0;bAe.fillInTsActiveExperiments=CJa;var vJa=oy(),XNi=Il();bAe.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function CJa(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(bAe.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(XNi.ICompletionsLogTargetService),s=t.get(vJa.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 XNi.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(CJa,"fillInTsActiveExperiments")});var Lyt=I(xl=>{"use strict";p();var eRr=xl&&xl.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},DD=xl&&xl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(xl,"__esModule",{value:!0});xl.DefaultDiagnosticSettings=xl.CachedContextProviderRegistry=xl.MutableContextProviderRegistry=xl.CoreContextProviderRegistry=xl.DefaultContextProvidersContainer=xl.ICompletionsDefaultContextProviders=xl.ICompletionsContextProviderRegistryService=void 0;xl.telemetrizeContextItems=kJa;xl.matchContextItems=DJa;xl.useContextProviderAPI=MJa;xl.getDefaultDiagnosticSettings=BJa;var bJa=ri(),tMi=Tl(),tRr=Myt(),SJa=Cp(),iMi=rn(),TJa=Is(),rRr=Fs(),Oyt=RE(),oMi=oy(),IJa=c6(),A6=Il(),nRr=Gre(),rMi=zNi(),xJa=YNi(),wJa=JNi(),RJa=ZNi(),PJa=eMi(),nMi=x4e(),sMi=f$();xl.ICompletionsContextProviderRegistryService=(0,iMi.createServiceIdentifier)("ICompletionsContextProviderRegistryService");xl.ICompletionsDefaultContextProviders=(0,iMi.createServiceIdentifier)("ICompletionsDefaultContextProviders");var Kwr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};xl.DefaultContextProvidersContainer=Kwr;var Byt=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 A6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction(wJa.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 A6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(xJa.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(RJa.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(PJa.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new bJa.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(OJa,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,rMi.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,TJa.isCancellationError)(x.reason)||A6.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")&&(A6.logger.info(this.logTarget,`Context provider ${w.id} exceeded time budget of ${A}ms`),w.resolver.resolveOnTimeout))try{let j=w.resolver.resolveOnTimeout(v);(0,rMi.isArrayOfT)(j)?P.push(...j):j&&P.push(j),P.length>0&&(x.status="partial")}catch(j){A6.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,j)}let[D,N]=(0,nMi.filterSupportedContextItems)(P);N&&A6.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let B=this.instantiationService.invokeFunction(nMi.addOrValidateContextItemsIDs,D),L={providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:B};u.push(L)}b.setLastResolution(w.id,x.status)}else A6.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(aMi,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]}))}};xl.CoreContextProviderRegistry=Byt;xl.CoreContextProviderRegistry=Byt=eRr([DD(1,tRr.ILanguageContextProviderService),DD(2,nRr.ICompletionsRuntimeModeService),DD(3,rRr.IInstantiationService),DD(4,A6.ICompletionsLogTargetService),DD(5,sMi.ICompletionsContextProviderService)],Byt);var Jwr=class extends Byt{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)}};xl.MutableContextProviderRegistry=Jwr;xl.MutableContextProviderRegistry=Jwr=eRr([DD(1,tRr.ILanguageContextProviderService),DD(2,nRr.ICompletionsRuntimeModeService),DD(3,rRr.IInstantiationService),DD(4,A6.ICompletionsLogTargetService),DD(5,sMi.ICompletionsContextProviderService)],Jwr);var Zwr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new IJa.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}};xl.CachedContextProviderRegistry=Zwr;xl.CachedContextProviderRegistry=Zwr=eRr([DD(2,rRr.IInstantiationService)],Zwr);function kJa(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(kJa,"telemetrizeContextItems");function DJa(t){return t.matchScore>0&&t.resolution!=="error"}a(DJa,"matchContextItems");function aMi(t,e,r){let n=NJa(t,e,r),o=(0,Oyt.getConfig)(t,Oyt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get(xl.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(aMi,"getActiveContextProviders");function NJa(t,e,r){if(t.get(nRr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(oMi.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(NJa,"getExpContextProviders");function MJa(t,e,r){return aMi(t,e,r).length>0}a(MJa,"useContextProviderAPI");function OJa(t,e,r){let n=(0,Oyt.getConfig)(t,Oyt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(oMi.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(OJa,"getContextProviderTimeBudget");var Xwr;(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")})(Xwr||(xl.DefaultDiagnosticSettings=Xwr={}));function BJa(t){let e=t.get(tMi.IConfigurationService),r=t.get(SJa.IExperimentationService),n=e.getExperimentBasedConfig(tMi.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return Xwr.from(n)}a(BJa,"getDefaultDiagnosticSettings")});var Fyt=I(ND=>{"use strict";p();var LJa=ND&&ND.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},FJa=ND&&ND.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ND,"__esModule",{value:!0});ND.ContextProviderBridge=ND.ICompletionsContextProviderBridgeService=void 0;var UJa=rn(),QJa=c6(),qJa=Lyt();ND.ICompletionsContextProviderBridgeService=(0,UJa.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var iRr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new QJa.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:[]}};ND.ContextProviderBridge=iRr;ND.ContextProviderBridge=iRr=LJa([FJa(0,qJa.ICompletionsContextProviderRegistryService)],iRr)});var aRr=I(Uyt=>{"use strict";p();Object.defineProperty(Uyt,"__esModule",{value:!0});Uyt.Diagnostics=void 0;var oRr=V4(),jJa=b0(),sRr=h6(),HJa=$G(),GJa=g6();function $Ja(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($Ja,"getCode");function VJa(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a(VJa,"getRelativePath");var WJa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(GJa.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,HJa.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,oRr.jsx)(sRr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${VJa(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=$Ja(A);E!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${E}`);let _=A.range.start;m.push((0,oRr.jsx)(sRr.Text,{children:`${_.line+1}:${_.character+1} - ${jJa.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,oRr.jsx)(sRr.Chunk,{children:m})})},"Diagnostics");Uyt.Diagnostics=WJa});var cRr=I(qyt=>{"use strict";p();Object.defineProperty(qyt,"__esModule",{value:!0});qyt.DocumentMarker=void 0;var Qyt=V4(),cMi=h6(),lMi=m4e(),zJa=g6(),YJa=a((t,e)=>{let[r,n]=e.useState();if(e.useData(zJa.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,Qyt.jsx)(KJa,{docInfo:s}):(0,Qyt.jsx)(JJa,{docInfo:s})}},"DocumentMarker");qyt.DocumentMarker=YJa;var KJa=a(t=>(0,Qyt.jsx)(cMi.Text,{children:(0,lMi.getPathMarker)(t.docInfo)}),"PathMarker"),JJa=a(t=>(0,Qyt.jsx)(cMi.Text,{children:(0,lMi.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var lRr=I(D4e=>{"use strict";p();Object.defineProperty(D4e,"__esModule",{value:!0});D4e.RecentEdits=void 0;D4e.editIsTooCloseToCursor=fMi;var uMi=V4(),dMi=h6(),jyt=m4e(),ZJa=g6();function fMi(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(fMi,"editIsTooCloseToCursor");var XJa=a((t,e)=>{let[r,n]=e.useState();return e.useData(ZJa.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(fMi(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,jyt.newLineEnded)(`File: ${T}`)+(0,jyt.newLineEnded)(b))}}if(f.length===0){n(void 0);return}let h=(0,jyt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,jyt.newLineEnded)("End of recent edits");n(h)}),r?(0,uMi.jsx)(dMi.Chunk,{children:(0,uMi.jsx)(dMi.Text,{children:r})}):void 0},"RecentEdits");D4e.RecentEdits=XJa});var pMi=I(K4=>{"use strict";p();Object.defineProperty(K4,"__esModule",{value:!0});K4.registerDocumentTracker=K4.accessTimes=void 0;K4.sortByAccessTimes=rZa;var eZa=c6(),tZa=e1();K4.accessTimes=new eZa.LRUCacheMap;function rZa(t){return[...t].sort((e,r)=>{let n=K4.accessTimes.get(e.uri)??0;return(K4.accessTimes.get(r.uri)??0)-n})}a(rZa,"sortByAccessTimes");var nZa=a(t=>t.get(tZa.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&K4.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");K4.registerDocumentTracker=nZa});var hMi=I(y6=>{"use strict";p();var iZa=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},oZa=y6&&y6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(y6,"__esModule",{value:!0});y6.OpenTabFiles=void 0;var sZa=pMi(),aZa=e1(),uRr=SAe(),dRr=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>uRr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,uRr.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,sZa.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(uRr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};y6.OpenTabFiles=dRr;y6.OpenTabFiles=dRr=iZa([oZa(0,aZa.ICompletionsTextDocumentManagerService)],dRr)});var mMi=I(fRr=>{"use strict";p();Object.defineProperty(fRr,"__esModule",{value:!0});fRr.shortCircuit=cZa;function cZa(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(cZa,"shortCircuit")});var zyt=I(wl=>{"use strict";p();var lZa=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},Hyt=wl&&wl.__param||function(t,e){return function(r,n){e(r,n,t)}},pRr;Object.defineProperty(wl,"__esModule",{value:!0});wl.RelatedFilesProvider=wl.ICompletionsRelatedFilesProviderService=wl.relatedFilesLogger=wl.PromiseExpirationCacheMap=wl.EmptyRelatedFilesResponse=void 0;wl.getRelatedFilesAndTraits=EZa;var uZa=Tre(),dZa=rn(),fZa=Ku(),gRr=Fs(),pZa=zG(),hZa=c6(),Wyt=Il(),mZa=Og(),gZa=mMi();wl.EmptyRelatedFilesResponse={entries:[],traits:[]};var Gyt={entries:new Map,traits:[]},$yt=class extends hZa.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.timestampwl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};wl.RelatedFilesProvider=hRr;wl.RelatedFilesProvider=hRr=pRr=lZa([Hyt(0,gRr.IInstantiationService),Hyt(1,uZa.IIgnoreService),Hyt(2,Wyt.ICompletionsLogTargetService),Hyt(3,pZa.ICompletionsFileSystemService)],hRr);var yZa=3,N4e=new $yt(AZa);async function gMi(t,e,r,n,o){let s=t.get(gRr.IInstantiationService),c=t.get(Wyt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>wl.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(N4e.bumpRetryCount(e.uri)>=yZa?u=Gyt:u=void 0);let d=performance.now()-l;if(wl.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 Vyt;return u}a(gMi,"getRelatedFiles");var mRr=a(function(t,e,r,n,o){let s=`${e.uri}`;if(N4e.has(s))return N4e.get(s);let c=gMi(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw N4e.delete(s),l})),N4e.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");mRr=(0,gZa.shortCircuit)(mRr,200,Gyt);async function EZa(t,e,r,n,o,s=!1){let c=t.get(gRr.IInstantiationService),l=t.get(Wyt.ICompletionsLogTargetService),u=t.get(wl.ICompletionsRelatedFilesProviderService),d=Gyt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(gMi,f,r,n,u):await c.invokeFunction(mRr,f,r,n,u)}catch(f){d=Gyt,f instanceof Vyt&&c.invokeFunction(mZa.telemetry,"getRelatedFilesList",r)}return wl.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(EZa,"getRelatedFilesAndTraits")});var SAe=I(m$=>{"use strict";p();Object.defineProperty(m$,"__esModule",{value:!0});m$.NeighborSource=m$.NeighboringFileType=void 0;m$.considerNeighborFile=SZa;m$.isIncludeNeighborFilesActive=TZa;var _Za=Fs(),AMi=$G(),EMi=oy(),vZa=Il(),CZa=e1(),bZa=hMi(),Yyt=zyt(),yMi;(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"})(yMi||(m$.NeighboringFileType=yMi={}));function SZa(t,e){return(0,AMi.normalizeLanguageId)(t)===(0,AMi.normalizeLanguageId)(e)}a(SZa,"considerNeighborFile");var ARr=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(EMi.ICompletionsFeaturesService),d=e.get(vZa.ICompletionsLogTargetService),f=e.get(_Za.IInstantiationService),h=e.get(CZa.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(bZa.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 Yyt.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 Yyt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(Yyt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(Yyt.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)}};m$.NeighborSource=ARr;function TZa(t,e,r){return t.get(EMi.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(TZa,"isIncludeNeighborFilesActive")});var ERr=I(Kyt=>{"use strict";p();Object.defineProperty(Kyt,"__esModule",{value:!0});Kyt.SimilarFiles=void 0;var TAe=V4(),yRr=h6(),IZa=ryt(),xZa=tIr(),wZa=iyt(),RZa=g6(),PZa=IAe(),_Mi=SAe(),kZa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(RZa.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=_Mi.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await _Mi.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(PZa.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,xZa.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction(wZa.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,IZa.getSimilarSnippets)(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,TAe.jsxs)(TAe.Fragment,{children:[...o.map((u,d)=>(0,TAe.jsx)(DZa,{snippet:u}))]})},"SimilarFiles");Kyt.SimilarFiles=kZa;var DZa=a((t,e)=>(0,TAe.jsxs)(yRr.Chunk,{children:[(0,TAe.jsx)(yRr.Text,{children:t.snippet.headline}),(0,TAe.jsx)(yRr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var wMi=I(KT=>{"use strict";p();Object.defineProperty(KT,"__esModule",{value:!0});KT.getAllRecentEditsByTimestamp=NZa;KT.findChangeSpan=_Rr;KT.getDiff=CMi;KT.unifiedDiff=bMi;KT.findReplaceDiff=SMi;KT.editsOverlap=TMi;KT.updateEdits=IMi;KT.buildIncomingEdit=vRr;KT.trimOldFilesFromState=xMi;KT.recentEditsReducer=BZa;KT.summarizeEdit=LZa;function NZa(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(NZa,"getAllRecentEditsByTimestamp");function _Rr(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(_Rr,"findChangeSpan");function CMi(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(CMi,"getDiff");function MZa(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(MZa,"measureDiffSize");function bMi(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(` +${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(` `)+` -`}a(bMi,"unifiedDiff");function OZa(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(OZa,"aidersDiff");function SMi(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(SMi,"findReplaceDiff");function vMi(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(vMi,"applyEditsToLines");function TMi(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(TMi,"editsOverlap");function IMi(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if(TMi(r,c,o.editMergeLineDistance)){let u=vMi(t.split(` -`),s.slice(0,-1)),d=_Rr(u,n);d&&(r=vRr(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=vMi(t.split(` +`}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(` `),c).join(` -`)}return{originalContent:t,edits:s}}a(IMi,"updateEdits");function vRr(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=CMi(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a(vRr,"buildIncomingEdit");function xMi(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(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(` `),c=r.split(` -`),l=_Rr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=vRr(e,s,c,l,n);if(MZa(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=IMi(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return xMi(h,n.maxFiles)}a(BZa,"recentEditsReducer");function LZa(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=OZa(t.diff);else if(e.summarizationFormat==="diff")o=bMi(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=SMi(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(LZa,"summarizeEdit")});var Jyt=I(MD=>{"use strict";p();var FZa=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},UZa=MD&&MD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(MD,"__esModule",{value:!0});MD.FullRecentEditsProvider=MD.ICompletionsRecentEditsProviderService=void 0;var QZa=s4(),qZa=rn(),jZa=Io(),HZa=l8(),GZa=FSr(),CRr=wMi();MD.ICompletionsRecentEditsProviderService=(0,qZa.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var $Za=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}),bRr=class extends jZa.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({},$Za)}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,CRr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,CRr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,CRr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,HZa.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,QZa.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))}};MD.FullRecentEditsProvider=bRr;MD.FullRecentEditsProvider=bRr=FZa([UZa(1,GZa.ICompletionsObservableWorkspace)],bRr)});var SRr=I(Xyt=>{"use strict";p();Object.defineProperty(Xyt,"__esModule",{value:!0});Xyt.Traits=void 0;var Zyt=V4(),RMi=h6(),VZa=$G(),WZa=g6(),zZa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(WZa.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,VZa.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,Zyt.jsxs)(Zyt.Fragment,{children:[(0,Zyt.jsx)(RMi.Text,{children:`Consider this related information: -`}),...r.map(c=>(0,Zyt.jsx)(RMi.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");Xyt.Traits=zZa});var DMi=I(TRr=>{"use strict";p();Object.defineProperty(TRr,"__esModule",{value:!0});TRr.splitContextCompletionsPrompt=iXa;var OR=V4(),YZa=Fs(),KZa=e1(),JZa=Jyt(),ZZa=kwr(),PMi=w4e(),kMi=P4e(),XZa=aRr(),eXa=cRr(),tXa=lRr(),rXa=ERr(),nXa=SRr();function iXa(t){let e=t.get(YZa.IInstantiationService),r=t.get(KZa.ICompletionsTextDocumentManagerService),n=t.get(JZa.ICompletionsRecentEditsProviderService);return(0,OR.jsxs)(OR.Fragment,{children:[(0,OR.jsxs)(PMi.StableCompletionsContext,{children:[(0,OR.jsx)(eXa.DocumentMarker,{tdms:r,weight:.7}),(0,OR.jsx)(nXa.Traits,{weight:.6}),(0,OR.jsx)(XZa.Diagnostics,{tdms:r,weight:.65}),(0,OR.jsx)(ZZa.CodeSnippets,{tdms:r,weight:.9}),(0,OR.jsx)(rXa.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,OR.jsx)(kMi.DocumentSuffix,{weight:1}),(0,OR.jsx)(PMi.AdditionalCompletionsContext,{children:(0,OR.jsx)(tXa.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,OR.jsx)(kMi.DocumentPrefix,{weight:1})]})}a(iXa,"splitContextCompletionsPrompt")});var BMi=I(tEt=>{"use strict";p();Object.defineProperty(tEt,"__esModule",{value:!0});tEt.SplitContextPromptRenderer=void 0;var oXa=Nwr(),sXa=w4e(),eEt=Hwr(),NMi=P4e(),MMi=Qwr(),OMi=0;function aXa(){OMi=0}a(aXa,"resetContextIndex");function cXa(){return OMi++}a(cXa,"getNextContextIndex");var IRr=class extends eEt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=MMi.makePrefixPrompt,this.formatContext=MMi.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(aXa(),new oXa.SnapshotWalker(e,lXa).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===NMi.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,eEt.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,eEt.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 ${NMi.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}}};tEt.SplitContextPromptRenderer=IRr;var lXa=[...eEt.transformers,(t,e,r)=>(0,sXa.isContextNode)(t)?{...r,index:cXa()}:r]});var g$=I(E6=>{"use strict";p();Object.defineProperty(E6,"__esModule",{value:!0});E6.AbstractLanguageDiagnosticsService=E6.ILanguageDiagnosticsService=void 0;E6.rangeSpanningDiagnostics=fXa;E6.isError=pXa;E6.getDiagnosticsAtSelection=hXa;var uXa=rn(),dXa=kk(),xRr=b0();E6.ILanguageDiagnosticsService=(0,uXa.createServiceIdentifier)("ILanguageDiagnosticService");var wRr=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,dXa.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};E6.AbstractLanguageDiagnosticsService=wRr;function fXa(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a(fXa,"rangeSpanningDiagnostics");function pXa(t){return t.severity===xRr.DiagnosticSeverity.Error}a(pXa,"isError");function hXa(t,e,r=[xRr.DiagnosticSeverity.Error,xRr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a(hXa,"getDiagnosticsAtSelection")});var FMi=I(RRr=>{"use strict";p();Object.defineProperty(RRr,"__esModule",{value:!0});RRr.getDiagnosticsFromContextItems=yXa;var mXa=e1(),LMi=f$(),gXa=x4e(),AXa="content_excluded";async function yXa(t,e,r){let n=(0,gXa.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)EXa(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(LMi.ICompletionsContextProviderService),l=t.get(mXa.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,AXa]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a(yXa,"getDiagnosticsFromContextItems");function EXa(t,e,r,n){let o=t.get(LMi.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(EXa,"setupExpectationsForDiagnosticBags")});var UMi=I(rEt=>{"use strict";p();Object.defineProperty(rEt,"__esModule",{value:!0});rEt.getTraitsFromContextItems=bXa;rEt.ReportTraitsTelemetry=IXa;var _Xa=Og(),vXa=f$(),CXa=x4e();function bXa(t,e,r){let n=(0,CXa.filterContextItemsByType)(r,"Trait");for(let s of n)SXa(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(bXa,"getTraitsFromContextItems");function SXa(t,e,r,n){let o=t.get(vXa.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(SXa,"setupExpectationsForTraits");var TXa=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function IXa(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=TXa.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,_Xa.telemetry)(t,e,l)}}a(IXa,"ReportTraitsTelemetry")});var g6=I(o1=>{"use strict";p();var HMi=o1&&o1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i1=o1&&o1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(o1,"__esModule",{value:!0});o1.TestComponentsCompletionsPromptFactory=o1.ComponentsCompletionsPromptFactory=o1.PromptOrdering=void 0;o1.isCompletionRequestData=$Xa;var J4=V4(),QMi=b0(),MRr=Il(),GMi=Tre(),PRr=Ku(),ORr=Fs(),$Mi=hte(),qMi=NNi(),xXa=Og(),wXa=e1(),RXa=kwr(),PXa=w4e(),kXa=Hwr(),VMi=Fyt(),DXa=P4e(),NXa=aRr(),MXa=cRr(),OXa=lRr(),BXa=ERr(),LXa=DMi(),FXa=BMi(),UXa=SRr(),WMi=g$(),QXa=y0(),M4e=Lyt(),qXa=Pwr(),jXa=FMi(),jMi=UMi(),BRr=f$(),OD=IAe(),HXa=Jyt(),GXa=SAe();function $Xa(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($Xa,"isCompletionRequestData");var A$;(function(t){t.Default="default",t.SplitContext="splitContext"})(A$||(o1.PromptOrdering=A$={}));var kRr={[A$.Default]:{promptFunction:zMi,renderer:kXa.CompletionsPromptRenderer},[A$.SplitContext]:{promptFunction:LXa.splitContextCompletionsPrompt,renderer:FXa.SplitContextPromptRenderer}};function zMi(t){let e=t.get(wXa.ICompletionsTextDocumentManagerService),r=t.get(ORr.IInstantiationService),n=t.get(HXa.ICompletionsRecentEditsProviderService);return(0,J4.jsxs)(J4.Fragment,{children:[(0,J4.jsxs)(PXa.CompletionsContext,{children:[(0,J4.jsx)(MXa.DocumentMarker,{tdms:e,weight:.7}),(0,J4.jsx)(UXa.Traits,{weight:.6}),(0,J4.jsx)(NXa.Diagnostics,{tdms:e,weight:.65}),(0,J4.jsx)(RXa.CodeSnippets,{tdms:e,weight:.9}),(0,J4.jsx)(BXa.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,J4.jsx)(OXa.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,J4.jsx)(DXa.CurrentFile,{weight:1})]})}a(zMi,"defaultCompletionsPrompt");var nEt=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??A$.Default,this.virtualPrompt=e??new qMi.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(OD.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?A$.SplitContext:A$.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 OD._promptCancelled;let _=this.virtualPrompt.snapshot(s),v=_.status;if(v==="cancelled")return OD._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 OD._promptCancelled;if(b.status==="error")return this.errorPrompt(b.error);let[T,w]=(0,OD.trimLastLine)(b.prefix),R={...b,prefix:T},x,P=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(M4e.useContextProviderAPI,P,n)){let N=(0,BRr.componentStatisticsToPromptMatcher)(b.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,M4e.telemetrizeContextItems)(this.contextProviderStatistics,e,E),MRr.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(M4e.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(M4e.matchContextItems);this.instantiationService.invokeFunction(VXa,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(jMi.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(jMi.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction(qXa.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(jXa.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(M4e.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 OD._promptCancelled;if(await this.ignoreService.isCopilotIgnored(PRr.URI.parse(e.uri)))return OD._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,xXa.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),OD._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new qMi.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=kRr[this.promptOrdering]?.promptFunction??zMi;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=kRr[this.promptOrdering]??kRr[A$.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(PRr.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===QMi.DiagnosticSeverity.Error?d.push(_):_.severity===QMi.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:PRr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,QXa.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)}};nEt=HMi([i1(2,ORr.IInstantiationService),i1(3,$Mi.ICompletionsTelemetryService),i1(4,GMi.IIgnoreService),i1(5,VMi.ICompletionsContextProviderBridgeService),i1(6,MRr.ICompletionsLogTargetService),i1(7,BRr.ICompletionsContextProviderService),i1(8,WMi.ILanguageDiagnosticsService)],nEt);var DRr=class extends nEt{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};o1.ComponentsCompletionsPromptFactory=DRr;o1.ComponentsCompletionsPromptFactory=DRr=HMi([i1(0,ORr.IInstantiationService),i1(1,$Mi.ICompletionsTelemetryService),i1(2,GMi.IIgnoreService),i1(3,VMi.ICompletionsContextProviderBridgeService),i1(4,MRr.ICompletionsLogTargetService),i1(5,BRr.ICompletionsContextProviderService),i1(6,WMi.ILanguageDiagnosticsService)],DRr);var NRr=class extends nEt{static{a(this,"TestComponentsCompletionsPromptFactory")}};o1.TestComponentsCompletionsPromptFactory=NRr;function VXa(t,e,r,n){let o=["cpp","c"];return(0,GXa.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(VXa,"similarFilesEnabled")});var jRr=I(OE=>{"use strict";p();var YMi=OE&&OE.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},KMi=OE&&OE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(OE,"__esModule",{value:!0});OE.TestCompletionsPromptFactory=OE.CompletionsPromptFactory=OE.DEFAULT_PROMPT_TIMEOUT=OE.ICompletionsPromptFactoryService=void 0;var WXa=ri(),JMi=Fs(),LRr=IAe(),zXa=g6(),YXa=rn();OE.ICompletionsPromptFactoryService=(0,YXa.createServiceIdentifier)("ICompletionsPromptFactoryService");var FRr=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 LRr._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return LRr._promptError}}};OE.DEFAULT_PROMPT_TIMEOUT=1200;var URr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new WXa.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(LRr._promptTimeout)},OE.DEFAULT_PROMPT_TIMEOUT)})])}},iEt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new FRr(new URr(n.createInstance(zXa.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};iEt=YMi([KMi(2,JMi.IInstantiationService)],iEt);var QRr=class extends iEt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};OE.CompletionsPromptFactory=QRr;OE.CompletionsPromptFactory=QRr=YMi([KMi(0,JMi.IInstantiationService)],QRr);var qRr=class extends iEt{static{a(this,"TestCompletionsPromptFactory")}};OE.TestCompletionsPromptFactory=qRr});var IAe=I(dh=>{"use strict";p();Object.defineProperty(dh,"__esModule",{value:!0});dh.PromptResponse=dh._promptTimeout=dh._promptCancelled=dh._promptError=dh._copilotContentExclusion=dh._contextTooShort=dh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=dh.MIN_PROMPT_CHARS=void 0;dh.trimLastLine=rec;dh.extractPrompt=nec;dh.getPromptOptions=sec;var KXa=m4e(),JXa=oy(),ZMi=iyt(),ZXa=E4e(),XXa=e1(),eec=jRr(),tec=SAe();dh.MIN_PROMPT_CHARS=10;dh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];dh._contextTooShort={type:"contextTooShort"};dh._copilotContentExclusion={type:"copilotContentExclusion"};dh._promptError={type:"promptError"};dh._promptCancelled={type:"promptCancelled"};dh._promptTimeout={type:"promptTimeout"};var XMi;(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=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(` --- `)},{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} @@ -1018,14 +1020,14 @@ ${o.join(", ")}`).join(` --- ${n.content} ---------------`).join(` -`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(XMi||(dh.PromptResponse=XMi={}));function rec(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(rec,"trimLastLine");function nec(t,e,r,n,o,s={}){let l=t.get(XXa.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=oec(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(eec.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(nec,"extractPrompt");function iec(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,KXa.commentBlockAsSingles)(n,e)}a(iec,"addNeighboringCellsToPrompt");function oec(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>iec(l,r.document.detectedLanguageId)).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(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(oec,"applyEditsForNotebook");function sec(t,e,r){let n=t.get(JXa.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,ZXa.getMaxSolutionTokens)(),c=(0,ZMi.getNumberOfSnippets)(e,r),l=(0,ZMi.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(sec,"getPromptOptions")});var rOi=I(y$=>{"use strict";p();Object.defineProperty(y$,"__esModule",{value:!0});y$.TypeSystem=y$.TypeSystemDuplicateFormat=y$.TypeSystemDuplicateTypeKind=void 0;var oEt=wge(),aec=$5e(),cec=vn(),tOi=Rf(),sEt=class extends tOi.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};y$.TypeSystemDuplicateTypeKind=sEt;var aEt=class extends tOi.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};y$.TypeSystemDuplicateFormat=aEt;var eOi;(function(t){function e(n,o){if(oEt.TypeRegistry.Has(n))throw new sEt(n);return oEt.TypeRegistry.Set(n,o),(s={})=>(0,aec.Unsafe)({...s,[cec.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(oEt.FormatRegistry.Has(n))throw new aEt(n);return oEt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(eOi||(y$.TypeSystem=eOi={}))});var HRr=I(E$=>{"use strict";p();var lec=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]})),nOi=E$&&E$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lec(e,t,r)};Object.defineProperty(E$,"__esModule",{value:!0});nOi(p5e(),E$);nOi(rOi(),E$)});var GRr=I(O4e=>{"use strict";p();Object.defineProperty(O4e,"__esModule",{value:!0});O4e.DefaultErrorFunction=iOi;O4e.SetErrorFunction=dec;O4e.GetErrorFunction=fec;var uec=vn(),Qn=$Rr();function iOi(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[uec.Kind]}'`;default:return"Unknown error type"}}a(iOi,"DefaultErrorFunction");var oOi=iOi;function dec(t){oOi=t}a(dec,"SetErrorFunction");function fec(){return oOi}a(fec,"GetErrorFunction")});var cOi=I(xAe=>{"use strict";p();Object.defineProperty(xAe,"__esModule",{value:!0});xAe.TypeDereferenceError=void 0;xAe.Pushref=gec;xAe.Deref=aOi;var pec=Rf(),sOi=vn(),hec=Agt(),cEt=class extends pec.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};xAe.TypeDereferenceError=cEt;function mec(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new cEt(t);return aOi(r,e)}a(mec,"Resolve");function gec(t,e){return!(0,hec.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(gec,"Pushref");function aOi(t,e){return t[sOi.Kind]==="This"||t[sOi.Kind]==="Ref"?mec(t,e):t}a(aOi,"Deref")});var BD=I($re=>{"use strict";p();var Aec=$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]})),yec=$re&&$re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Aec(e,t,r)};Object.defineProperty($re,"__esModule",{value:!0});yec(cOi(),$re)});var fOi=I(B4e=>{"use strict";p();Object.defineProperty(B4e,"__esModule",{value:!0});B4e.ValueHashError=void 0;B4e.Hash=Oec;var LD=v0(),Eec=Rf(),lEt=class extends Eec.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};B4e.ValueHashError=lEt;var JT;(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"})(JT||(JT={}));var wAe=BigInt("14695981039346656037"),[_ec,vec]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Cec=Array.from({length:256}).map((t,e)=>BigInt(e)),lOi=new Float64Array(1),uOi=new DataView(lOi.buffer),dOi=new Uint8Array(lOi.buffer);function*bec(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(bec,"NumberToBytes");function Sec(t){BE(JT.Array);for(let e of t)RAe(e)}a(Sec,"ArrayType");function Tec(t){BE(JT.Boolean),BE(t?1:0)}a(Tec,"BooleanType");function Iec(t){BE(JT.BigInt),uOi.setBigInt64(0,t);for(let e of dOi)BE(e)}a(Iec,"BigIntType");function xec(t){BE(JT.Date),RAe(t.getTime())}a(xec,"DateType");function wec(t){BE(JT.Null)}a(wec,"NullType");function Rec(t){BE(JT.Number),uOi.setFloat64(0,t);for(let e of dOi)BE(e)}a(Rec,"NumberType");function Pec(t){BE(JT.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())RAe(e),RAe(t[e])}a(Pec,"ObjectType");function kec(t){BE(JT.String);for(let e=0;e{"use strict";p();var Bec=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]})),Lec=Vre&&Vre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Bec(e,t,r)};Object.defineProperty(Vre,"__esModule",{value:!0});Lec(fOi(),Vre)});var WRr=I(Q4e=>{"use strict";p();Object.defineProperty(Q4e,"__esModule",{value:!0});Q4e.ValueCheckUnknownTypeError=void 0;Q4e.Check=Stc;var F4e=HRr(),VRr=BD(),Fec=L4e(),PAe=vn(),pOi=dD(),Uec=tre(),U4e=wge(),Qec=Rf(),qec=ym(),Cm=v0(),jec=As(),uEt=class extends Qec.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};Q4e.ValueCheckUnknownTypeError=uEt;function Hec(t){return t[PAe.Kind]==="Any"||t[PAe.Kind]==="Unknown"}a(Hec,"IsAnyOrUnknown");function ea(t){return t!==void 0}a(ea,"IsDefined");function Gec(t,e,r){return!0}a(Gec,"FromAny");function $ec(t,e,r){return!0}a($ec,"FromArgument");function Vec(t,e,r){if(!(0,Cm.IsArray)(r)||ea(t.minItems)&&!(r.length>=t.minItems)||ea(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,Fec.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(ea(t.contains)||(0,Cm.IsNumber)(t.minContains)||(0,Cm.IsNumber)(t.maxContains)))return!0;let n=ea(t.contains)?t.contains:(0,qec.Never)(),o=r.reduce((s,c)=>jg(n,e,c)?s+1:s,0);return!(o===0||(0,Cm.IsNumber)(t.minContains)&&ot.maxContains)}a(Vec,"FromArray");function Wec(t,e,r){return(0,Cm.IsAsyncIterator)(r)}a(Wec,"FromAsyncIterator");function zec(t,e,r){return!(!(0,Cm.IsBigInt)(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(zec,"FromBigInt");function Yec(t,e,r){return(0,Cm.IsBoolean)(r)}a(Yec,"FromBoolean");function Kec(t,e,r){return jg(t.returns,e,r.prototype)}a(Kec,"FromConstructor");function Jec(t,e,r){return!(!(0,Cm.IsDate)(r)||ea(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||ea(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||ea(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||ea(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(Jec,"FromDate");function Zec(t,e,r){return(0,Cm.IsFunction)(r)}a(Zec,"FromFunction");function Xec(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return jg(o,[...e,...n],r)}a(Xec,"FromImport");function etc(t,e,r){return!(!(0,Cm.IsInteger)(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.multipleOf)&&r%t.multipleOf!==0)}a(etc,"FromInteger");function ttc(t,e,r){let n=t.allOf.every(o=>jg(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,pOi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,jec.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,pOi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||jg(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(ttc,"FromIntersect");function rtc(t,e,r){return(0,Cm.IsIterator)(r)}a(rtc,"FromIterator");function ntc(t,e,r){return r===t.const}a(ntc,"FromLiteral");function itc(t,e,r){return!1}a(itc,"FromNever");function otc(t,e,r){return!jg(t.not,e,r)}a(otc,"FromNot");function stc(t,e,r){return(0,Cm.IsNull)(r)}a(stc,"FromNull");function atc(t,e,r){return!(!F4e.TypeSystemPolicy.IsNumberLike(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.multipleOf)&&r%t.multipleOf!==0)}a(atc,"FromNumber");function ctc(t,e,r){if(!F4e.TypeSystemPolicy.IsObjectLike(r)||ea(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ea(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!jg(s,e,r[o])||((0,Uec.ExtendsUndefinedCheck)(s)||Hec(s))&&!(o in r))return!1}else if(F4e.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(ctc,"FromObject");function ltc(t,e,r){return(0,Cm.IsPromise)(r)}a(ltc,"FromPromise");function utc(t,e,r){if(!F4e.TypeSystemPolicy.IsRecordLike(r)||ea(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ea(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?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(utc,"FromRecord");function dtc(t,e,r){return jg((0,VRr.Deref)(t,e),e,r)}a(dtc,"FromRef");function ftc(t,e,r){let n=new RegExp(t.source,t.flags);return ea(t.minLength)&&!(r.length>=t.minLength)||ea(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(ftc,"FromRegExp");function ptc(t,e,r){return!(0,Cm.IsString)(r)||ea(t.minLength)&&!(r.length>=t.minLength)||ea(t.maxLength)&&!(r.length<=t.maxLength)||ea(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:ea(t.format)?U4e.FormatRegistry.Has(t.format)?U4e.FormatRegistry.Get(t.format)(r):!1:!0}a(ptc,"FromString");function htc(t,e,r){return(0,Cm.IsSymbol)(r)}a(htc,"FromSymbol");function mtc(t,e,r){return(0,Cm.IsString)(r)&&new RegExp(t.pattern).test(r)}a(mtc,"FromTemplateLiteral");function gtc(t,e,r){return jg((0,VRr.Deref)(t,e),e,r)}a(gtc,"FromThis");function Atc(t,e,r){if(!(0,Cm.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(Etc,"FromUnion");function _tc(t,e,r){return!(!(0,Cm.IsUint8Array)(r)||ea(t.maxByteLength)&&!(r.length<=t.maxByteLength)||ea(t.minByteLength)&&!(r.length>=t.minByteLength))}a(_tc,"FromUint8Array");function vtc(t,e,r){return!0}a(vtc,"FromUnknown");function Ctc(t,e,r){return F4e.TypeSystemPolicy.IsVoidLike(r)}a(Ctc,"FromVoid");function btc(t,e,r){return U4e.TypeRegistry.Has(t[PAe.Kind])?U4e.TypeRegistry.Get(t[PAe.Kind])(t,r):!1}a(btc,"FromKind");function jg(t,e,r){let n=ea(t.$id)?(0,VRr.Pushref)(t,e):e,o=t;switch(o[PAe.Kind]){case"Any":return Gec(o,n,r);case"Argument":return $ec(o,n,r);case"Array":return Vec(o,n,r);case"AsyncIterator":return Wec(o,n,r);case"BigInt":return zec(o,n,r);case"Boolean":return Yec(o,n,r);case"Constructor":return Kec(o,n,r);case"Date":return Jec(o,n,r);case"Function":return Zec(o,n,r);case"Import":return Xec(o,n,r);case"Integer":return etc(o,n,r);case"Intersect":return ttc(o,n,r);case"Iterator":return rtc(o,n,r);case"Literal":return ntc(o,n,r);case"Never":return itc(o,n,r);case"Not":return otc(o,n,r);case"Null":return stc(o,n,r);case"Number":return atc(o,n,r);case"Object":return ctc(o,n,r);case"Promise":return ltc(o,n,r);case"Record":return utc(o,n,r);case"Ref":return dtc(o,n,r);case"RegExp":return ftc(o,n,r);case"String":return ptc(o,n,r);case"Symbol":return htc(o,n,r);case"TemplateLiteral":return mtc(o,n,r);case"This":return gtc(o,n,r);case"Tuple":return Atc(o,n,r);case"Undefined":return ytc(o,n,r);case"Union":return Etc(o,n,r);case"Uint8Array":return _tc(o,n,r);case"Unknown":return vtc(o,n,r);case"Void":return Ctc(o,n,r);default:if(!U4e.TypeRegistry.Has(o[PAe.Kind]))throw new uEt(o);return btc(o,n,r)}}a(jg,"Visit");function Stc(...t){return t.length===3?jg(t[0],t[1],t[2]):jg(t[0],[],t[1])}a(Stc,"Check")});var ZT=I(Wre=>{"use strict";p();var Ttc=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]})),Itc=Wre&&Wre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ttc(e,t,r)};Object.defineProperty(Wre,"__esModule",{value:!0});Itc(WRr(),Wre)});var $Rr=I(v6=>{"use strict";p();Object.defineProperty(v6,"__esModule",{value:!0});v6.ValueErrorIterator=v6.ValueErrorsUnknownTypeError=v6.ValueErrorType=void 0;v6.Errors=prc;var q4e=HRr(),hOi=dD(),dEt=wge(),xtc=T1r(),wtc=GRr(),Rtc=Rf(),mOi=BD(),Ptc=L4e(),ktc=ZT(),zRr=vn(),Dtc=ym(),fh=v0(),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||(v6.ValueErrorType=tn={}));var fEt=class extends Rtc.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};v6.ValueErrorsUnknownTypeError=fEt;function _6(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(_6,"EscapeKey");function ta(t){return t!==void 0}a(ta,"IsDefined");var j4e=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}};v6.ValueErrorIterator=j4e;function an(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,wtc.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(an,"Create");function*Ntc(t,e,r,n){}a(Ntc,"FromAny");function*Mtc(t,e,r,n){}a(Mtc,"FromArgument");function*Otc(t,e,r,n){if(!(0,fh.IsArray)(n))return yield an(tn.Array,t,r,n);ta(t.minItems)&&!(n.length>=t.minItems)&&(yield an(tn.ArrayMinItems,t,r,n)),ta(t.maxItems)&&!(n.length<=t.maxItems)&&(yield an(tn.ArrayMaxItems,t,r,n));for(let c=0;cHg(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield an(tn.ArrayContains,t,r,n)),(0,fh.IsNumber)(t.minContains)&&st.maxContains&&(yield an(tn.ArrayMaxContains,t,r,n))}a(Otc,"FromArray");function*Btc(t,e,r,n){(0,fh.IsAsyncIterator)(n)||(yield an(tn.AsyncIterator,t,r,n))}a(Btc,"FromAsyncIterator");function*Ltc(t,e,r,n){if(!(0,fh.IsBigInt)(n))return yield an(tn.BigInt,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield an(tn.BigIntExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield an(tn.BigIntMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield an(tn.BigIntMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield an(tn.BigIntMultipleOf,t,r,n))}a(Ltc,"FromBigInt");function*Ftc(t,e,r,n){(0,fh.IsBoolean)(n)||(yield an(tn.Boolean,t,r,n))}a(Ftc,"FromBoolean");function*Utc(t,e,r,n){yield*Hg(t.returns,e,r,n.prototype)}a(Utc,"FromConstructor");function*Qtc(t,e,r,n){if(!(0,fh.IsDate)(n))return yield an(tn.Date,t,r,n);ta(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield an(tn.DateExclusiveMinimumTimestamp,t,r,n)),ta(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield an(tn.DateMaximumTimestamp,t,r,n)),ta(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield an(tn.DateMinimumTimestamp,t,r,n)),ta(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield an(tn.DateMultipleOfTimestamp,t,r,n))}a(Qtc,"FromDate");function*qtc(t,e,r,n){(0,fh.IsFunction)(n)||(yield an(tn.Function,t,r,n))}a(qtc,"FromFunction");function*jtc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Hg(s,[...e,...o],r,n)}a(jtc,"FromImport");function*Htc(t,e,r,n){if(!(0,fh.IsInteger)(n))return yield an(tn.Integer,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield an(tn.IntegerExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield an(tn.IntegerMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield an(tn.IntegerMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==0&&(yield an(tn.IntegerMultipleOf,t,r,n))}a(Htc,"FromInteger");function*Gtc(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Hg(s,e,r,n))o=!0,yield c;if(o)return yield an(tn.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,hOi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield an(tn.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,hOi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Hg(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(Gtc,"FromIntersect");function*$tc(t,e,r,n){(0,fh.IsIterator)(n)||(yield an(tn.Iterator,t,r,n))}a($tc,"FromIterator");function*Vtc(t,e,r,n){n!==t.const&&(yield an(tn.Literal,t,r,n))}a(Vtc,"FromLiteral");function*Wtc(t,e,r,n){yield an(tn.Never,t,r,n)}a(Wtc,"FromNever");function*ztc(t,e,r,n){Hg(t.not,e,r,n).next().done===!0&&(yield an(tn.Not,t,r,n))}a(ztc,"FromNot");function*Ytc(t,e,r,n){(0,fh.IsNull)(n)||(yield an(tn.Null,t,r,n))}a(Ytc,"FromNull");function*Ktc(t,e,r,n){if(!q4e.TypeSystemPolicy.IsNumberLike(n))return yield an(tn.Number,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield an(tn.NumberExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield an(tn.NumberMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield an(tn.NumberMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==0&&(yield an(tn.NumberMultipleOf,t,r,n))}a(Ktc,"FromNumber");function*Jtc(t,e,r,n){if(!q4e.TypeSystemPolicy.IsObjectLike(n))return yield an(tn.Object,t,r,n);ta(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield an(tn.ObjectMinProperties,t,r,n)),ta(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield an(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 an(tn.ObjectRequiredProperty,t.properties[l],`${r}/${_6(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield an(tn.ObjectAdditionalProperties,t,`${r}/${_6(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Hg(t.additionalProperties,e,`${r}/${_6(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Hg(u,e,`${r}/${_6(l)}`,n[l]),(0,xtc.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield an(tn.ObjectRequiredProperty,u,`${r}/${_6(l)}`,void 0))):q4e.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*Hg(u,e,`${r}/${_6(l)}`,n[l]))}}a(Jtc,"FromObject");function*Ztc(t,e,r,n){(0,fh.IsPromise)(n)||(yield an(tn.Promise,t,r,n))}a(Ztc,"FromPromise");function*Xtc(t,e,r,n){if(!q4e.TypeSystemPolicy.IsRecordLike(n))return yield an(tn.Object,t,r,n);ta(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield an(tn.ObjectMinProperties,t,r,n)),ta(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield an(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*Hg(s,e,`${r}/${_6(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Hg(t.additionalProperties,e,`${r}/${_6(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield an(tn.ObjectAdditionalProperties,t,`${r}/${_6(l)}`,u)}}a(Xtc,"FromRecord");function*erc(t,e,r,n){yield*Hg((0,mOi.Deref)(t,e),e,r,n)}a(erc,"FromRef");function*trc(t,e,r,n){if(!(0,fh.IsString)(n))return yield an(tn.String,t,r,n);if(ta(t.minLength)&&!(n.length>=t.minLength)&&(yield an(tn.StringMinLength,t,r,n)),ta(t.maxLength)&&!(n.length<=t.maxLength)&&(yield an(tn.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield an(tn.RegExp,t,r,n)}a(trc,"FromRegExp");function*rrc(t,e,r,n){if(!(0,fh.IsString)(n))return yield an(tn.String,t,r,n);ta(t.minLength)&&!(n.length>=t.minLength)&&(yield an(tn.StringMinLength,t,r,n)),ta(t.maxLength)&&!(n.length<=t.maxLength)&&(yield an(tn.StringMaxLength,t,r,n)),(0,fh.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield an(tn.StringPattern,t,r,n))),(0,fh.IsString)(t.format)&&(dEt.FormatRegistry.Has(t.format)?dEt.FormatRegistry.Get(t.format)(n)||(yield an(tn.StringFormat,t,r,n)):yield an(tn.StringFormatUnknown,t,r,n))}a(rrc,"FromString");function*nrc(t,e,r,n){(0,fh.IsSymbol)(n)||(yield an(tn.Symbol,t,r,n))}a(nrc,"FromSymbol");function*irc(t,e,r,n){if(!(0,fh.IsString)(n))return yield an(tn.String,t,r,n);new RegExp(t.pattern).test(n)||(yield an(tn.StringPattern,t,r,n))}a(irc,"FromTemplateLiteral");function*orc(t,e,r,n){yield*Hg((0,mOi.Deref)(t,e),e,r,n)}a(orc,"FromThis");function*src(t,e,r,n){if(!(0,fh.IsArray)(n))return yield an(tn.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield an(tn.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield an(tn.TupleLength,t,r,n);if(t.items)for(let o=0;onew j4e(Hg(s,e,r,n)));yield an(tn.Union,t,r,n,o)}a(crc,"FromUnion");function*lrc(t,e,r,n){if(!(0,fh.IsUint8Array)(n))return yield an(tn.Uint8Array,t,r,n);ta(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield an(tn.Uint8ArrayMaxByteLength,t,r,n)),ta(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield an(tn.Uint8ArrayMinByteLength,t,r,n))}a(lrc,"FromUint8Array");function*urc(t,e,r,n){}a(urc,"FromUnknown");function*drc(t,e,r,n){q4e.TypeSystemPolicy.IsVoidLike(n)||(yield an(tn.Void,t,r,n))}a(drc,"FromVoid");function*frc(t,e,r,n){dEt.TypeRegistry.Get(t[zRr.Kind])(t,n)||(yield an(tn.Kind,t,r,n))}a(frc,"FromKind");function*Hg(t,e,r,n){let o=ta(t.$id)?[...e,t]:e,s=t;switch(s[zRr.Kind]){case"Any":return yield*Ntc(s,o,r,n);case"Argument":return yield*Mtc(s,o,r,n);case"Array":return yield*Otc(s,o,r,n);case"AsyncIterator":return yield*Btc(s,o,r,n);case"BigInt":return yield*Ltc(s,o,r,n);case"Boolean":return yield*Ftc(s,o,r,n);case"Constructor":return yield*Utc(s,o,r,n);case"Date":return yield*Qtc(s,o,r,n);case"Function":return yield*qtc(s,o,r,n);case"Import":return yield*jtc(s,o,r,n);case"Integer":return yield*Htc(s,o,r,n);case"Intersect":return yield*Gtc(s,o,r,n);case"Iterator":return yield*$tc(s,o,r,n);case"Literal":return yield*Vtc(s,o,r,n);case"Never":return yield*Wtc(s,o,r,n);case"Not":return yield*ztc(s,o,r,n);case"Null":return yield*Ytc(s,o,r,n);case"Number":return yield*Ktc(s,o,r,n);case"Object":return yield*Jtc(s,o,r,n);case"Promise":return yield*Ztc(s,o,r,n);case"Record":return yield*Xtc(s,o,r,n);case"Ref":return yield*erc(s,o,r,n);case"RegExp":return yield*trc(s,o,r,n);case"String":return yield*rrc(s,o,r,n);case"Symbol":return yield*nrc(s,o,r,n);case"TemplateLiteral":return yield*irc(s,o,r,n);case"This":return yield*orc(s,o,r,n);case"Tuple":return yield*src(s,o,r,n);case"Undefined":return yield*arc(s,o,r,n);case"Union":return yield*crc(s,o,r,n);case"Uint8Array":return yield*lrc(s,o,r,n);case"Unknown":return yield*urc(s,o,r,n);case"Void":return yield*drc(s,o,r,n);default:if(!dEt.TypeRegistry.Has(s[zRr.Kind]))throw new fEt(t);return yield*frc(s,o,r,n)}}a(Hg,"Visit");function prc(...t){let e=t.length===3?Hg(t[0],t[1],"",t[2]):Hg(t[0],[],"",t[1]);return new j4e(e)}a(prc,"Errors")});var kAe=I(_$=>{"use strict";p();var hrc=_$&&_$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=_$&&_$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hrc(e,t,r)};Object.defineProperty(_$,"__esModule",{value:!0});gOi($Rr(),_$);gOi(GRr(),_$)});var vOi=I(C6=>{"use strict";p();var mrc=C6&&C6.__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},yOi=C6&&C6.__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)},YRr,pEt,EOi;Object.defineProperty(C6,"__esModule",{value:!0});C6.AssertError=void 0;C6.Assert=yrc;var _Oi=kAe(),grc=wCr(),Arc=WRr(),hEt=class extends grc.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),YRr.add(this),pEt.set(this,void 0),mrc(this,pEt,e,"f"),this.error=r}Errors(){return new _Oi.ValueErrorIterator(yOi(this,YRr,"m",EOi).call(this))}};C6.AssertError=hEt;pEt=new WeakMap,YRr=new WeakSet,EOi=a(function*(){this.error&&(yield this.error),yield*yOi(this,pEt,"f")},"_AssertError_Iterator");function AOi(t,e,r){if(!(0,Arc.Check)(t,e,r))throw new hEt((0,_Oi.Errors)(t,e,r))}a(AOi,"AssertValue");function yrc(...t){return t.length===3?AOi(t[0],t[1],t[2]):AOi(t[0],[],t[1])}a(yrc,"Assert")});var mEt=I(zre=>{"use strict";p();var Erc=zre&&zre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_rc=zre&&zre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Erc(e,t,r)};Object.defineProperty(zre,"__esModule",{value:!0});_rc(vOi(),zre)});var COi=I(KRr=>{"use strict";p();Object.defineProperty(KRr,"__esModule",{value:!0});KRr.Clone=DAe;var Yre=v0();function vrc(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=DAe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=DAe(t[r]);return e}a(vrc,"FromObject");function Crc(t){return t.map(e=>DAe(e))}a(Crc,"FromArray");function brc(t){return t.slice()}a(brc,"FromTypedArray");function Src(t){return new Map(DAe([...t.entries()]))}a(Src,"FromMap");function Trc(t){return new Set(DAe([...t.entries()]))}a(Trc,"FromSet");function Irc(t){return new Date(t.toISOString())}a(Irc,"FromDate");function DAe(t){if((0,Yre.IsArray)(t))return Crc(t);if((0,Yre.IsDate)(t))return Irc(t);if((0,Yre.IsTypedArray)(t))return brc(t);if((0,Yre.IsMap)(t))return Src(t);if((0,Yre.IsSet)(t))return Trc(t);if((0,Yre.IsObject)(t))return vrc(t);if((0,Yre.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(DAe,"Clone")});var FD=I(Kre=>{"use strict";p();var xrc=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]})),wrc=Kre&&Kre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xrc(e,t,r)};Object.defineProperty(Kre,"__esModule",{value:!0});wrc(COi(),Kre)});var IOi=I(H4e=>{"use strict";p();Object.defineProperty(H4e,"__esModule",{value:!0});H4e.ValueCreateError=void 0;H4e.Create=mnc;var Oa=v0(),Rrc=ZT(),Prc=FD(),JRr=BD(),bOi=lD(),krc=wge(),SOi=vn(),Drc=Rf(),Nrc=Agt(),s1=class extends Drc.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};H4e.ValueCreateError=s1;function Ja(t){return(0,Nrc.IsFunction)(t)?t():(0,Prc.Clone)(t)}a(Ja,"FromDefault");function Mrc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):{}}a(Mrc,"FromAny");function Orc(t,e){return{}}a(Orc,"FromArgument");function Brc(t,e){if(t.uniqueItems===!0&&!(0,Oa.HasPropertyKey)(t,"default"))throw new s1(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,Oa.HasPropertyKey)(t,"default"))throw new s1(t,"Array with the contains constraint requires a default value");return"default"in t?Ja(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>XT(t.items,e)):[]}a(Brc,"FromArray");function Lrc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):(async function*(){})()}a(Lrc,"FromAsyncIterator");function Frc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):BigInt(0)}a(Frc,"FromBigInt");function Urc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):!1}a(Urc,"FromBoolean");function Qrc(t,e){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default);{let r=XT(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(Qrc,"FromConstructor");function qrc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(qrc,"FromDate");function jrc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):()=>XT(t.returns,e)}a(jrc,"FromFunction");function Hrc(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return XT(n,[...e,...r])}a(Hrc,"FromImport");function Grc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):t.minimum!==void 0?t.minimum:0}a(Grc,"FromInteger");function $rc(t,e){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default);{let r=t.allOf.reduce((n,o)=>{let s=XT(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,Rrc.Check)(t,e,r))throw new s1(t,"Intersect produced invalid value. Consider using a default value.");return r}}a($rc,"FromIntersect");function Vrc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):(function*(){})()}a(Vrc,"FromIterator");function Wrc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):t.const}a(Wrc,"FromLiteral");function zrc(t,e){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default);throw new s1(t,"Never types cannot be created. Consider using a default value.")}a(zrc,"FromNever");function Yrc(t,e){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default);throw new s1(t,"Not types must have a default value")}a(Yrc,"FromNot");function Krc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):null}a(Krc,"FromNull");function Jrc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):t.minimum!==void 0?t.minimum:0}a(Jrc,"FromNumber");function Zrc(t,e){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=XT(s,e));return n}}a(Zrc,"FromObject");function Xrc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):Promise.resolve(XT(t.item,e))}a(Xrc,"FromPromise");function enc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):{}}a(enc,"FromRecord");function tnc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):XT((0,JRr.Deref)(t,e),e)}a(tnc,"FromRef");function rnc(t,e){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default);throw new s1(t,"RegExp types cannot be created. Consider using a default value.")}a(rnc,"FromRegExp");function nnc(t,e){if(t.pattern!==void 0){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default);throw new s1(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default);throw new s1(t,"String types with formats must specify a default value")}else return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(nnc,"FromString");function inc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(inc,"FromSymbol");function onc(t,e){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default);if(!(0,bOi.IsTemplateLiteralFinite)(t))throw new s1(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,bOi.TemplateLiteralGenerate)(t)[0]}a(onc,"FromTemplateLiteral");function snc(t,e){if(TOi++>hnc)throw new s1(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):XT((0,JRr.Deref)(t,e),e)}a(snc,"FromThis");function anc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>XT(t.items[n],e))}a(anc,"FromTuple");function cnc(t,e){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default)}a(cnc,"FromUndefined");function lnc(t,e){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return XT(t.anyOf[0],e)}a(lnc,"FromUnion");function unc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(unc,"FromUint8Array");function dnc(t,e){return(0,Oa.HasPropertyKey)(t,"default")?Ja(t.default):{}}a(dnc,"FromUnknown");function fnc(t,e){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default)}a(fnc,"FromVoid");function pnc(t,e){if((0,Oa.HasPropertyKey)(t,"default"))return Ja(t.default);throw new Error("User defined types must specify a default value")}a(pnc,"FromKind");function XT(t,e){let r=(0,JRr.Pushref)(t,e),n=t;switch(n[SOi.Kind]){case"Any":return Mrc(n,r);case"Argument":return Orc(n,r);case"Array":return Brc(n,r);case"AsyncIterator":return Lrc(n,r);case"BigInt":return Frc(n,r);case"Boolean":return Urc(n,r);case"Constructor":return Qrc(n,r);case"Date":return qrc(n,r);case"Function":return jrc(n,r);case"Import":return Hrc(n,r);case"Integer":return Grc(n,r);case"Intersect":return $rc(n,r);case"Iterator":return Vrc(n,r);case"Literal":return Wrc(n,r);case"Never":return zrc(n,r);case"Not":return Yrc(n,r);case"Null":return Krc(n,r);case"Number":return Jrc(n,r);case"Object":return Zrc(n,r);case"Promise":return Xrc(n,r);case"Record":return enc(n,r);case"Ref":return tnc(n,r);case"RegExp":return rnc(n,r);case"String":return nnc(n,r);case"Symbol":return inc(n,r);case"TemplateLiteral":return onc(n,r);case"This":return snc(n,r);case"Tuple":return anc(n,r);case"Undefined":return cnc(n,r);case"Union":return lnc(n,r);case"Uint8Array":return unc(n,r);case"Unknown":return dnc(n,r);case"Void":return fnc(n,r);default:if(!krc.TypeRegistry.Has(n[SOi.Kind]))throw new s1(n,"Unknown type");return pnc(n,r)}}a(XT,"Visit");var hnc=512,TOi=0;function mnc(...t){return TOi=0,t.length===2?XT(t[0],t[1]):XT(t[0],[])}a(mnc,"Create")});var gEt=I(Jre=>{"use strict";p();var gnc=Jre&&Jre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Anc=Jre&&Jre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gnc(e,t,r)};Object.defineProperty(Jre,"__esModule",{value:!0});Anc(IOi(),Jre)});var POi=I(V4e=>{"use strict";p();Object.defineProperty(V4e,"__esModule",{value:!0});V4e.ValueCastError=void 0;V4e.Cast=ROi;var BR=v0(),ync=Rf(),AEt=vn(),v$=gEt(),eI=ZT(),Zre=FD(),$4e=BD(),G4e=class extends ync.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};V4e.ValueCastError=G4e;function xOi(t,e,r){if(t[AEt.Kind]==="Object"&&typeof r=="object"&&!(0,BR.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[AEt.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,eI.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[AEt.Kind]==="Union"){let o=t.anyOf.map(s=>(0,$4e.Deref)(s,e)).map(s=>xOi(s,e,r));return Math.max(...o)}else return(0,eI.Check)(t,e,r)?1:0}a(xOi,"ScoreUnion");function Enc(t,e,r){let n=t.anyOf.map(c=>(0,$4e.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=xOi(c,e,r);l>s&&(o=c,s=l)}return o}a(Enc,"SelectUnion");function _nc(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,Zre.Clone)(t.default);{let n=Enc(t,e,r);return ROi(n,e,r)}}a(_nc,"CastUnion");function vnc(t,e,r){return(0,eI.Check)(t,e,r)?(0,Zre.Clone)(r):(0,v$.Create)(t,e)}a(vnc,"DefaultClone");function Cnc(t,e,r){return(0,eI.Check)(t,e,r)?r:(0,v$.Create)(t,e)}a(Cnc,"Default");function bnc(t,e,r){if((0,eI.Check)(t,e,r))return(0,Zre.Clone)(r);let n=(0,BR.IsArray)(r)?(0,Zre.Clone)(r):(0,v$.Create)(t,e),o=(0,BR.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,BR.IsNumber)(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>UD(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!(0,eI.Check)(t,e,l))throw new G4e(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(bnc,"FromArray");function Snc(t,e,r){if((0,eI.Check)(t,e,r))return(0,v$.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]=UD(c,e,r.prototype[s]));return o}a(Snc,"FromConstructor");function Tnc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return UD(o,[...e,...n],r)}a(Tnc,"FromImport");function wOi(t,e){return(0,BR.IsObject)(t)&&!(0,BR.IsObject)(e)||!(0,BR.IsObject)(t)&&(0,BR.IsObject)(e)?t:!(0,BR.IsObject)(t)||!(0,BR.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?wOi(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(wOi,"IntersectAssign");function Inc(t,e,r){if((0,eI.Check)(t,e,r))return r;let n=(0,v$.Create)(t,e),o=wOi(n,r);return(0,eI.Check)(t,e,o)?o:n}a(Inc,"FromIntersect");function xnc(t,e,r){throw new G4e(t,"Never types cannot be cast")}a(xnc,"FromNever");function wnc(t,e,r){if((0,eI.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,v$.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]=UD(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]=UD(t.additionalProperties,e,r[c]))}return o}a(wnc,"FromObject");function Rnc(t,e,r){if((0,eI.Check)(t,e,r))return(0,Zre.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,v$.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]=UD(o,e,l);return s}a(Rnc,"FromRecord");function Pnc(t,e,r){return UD((0,$4e.Deref)(t,e),e,r)}a(Pnc,"FromRef");function knc(t,e,r){return UD((0,$4e.Deref)(t,e),e,r)}a(knc,"FromThis");function Dnc(t,e,r){return(0,eI.Check)(t,e,r)?(0,Zre.Clone)(r):(0,BR.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>UD(n,e,r[o])):(0,v$.Create)(t,e)}a(Dnc,"FromTuple");function Nnc(t,e,r){return(0,eI.Check)(t,e,r)?(0,Zre.Clone)(r):_nc(t,e,r)}a(Nnc,"FromUnion");function UD(t,e,r){let n=(0,BR.IsString)(t.$id)?(0,$4e.Pushref)(t,e):e,o=t;switch(t[AEt.Kind]){case"Array":return bnc(o,n,r);case"Constructor":return Snc(o,n,r);case"Import":return Tnc(o,n,r);case"Intersect":return Inc(o,n,r);case"Never":return xnc(o,n,r);case"Object":return wnc(o,n,r);case"Record":return Rnc(o,n,r);case"Ref":return Pnc(o,n,r);case"This":return knc(o,n,r);case"Tuple":return Dnc(o,n,r);case"Union":return Nnc(o,n,r);case"Date":case"Symbol":case"Uint8Array":return vnc(t,e,r);default:return Cnc(o,n,r)}}a(UD,"Visit");function ROi(...t){return t.length===3?UD(t[0],t[1],t[2]):UD(t[0],[],t[1])}a(ROi,"Cast")});var yEt=I(Xre=>{"use strict";p();var Mnc=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]})),Onc=Xre&&Xre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mnc(e,t,r)};Object.defineProperty(Xre,"__esModule",{value:!0});Onc(POi(),Xre)});var DOi=I(XRr=>{"use strict";p();Object.defineProperty(XRr,"__esModule",{value:!0});XRr.Clean=znc;var Bnc=dD(),EEt=ZT(),Lnc=FD(),ZRr=BD(),kOi=vn(),QD=v0(),_Et=As();function Fnc(t){return(0,_Et.IsKind)(t)&&t[kOi.Kind]!=="Unsafe"}a(Fnc,"IsCheckable");function Unc(t,e,r){return(0,QD.IsArray)(r)?r.map(n=>a1(t.items,e,n)):r}a(Unc,"FromArray");function Qnc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return a1(o,[...e,...n],r)}a(Qnc,"FromImport");function qnc(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>a1(l,e,(0,Lnc.Clone)(r))).reduce((l,u)=>(0,QD.IsObject)(u)?{...l,...u}:u,{});if(!(0,QD.IsObject)(r)||!(0,QD.IsObject)(s)||!(0,_Et.IsKind)(n))return s;let c=(0,Bnc.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,EEt.Check)(n,e,r[l])&&(s[l]=a1(n,e,r[l]));return s}a(qnc,"FromIntersect");function jnc(t,e,r){if(!(0,QD.IsObject)(r)||(0,QD.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,QD.HasPropertyKey)(t.properties,o)){r[o]=a1(t.properties[o],e,r[o]);continue}if((0,_Et.IsKind)(n)&&(0,EEt.Check)(n,e,r[o])){r[o]=a1(n,e,r[o]);continue}delete r[o]}return r}a(jnc,"FromObject");function Hnc(t,e,r){if(!(0,QD.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]=a1(c,e,r[u]);continue}if((0,_Et.IsKind)(n)&&(0,EEt.Check)(n,e,r[u])){r[u]=a1(n,e,r[u]);continue}delete r[u]}return r}a(Hnc,"FromRecord");function Gnc(t,e,r){return a1((0,ZRr.Deref)(t,e),e,r)}a(Gnc,"FromRef");function $nc(t,e,r){return a1((0,ZRr.Deref)(t,e),e,r)}a($nc,"FromThis");function Vnc(t,e,r){if(!(0,QD.IsArray)(r))return r;if((0,QD.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(Vnc,"FromTuple");function Wnc(t,e,r){for(let n of t.anyOf)if(Fnc(n)&&(0,EEt.Check)(n,e,r))return a1(n,e,r);return r}a(Wnc,"FromUnion");function a1(t,e,r){let n=(0,QD.IsString)(t.$id)?(0,ZRr.Pushref)(t,e):e,o=t;switch(o[kOi.Kind]){case"Array":return Unc(o,n,r);case"Import":return Qnc(o,n,r);case"Intersect":return qnc(o,n,r);case"Object":return jnc(o,n,r);case"Record":return Hnc(o,n,r);case"Ref":return Gnc(o,n,r);case"This":return $nc(o,n,r);case"Tuple":return Vnc(o,n,r);case"Union":return Wnc(o,n,r);default:return r}}a(a1,"Visit");function znc(...t){return t.length===3?a1(t[0],t[1],t[2]):a1(t[0],[],t[1])}a(znc,"Clean")});var vEt=I(ene=>{"use strict";p();var Ync=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]})),Knc=ene&&ene.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ync(e,t,r)};Object.defineProperty(ene,"__esModule",{value:!0});Knc(DOi(),ene)});var LOi=I(tPr=>{"use strict";p();Object.defineProperty(tPr,"__esModule",{value:!0});tPr.Convert=Nic;var Jnc=FD(),NOi=ZT(),ePr=BD(),Znc=vn(),Ba=v0();function CEt(t){return(0,Ba.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(CEt,"IsStringNumeric");function Xnc(t){return(0,Ba.IsBigInt)(t)||(0,Ba.IsBoolean)(t)||(0,Ba.IsNumber)(t)}a(Xnc,"IsValueToString");function W4e(t){return t===!0||(0,Ba.IsNumber)(t)&&t===1||(0,Ba.IsBigInt)(t)&&t===BigInt("1")||(0,Ba.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(W4e,"IsValueTrue");function z4e(t){return t===!1||(0,Ba.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,Ba.IsBigInt)(t)&&t===BigInt("0")||(0,Ba.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(z4e,"IsValueFalse");function eic(t){return(0,Ba.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(eic,"IsTimeStringWithTimeZone");function tic(t){return(0,Ba.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(tic,"IsTimeStringWithoutTimeZone");function ric(t){return(0,Ba.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(ric,"IsDateTimeStringWithTimeZone");function nic(t){return(0,Ba.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(nic,"IsDateTimeStringWithoutTimeZone");function iic(t){return(0,Ba.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(iic,"IsDateString");function oic(t,e){let r=OOi(t);return r===e?r:t}a(oic,"TryConvertLiteralString");function sic(t,e){let r=BOi(t);return r===e?r:t}a(sic,"TryConvertLiteralNumber");function aic(t,e){let r=MOi(t);return r===e?r:t}a(aic,"TryConvertLiteralBoolean");function cic(t,e){return(0,Ba.IsString)(t.const)?oic(e,t.const):(0,Ba.IsNumber)(t.const)?sic(e,t.const):(0,Ba.IsBoolean)(t.const)?aic(e,t.const):e}a(cic,"TryConvertLiteral");function MOi(t){return W4e(t)?!0:z4e(t)?!1:t}a(MOi,"TryConvertBoolean");function lic(t){let e=a(r=>r.split(".")[0],"truncateInteger");return CEt(t)?BigInt(e(t)):(0,Ba.IsNumber)(t)?BigInt(Math.trunc(t)):z4e(t)?BigInt(0):W4e(t)?BigInt(1):t}a(lic,"TryConvertBigInt");function OOi(t){return(0,Ba.IsSymbol)(t)&&t.description!==void 0?t.description.toString():Xnc(t)?t.toString():t}a(OOi,"TryConvertString");function BOi(t){return CEt(t)?parseFloat(t):W4e(t)?1:z4e(t)?0:t}a(BOi,"TryConvertNumber");function uic(t){return CEt(t)?parseInt(t):(0,Ba.IsNumber)(t)?Math.trunc(t):W4e(t)?1:z4e(t)?0:t}a(uic,"TryConvertInteger");function dic(t){return(0,Ba.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(dic,"TryConvertNull");function fic(t){return(0,Ba.IsString)(t)&&t==="undefined"?void 0:t}a(fic,"TryConvertUndefined");function pic(t){return(0,Ba.IsDate)(t)?t:(0,Ba.IsNumber)(t)?new Date(t):W4e(t)?new Date(1):z4e(t)?new Date(0):CEt(t)?new Date(parseInt(t)):tic(t)?new Date(`1970-01-01T${t}.000Z`):eic(t)?new Date(`1970-01-01T${t}`):nic(t)?new Date(`${t}.000Z`):ric(t)?new Date(t):iic(t)?new Date(`${t}T00:00:00.000Z`):t}a(pic,"TryConvertDate");function hic(t,e,r){return((0,Ba.IsArray)(r)?r:[r]).map(o=>qD(t.items,e,o))}a(hic,"FromArray");function mic(t,e,r){return lic(r)}a(mic,"FromBigInt");function gic(t,e,r){return MOi(r)}a(gic,"FromBoolean");function Aic(t,e,r){return pic(r)}a(Aic,"FromDate");function yic(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return qD(o,[...e,...n],r)}a(yic,"FromImport");function Eic(t,e,r){return uic(r)}a(Eic,"FromInteger");function _ic(t,e,r){return t.allOf.reduce((n,o)=>qD(o,e,n),r)}a(_ic,"FromIntersect");function vic(t,e,r){return cic(t,r)}a(vic,"FromLiteral");function Cic(t,e,r){return dic(r)}a(Cic,"FromNull");function bic(t,e,r){return BOi(r)}a(bic,"FromNumber");function Sic(t,e,r){if(!(0,Ba.IsObject)(r)||(0,Ba.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,Ba.HasPropertyKey)(r,n)&&(r[n]=qD(t.properties[n],e,r[n]));return r}a(Sic,"FromObject");function Tic(t,e,r){if(!((0,Ba.IsObject)(r)&&!(0,Ba.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]=qD(s,e,l);return r}a(Tic,"FromRecord");function Iic(t,e,r){return qD((0,ePr.Deref)(t,e),e,r)}a(Iic,"FromRef");function xic(t,e,r){return OOi(r)}a(xic,"FromString");function wic(t,e,r){return(0,Ba.IsString)(r)||(0,Ba.IsNumber)(r)?Symbol(r):r}a(wic,"FromSymbol");function Ric(t,e,r){return qD((0,ePr.Deref)(t,e),e,r)}a(Ric,"FromThis");function Pic(t,e,r){return(0,Ba.IsArray)(r)&&!(0,Ba.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var Mic=tne&&tne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Oic=tne&&tne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mic(e,t,r)};Object.defineProperty(tne,"__esModule",{value:!0});Oic(LOi(),tne)});var qOi=I(rne=>{"use strict";p();Object.defineProperty(rne,"__esModule",{value:!0});rne.TransformDecodeError=rne.TransformDecodeCheckError=void 0;rne.TransformDecode=zic;var Bic=p5e(),FOi=vn(),UOi=Rf(),QOi=dD(),nPr=BD(),Lic=ZT(),b6=v0(),Y4e=As(),rPr=class extends UOi.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}};rne.TransformDecodeCheckError=rPr;var SEt=class extends UOi.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}};rne.TransformDecodeError=SEt;function $d(t,e,r){try{return(0,Y4e.IsTransform)(t)?t[FOi.TransformKind].Decode(r):r}catch(n){throw new SEt(t,e,r,n)}}a($d,"Default");function Fic(t,e,r,n){return(0,b6.IsArray)(n)?$d(t,r,n.map((o,s)=>jD(t.items,e,`${r}/${s}`,o))):$d(t,r,n)}a(Fic,"FromArray");function Uic(t,e,r,n){if(!(0,b6.IsObject)(n)||(0,b6.IsValueType)(n))return $d(t,r,n);let o=(0,QOi.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=jD(h,e,`${r}/${f}`,c[f]));if(!(0,Y4e.IsTransform)(t.unevaluatedProperties))return $d(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=$d(u,`${r}/${f}`,d[f]));return $d(t,r,d)}a(Uic,"FromIntersect");function Qic(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=jD(s,[...e,...o],r,n);return $d(t,r,c)}a(Qic,"FromImport");function qic(t,e,r,n){return $d(t,r,jD(t.not,e,r,n))}a(qic,"FromNot");function jic(t,e,r,n){if(!(0,b6.IsObject)(n))return $d(t,r,n);let o=(0,QOi.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,b6.HasPropertyKey)(s,d)&&((0,b6.IsUndefined)(s[d])&&(!(0,Y4e.IsUndefined)(t.properties[d])||Bic.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=jD(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,Y4e.IsSchema)(t.additionalProperties))return $d(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=$d(l,`${r}/${d}`,u[d]));return $d(t,r,u)}a(jic,"FromObject");function Hic(t,e,r,n){if(!(0,b6.IsObject)(n))return $d(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]=jD(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,Y4e.IsSchema)(t.additionalProperties))return $d(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=$d(u,`${r}/${f}`,d[f]));return $d(t,r,d)}a(Hic,"FromRecord");function Gic(t,e,r,n){let o=(0,nPr.Deref)(t,e);return $d(t,r,jD(o,e,r,n))}a(Gic,"FromRef");function $ic(t,e,r,n){let o=(0,nPr.Deref)(t,e);return $d(t,r,jD(o,e,r,n))}a($ic,"FromThis");function Vic(t,e,r,n){return(0,b6.IsArray)(n)&&(0,b6.IsArray)(t.items)?$d(t,r,t.items.map((o,s)=>jD(o,e,`${r}/${s}`,n[s]))):$d(t,r,n)}a(Vic,"FromTuple");function Wic(t,e,r,n){for(let o of t.anyOf){if(!(0,Lic.Check)(o,e,n))continue;let s=jD(o,e,r,n);return $d(t,r,s)}return $d(t,r,n)}a(Wic,"FromUnion");function jD(t,e,r,n){let o=(0,nPr.Pushref)(t,e),s=t;switch(t[FOi.Kind]){case"Array":return Fic(s,o,r,n);case"Import":return Qic(s,o,r,n);case"Intersect":return Uic(s,o,r,n);case"Not":return qic(s,o,r,n);case"Object":return jic(s,o,r,n);case"Record":return Hic(s,o,r,n);case"Ref":return Gic(s,o,r,n);case"Symbol":return $d(s,r,n);case"This":return $ic(s,o,r,n);case"Tuple":return Vic(s,o,r,n);case"Union":return Wic(s,o,r,n);default:return $d(s,r,n)}}a(jD,"Visit");function zic(t,e,r){return jD(t,e,"",r)}a(zic,"TransformDecode")});var VOi=I(nne=>{"use strict";p();Object.defineProperty(nne,"__esModule",{value:!0});nne.TransformEncodeError=nne.TransformEncodeCheckError=void 0;nne.TransformEncode=soc;var Yic=p5e(),HOi=vn(),GOi=Rf(),$Oi=dD(),oPr=BD(),jOi=ZT(),C$=v0(),K4e=As(),iPr=class extends GOi.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}};nne.TransformEncodeCheckError=iPr;var TEt=class extends GOi.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}};nne.TransformEncodeError=TEt;function uy(t,e,r){try{return(0,K4e.IsTransform)(t)?t[HOi.TransformKind].Encode(r):r}catch(n){throw new TEt(t,e,r,n)}}a(uy,"Default");function Kic(t,e,r,n){let o=uy(t,r,n);return(0,C$.IsArray)(o)?o.map((s,c)=>HD(t.items,e,`${r}/${c}`,s)):o}a(Kic,"FromArray");function Jic(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=uy(t,r,n);return HD(s,[...e,...o],r,c)}a(Jic,"FromImport");function Zic(t,e,r,n){let o=uy(t,r,n);if(!(0,C$.IsObject)(n)||(0,C$.IsValueType)(n))return o;let s=(0,$Oi.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=HD(m,e,`${r}/${h}`,l[h]));if(!(0,K4e.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]=uy(d,`${r}/${h}`,f[h]));return f}a(Zic,"FromIntersect");function Xic(t,e,r,n){return uy(t.not,r,uy(t,r,n))}a(Xic,"FromNot");function eoc(t,e,r,n){let o=uy(t,r,n);if(!(0,C$.IsObject)(o))return o;let s=(0,$Oi.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,C$.HasPropertyKey)(c,f)&&((0,C$.IsUndefined)(c[f])&&(!(0,K4e.IsUndefined)(t.properties[f])||Yic.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=HD(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,K4e.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]=uy(u,`${r}/${f}`,d[f]));return d}a(eoc,"FromObject");function toc(t,e,r,n){let o=uy(t,r,n);if(!(0,C$.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]=HD(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,K4e.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]=uy(d,`${r}/${h}`,f[h]));return f}a(toc,"FromRecord");function roc(t,e,r,n){let o=(0,oPr.Deref)(t,e),s=HD(o,e,r,n);return uy(t,r,s)}a(roc,"FromRef");function noc(t,e,r,n){let o=(0,oPr.Deref)(t,e),s=HD(o,e,r,n);return uy(t,r,s)}a(noc,"FromThis");function ioc(t,e,r,n){let o=uy(t,r,n);return(0,C$.IsArray)(t.items)?t.items.map((s,c)=>HD(s,e,`${r}/${c}`,o[c])):[]}a(ioc,"FromTuple");function ooc(t,e,r,n){for(let o of t.anyOf){if(!(0,jOi.Check)(o,e,n))continue;let s=HD(o,e,r,n);return uy(t,r,s)}for(let o of t.anyOf){let s=HD(o,e,r,n);if((0,jOi.Check)(t,e,s))return uy(t,r,s)}return uy(t,r,n)}a(ooc,"FromUnion");function HD(t,e,r,n){let o=(0,oPr.Pushref)(t,e),s=t;switch(t[HOi.Kind]){case"Array":return Kic(s,o,r,n);case"Import":return Jic(s,o,r,n);case"Intersect":return Zic(s,o,r,n);case"Not":return Xic(s,o,r,n);case"Object":return eoc(s,o,r,n);case"Record":return toc(s,o,r,n);case"Ref":return roc(s,o,r,n);case"This":return noc(s,o,r,n);case"Tuple":return ioc(s,o,r,n);case"Union":return ooc(s,o,r,n);default:return uy(s,r,n)}}a(HD,"Visit");function soc(t,e,r){return HD(t,e,"",r)}a(soc,"TransformEncode")});var WOi=I(cPr=>{"use strict";p();Object.defineProperty(cPr,"__esModule",{value:!0});cPr.HasTransform=Soc;var aPr=BD(),aoc=vn(),bm=As(),coc=v0();function loc(t,e){return(0,bm.IsTransform)(t)||S0(t.items,e)}a(loc,"FromArray");function uoc(t,e){return(0,bm.IsTransform)(t)||S0(t.items,e)}a(uoc,"FromAsyncIterator");function doc(t,e){return(0,bm.IsTransform)(t)||S0(t.returns,e)||t.parameters.some(r=>S0(r,e))}a(doc,"FromConstructor");function foc(t,e){return(0,bm.IsTransform)(t)||S0(t.returns,e)||t.parameters.some(r=>S0(r,e))}a(foc,"FromFunction");function poc(t,e){return(0,bm.IsTransform)(t)||(0,bm.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>S0(r,e))}a(poc,"FromIntersect");function hoc(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,bm.IsTransform)(t)||S0(n,[...r,...e])}a(hoc,"FromImport");function moc(t,e){return(0,bm.IsTransform)(t)||S0(t.items,e)}a(moc,"FromIterator");function goc(t,e){return(0,bm.IsTransform)(t)||S0(t.not,e)}a(goc,"FromNot");function Aoc(t,e){return(0,bm.IsTransform)(t)||Object.values(t.properties).some(r=>S0(r,e))||(0,bm.IsSchema)(t.additionalProperties)&&S0(t.additionalProperties,e)}a(Aoc,"FromObject");function yoc(t,e){return(0,bm.IsTransform)(t)||S0(t.item,e)}a(yoc,"FromPromise");function Eoc(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,bm.IsTransform)(t)||S0(n,e)||(0,bm.IsSchema)(t.additionalProperties)&&(0,bm.IsTransform)(t.additionalProperties)}a(Eoc,"FromRecord");function _oc(t,e){return(0,bm.IsTransform)(t)?!0:S0((0,aPr.Deref)(t,e),e)}a(_oc,"FromRef");function voc(t,e){return(0,bm.IsTransform)(t)?!0:S0((0,aPr.Deref)(t,e),e)}a(voc,"FromThis");function Coc(t,e){return(0,bm.IsTransform)(t)||!(0,coc.IsUndefined)(t.items)&&t.items.some(r=>S0(r,e))}a(Coc,"FromTuple");function boc(t,e){return(0,bm.IsTransform)(t)||t.anyOf.some(r=>S0(r,e))}a(boc,"FromUnion");function S0(t,e){let r=(0,aPr.Pushref)(t,e),n=t;if(t.$id&&sPr.has(t.$id))return!1;switch(t.$id&&sPr.add(t.$id),t[aoc.Kind]){case"Array":return loc(n,r);case"AsyncIterator":return uoc(n,r);case"Constructor":return doc(n,r);case"Function":return foc(n,r);case"Import":return hoc(n,r);case"Intersect":return poc(n,r);case"Iterator":return moc(n,r);case"Not":return goc(n,r);case"Object":return Aoc(n,r);case"Promise":return yoc(n,r);case"Record":return Eoc(n,r);case"Ref":return _oc(n,r);case"This":return voc(n,r);case"Tuple":return Coc(n,r);case"Union":return boc(n,r);default:return(0,bm.IsTransform)(t)}}a(S0,"Visit");var sPr=new Set;function Soc(t,e){return sPr.clear(),S0(t,e)}a(Soc,"HasTransform")});var J4e=I(S6=>{"use strict";p();var Toc=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]})),lPr=S6&&S6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Toc(e,t,r)};Object.defineProperty(S6,"__esModule",{value:!0});lPr(qOi(),S6);lPr(VOi(),S6);lPr(WOi(),S6)});var zOi=I(dPr=>{"use strict";p();Object.defineProperty(dPr,"__esModule",{value:!0});dPr.Decode=woc;var uPr=J4e(),Ioc=ZT(),xoc=kAe();function woc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,Ioc.Check)(e,r,n))throw new uPr.TransformDecodeCheckError(e,n,(0,xoc.Errors)(e,r,n).First());return(0,uPr.HasTransform)(e,r)?(0,uPr.TransformDecode)(e,r,n):n}a(woc,"Decode")});var fPr=I(ine=>{"use strict";p();var Roc=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]})),Poc=ine&&ine.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Roc(e,t,r)};Object.defineProperty(ine,"__esModule",{value:!0});Poc(zOi(),ine)});var KOi=I(mPr=>{"use strict";p();Object.defineProperty(mPr,"__esModule",{value:!0});mPr.Default=Goc;var koc=ZT(),YOi=FD(),hPr=BD(),Doc=vn(),c1=v0(),Noc=As();function T6(t,e){let r=(0,c1.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,c1.IsFunction)(r)?r():(0,YOi.Clone)(r);return(0,c1.IsUndefined)(e)?n:(0,c1.IsObject)(e)&&(0,c1.IsObject)(n)?Object.assign(n,e):e}a(T6,"ValueOrDefault");function pPr(t){return(0,Noc.IsKind)(t)&&"default"in t}a(pPr,"HasDefaultProperty");function Moc(t,e,r){if((0,c1.IsArray)(r)){for(let o=0;o{let c=Iv(s,e,n);return(0,c1.IsObject)(c)?{...o,...c}:c},{})}a(Loc,"FromIntersect");function Foc(t,e,r){let n=T6(t,r);if(!(0,c1.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=Iv(t.properties[s],e,n[s]);(0,c1.IsUndefined)(c)||(n[s]=Iv(t.properties[s],e,n[s]))}if(!pPr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=Iv(t.additionalProperties,e,n[s]));return n}a(Foc,"FromObject");function Uoc(t,e,r){let n=T6(t,r);if(!(0,c1.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)&&pPr(c)&&(n[u]=Iv(c,e,n[u]));if(!pPr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=Iv(o,e,n[u]));return n}a(Uoc,"FromRecord");function Qoc(t,e,r){return Iv((0,hPr.Deref)(t,e),e,T6(t,r))}a(Qoc,"FromRef");function qoc(t,e,r){return Iv((0,hPr.Deref)(t,e),e,r)}a(qoc,"FromThis");function joc(t,e,r){let n=T6(t,r);if(!(0,c1.IsArray)(n)||(0,c1.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 $oc=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]})),Voc=one&&one.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$oc(e,t,r)};Object.defineProperty(one,"__esModule",{value:!0});Voc(KOi(),one)});var XOi=I(GD=>{"use strict";p();Object.defineProperty(GD,"__esModule",{value:!0});GD.ValuePointerRootDeleteError=GD.ValuePointerRootSetError=void 0;GD.Format=Z4e;GD.Set=Woc;GD.Delete=zoc;GD.Has=Yoc;GD.Get=Koc;var ZOi=Rf(),xEt=class extends ZOi.TypeBoxError{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}};GD.ValuePointerRootSetError=xEt;var wEt=class extends ZOi.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};GD.ValuePointerRootDeleteError=wEt;function JOi(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(JOi,"Escape");function*Z4e(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var Joc=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]})),Zoc=Z4&&Z4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xoc=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{"use strict";p();Object.defineProperty(gPr,"__esModule",{value:!0});gPr.Equal=PEt;var I6=v0();function esc(t,e){if(!(0,I6.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=>PEt(t[o],e[o]))}a(esc,"ObjectType");function tsc(t,e){return(0,I6.IsDate)(e)&&t.getTime()===e.getTime()}a(tsc,"DateType");function rsc(t,e){return!(0,I6.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>PEt(r,e[n]))}a(rsc,"ArrayType");function nsc(t,e){return!(0,I6.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>PEt(r,e[n]))}a(nsc,"TypedArrayType");function isc(t,e){return t===e}a(isc,"ValueType");function PEt(t,e){if((0,I6.IsDate)(t))return tsc(t,e);if((0,I6.IsTypedArray)(t))return nsc(t,e);if((0,I6.IsArray)(t))return rsc(t,e);if((0,I6.IsObject)(t))return esc(t,e);if((0,I6.IsValueType)(t))return isc(t,e);throw new Error("ValueEquals: Unable to compare value")}a(PEt,"Equal")});var i5i=I(dy=>{"use strict";p();Object.defineProperty(dy,"__esModule",{value:!0});dy.ValueDiffError=dy.Edit=dy.Delete=dy.Update=dy.Insert=void 0;dy.Diff=fsc;dy.Patch=msc;var X4=v0(),yPr=REt(),EPr=FD(),osc=APr(),ssc=Rf(),_Pr=DE(),vPr=yv(),CPr=MG(),t5i=QG(),asc=vp();dy.Insert=(0,vPr.Object)({type:(0,_Pr.Literal)("insert"),path:(0,CPr.String)(),value:(0,t5i.Unknown)()});dy.Update=(0,vPr.Object)({type:(0,_Pr.Literal)("update"),path:(0,CPr.String)(),value:(0,t5i.Unknown)()});dy.Delete=(0,vPr.Object)({type:(0,_Pr.Literal)("delete"),path:(0,CPr.String)()});dy.Edit=(0,asc.Union)([dy.Insert,dy.Update,dy.Delete]);var X4e=class extends ssc.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};dy.ValueDiffError=X4e;function kEt(t,e){return{type:"update",path:t,value:e}}a(kEt,"CreateUpdate");function r5i(t,e){return{type:"insert",path:t,value:e}}a(r5i,"CreateInsert");function n5i(t){return{type:"delete",path:t}}a(n5i,"CreateDelete");function e5i(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new X4e(t,"Cannot diff objects with symbols")}a(e5i,"AssertDiffable");function*csc(t,e,r){if(e5i(e),e5i(r),!(0,X4.IsStandardObject)(r))return yield kEt(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,X4.HasPropertyKey)(e,s)||(yield r5i(`${t}/${s}`,r[s]));for(let s of n)(0,X4.HasPropertyKey)(r,s)&&((0,osc.Equal)(e,r)||(yield*DEt(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,X4.HasPropertyKey)(r,s)||(yield n5i(`${t}/${s}`))}a(csc,"ObjectType");function*lsc(t,e,r){if(!(0,X4.IsArray)(r))return yield kEt(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(psc,"IsRootUpdate");function hsc(t){return t.length===0}a(hsc,"IsIdentity");function msc(t,e){if(psc(e))return(0,EPr.Clone)(e[0].value);if(hsc(e))return(0,EPr.Clone)(t);let r=(0,EPr.Clone)(t);for(let n of e)switch(n.type){case"insert":{yPr.ValuePointer.Set(r,n.path,n.value);break}case"update":{yPr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{yPr.ValuePointer.Delete(r,n.path);break}}return r}a(msc,"Patch")});var bPr=I(sne=>{"use strict";p();var gsc=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]})),Asc=sne&&sne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gsc(e,t,r)};Object.defineProperty(sne,"__esModule",{value:!0});Asc(i5i(),sne)});var o5i=I(TPr=>{"use strict";p();Object.defineProperty(TPr,"__esModule",{value:!0});TPr.Encode=_sc;var SPr=J4e(),ysc=ZT(),Esc=kAe();function _sc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,SPr.HasTransform)(e,r)?(0,SPr.TransformEncode)(e,r,n):n;if(!(0,ysc.Check)(e,r,o))throw new SPr.TransformEncodeCheckError(e,o,(0,Esc.Errors)(e,r,o).First());return o}a(_sc,"Encode")});var IPr=I(ane=>{"use strict";p();var vsc=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]})),Csc=ane&&ane.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vsc(e,t,r)};Object.defineProperty(ane,"__esModule",{value:!0});Csc(o5i(),ane)});var xPr=I(cne=>{"use strict";p();var bsc=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]})),Ssc=cne&&cne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bsc(e,t,r)};Object.defineProperty(cne,"__esModule",{value:!0});Ssc(APr(),cne)});var a5i=I(tBe=>{"use strict";p();Object.defineProperty(tBe,"__esModule",{value:!0});tBe.ValueMutateError=void 0;tBe.Mutate=ksc;var $D=v0(),MEt=REt(),wPr=FD(),Tsc=Rf();function NEt(t){return(0,$D.IsObject)(t)&&!(0,$D.IsArray)(t)}a(NEt,"IsStandardObject");var eBe=class extends Tsc.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};tBe.ValueMutateError=eBe;function Isc(t,e,r,n){if(!NEt(r))MEt.ValuePointer.Set(t,e,(0,wPr.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)RPr(t,`${e}/${c}`,r[c],n[c])}}a(Isc,"ObjectType");function xsc(t,e,r,n){if(!(0,$D.IsArray)(r))MEt.ValuePointer.Set(t,e,(0,wPr.Clone)(n));else{for(let o=0;o{"use strict";p();var Dsc=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]})),Nsc=lne&&lne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Dsc(e,t,r)};Object.defineProperty(lne,"__esModule",{value:!0});Nsc(a5i(),lne)});var l5i=I(VD=>{"use strict";p();Object.defineProperty(VD,"__esModule",{value:!0});VD.ParseDefault=VD.ParseRegistry=VD.ParseError=void 0;VD.Parse=jsc;var Msc=Rf(),OEt=J4e(),Osc=mEt(),Bsc=yEt(),Lsc=vEt(),Fsc=FD(),Usc=bEt(),Qsc=IEt(),c5i=v0(),rBe=class extends Msc.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};VD.ParseError=rBe;var kPr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,Osc.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,Bsc.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,Lsc.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,Fsc.Clone)(l)],["Convert",(s,c,l)=>(0,Usc.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,OEt.HasTransform)(s,c)?(0,OEt.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,Qsc.Default)(s,c,l)],["Encode",(s,c,l)=>(0,OEt.HasTransform)(s,c)?(0,OEt.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})(kPr||(VD.ParseRegistry=kPr={}));VD.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function qsc(t,e,r,n){return t.reduce((o,s)=>{let c=kPr.Get(s);if((0,c5i.IsUndefined)(c))throw new rBe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(qsc,"ParseValue");function jsc(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,c5i.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[VD.ParseDefault,t[0],t[1],t[2]]:t.length===2?[VD.ParseDefault,t[0],[],t[1]]:(()=>{throw new rBe("Invalid Arguments")})();return qsc(e,r,n,o)}a(jsc,"Parse")});var DPr=I(une=>{"use strict";p();var Hsc=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]})),Gsc=une&&une.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hsc(e,t,r)};Object.defineProperty(une,"__esModule",{value:!0});Gsc(l5i(),une)});var d5i=I(ys=>{"use strict";p();Object.defineProperty(ys,"__esModule",{value:!0});ys.Parse=ys.Mutate=ys.Hash=ys.Equal=ys.Encode=ys.Edit=ys.Patch=ys.Diff=ys.Default=ys.Decode=ys.Create=ys.Convert=ys.Clone=ys.Clean=ys.Check=ys.Cast=ys.Assert=ys.ValueErrorIterator=ys.Errors=void 0;var u5i=kAe();Object.defineProperty(ys,"Errors",{enumerable:!0,get:a(function(){return u5i.Errors},"get")});Object.defineProperty(ys,"ValueErrorIterator",{enumerable:!0,get:a(function(){return u5i.ValueErrorIterator},"get")});var $sc=mEt();Object.defineProperty(ys,"Assert",{enumerable:!0,get:a(function(){return $sc.Assert},"get")});var Vsc=yEt();Object.defineProperty(ys,"Cast",{enumerable:!0,get:a(function(){return Vsc.Cast},"get")});var Wsc=ZT();Object.defineProperty(ys,"Check",{enumerable:!0,get:a(function(){return Wsc.Check},"get")});var zsc=vEt();Object.defineProperty(ys,"Clean",{enumerable:!0,get:a(function(){return zsc.Clean},"get")});var Ysc=FD();Object.defineProperty(ys,"Clone",{enumerable:!0,get:a(function(){return Ysc.Clone},"get")});var Ksc=bEt();Object.defineProperty(ys,"Convert",{enumerable:!0,get:a(function(){return Ksc.Convert},"get")});var Jsc=gEt();Object.defineProperty(ys,"Create",{enumerable:!0,get:a(function(){return Jsc.Create},"get")});var Zsc=fPr();Object.defineProperty(ys,"Decode",{enumerable:!0,get:a(function(){return Zsc.Decode},"get")});var Xsc=IEt();Object.defineProperty(ys,"Default",{enumerable:!0,get:a(function(){return Xsc.Default},"get")});var NPr=bPr();Object.defineProperty(ys,"Diff",{enumerable:!0,get:a(function(){return NPr.Diff},"get")});Object.defineProperty(ys,"Patch",{enumerable:!0,get:a(function(){return NPr.Patch},"get")});Object.defineProperty(ys,"Edit",{enumerable:!0,get:a(function(){return NPr.Edit},"get")});var eac=IPr();Object.defineProperty(ys,"Encode",{enumerable:!0,get:a(function(){return eac.Encode},"get")});var tac=xPr();Object.defineProperty(ys,"Equal",{enumerable:!0,get:a(function(){return tac.Equal},"get")});var rac=L4e();Object.defineProperty(ys,"Hash",{enumerable:!0,get:a(function(){return rac.Hash},"get")});var nac=PPr();Object.defineProperty(ys,"Mutate",{enumerable:!0,get:a(function(){return nac.Mutate},"get")});var iac=DPr();Object.defineProperty(ys,"Parse",{enumerable:!0,get:a(function(){return iac.Parse},"get")})});var f5i=I(eB=>{"use strict";p();var oac=eB&&eB.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sac=eB&&eB.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aac=eB&&eB.__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 cac=qc&&qc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gg=qc&&qc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cac(e,t,r)};Object.defineProperty(qc,"__esModule",{value:!0});qc.Value=qc.ValueErrorIterator=qc.ValueErrorType=void 0;var p5i=kAe();Object.defineProperty(qc,"ValueErrorType",{enumerable:!0,get:a(function(){return p5i.ValueErrorType},"get")});Object.defineProperty(qc,"ValueErrorIterator",{enumerable:!0,get:a(function(){return p5i.ValueErrorIterator},"get")});Gg(v0(),qc);Gg(mEt(),qc);Gg(yEt(),qc);Gg(ZT(),qc);Gg(vEt(),qc);Gg(FD(),qc);Gg(bEt(),qc);Gg(gEt(),qc);Gg(fPr(),qc);Gg(IEt(),qc);Gg(bPr(),qc);Gg(IPr(),qc);Gg(xPr(),qc);Gg(L4e(),qc);Gg(PPr(),qc);Gg(DPr(),qc);Gg(REt(),qc);Gg(J4e(),qc);var lac=f5i();Object.defineProperty(qc,"Value",{enumerable:!0,get:a(function(){return lac.Value},"get")})});var m5i=I(BEt=>{"use strict";p();Object.defineProperty(BEt,"__esModule",{value:!0});BEt.assertShape=void 0;var h5i=MPr(),uac=a((t,e)=>{if(h5i.Value.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...h5i.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");BEt.assertShape=uac});var dne={};Ri(dne,{CAPIClient:()=>gac,RequestType:()=>A5i});async function hac(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 mac(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 dac,OPr,nBe,fac,pac,A5i,gac,fne=_e(()=>{p();dac=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";nBe=OPr,fac=`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(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. IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. @@ -1067,155 +1069,155 @@ 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.`,pac=`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.`,scc=`I have read and agree to the following license terms: -${fac} -`,A5i=(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))(A5i||{});a(hac,"v");a(mac,"_");gac=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===pac&&(this._licenseCheckSucceeded=!0),this._domainService=new nBe,this._fetcherService=r??new dac,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(`${nBe.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${nBe.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(`${nBe.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${nBe.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(!mac(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 hac(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 fy=I(xv=>{"use strict";p();Object.defineProperty(xv,"__esModule",{value:!0});xv.DestroyableStream=xv.HeadersImpl=xv.Response=xv.NO_FETCH_TELEMETRY=xv.IFetcherService=void 0;xv.jsonVerboseError=yac;xv.isAbortError=y5i;xv.safeGetHostname=Eac;var Aac=rn();xv.IFetcherService=(0,Aac.createServiceIdentifier)("IFetcherService");xv.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var BPr=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&&!y5i(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 LEt(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())}};xv.Response=BPr;var LPr=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")}}};xv.HeadersImpl=LPr;var LEt=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()}};xv.DestroyableStream=LEt;async function yac(t){let e=await t.text();try{return JSON.parse(e)}catch(r){let n=e.split(` +${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(` `),o=n.length>50?[...n.slice(0,25),"[...]",...n.slice(n.length-25)].join(` -`):e;throw r.message=`${r.message}. Response: ${o}`,r}}a(yac,"jsonVerboseError");function y5i(t){return t&&t.name==="AbortError"}a(y5i,"isAbortError");function Eac(t){try{return new URL(t).hostname}catch{return"unknown"}}a(Eac,"safeGetHostname")});var E5i=I(NAe=>{"use strict";p();Object.defineProperty(NAe,"__esModule",{value:!0});NAe.INTEGRATION_ID=NAe.LICENSE_AGREEMENT=void 0;NAe.LICENSE_AGREEMENT=void 0;NAe.INTEGRATION_ID="code-oss"});var LE=I(MAe=>{"use strict";p();Object.defineProperty(MAe,"__esModule",{value:!0});MAe.ICAPIClientService=MAe.BaseCAPIClientService=void 0;var iBe=(fne(),_a(dne)),_ac=rn(),vac=fy(),Cac=E5i(),FPr=class extends iBe.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()},Cac.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===iBe.RequestType.Telemetry||r.type===iBe.RequestType.ChatCompletions||r.type===iBe.RequestType.ChatMessages||r.type===iBe.RequestType.ChatResponses)&&(e.callSite=vac.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};MAe.BaseCAPIClientService=FPr;MAe.ICAPIClientService=(0,_ac.createServiceIdentifier)("ICAPIClientService")});var UEt=I(FEt=>{"use strict";p();Object.defineProperty(FEt,"__esModule",{value:!0});FEt.getEndpointUrl=wac;FEt.getLastKnownEndpoints=Rac;var bac=kE(),Sac=LE(),b$=RE(),Tac=Gre(),Iac=KG();function v5i(t){let e=t.get(Sac.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a(v5i,"getDefaultEndpoints");function _5i(t,e,r){if(r!==void 0&&t.get(Tac.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,b$.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,b$.getConfig)(t,n);if(o)return o}}a(_5i,"urlConfigOverride");function xac(t,e){switch(e){case"proxy":return _5i(t,[b$.ConfigKey.DebugOverrideProxyUrl,b$.ConfigKey.DebugOverrideProxyUrlLegacy],[b$.ConfigKey.DebugTestOverrideProxyUrl,b$.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!b$.BuildInfo.isProduction())return _5i(t,[b$.ConfigKey.DebugSnippyOverrideUrl])}}a(xac,"getEndpointOverrideUrl");function wac(t,e,r,...n){let o=xac(t,r)??(e.endpoints?e.endpoints[r]:void 0)??v5i(t)[r];return(0,Iac.joinPath)(o,...n)}a(wac,"getEndpointUrl");function Rac(t){return t.get(bac.IAuthenticationService).copilotToken?.endpoints??v5i(t)}a(Rac,"getLastKnownEndpoints")});var QPr=I(oBe=>{"use strict";p();Object.defineProperty(oBe,"__esModule",{value:!0});oBe.Response=void 0;oBe.isAbortError=kac;var Pac=fy();Object.defineProperty(oBe,"Response",{enumerable:!0,get:a(function(){return Pac.Response},"get")});var UPr=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function kac(t){return!t||typeof t!="object"?!1:t instanceof UPr||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(kac,"isAbortError")});var OAe=I(T0=>{"use strict";p();var Dac=T0&&T0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=T0&&T0.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Mac=T0&&T0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Dac(e,t,r)},qPr=T0&&T0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(T0,"__esModule",{value:!0});T0.Fetcher=T0.CompletionsFetcher=T0.ICompletionsFetcherService=void 0;T0.isInterruptedNetworkError=Fac;Mac(QPr(),T0);var C5i=Tl(),Oac=fy(),Bac=Cp(),Lac=rn();T0.ICompletionsFetcherService=(0,Lac.createServiceIdentifier)("ICompletionsFetcherService");var jPr=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(C5i.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()}};T0.CompletionsFetcher=jPr;T0.CompletionsFetcher=jPr=Nac([qPr(0,C5i.IConfigurationService),qPr(1,Oac.IFetcherService),qPr(2,Bac.IExperimentationService)],jPr);var HPr=class{static{a(this,"Fetcher")}getImplementation(){return this}};T0.Fetcher=HPr;function Fac(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(Fac,"isInterruptedNetworkError")});var b5i=I(BAe=>{"use strict";p();Object.defineProperty(BAe,"__esModule",{value:!0});BAe.FeatureName=BAe.OutputPaneShowCommand=void 0;BAe.OutputPaneShowCommand="codereferencing.showOutputPane2";BAe.FeatureName="code-referencing"});var sBe=I(QEt=>{"use strict";p();Object.defineProperty(QEt,"__esModule",{value:!0});QEt.codeReferenceLogger=void 0;var Uac=Il(),Qac=b5i();QEt.codeReferenceLogger=new Uac.Logger(Qac.FeatureName)});var I5i=I(HEt=>{"use strict";p();Object.defineProperty(HEt,"__esModule",{value:!0});HEt.ConnectionState=void 0;var qac=Fs(),jac=Il(),Hac=UEt(),Gac=OAe(),aBe=sBe(),$ac=3e3,GPr=2,S5i=256,T5i=Math.log(S5i)/Math.log(GPr)/GPr,WD={connection:"disabled",maxAttempts:T5i,retryAttempts:0,initialWait:!1},qEt,jEt=[];function Vac(){if(qEt)return qEt;function t(_){return jEt.push(_),()=>{let v=jEt.indexOf(_);v!==-1&&jEt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of jEt)_()}a(e,"afterUpdateConnection");function r(_){WD.connection!==_&&(WD.connection=_,e())}a(r,"updateConnection");function n(){return WD.connection==="connected"}a(n,"isConnected");function o(){return WD.connection==="disconnected"}a(o,"isDisconnected");function s(){return WD.connection==="retry"}a(s,"isRetrying");function c(){return WD.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(_){WD.initialWait!==_&&(WD.initialWait=_)}a(h,"setInitialWait");function m(_,v=$ac){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return WD.initialWait}a(g,"isInitialWait");async function A(_,v){let b=_.get(jac.ICompletionsLogTargetService),T=_.get(Gac.ICompletionsFetcherService),w=_.get(qac.IInstantiationService);aBe.codeReferenceLogger.info(b,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>S5i){aBe.codeReferenceLogger.info(b,"Max retry time reached, disabling."),f();return}let P=a(async()=>{WD.retryAttempts=Math.min(WD.retryAttempts+1,T5i);try{aBe.codeReferenceLogger.info(b,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(Hac.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{aBe.codeReferenceLogger.info(b,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{P()},x*1e3)}a(R,"succeedOrRetry"),aBe.codeReferenceLogger.info(b,"Attempting to reconnect."),R(GPr)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),qEt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},qEt}a(Vac,"registerConnectionState");HEt.ConnectionState=Vac()});var w5i=I($g=>{"use strict";p();Object.defineProperty($g,"__esModule",{value:!0});$g.ErrorMessages=$g.ErrorReasons=void 0;$g.getErrorType=x5i;$g.createErrorResponse=Wac;$g.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};$g.ErrorMessages={[$g.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[$g.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[$g.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function x5i(t){return t===401?$g.ErrorReasons.Unauthorized:t===400?$g.ErrorReasons.BadArguments:t===404?$g.ErrorReasons.NotFound:t===429?$g.ErrorReasons.RateLimit:t>=500&&t<600?$g.ErrorReasons.InternalError:t>=600?$g.ErrorReasons.ConnectionError:$g.ErrorReasons.Unknown}a(x5i,"getErrorType");function Wac(t,e,r={}){return{kind:"failure",reason:x5i(Number(t)),code:Number(t),msg:e,meta:r}}a(Wac,"createErrorResponse")});var YPr=I(tB=>{"use strict";p();Object.defineProperty(tB,"__esModule",{value:!0});tB.NoopTelemetryReporter=tB.snippyTelemetry=tB.matchNotificationTelemetry=tB.copilotOutputLogTelemetry=void 0;var zac=Il(),FE=Og(),Yac=sBe(),Kac=/^[1-6][0-9][0-9]$/,Jac=/([A-Z][a-z]+)/,Zac="code_referencing",LAe=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[Zac,this.baseKey,...e].join(".")}},$Pr=class extends LAe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=FE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(FE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=FE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(FE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=FE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(FE.telemetry,n,r)}};tB.copilotOutputLogTelemetry=new $Pr;var VPr=class extends LAe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=FE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(FE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=FE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(FE.telemetry,o,n)}};tB.matchNotificationTelemetry=new VPr;var WPr=class extends LAe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=FE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(FE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=FE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(FE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(Kac)){e.invokeFunction(l=>Yac.codeReferenceLogger.debug(l.get(zac.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(Jac).filter(l=>!!l).join("_").toLowerCase(),c=FE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(FE.telemetryError,this.buildKey(s,r),c)}};tB.snippyTelemetry=new WPr;var zPr=class extends LAe{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};tB.NoopTelemetryReporter=zPr});var R5i=I(KPr=>{"use strict";p();Object.defineProperty(KPr,"__esModule",{value:!0});KPr.call=acc;var Xac=Fs(),ecc=Sge(),tcc=RE(),rcc=Il(),ncc=UEt(),icc=OAe(),FAe=I5i(),ph=w5i(),occ=sBe(),scc=YPr();async function acc(t,e,r,n){let o,s=t.get(rcc.ICompletionsLogTargetService),c=t.get(Xac.IInstantiationService),l=t.get(ecc.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return FAe.ConnectionState.setDisconnected(),(0,ph.createErrorResponse)(401,ph.ErrorMessages[ph.ErrorReasons.Unauthorized])}if(occ.codeReferenceLogger.info(s,`Calling ${e}`),FAe.ConnectionState.isRetrying())return(0,ph.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(FAe.ConnectionState.isDisconnected())return(0,ph.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(_=>_.get(icc.ICompletionsFetcherService).fetch((0,ncc.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,tcc.editorVersionHeaders)(_)},signal:n}))}catch{return c.invokeFunction(FAe.ConnectionState.enableRetry),(0,ph.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(_){let v=_.message;throw scc.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,ph.getErrorType)(A),E=m||"unknown error";switch(y){case ph.ErrorReasons.Unauthorized:return(0,ph.createErrorResponse)(h,ph.ErrorMessages[ph.ErrorReasons.Unauthorized],g);case ph.ErrorReasons.BadArguments:return(0,ph.createErrorResponse)(h,E,g);case ph.ErrorReasons.RateLimit:return c.invokeFunction(_=>FAe.ConnectionState.enableRetry(_,60*1e3)),(0,ph.createErrorResponse)(h,ph.ErrorMessages.RateLimitError,g);case ph.ErrorReasons.InternalError:return c.invokeFunction(_=>FAe.ConnectionState.enableRetry(_)),(0,ph.createErrorResponse)(h,ph.ErrorMessages[ph.ErrorReasons.InternalError],g);default:return(0,ph.createErrorResponse)(h,E,g)}}a(acc,"call")});var JPr=I(l1=>{"use strict";p();Object.defineProperty(l1,"__esModule",{value:!0});l1.FileMatchResponse=l1.FileMatchRequest=l1.MatchResponse=l1.MatchRequest=l1.MatchError=void 0;var ga=PAt();l1.MatchError=ga.Type.Object({kind:ga.Type.Literal("failure"),reason:ga.Type.String(),code:ga.Type.Number(),msg:ga.Type.String(),meta:ga.Type.Optional(ga.Type.Any())});var ccc=ga.Type.Object({matched_source:ga.Type.String(),occurrences:ga.Type.String(),capped:ga.Type.Boolean(),cursor:ga.Type.String(),github_url:ga.Type.String()});l1.MatchRequest=ga.Type.Object({source:ga.Type.String()});var lcc=ga.Type.Object({snippets:ga.Type.Array(ccc)});l1.MatchResponse=ga.Type.Union([lcc,l1.MatchError]);l1.FileMatchRequest=ga.Type.Object({cursor:ga.Type.String()});var ucc=ga.Type.Object({commit_id:ga.Type.String(),license:ga.Type.String(),nwo:ga.Type.String(),path:ga.Type.String(),url:ga.Type.String()}),dcc=ga.Type.Object({has_next_page:ga.Type.Boolean(),cursor:ga.Type.String()}),fcc=ga.Type.Object({count:ga.Type.Record(ga.Type.String(),ga.Type.String())}),pcc=ga.Type.Object({file_matches:ga.Type.Array(ucc),page_info:dcc,license_stats:fcc});l1.FileMatchResponse=ga.Type.Union([pcc,l1.MatchError])});var N5i=I(rB=>{"use strict";p();var hcc=rB&&rB.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=rB&&rB.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),P5i=rB&&rB.__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(x6,"__esModule",{value:!0});x6.MinTokenLength=void 0;x6.lexemeLength=M5i;x6.offsetLastLexemes=Ecc;x6.hasMinLexemeLength=_cc;var cBe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");x6.MinTokenLength=65;function M5i(t){let e=0,r;cBe.lastIndex=0;do if(r=cBe.exec(t),r&&(e+=1),e>=x6.MinTokenLength)break;while(r);return e}a(M5i,"lexemeLength");function ycc(t,e){let r=0,n;cBe.lastIndex=0;do if(n=cBe.exec(t),n&&(r+=1,r>=e))return cBe.lastIndex;while(n);return t.length}a(ycc,"offsetFirstLexemes");function Ecc(t,e){let r=t.split("").reverse().join(""),n=ycc(r,e);return r.length-n}a(Ecc,"offsetLastLexemes");function _cc(t){return M5i(t)>=x6.MinTokenLength}a(_cc,"hasMinLexemeLength")});var q5i=I(w6=>{"use strict";p();var vcc=w6&&w6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ccc=w6&&w6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),U5i=w6&&w6.__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;oL5i(E,()=>B5i.Match(E,f)));if(!h||F5i(h)||!h.snippets.length){ZPr.codeReferenceLogger.info(s,"No match found");return}ZPr.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async E=>{let _=await o.invokeFunction(T=>L5i(T,()=>B5i.FilesForMatch(T,{cursor:E.cursor})));if(!_||F5i(_))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(Pcc,"fetchCitations")});var W5i=I(S$=>{"use strict";p();Object.defineProperty(S$,"__esModule",{value:!0});S$.editDistance=H5i;S$.emptyLexDictionary=G5i;S$.reverseLexDictionary=$5i;S$.lexGeneratorWords=V5i;S$.lexicalAnalyzer=XPr;S$.lexEditDistance=kcc;function H5i(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(V5i,"lexGeneratorWords");function XPr(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(XPr,"lexicalAnalyzer");function j5i(t){return t!==" "}a(j5i,"notSingleSpace");function kcc(t,e,r=V5i){let[n,o]=XPr(t,G5i(),r,j5i),[s,c]=XPr(e,o,r,j5i);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=$5i(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=H5i(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(kcc,"lexEditDistance")});var ekr=I(pne=>{"use strict";p();Object.defineProperty(pne,"__esModule",{value:!0});pne.PartialAcceptTriggerKind=void 0;pne.computeCompCharLen=Dcc;pne.countLines=Ncc;pne.computeCompletionText=Mcc;var z5i;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})(z5i||(pne.PartialAcceptTriggerKind=z5i={}));function Dcc(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(Dcc,"computeCompCharLen");function Ncc(t){return t.length===0?0:t.split(` -`).length}a(Ncc,"countLines");function Mcc(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(Mcc,"computeCompletionText")});var i4i=I(zEt=>{"use strict";p();Object.defineProperty(zEt,"__esModule",{value:!0});zEt.postRejectionTasks=Vcc;zEt.postInsertionTasks=Wcc;var WEt=Fs(),J5i=hte(),Occ=Sge(),VEt=d2i(),Bcc=pgt(),Lcc=WTr(),Z5i=gTr(),X5i=fAe(),QAe=Il(),Y5i=XAt(),Fcc=IAe(),Ucc=q5i(),K5i=W5i(),Qcc=ekr(),T$=Og(),qcc=e1(),e4i=c5e(),jcc=Gre(),I$=new QAe.Logger("postInsertion"),t4i=[{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}],r4i=50,Hcc=1500,Gcc=.5,$cc=500,tkr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function n4i(t,e,r,n,o){let s=t.get(WEt.IInstantiationService),c=t.get(QAe.ICompletionsLogTargetService),l=await t.get(Z5i.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return I$.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(Fcc.extractPrompt,r.properties.headerRequestId,(0,Lcc.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,Y5i.contextIndentationFromText)(f,n,u.detectedLanguageId),_=(0,Y5i.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(_?_*2:$cc)),b=d.substring(n,v);return{prompt:g,capturedCode:b,terminationOffset:_??-1}}}a(n4i,"captureCode");function Vcc(t,e,r,n,o){let s=t.get(QAe.ICompletionsLogTargetService),c=t.get(WEt.IInstantiationService),l=t.get(J5i.ICompletionsTelemetryService),u=t.get(e4i.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{I$.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(X5i.telemetryRejected,e,g)});let d=c.createInstance(VEt.ChangeTracker,n,r-1),f=c.createInstance(VEt.ChangeTracker,n,r),h=a(async m=>{I$.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:E}=await c.invokeFunction(n4i,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});I$.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(T$.telemetry,e+".capturedAfterRejected",v,T$.TelemetryStore.Enhanced)},"checkInCode");t4i.filter(m=>m.captureRejection).map(m=>d.push((0,T$.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a(Vcc,"postRejectionTasks");function Wcc(t,e,r,n,o,s,c,l){let u=t.get(QAe.ICompletionsLogTargetService),d=t.get(WEt.IInstantiationService),f=t.get(e4i.ICompletionsPromiseQueueService),h=t.get(J5i.ICompletionsTelemetryService),m=t.get(jcc.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});I$.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(X5i.telemetryAccepted,e,g);let A=r;r=(0,Qcc.computeCompletionText)(r,c);let y=r.trim(),E=d.createInstance(VEt.ChangeTracker,o,n),_=d.createInstance(VEt.ChangeTracker,o,n+r.length),v=a(async b=>{await d.invokeFunction(Jcc,e,y,n,o,b,g,E,_)},"stillInCodeCheck");if(tkr.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let b=v({seconds:0,captureCode:tkr.captureCode,captureRejection:tkr.captureRejection});f.register(b)}else t4i.map(b=>E.push((0,T$.telemetryCatch)(h,f,()=>v(b),"postInsertionTasks"),b.seconds*1e3));d.invokeFunction(b=>(0,T$.telemetryCatch)(h,f,zcc,"post insertion citation check")(b,o,A,r,n,l))}a(Wcc,"postInsertionTasks");async function zcc(t,e,r,n,o,s){let c=t.get(QAe.ICompletionsLogTargetService),l=t.get(qcc.ICompletionsTextDocumentManagerService),u=t.get(Occ.ICompletionsCopilotTokenManager),d=t.get(Bcc.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,Ucc.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=rkr(f.getText(),n,r4i,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=Ycc(r.length,n.length,h.start_offset);if(m===void 0){I$.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+Kcc(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(zcc,"citationCheck");function Ycc(t,e,r){if(!(ee))return r}a(Ycc,"computeCitationStart");function Kcc(t,e,r){return e{"use strict";p();Object.defineProperty(py,"__esModule",{value:!0});py.LastGhostText=py.ICompletionsLastGhostText=void 0;py.rejectLastShown=a4i;py.setLastShown=tlc;py.handleGhostTextShown=rlc;py.handleGhostTextPostInsert=ilc;py.handlePartialGhostTextPostInsert=olc;var Zcc=rn(),o4i=Il(),ikr=i4i(),YEt=ekr(),s4i=ZG(),okr=fAe(),Xcc=new o4i.Logger("ghostText");py.ICompletionsLastGhostText=(0,Zcc.createServiceIdentifier)("ICompletionsLastGhostText");var nkr=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}};py.LastGhostText=nkr;function elc(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(elc,"computeRejectedCompletions");function a4i(t,e){let r=t.get(py.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=elc(r);n.length>0&&(0,ikr.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(a4i,"rejectLastShown");function tlc(t,e,r,n){let o=t.get(py.ICompletionsLastGhostText);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==s4i.ResultType.TypingAsSuggested&&a4i(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(tlc,"setLastShown");function rlc(t,e){let r=t.get(o4i.ICompletionsLogTargetService),n=t.get(py.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!==s4i.ResultType.Network;Xcc.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,okr.telemetryShown)(t,e)}}a(rlc,"handleGhostTextShown");function nlc(t,e,r){let n=t.get(py.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,YEt.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,YEt.countLines)(e.displayText));let o=(0,YEt.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(nlc,"handleLineAcceptance");function ilc(t,e){let r=t.get(py.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,YEt.countLines)(e.displayText)},r.resetState(),(0,ikr.postInsertionTasks)(t,okr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(ilc,"handleGhostTextPostInsert");function olc(t,e,r){let n=t.get(py.ICompletionsLastGhostText);nlc(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,ikr.postInsertionTasks)(t,okr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(olc,"handlePartialGhostTextPostInsert")});var c4i=I(akr=>{"use strict";p();Object.defineProperty(akr,"__esModule",{value:!0});akr.normalizeIndentCharacter=slc;function slc(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(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(` `).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(slc,"normalizeIndentCharacter")});var l4i=I(ckr=>{"use strict";p();Object.defineProperty(ckr,"__esModule",{value:!0});ckr.completionsFromGhostTextResults=ulc;var alc=y0(),KEt=eAe(),clc=c4i(),llc=ZG();function ulc(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=KEt.LocationFactory.range(KEt.LocationFactory.position(n.line,0),KEt.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,clc.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=KEt.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,alc.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===llc.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(ulc,"completionsFromGhostTextResults")});var dkr=I(zD=>{"use strict";p();var dlc=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]})),flc=zD&&zD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),plc=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;ou.toString(16).padStart(2,"0")).join("");return`${r}.${l}`}a(hlc,"createRequestHMAC");async function mlc(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(mlc,"createSha256Hash");var lkr=new Map;function glc(t){if(lkr.has(t))return lkr.get(t);let e=Alc(t);return lkr.set(t,e),e}a(glc,"getCachedSha256Hash");function Alc(t){let e=new ukr;return e.update(t),e.digest()}a(Alc,"createSha256HashSyncInsecure");function x$(t,e=32){return t instanceof ArrayBuffer?(0,u4i.encodeHex)(u4i.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(x$,"toHexString");function nB(t,e){return(t>>>e|t<<32-e)>>>0}a(nB,"rightRotate");var ukr=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(JEt.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()),x$(this._h0)+x$(this._h1)+x$(this._h2)+x$(this._h3)+x$(this._h4)+x$(this._h5)+x$(this._h6)+x$(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=nB(A,7)^nB(A,18)^A>>>3,_=nB(y,17)^nB(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=nB(u,6)^nB(u,11)^nB(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,E=nB(o,2)^nB(o,13)^nB(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 fkr=I(ZEt=>{"use strict";p();Object.defineProperty(ZEt,"__esModule",{value:!0});ZEt.isInlineSuggestionFromTextAfterCursor=d4i;ZEt.determineIsInlineSuggestionPosition=ylc;function d4i(t){let e=Elc(t),r=_lc(t);if(!(e&&!r))return e&&r}a(d4i,"isInlineSuggestionFromTextAfterCursor");function ylc(t){let e=t.textAfterCursor();return d4i(e)}a(ylc,"determineIsInlineSuggestionPosition");function Elc(t){return t.trim().length!==0}a(Elc,"isMiddleOfTheLineFromTextAfterCursor");function _lc(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(_lc,"isValidMiddleOfTheLineFromTextAfterCursor")});var e_t=I(w$=>{"use strict";p();Object.defineProperty(w$,"__esModule",{value:!0});w$.NoOpStatusReporter=w$.StatusReporter=w$.ICompletionsStatusReporter=void 0;var vlc=rn();w$.ICompletionsStatusReporter=(0,vlc.createServiceIdentifier)("ICompletionsStatusReporter");var XEt=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)}};w$.StatusReporter=XEt;var pkr=class extends XEt{static{a(this,"NoOpStatusReporter")}didChange(){}};w$.NoOpStatusReporter=pkr});var ykr=I(hy=>{"use strict";p();Object.defineProperty(hy,"__esModule",{value:!0});hy.AdoRepoId=hy.GithubRepoId=hy.IGitService=void 0;hy.getGitHubRepoInfoFromContext=Slc;hy.getOrderedRepoInfosFromContext=Tlc;hy.getOrderedRemoteUrlsFromContext=mkr;hy.parseRemoteUrl=gkr;hy.toGithubNwo=f4i;hy.toGithubWebUrl=Ilc;hy.getGithubRepoIdFromFetchUrl=Akr;hy.getAdoRepoIdFromFetchUrl=p4i;hy.normalizeFetchUrl=xlc;var Clc=rn(),hkr=Qh(),blc=Ku();hy.IGitService=(0,Clc.createServiceIdentifier)("IGitService");function Slc(t){for(let e of mkr(t))if(e){let r=Akr(e);if(r)return{id:r,remoteUrl:e}}}a(Slc,"getGitHubRepoInfoFromContext");function*Tlc(t){for(let e of mkr(t)){let r=Akr(e)??p4i(e);r&&(yield{repoId:r,fetchUrl:e})}}a(Tlc,"getOrderedRepoInfosFromContext");function mkr(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(mkr,"getOrderedRemoteUrlsFromContext");function gkr(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=blc.URI.parse(t),r=e.authority,n=e.path;if(!((0,hkr.equalsIgnoreCase)(e.scheme,"ssh")||(0,hkr.equalsIgnoreCase)(e.scheme,"https")||(0,hkr.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(gkr,"parseRemoteUrl");var t_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 f4i(this)}};hy.GithubRepoId=t_t;function f4i(t){return`${t.org}/${t.repo}`.toLowerCase()}a(f4i,"toGithubNwo");function Ilc(t){return`https://${t.host}/${t.org}/${t.repo}`}a(Ilc,"toGithubWebUrl");function Akr(t){let e=gkr(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 t_t(s[1],s[2],o):void 0}a(Akr,"getGithubRepoIdFromFetchUrl");var qAe=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()}};hy.AdoRepoId=qAe;function p4i(t){let e=gkr(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new qAe(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 qAe(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 qAe(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(p4i,"getAdoRepoIdFromFetchUrl");function xlc(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(xlc,"normalizeFetchUrl")});var vkr=I(hne=>{"use strict";p();Object.defineProperty(hne,"__esModule",{value:!0});hne.ComputationStatus=void 0;hne.tryGetGitHubNWO=Plc;hne.extractRepoInfoInBackground=klc;hne.extractRepoInfo=h4i;var Ekr=ykr(),wlc=zG(),Rlc=c6(),lBe=KG();function Plc(t){if(t!==void 0&&t!==uBe.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(Plc,"tryGetGitHubNWO");function klc(t,e){let r=(0,lBe.dirname)(e);return Dlc(t,r)}a(klc,"extractRepoInfoInBackground");var Dlc=Blc(h4i,1e4);async function h4i(t,e){let r=t.get(wlc.ICompletionsFileSystemService),n=(0,lBe.getFsUri)(e);if(!n)return;let o=await Mlc(r,n);if(!o)return;let s=(0,lBe.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=Olc(c)??"",u=Nlc(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(h4i,"extractRepoInfo");function Nlc(t){let e=(0,Ekr.parseRemoteUrl)(t);if(!e)return;let r=(0,Ekr.getGithubRepoIdFromFetchUrl)(t)??(0,Ekr.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(Nlc,"parseRepoUrl");async function Mlc(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 uBe.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new _kr(d)),n.delete(c)}),uBe.PENDING}}a(Blc,"computeInBackgroundAndMemoize")});var g4i=I(Ckr=>{"use strict";p();Object.defineProperty(Ckr,"__esModule",{value:!0});Ckr.isRepetitive=Flc;var Llc=[{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 Flc(t){let e=t.slice();return e.reverse(),m4i(e)||m4i(e.filter(r=>r.trim().length>0))}a(Flc,"isRepetitive");function m4i(t){let e=Ulc(t);for(let r of Llc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(Ulc,"kmp_prefix_function")});var y4i=I(dBe=>{"use strict";p();Object.defineProperty(dBe,"__esModule",{value:!0});dBe.maybeSnipCompletionImpl=A4i;dBe.postProcessChoiceInContext=$lc;dBe.checkSuffix=Vlc;var Qlc=wre(),mne=Og(),qlc=g4i();function jlc(t,e,r,n){let o="}";try{o=(0,Qlc.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return A4i({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(jlc,"maybeSnipCompletion");function A4i(t,e,r,n){let o=Hlc(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(A4i,"maybeSnipCompletionImpl");function Hlc(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(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 `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(Hlc,"splitByNewLine");function Glc(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(Vlc,"checkSuffix")});var C4i=I(R$=>{"use strict";p();Object.defineProperty(R$,"__esModule",{value:!0});R$.DocumentLogEntry=void 0;R$.serializeOffsetRange=Wlc;R$.deserializeOffsetRange=zlc;R$.serializeEdit=Ylc;R$.deserializeEdit=Klc;var E4i=bE(),v4i=dd(),_4i;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(_4i||(R$.DocumentLogEntry=_4i={}));function Wlc(t){return[t.start,t.endExclusive]}a(Wlc,"serializeOffsetRange");function zlc(t){return new v4i.OffsetRange(t[0],t[1])}a(zlc,"deserializeOffsetRange");function Ylc(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(Ylc,"serializeEdit");function Klc(t){return E4i.StringEdit.create(t.map(e=>E4i.StringReplacement.replace(new v4i.OffsetRange(e[0],e[1]),e[2])))}a(Klc,"deserializeEdit")});var jAe=I(Sm=>{"use strict";p();Object.defineProperty(Sm,"__esModule",{value:!0});Sm.StatelessNextEditTelemetryBuilder=Sm.StatelessNextEditResult=Sm.NoNextEditReason=Sm.FilteredOutReason=Sm.StatelessNextEditDocument=Sm.StatelessNextEditRequest=Sm.RequestEditWindowWithCursorJump=Sm.RequestEditWindow=Sm.WithStatelessProviderTelemetry=void 0;var b4i=cw(),bkr=zu(),Jlc=Yc(),Zlc=wk(),Xlc=bE(),euc=OT(),tuc=C4i(),ruc=b0r(),Skr=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};Sm.WithStatelessProviderTelemetry=Skr;var Tkr=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};Sm.RequestEditWindow=Tkr;var Ikr=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)}};Sm.RequestEditWindowWithCursorJump=Ikr;var xkr=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 Zlc.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=Xlc.StringEdit.empty,this._result=new Jlc.DeferredPromise,(0,bkr.assert)(o.length>0),(0,bkr.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(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 ${this.documents.map((r,n)=>` * [${n+1}/${this.documents.length}] ${n===this.activeDocumentIdx?"(active document) ":""}`+r.toMarkdown()).join(` -`)}`}};Sm.StatelessNextEditRequest=xkr;var wkr=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 euc.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,tuc.serializeOffsetRange)(this.lastSelectionInAfterEdit)}}toString(){return this.toMarkdown()}toMarkdown(){let e=[];return e.push(`StatelessNextEditDocument: **${this.id.uri}** +`)}`}};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}** `),e.push("```patch"),e.push(this.recentEdit.humanReadablePatch(this.documentLinesBeforeEdit)),e.push("```"),e.push(""),e.join(` -`)}};Sm.StatelessNextEditDocument=wkr;var S4i;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(S4i||(Sm.FilteredOutReason=S4i={}));var iB;(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})(iB||(Sm.NoNextEditReason=iB={}));var Rkr=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=b4i.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=b4i.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};Sm.StatelessNextEditResult=Rkr;var Pkr=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,ruc.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 iB.ActiveDocumentHasNoEdits||e.err instanceof iB.NoSuggestions||(e.err instanceof iB.GotCancelled||e.err instanceof iB.FilteredOut||e.err instanceof iB.PromptTooLarge?d=e.err.message:e.err instanceof iB.FetchFailure||e.err instanceof iB.Uncategorized||e.err instanceof iB.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,bkr.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}};Sm.StatelessNextEditTelemetryBuilder=Pkr});var T4i=I(r_t=>{"use strict";p();Object.defineProperty(r_t,"__esModule",{value:!0});r_t.StreamCopilotAnnotations=void 0;var kkr=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]??[]}};r_t.StreamCopilotAnnotations=kkr});var n_t=I(P$=>{"use strict";p();Object.defineProperty(P$,"__esModule",{value:!0});P$.ICompletionsFetchService=P$.CompletionsFetchError=P$.Completions=void 0;var nuc=rn(),I4i;(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})(I4i||(P$.Completions=I4i={}));var Dkr=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};P$.CompletionsFetchError=Dkr;P$.ICompletionsFetchService=(0,nuc.createServiceIdentifier)("ICompletionsFetchService")});var fBe=I(HAe=>{"use strict";p();Object.defineProperty(HAe,"__esModule",{value:!0});HAe.CacheType=HAe.CustomDataPartMimeTypes=void 0;var x4i;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(x4i||(HAe.CustomDataPartMimeTypes=x4i={}));HAe.CacheType="ephemeral"});var Mkr=I(pBe=>{"use strict";p();Object.defineProperty(pBe,"__esModule",{value:!0});pBe.ThinkingDataContainer=void 0;pBe.rawPartAsThinkingData=ouc;var iuc=xo(),w4i=fBe(),Nkr=class extends iuc.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:w4i.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};pBe.ThinkingDataContainer=Nkr;function ouc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===w4i.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(ouc,"rawPartAsThinkingData")});var R6=I(wv=>{"use strict";p();Object.defineProperty(wv,"__esModule",{value:!0});wv.FilterReason=wv.FinishedCompletionReason=wv.ChatRole=wv.modelsWithoutResponsesContextManagement=wv.openAIContextManagementCompactionType=void 0;wv.isApiUsage=cuc;wv.getCAPITextPart=D4i;wv.rawMessageToCAPI=N4i;var i_t=xo(),suc=JTe(),auc=Mkr();function cuc(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(cuc,"isApiUsage");wv.openAIContextManagementCompactionType="compaction";wv.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var R4i;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(R4i||(wv.ChatRole=R4i={}));function D4i(t){return Array.isArray(t)?t.map(e=>D4i(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(D4i,"getCAPITextPart");function N4i(t,e){if(Array.isArray(t))return t.map(n=>N4i(n,e));let r=(0,i_t.toMode)(i_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===suc.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===i_t.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,auc.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a(N4i,"rawMessageToCAPI");var P4i;(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"})(P4i||(wv.FinishedCompletionReason=P4i={}));var k4i;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(k4i||(wv.FilterReason=k4i={}))});var k6=I(P6=>{"use strict";p();Object.defineProperty(P6,"__esModule",{value:!0});P6.getRequestId=uuc;P6.isCopilotAnnotation=duc;P6.isCodeCitationAnnotation=fuc;P6.isCopilotWebReference=puc;P6.isOpenAIContextManagementResponse=huc;P6.isAnthropicContextManagementResponse=muc;P6.isOpenAiFunctionTool=guc;var luc=R6();function uuc(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(uuc,"getRequestId");function duc(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(duc,"isCopilotAnnotation");function fuc(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(fuc,"isCodeCitationAnnotation");function puc(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(puc,"isCopilotWebReference");function huc(t){return"type"in t&&t.type===luc.openAIContextManagementCompactionType}a(huc,"isOpenAIContextManagementResponse");function muc(t){return"applied_edits"in t}a(muc,"isAnthropicContextManagementResponse");function guc(t){return t.function!==void 0}a(guc,"isOpenAiFunctionTool")});var M4i=I(YD=>{"use strict";p();Object.defineProperty(YD,"__esModule",{value:!0});YD.asyncIterableMap=Auc;YD.asyncIterableFilter=yuc;YD.asyncIterableMapFilter=Euc;YD.asyncIterableFromArray=_uc;YD.asyncIterableToArray=vuc;YD.asyncIterableConcat=Cuc;YD.asyncIterableCount=buc;YD.iterableMap=Suc;YD.iterableMapFilter=Tuc;async function*Auc(t,e){for await(let r of t)yield e(r)}a(Auc,"asyncIterableMap");async function*yuc(t,e){for await(let r of t)await e(r)&&(yield r)}a(yuc,"asyncIterableFilter");async function*Euc(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(Euc,"asyncIterableMapFilter");async function*_uc(t){for(let e of t)yield Promise.resolve(e)}a(_uc,"asyncIterableFromArray");async function vuc(t){let e=[];for await(let r of t)e.push(r);return e}a(vuc,"asyncIterableToArray");async function*Cuc(...t){for(let e of t)yield*e}a(Cuc,"asyncIterableConcat");async function buc(t){let e=0;for await(let r of t)e++;return e}a(buc,"asyncIterableCount");function*Suc(t,e){for(let r of t)yield e(r)}a(Suc,"iterableMap");function*Tuc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(Tuc,"iterableMapFilter")});var O4i=I(Okr=>{"use strict";p();Object.defineProperty(Okr,"__esModule",{value:!0});Okr.getKey=xuc;function Iuc(t,e){return t!==null&&typeof t=="object"&&e in t}a(Iuc,"hasKey");function xuc(t,e){return Iuc(t,e)?t[e]:void 0}a(xuc,"getKey")});var Ukr=I(Tm=>{"use strict";p();var wuc=Tm&&Tm.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},k$=Tm&&Tm.__param||function(t,e){return function(r,n){e(r,n,t)}},Bkr;Object.defineProperty(Tm,"__esModule",{value:!0});Tm.LiveOpenAIFetcher=Tm.CMDQuotaExceeded=Tm.OpenAIFetcher=Tm.ICompletionsOpenAIFetcherService=Tm.CopilotUiKind=void 0;Tm.sanitizeRequestOptionTelemetry=q4i;Tm.postProcessChoices=j4i;var Ruc=kE(),Puc=T4i(),kuc=k4(),mBe=n_t(),Duc=k6(),B4i=qh(),Nuc=rn(),Muc=zu(),Ouc=wk(),Buc=iO(),Luc=y0(),Fuc=Fs(),Uuc=Sge(),Quc=ugt(),L4i=RE(),quc=M4i(),Q4i=Il(),juc=UEt(),F4i=OAe(),Huc=e_t(),Guc=vkr(),tI=Og(),$uc=n4e(),Vuc=Gre(),hBe=O4i(),o_t=E4e(),Vg=new Q4i.Logger("fetchCompletions"),s_t;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(s_t||(Tm.CopilotUiKind=s_t={}));function Wuc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(Wuc,"getProcessingTime");function zuc(t){switch(t){case s_t.GhostText:return"copilot-ghost";case s_t.Panel:return"copilot-panel"}}a(zuc,"uiKindToIntent");Tm.ICompletionsOpenAIFetcherService=(0,Nuc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var a_t=class{static{a(this,"OpenAIFetcher")}};Tm.OpenAIFetcher=a_t;function Yuc(t,e,r,n){return(0,juc.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(Yuc,"getProxyEngineUrl");function q4i(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(q4i,"sanitizeRequestOptionTelemetry");function j4i(t){return(0,quc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(j4i,"postProcessChoices");Tm.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var Lkr=Bkr=class extends a_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,o_t.getMaxSolutionTokens)(),temperature:(0,o_t.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,o_t.getTopP)(),n:e.count,stop:(0,o_t.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,Guc.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,$uc.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(Yuc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,tI.telemetrizePromptLength)(u));q4i(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(tI.telemetry,"request.sent",y);let E=zuc(m),_;_={...g,...this.instantiationService.invokeFunction(L4i.editorVersionHeaders)},_["Openai-Organization"]="github-copilot",_["X-Request-Id"]=f,_["VScode-SessionId"]=this.envService.sessionId,_["VScode-MachineId"]=this.envService.machineId,_["X-GitHub-Api-Version"]=L4i.apiVersion,E&&(_["OpenAI-Intent"]=E);let v=new Buc.StopWatch,b=o??Ouc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,b,_).then(w=>w.isError()&&w.err instanceof mBe.Completions.Unexpected&&(0,F4i.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(tI.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 mBe.Completions.RequestCancelled)return this.instantiationService.invokeFunction(tI.telemetry,"networking.cancelRequest",tI.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(tI.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof mBe.Completions.UnsuccessfulResponse){let P=(0,Duc.getRequestId)(x.headers);y.extendWithRequestId(P),P.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(B4i.ITelemetryService).setSharedProperty("capi.assignmentcontext",P.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),Vg.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),Vg.debug(this.logTargetService,"request.response properties",y.properties),Vg.debug(this.logTargetService,"request.response measurements",y.measurements),Vg.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(tI.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof mBe.Completions.Unexpected){let P=x.error;if((0,F4i.isAbortError)(P))throw this.instantiationService.invokeFunction(tI.telemetry,"request.cancel",y),P;this.statusReporter.setWarning((0,hBe.getKey)(P,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(tI.telemetry,"request.shownWarning",D),y.properties.message=String((0,hBe.getKey)(P,"name")??""),y.properties.code=String((0,hBe.getKey)(P,"code")??""),y.properties.errno=String((0,hBe.getKey)(P,"errno")??""),y.properties.type=String((0,hBe.getKey)(P,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,Vg.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(P)} after ${N}ms`),Vg.debug(this.logTargetService,"request.error properties",y.properties),Vg.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(tI.telemetry,"request.error",y),P}else(0,Muc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(B4i.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let P=v.elapsed();y.measurements.totalTimeMs=P;let D=200;Vg.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${P}ms`),y.properties.status=String(D),Vg.debug(this.logTargetService,"request.response properties",y.properties),Vg.debug(this.logTargetService,"request.response measurements",y.measurements),Vg.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(tI.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(P=>Vg.exception(P,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=Bkr.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:j4i(R),getProcessingTime:a(()=>Wuc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(tI.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,Luc.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:Tm.CMDQuotaExceeded,title:"Learn More"});let l=(0,Quc.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),Vg.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(U4i(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`;Vg.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else U4i(n)?(Vg.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(tI.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",Vg.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(Vg.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(Vg.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};Tm.LiveOpenAIFetcher=Lkr;Tm.LiveOpenAIFetcher=Lkr=Bkr=wuc([k$(0,Fuc.IInstantiationService),k$(1,Vuc.ICompletionsRuntimeModeService),k$(2,Q4i.ICompletionsLogTargetService),k$(3,Uuc.ICompletionsCopilotTokenManager),k$(4,Huc.ICompletionsStatusReporter),k$(5,Ruc.IAuthenticationService),k$(6,mBe.ICompletionsFetchService),k$(7,kuc.IEnvService)],Lkr);function U4i(t){return t.status>=400&&t.status<500}a(U4i,"isClientError");var Fkr=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new Puc.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 qkr=I(Qkr=>{"use strict";p();Object.defineProperty(Qkr,"__esModule",{value:!0});Qkr.appendToCache=Kuc;function Kuc(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(Kuc,"appendToCache")});var W4i=I(Vd=>{"use strict";p();var Juc=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},gne=Vd&&Vd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Vd,"__esModule",{value:!0});Vd.CompletionsFromNetwork=Vd.logger=void 0;Vd.postProcessChoices=c_t;Vd.makeGhostAPIChoice=V4i;Vd.telemetryPerformance=$kr;var gBe=jAe(),Zuc=$_(),ABe=cw(),Xuc=zu(),edc=OT(),tdc=Fs(),H4i=RE(),rdc=GSr(),ndc=oy(),$4i=Il(),idc=QPr(),Hkr=Ukr(),odc=E4e(),sdc=Og(),adc=Gre(),cdc=lAe(),jkr=qkr(),ldc=o4e(),G4i=ZG(),KD=fAe();Vd.logger=new $4i.Logger("ghostText");var Gkr=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 Vd.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,KD.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return Vd.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,KD.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return Vd.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,KD.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction($kr,"performance",h,c,l),Vd.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=c_t(h);m&&((0,jkr.appendToCache)(this.completionsCacheService,e,m),Vd.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;Vd.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let E=c_t(y,A);E&&(A.push(E),(0,jkr.appendToCache)(this.completionsCacheService,e,E))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[V4i(m,{forceSingleLine:!1}),g],telemetryData:(0,KD.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:G4i.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,KD.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 Vd.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,KD.mkCanceledResultTelemetry)(r)};let h=c_t(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,jkr.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction($kr,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,KD.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:G4i.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new gBe.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=ABe.Result.ok(void 0);break;case"canceled":f=ABe.Result.error(new gBe.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=ABe.Result.error(new gBe.NoNextEditReason.NoSuggestions(new edc.StringText(""),void 0));break;case"failed":f=ABe.Result.error(new gBe.NoNextEditReason.Uncategorized(Zuc.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=ABe.Result.error(new gBe.NoNextEditReason.GotCancelled(d.reason));break;default:(0,Xuc.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){Vd.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,odc.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,H4i.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===H4i.BlockMode.MoreMultiline&&cdc.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:Hkr.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:Hkr.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,KD.mkBasicResultTelemetry)(r)}:_.type==="canceled"?(Vd.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:(0,KD.mkCanceledResultTelemetry)(r)}):l(A,_.getProcessingTime(),_.choices)}catch(E){if((0,idc.isAbortError)(E))return{type:"canceled",reason:"network request aborted",telemetryData:(0,KD.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(_=>Vd.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,KD.mkBasicResultTelemetry)(r)}}}};Vd.CompletionsFromNetwork=Gkr;Vd.CompletionsFromNetwork=Gkr=Juc([gne(0,tdc.IInstantiationService),gne(1,Hkr.ICompletionsOpenAIFetcherService),gne(2,ndc.ICompletionsFeaturesService),gne(3,adc.ICompletionsRuntimeModeService),gne(4,$4i.ICompletionsLogTargetService),gne(5,ldc.ICompletionsCacheService),gne(6,rdc.ICompletionsUserErrorNotifierService)],Gkr);function c_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(c_t,"postProcessChoices");function V4i(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` +`)}};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(` `)[1]:r.completionText=n.split(` -`)[0]}return r}a(V4i,"makeGhostAPIChoice");function $kr(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,sdc.telemetry)(t,`ghostText.${e}`,l)}a($kr,"telemetryPerformance")});var z4i=I(l_t=>{"use strict";p();Object.defineProperty(l_t,"__esModule",{value:!0});l_t.contextualFilterCharacterMap=void 0;l_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 Y4i=I(Vkr=>{"use strict";p();Object.defineProperty(Vkr,"__esModule",{value:!0});Vkr.multilineModelPredict=udc;function udc(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let P;t[306]>1e-35?t[149]>1e-35?P=-.1389218965136736:P=-.032218642644416894:t[13]>1e-35?P=.006465035217331847:t[50]>1e-35?P=-.1381687930130022:t[179]>1e-35?P=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?P=-.03262719498763048:P=.023342916702125613:t[191]>1e-35?P=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?P=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?P=-.09989343595668776:P=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?P=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?P=-.09165257825246746:t[9]>32.50000000000001?P=.02484870392366004:P=-.008499493096971395:t[8]>24.500000000000004?P=.02459679192828244:P=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?P=.0015644546318714849:P=-.06579524865022705:P=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?P=.03331853632960164:P=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?P=-.019091477207111116:P=.037878468575478504:t[94]>1e-35?P=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?P=.16919658785098224:t[243]>1e-35?P=-.06580584936754524:P=.01567555159935563:t[129]>1e-35?P=.06721746994993226:t[10]>32.50000000000001?P=-.046394462507797975:P=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let B;t[308]>1e-35?B=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?B=.023223358334607133:B=-.04383410185346742:B=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?B=.023406489302867494:B=-.085521220804058:B=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?B=.028120059780969632:B=-.04211009474298743:t[294]>1e-35?B=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?B=-.0993035220737934:B=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?B=.029770210551187937:B=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?B=.06421359317599738:B=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?B=.024368404612215164:B=-.04045232374803373:t[131]>1e-35?B=.017372701982485795:t[120]>1e-35?B=.08812710275150198:t[18]>1e-35?t[90]>1e-35?B=.18451364351180236:t[7]>33.50000000000001?B=-.03850813130183531:t[195]>1e-35?B=.06966114053446336:t[3]>16.500000000000004?B=-.0012869181693341211:t[0]>4242.500000000001?B=-.054625548611291035:B=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?B=.006302103427145562:B=.13967622319898698:t[121]>1e-35?B=-.038798585213145644:t[5]>4544.500000000001?B=-.08050498033009466:B=-.002986974112681435;let L;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?L=-.03461119351456781:L=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?L=-.12404435523286539:L=-.0034376913880382956:L=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?L=.0037507103585310234:L=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?L=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?L=-.04832024079663151:t[37]>1e-35?L=-.037103393468366934:L=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?L=.032539071163832034:t[5]>1643.5000000000002?L=.036408625378035665:t[0]>1500.5000000000002?L=-.1346358322854993:L=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?L=-.1133991164577881:t[9]>52.50000000000001?L=-.024478640359723122:L=.03673777861098756:L=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?L=.002583438691776944:L=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?L=-.02141222346712401:L=.06392462314316179:t[4]>12.500000000000002?L=.08700122294434816:t[8]>267.50000000000006?L=.056923170082743224:L=-.07716309825583327:t[32]>1e-35?L=-.03961343943752142:L=.002674914122888783:t[1]>42.50000000000001?L=-.05217539654421676:t[145]>1e-35?L=.09553630282946368:L=-.009424791262477729;let j;t[183]>1e-35?j=-.05753337139158443:t[308]>1e-35?j=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?j=-.10477869875380448:j=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?j=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?j=-.04442302951713574:j=.00012409888451734224:j=-.092199119633697:t[225]>1e-35?j=.13773072450201831:t[0]>2882.5000000000005?j=.0028540012229920533:t[298]>1e-35?j=.07134486044361629:j=.014297412329837425:t[145]>1e-35?j=.05608385321902638:t[92]>1e-35?j=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?j=-.0039957800609801315:j=.0776927564241081:t[203]>1e-35?j=-.05502900859432093:t[105]>1e-35?j=.06062892720841595:j=-.009574839629252128:t[31]>1e-35?j=.009488858841144216:t[23]>1e-35?t[20]>1e-35?j=.08818126313644752:t[8]>161.50000000000003?j=.014353968957885408:j=-.022240738532827903:t[210]>1e-35?j=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?j=-.043902062079383485:j=-.014741559220396223:j=-.00934935734853194:t[6]>32.50000000000001?j=.1514593126307404:j=.010771222510801532:t[10]>22.500000000000004?j=.01412495209334078:j=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let q;t[0]>384.50000000000006?t[84]>1e-35?q=-.06088131453064195:t[147]>1e-35?q=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?q=.04219361472548491:q=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?q=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?q=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?q=-.11431764534511478:q=.013549717238356157:q=-.020987333767091276:t[6]>2.5000000000000004?q=-.02914877855133127:q=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?q=-.10087072787978416:t[37]>1e-35?q=-.030467397753331196:t[229]>1e-35?q=-.1017559811057469:t[4]>20.500000000000004?q=-.00413177742240167:t[20]>1e-35?q=.05213315982685969:q=.0037921635866823133:t[8]>51.50000000000001?q=.07327913092421544:t[6]>49.50000000000001?q=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?q=.02744420891894289:q=.11288946357194463:q=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?q=-.012329314369909049:q=.026816658655600168:q=-.0872405354618811:q=.007872673500247845:t[1]>42.50000000000001?q=-.04309044198258254:t[145]>1e-35?q=.07572529147860785:t[7]>5.500000000000001?q=-.013837187093264945:t[1]>17.500000000000004?q=.04208698439539668:q=-.06284346769019863;let Q;t[294]>1e-35?Q=-.0384794324818203:t[266]>1e-35?Q=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?Q=.07432960094940501:Q=-.035248735855751855:t[134]>1e-35?Q=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?Q=-.01706896375068821:Q=.08212247914968074:t[2]>59.50000000000001?Q=-.09546478958824225:t[6]>53.50000000000001?Q=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?Q=.02816463285971267:Q=.15449139016588445:Q=-.10199787406123524:Q=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?Q=-.13924786681478077:Q=-.0072772442570213335:t[39]>1e-35?Q=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?Q=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?Q=-.11174465335620831:Q=.00013144040097180107:Q=-.08493919336681105:t[42]>1e-35?Q=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?Q=-.015540659878839153:Q=-.14442609417300142:t[21]>1e-35?Q=-.025251979447574083:Q=.0023698372645272847:t[18]>1e-35?Q=.07269739695712212:t[8]>2592.5000000000005?Q=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?Q=-.01835130329646532:t[9]>45.50000000000001?Q=.02023047454629885:Q=.16469378262221102:Q=-.042975030085836426;let U;t[8]>2915.5000000000005?t[297]>1e-35?U=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?U=-.01034964686484714:U=-.07357437440667927:U=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?U=-.09476398869062203:t[9]>72.50000000000001?U=-.0757383854264379:U=.02806542779508718:U=-.05147742568418084:U=.10212721564444344:U=.0518263760642861:U=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?U=-.10669213185972036:U=.027050434286384796:t[302]>1e-35?U=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?U=.06354599160071946:t[1]>67.50000000000001?U=.05317447949011187:U=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?U=-.09369289448773599:t[0]>2215.5000000000005?U=.04077965380363924:t[0]>807.5000000000001?U=-.0591771776458298:U=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?U=-.016323380219241672:U=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?U=.03720704290087811:U=-.008730548158766654:t[4]>80.50000000000001?U=-.05346644687473197:U=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?U=.019984510398089086:U=-.03917825025861855:t[9]>170.50000000000003?U=-.09759719821334525:U=-.0023586682752856298;let z;t[183]>1e-35?t[17]>1e-35?z=.030100940443356424:t[10]>1.5000000000000002?z=-.10861112216742408:z=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?z=-.032062878390325456:z=-.10808232631806887:t[8]>1641.5000000000002?z=-.06147013392655731:t[4]>12.500000000000002?z=.03324767551088266:t[145]>1e-35?z=.028851633810612017:z=-.054871239091792784:t[134]>1e-35?z=-.023813968121342108:t[266]>1e-35?z=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?z=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?z=-.025350325484720576:z=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?z=.056817276537534815:z=-.07674158463557636:z=-.06335553143454145:t[1]>56.50000000000001?z=.16390494217299284:z=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?z=.041717597065890205:z=-.10357913492269129:t[10]>29.500000000000004?z=.1365512866715726:z=.020600048310575665:z=.09708785634773187:z=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?z=-.03146213719547347:z=.11784024316238083:z=-.050940520532045355:z=-.047988344143075616:t[191]>1e-35?z=.028764654731460032:z=.0011911575567860023;let $;t[294]>1e-35?t[10]>50.50000000000001?$=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?$=-.05103908560370243:$=.05002066201169583:$=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?$=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?$=.127983140816313:$=-.05436534163636867:$=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?$=-.009504203657088933:t[8]>819.5000000000001?$=.18689664822602375:$=.03635576744011826:$=-.029862411809998525:t[223]>1e-35?$=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?$=-.09405026597863717:t[0]>4153.500000000001?$=.053577663326799765:$=-.05062127873995668:$=.06512222894425874:t[39]>1e-35?$=-.04985311717827547:t[51]>1e-35?$=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?$=-.02860634573675884:$=.08863753005590103:$=.11158892111063744:t[0]>655.5000000000001?$=-.031005736641654926:$=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?$=-.00843386136334982:$=-.05273594615999777:$=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?$=-.015774115523598486:$=.10147367091236065:$=-.048307000563071016:$=.002118376117677254;let W;t[8]>1014.5000000000001?t[9]>137.50000000000003?W=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?W=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?W=.07211107542565391:W=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?W=-.0751486415451188:t[1]>59.50000000000001?W=.13459005084554104:W=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?W=.06715575425741895:W=-.005895690393702183:t[8]>2915.5000000000005?W=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?W=-.00029068886245881074:W=.0613467393188786:t[148]>1e-35?W=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?W=.003887223773199377:W=-.08553893131979015:W=.025654192706396767:W=-.05651733979610658:W=-.02039913645229667:t[2]>7.500000000000001?W=-.1058450646728524:W=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?W=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?W=.1283258201586378:W=-.01718135372229775:W=-.07702452408491414:t[125]>1e-35?W=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?W=.04273051857848212:W=-.04533122948101463:t[2]>196.50000000000003?W=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?W=.0231032972703664:W=-.04807386814498683:W=.002729435991332102;let J;t[179]>1e-35?J=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?J=.026484626664041125:t[10]>1.5000000000000002?J=-.10187000872941615:J=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?J=.09574540795390041:J=-.06454986703691233:J=-.11411849349353141:t[266]>1e-35?J=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?J=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?J=-.04403391373512386:J=.1132928075412222:t[2]>47.50000000000001?J=-.09700191391838056:J=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?J=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?J=-.001668912999010927:J=-.02363511102970245:t[8]>58.50000000000001?J=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?J=.0911011436534449:t[1]>28.500000000000004?J=-.07192390493729035:J=.06913818091291246:J=-.012312625373699222:J=.06784496312307986:J=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?J=.0026564453057705273:J=-.025425772389361445:t[122]>1e-35?J=-.12046786388602149:t[0]>3183.5000000000005?J=.01162092842804907:t[91]>1e-35?J=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?J=-.0001647792543020228:J=-.023664538532907665:J=.01609078206180752;let ne;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ne=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ne=-.017696526862422682:ne=.1450050954613223:ne=-.05406930069823832:ne=-.08308700260259043:t[120]>1e-35?ne=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ne=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ne=.038431826961746934:ne=-.05937462906539856:t[9]>65.50000000000001?ne=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ne=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ne=-.09579030954062734:ne=.025064711572811746:ne=.02579440518821548:ne=.1044440128091862:ne=-.058348633139536844:ne=.07766788227934436:ne=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ne=.07463684068207214:ne=.18244269035484484:t[6]>39.50000000000001?ne=-.06050050067471004:ne=.05787759066913493:ne=.010783225857972171:ne=.1674891243602606:t[4]>9.500000000000002?ne=-.004814132027475892:ne=-.14543299413454813:ne=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ne=-.07634466313617769:ne=.0287825335169114:ne=-.06894721943300268:ne=-.00023988459059521937;let H;t[131]>1e-35?t[1]>93.50000000000001?H=-.05706887458825395:t[2]>1.5000000000000002?H=.011446637886629108:H=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?H=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?H=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?H=.026278724448495064:H=.17053138400480508:t[0]>4463.500000000001?H=-.06482289890096041:H=.03026516489536295:H=-.031785170717683144:H=.1312690622980455:t[13]>1e-35?H=.14336922540461444:H=.03523850945454039:H=-.015407465968975714:t[39]>1e-35?H=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?H=-.0659975068798723:H=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?H=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?H=.057409156184759516:H=.2024322059866388:H=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?H=.010648654146284154:t[308]>1e-35?H=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?H=.12364025998551711:H=-.02247495081065243:t[1]>22.500000000000004?H=-.0726295464624251:H=.03481895086048152:t[0]>4331.500000000001?H=-.04775443357020673:H=.07172377425057568:t[2]>89.50000000000001?H=-.11782645274716962:H=.00010092665257989378;let re;t[147]>1e-35?re=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?re=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?re=-.016101990375700172:t[0]>2579.5000000000005?re=-.13045089661551845:re=-.02874367814784938:re=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?re=.17084176915326055:re=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?re=.10591712319944074:re=-.024082167264285:re=.16497698867036126:re=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?re=-.021012910475524206:re=-.13058422554298485:t[0]>1102.5000000000002?re=.10955864175201457:re=-.03566689354348996:t[1]>11.500000000000002?re=-.02093884208606101:re=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?re=-.013861861436128482:re=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?re=.10163873449625677:re=-.02779270277623805:t[1]>26.500000000000004?re=-.08035058228527389:re=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?re=-.007028075523033826:re=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?re=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?re=-.0032075580718124892:re=-.04442829143298883:re=-.06597073245775804:re=.0015594090939337751;let ae;t[223]>1e-35?t[8]>668.5000000000001?ae=-.12803889879260094:ae=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?ae=.08967966612917375:t[1]>39.50000000000001?ae=-.059791671514498074:ae=.05648934961902822:t[2]>59.50000000000001?ae=-.08633234097449628:t[6]>53.50000000000001?ae=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?ae=.025606129643140924:ae=.13835395886271978:ae=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?ae=-.09975506556937946:t[10]>36.50000000000001?ae=-.09427724661655643:t[10]>24.500000000000004?ae=.07329330653410447:ae=-.02271182965807972:ae=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?ae=-.05082091374050816:ae=.1687114435254966:t[0]>2314.5000000000005?ae=-.06422664016383926:ae=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ae=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?ae=-.1274167728754332:ae=.01308079126447365:t[4]>73.50000000000001?ae=.13854015371106546:t[4]>48.50000000000001?ae=-.03684255740123261:t[6]>45.50000000000001?ae=.10329912215813097:t[10]>77.50000000000001?ae=-.08630788656925215:ae=.031022006843800853:t[1]>25.500000000000004?ae=-.08278381528048026:ae=.06664374548141594:t[84]>1e-35?ae=-.05624227409079396:ae=.00012184182357340415;let Be;t[179]>1e-35?Be=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Be=-.07595415373151816:Be=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Be=.022822510448266862:Be=.17491569312933697:Be=-.058362287133533565:t[2]>2.5000000000000004?Be=-.03633895806364428:Be=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Be=-.07294848747514579:Be=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Be=-.07009535282685533:t[8]>2640.0000000000005?Be=-.051761240111316276:t[131]>1e-35?Be=-.06245774419231631:Be=.03495606662854905:Be=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Be=.0015036626973581122:Be=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Be=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Be=.022343994371919224:Be=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Be=.07724450228328664:t[0]>3853.5000000000005?Be=-.15671707454435677:t[10]>28.500000000000004?Be=-.10179090671841723:Be=.014878216919760927:Be=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Be=.14054154485273487:Be=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Be=-.08632985141410315:Be=.005524157938954954:Be=-.08802502622523681:Be=-.0004649168897260341;let ve;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ve=-.007458687464321174:ve=-.09444966249102484:t[1]>23.500000000000004?ve=.08564129697360716:ve=-.07105002902845851:ve=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ve=-.10326216566705966:t[1]>26.500000000000004?ve=.0050539832484585365:ve=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ve=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ve=.05783632021087773:t[10]>17.500000000000004?ve=-.06720598671764105:t[1]>47.50000000000001?ve=.097495825172558:ve=-.013372242800584872:ve=-.06463226787713715:t[42]>1e-35?ve=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ve=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ve=.11051270080118503:ve=.027719462817590454:t[8]>597.5000000000001?ve=-.08441503592016869:ve=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ve=-.12190088985091102:ve=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ve=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ve=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ve=.016585157185448045:ve=-.11032043771149425:ve=.01586986028570486:t[8]>388.50000000000006?ve=-.10592413013261853:ve=.04930703248769364:t[13]>1e-35?ve=.003621937787920821:ve=-.0013786331198611841;let 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 Pe;t[183]>1e-35?Pe=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Pe=-.11753465135886734:Pe=-.007515490299047085:Pe=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Pe=-.12371142493530439:t[1]>36.50000000000001?Pe=.032189417575190435:Pe=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Pe=-.0784518658439288:t[2]>54.50000000000001?Pe=.12477882322370665:Pe=.000313468482399738:Pe=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Pe=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Pe=.0353146070135579:Pe=-.06327619611098285:Pe=.02813577701641991:Pe=-.12354390728506215:t[34]>1e-35?Pe=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Pe=-.01245803535276381:Pe=-.07169472553475001:t[1]>11.500000000000002?Pe=.12989984824561698:Pe=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Pe=.010390226893521422:t[10]>14.500000000000002?Pe=.16790888126487719:Pe=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Pe=-.043398307129729134:Pe=.09963544907820426:t[9]>30.500000000000004?Pe=-.13540713124984502:t[9]>17.500000000000004?Pe=.0509435850590757:Pe=-.04761897852404613:t[4]>78.50000000000001?Pe=.09197086656470652:Pe=.0006771050176682337;let Z;t[122]>1e-35?t[6]>36.50000000000001?Z=.05686884451670743:Z=-.05334759543084309:t[266]>1e-35?Z=-.08603579519816038:t[157]>1e-35?Z=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?Z=-.0499592651503952:t[0]>725.5000000000001?Z=.11780353905132664:Z=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?Z=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Z=-.03190157229022304:Z=.07985197845805492:Z=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?Z=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?Z=-.027174047777029083:Z=.057117284879796476:t[3]>43.50000000000001?Z=-.0016147040913107311:Z=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?Z=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?Z=-.01466076988151239:Z=.13375695925484857:Z=-.04885873081899647:t[0]>5566.500000000001?Z=.11086813028591343:t[8]>992.5000000000001?Z=-.07622304217072383:Z=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?Z=.03285858361708423:Z=-.12354858211764992:Z=.0672788301823281:t[15]>1e-35?Z=.08658836986585006:Z=-.02741484278509758:t[290]>1e-35?Z=-.08161310335133287:t[135]>1e-35?Z=-.04824156054814152:Z=.0009156904299554183;let ee;t[3]>7.500000000000001?ee=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ee=.03642374718166293:ee=.16379973756366603:ee=-.03946685266127979:t[186]>1e-35?ee=.07618896623420895:t[96]>1e-35?ee=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?ee=-.022822371600847505:ee=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?ee=.044416424920571296:ee=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?ee=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?ee=.1061937286809567:t[7]>54.50000000000001?ee=.11487507743121311:t[8]>819.5000000000001?ee=-.07181278009001418:t[10]>25.500000000000004?ee=.13499019430369633:t[1]>31.500000000000004?ee=.09032979489780704:ee=-.12754166393372374:t[9]>37.50000000000001?ee=-.05093963635361407:ee=-.005026651151683848:t[9]>2.5000000000000004?ee=.07619735785573735:ee=.012363301341532136:t[26]>1e-35?ee=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?ee=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?ee=-.10764172927882483:ee=.01890760098464703:ee=.06573095405846417:t[8]>634.5000000000001?ee=-.00783575973273707:ee=-.050612689680229306:t[1]>22.500000000000004?ee=-.0016842490401359626:ee=.0738227088444087:ee=-.02663970950432175;let K;t[31]>1e-35?t[8]>17.500000000000004?K=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?K=.007191286124908192:K=-.09347881647636902:t[10]>1.5000000000000002?K=.07938758708008091:K=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?K=.12321804057595996:K=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?K=-.04644244754790671:K=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?K=.0706108609273337:t[2]>40.50000000000001?K=-.028046629962303716:K=-.06497613993109329:K=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?K=-.03056331974267756:K=-.11886389712497057:K=.053364962175658184:t[8]>2233.5000000000005?K=-.0448152521157682:K=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?K=.03818796510453344:K=.23673992112982362:K=.02858814226507374:t[10]>44.50000000000001?K=-.1125863771551199:K=.009129996952394916:t[1]>7.500000000000001?K=-.004374525302461639:K=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?K=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?K=-.13677189943034931:t[10]>2.5000000000000004?K=.039591891437078086:K=-.09312596849507347:K=-.02423172142089822:K=.0009836986075266283;let 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 X;t[179]>1e-35?X=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?X=.1470294450403005:X=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?X=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?X=.07965955447707423:t[10]>10.500000000000002?X=-.09236156404262426:X=.03396273196231458:X=-.13246465021467432:X=.07092822261735353:X=-.08753829085942:X=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?X=.004705878789890202:X=.13775378964952867:X=-.04770928980587811:t[10]>29.500000000000004?X=.011221519891071544:t[0]>3853.5000000000005?X=.06365381191628273:X=.15506252245336827:t[1]>37.50000000000001?X=-.07254777021042061:X=.026514587757252385:t[308]>1e-35?X=.04115804816617256:t[10]>26.500000000000004?X=.02077721353011946:t[5]>3548.5000000000005?X=-.1280907116663952:X=-.021974774274438:t[306]>1e-35?X=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?X=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?X=-.005710865560475598:t[94]>1e-35?X=-.06751507982853555:X=.027250040757588703:t[9]>52.50000000000001?X=.07060357924595577:X=-.030297760713011795:X=-.0006005400085266517;let ue;t[113]>1e-35?ue=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ue=-.06996356565314456:ue=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ue=-.08317707559926495:t[21]>1e-35?ue=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ue=-.010538203005984922:ue=.08454819465349446:t[9]>124.50000000000001?ue=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ue=-.08542251249346582:t[9]>50.50000000000001?ue=-.023428882537657472:ue=.010042500833979073:ue=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ue=.03006025206979096:t[9]>108.50000000000001?ue=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ue=.04222035773042132:ue=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ue=-.07209095448054853:ue=.028065954981903313:ue=.08714651929917122:ue=-.006678820669279169:t[10]>40.50000000000001?ue=.006982396294941626:ue=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ue=-.09351114982645548:t[4]>3.5000000000000004?ue=-.004837550129223451:ue=-.08324141237464677:t[303]>1e-35?ue=.10703037493990825:t[9]>156.50000000000003?ue=-.10803018621648303:t[116]>1e-35?ue=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ue=.10261721665006701:ue=.018994509090668264:ue=.0011244262442038839;let je;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?je=-.08404263465005328:t[0]>3682.5000000000005?je=.041259223920298876:t[1]>29.500000000000004?je=-.09541257493441671:je=.001482192721625409:je=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?je=-.08268996098437432:t[230]>1e-35?je=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?je=-913218977737457e-19:t[4]>10.500000000000002?je=-.056334165674005156:t[127]>1e-35?je=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?je=-.04231200150318989:t[10]>42.50000000000001?je=.10182973257894812:je=.015934763950068445:je=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?je=-.041117068322885315:je=.1167767830037126:je=.13611206992387337:t[10]>41.50000000000001?je=-.07120286010564107:je=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?je=-.07702290997669524:t[198]>1e-35?je=.08776558554437136:je=-.008290740324975692:t[2]>32.50000000000001?je=.07198457624219955:je=.005463113714361629:je=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?je=.03295785445437507:je=.15140250150674536:je=-.035613213948910254:t[186]>1e-35?je=.06849425535860769:t[96]>1e-35?je=.06028225812727254:je=-.007582543288662308;let ie;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ie=.08396556264106572:ie=-.0562516995099192:ie=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ie=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ie=.0052017514017035915:ie=-.11194119432743639:ie=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ie=-.025692451287403446:ie=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ie=-.11892250746801664:t[10]>22.500000000000004?ie=.07548493166973796:ie=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ie=.13750699058082427:t[18]>1e-35?ie=.06535408879552801:ie=-.054118179035040674:ie=.1344282838979622:t[0]>3982.5000000000005?ie=-.10409582202467015:t[19]>1e-35?ie=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ie=.012705935670766466:ie=.14149359442527545:ie=-.047977876173706004:t[20]>1e-35?ie=.057945228080337946:t[0]>3642.5000000000005?ie=-.008726535792122467:ie=-.08424769891378858:t[34]>1e-35?ie=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ie=.01196849566739346:ie=.1614642278429876:ie=-.043022338150701625:t[3]>5.500000000000001?ie=-.03907848255033881:ie=.018280601026175593:ie=.0006654540402589085;let le;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?le=-.01386103677247845:le=.11386694333005128:t[4]>27.500000000000004?le=-.021862617610091336:t[2]>31.500000000000004?le=.0828858469030438:le=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?le=.11303635767048735:le=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?le=-.04238798044549342:le=.022091190130494303:t[5]>5082.500000000001?le=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?le=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?le=-.04291104140431434:t[17]>1e-35?le=.11256797532342613:le=-.017206916368289193:le=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?le=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?le=.03581712466863222:le=.14770264307668884:t[8]>73.50000000000001?le=-.13093289429740068:le=.042461737442702936:t[52]>1e-35?le=.0501831919044939:le=-.010450249720465756:le=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?le=.0005381332165438493:le=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?le=.04849637311285226:le=-.036671377119808564:t[0]>421.50000000000006?le=.00020968499911058945:le=.11636422423182405:le=-.12687837788222575:le=.0012774367867215346;let Ne;t[120]>1e-35?Ne=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ne=-.042799574885345304:Ne=.07412430171193245:Ne=-.11248270469336048:t[193]>1e-35?Ne=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ne=.028911612178122104:Ne=.12326369727728437:t[0]>4091.5000000000005?Ne=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ne=.1159839898100149:Ne=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ne=-.0216343737351583:Ne=-.1220272260878369:t[2]>18.500000000000004?Ne=.09152924475072398:t[8]>55.50000000000001?Ne=.039508716651005665:Ne=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ne=.06793009902674053:Ne=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ne=-.04391068849624096:Ne=.04009967593394672:t[8]>1085.5000000000002?Ne=-.024773826356034825:Ne=-.13919707884246582:Ne=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ne=-.11567917501901476:Ne=-.006813640337684114:t[3]>7.500000000000001?Ne=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ne=-.001754586408351048:Ne=-.055422422450722056:Ne=-.06090032532532226:t[0]>5269.500000000001?Ne=.11787981735983527:Ne=-.00198119768540783:Ne=.00210412924303036;let we;t[294]>1e-35?t[10]>50.50000000000001?we=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?we=-.06063239096209816:we=.03317022411417386:we=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?we=-.013608609329298802:we=.09078000157330264:t[99]>1e-35?we=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?we=-.07536137260189814:we=.006253266595455118:t[10]>28.500000000000004?we=-.006106041147592768:t[9]>156.50000000000003?we=-.11828932797811101:t[94]>1e-35?we=-.02566078479505714:t[303]>1e-35?we=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?we=-.08401252789168523:t[5]>4244.500000000001?we=.026372887658499107:t[1]>16.500000000000004?we=-.027836756345634026:we=.09205362097909099:we=.00934612788718244:t[203]>1e-35?we=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?we=-.09580979052540028:t[1]>50.50000000000001?we=-.06402211827281554:we=.08342858760095972:t[2]>36.50000000000001?we=.008114897658204584:t[92]>1e-35?we=.09541587072672864:we=-.022342147210555434:we=-.01660492519175128:we=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?we=.15846731118501817:we=.039498507912023195:t[245]>1e-35?we=.07008718676813333:we=.0019806389728814727;let Le;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Le=-.01192072916082109:Le=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Le=.06874032717466054:t[4]>40.50000000000001?Le=-.07752510020707537:t[1]>76.50000000000001?Le=-.09944032260703917:t[8]>1381.5000000000002?Le=-.054466635810800745:t[1]>32.50000000000001?Le=.05974084520839573:Le=-.0384718740755954:Le=-.11374190719134032:t[0]>2151.5000000000005?Le=-.13703645155803298:Le=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Le=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Le=.013539805885738608:Le=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Le=.09941880179344399:Le=-.01608127391210995:Le=.08025226531247417:t[9]>67.50000000000001?Le=.13525448212444113:t[6]>61.50000000000001?Le=-.05511099182158894:t[94]>1e-35?Le=-.06821509831783572:t[128]>1e-35?Le=.11361314817714643:Le=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Le=-.09954181329804547:t[197]>1e-35?Le=.10102833149755386:t[188]>1e-35?Le=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Le=-.03781554214742005:Le=.09927933385592314:Le=-.020006000056720083:Le=-.10520473615957895:Le=-.12006990846253787:Le=-.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 kt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?kt=.0011484728213539738:kt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?kt=-.09828874964938798:t[8]>1586.5000000000002?kt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?kt=.011938269926919522:kt=.17541983715953954:t[19]>1e-35?kt=.023002786011088672:kt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?kt=.06508934844183291:kt=-.10168553534835639:kt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?kt=.021140806225203937:kt=-.1167833342453639:t[2]>33.50000000000001?kt=.13163585734056618:kt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?kt=.06314479201263888:kt=-.09639088327091713:t[10]>29.500000000000004?kt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?kt=40577156464836036e-21:kt=.12322387121810757:kt=-.03697224045046014:t[1]>22.500000000000004?kt=.016474835887320276:kt=.16919298733903063:kt=.07633203630214054:kt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?kt=.14150493354700563:kt=-.01831155354975749:t[1]>28.500000000000004?kt=-.07952557178685365:t[10]>28.500000000000004?kt=.0665695554984927:kt=-.053640139319277094:kt=.0004754840665898665;let $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 Ht;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?Ht=.018337297491457794:Ht=-.05926206443180149:Ht=.024026520855881126:t[288]>1e-35?t[184]>1e-35?Ht=.10747078482128616:t[126]>1e-35?Ht=-.10550625192391357:t[7]>71.50000000000001?Ht=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?Ht=.1317396472229434:Ht=-.025035791351328947:Ht=-.0728334305864372:t[8]>963.5000000000001?Ht=.023642201723096064:Ht=.183010326734258:t[128]>1e-35?Ht=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?Ht=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?Ht=-.1088876900335281:Ht=.02758317023002635:Ht=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?Ht=-.01928020117446408:Ht=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?Ht=.07893723375925096:Ht=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?Ht=-.10301657587280551:Ht=.005787463140224318:Ht=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?Ht=-.019296977889522397:Ht=-.07274529751752634:t[1]>30.500000000000004?Ht=-.050368901143148286:Ht=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?Ht=.0015332402792773946:Ht=.09930153676749967:Ht=-.06370844564357069:Ht=.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 fe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?fe=.07554189644995735:fe=-.052089349455904946:fe=-.10148206848169845:t[113]>1e-35?fe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?fe=.07172653627995676:fe=-.07602959317610998:fe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?fe=-.0399322883690891:fe=.06523495517476098:fe=-.10358715295743802:t[193]>1e-35?fe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?fe=.015928764772252406:fe=.1341513061552287:fe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?fe=-.033592997607280156:fe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?fe=-.08402551858097379:fe=.017401984506038796:t[1]>25.500000000000004?fe=.13337205393591278:fe=-.01160208350090984:fe=.06708317942315471:t[8]>227.50000000000003?fe=-.08486943882418681:fe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?fe=-.10496268177586783:fe=-.020921489532370493:fe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?fe=.11639296062157028:fe=-.004275784356569115:t[32]>1e-35?fe=-.07297384970166025:fe=.006026841626381599:fe=.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 Y;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?Y=-.07583539600416284:t[188]>1e-35?Y=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?Y=-.011038193049597113:Y=.08154028164397753:t[1]>85.50000000000001?Y=.10259361975201933:Y=.011640408330521594:Y=-.00023319159023748508:t[92]>1e-35?Y=.13771692859530546:Y=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?Y=.09967230141007705:t[30]>1e-35?Y=-.08888529037551285:Y=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?Y=.08284665960761373:Y=-.029292565021289504:t[7]>7.500000000000001?Y=-.09945093355204493:Y=-.008381393701708593:t[20]>1e-35?Y=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?Y=.07585582641438211:t[8]>284.50000000000006?Y=-.029387993239886723:Y=.07716738177321587:t[1]>18.500000000000004?Y=.026745348497993746:Y=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?Y=.02337306890530338:Y=-.10390355904767366:Y=.07390521199638532:Y=-.06788247515155237:Y=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?Y=-.06360325615644084:Y=.04342192339836601:Y=-.10598779152030145:Y=.05253384605768211;let se;t[3]>7.500000000000001?t[157]>1e-35?se=-.07514182877923786:se=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?se=.028692053800951845:se=.14081686716133598:se=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?se=.0037139292567243084:se=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?se=.01202688580305612:se=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?se=.043935495082738626:se=-.05639305759669704:t[247]>1e-35?se=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?se=.10331836202616368:se=.0006926658459781341:t[96]>1e-35?se=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?se=-.0741403257305367:se=.022900127535540854:t[7]>3.5000000000000004?se=.038110741403836294:se=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?se=-.09552842289807008:t[1]>27.500000000000004?se=.012505935885798007:se=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?se=-.1046104767723845:se=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?se=.023466328488582572:se=.11730925774586994:se=-.04771965631104874:se=.17059689880751394:se=-.08181850955999449:t[26]>1e-35?se=-.12727482696678769:se=-.014343123272734182;let 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 ce;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ce=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ce=.020637047900190317:ce=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?ce=-.04632587527094407:ce=.08603684785510396:ce=-.05101401015448496:ce=.025466432054358498:ce=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ce=.020385355430046367:ce=.12032592051335252:ce=-.012387370292173013:t[2]>23.500000000000004?ce=-.12568545484492677:ce=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ce=.043528764484784536:ce=.14352071657196003:ce=-.009332833816977268:ce=.11186782227735846:ce=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ce=-.05649104643152564:ce=.03884200719305747:t[42]>1e-35?ce=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ce=-.04103416502526736:ce=.04881823954656287:t[4]>15.500000000000002?ce=.009342724662897898:t[0]>3969.5000000000005?ce=-.025637309961309498:ce=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ce=-.08185697075265091:t[0]>2215.5000000000005?ce=.030063975892297354:t[0]>807.5000000000001?ce=-.03924325550733229:ce=.0415330999189793:ce=-.00024374664461674863;let Re;t[3]>7.500000000000001?Re=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Re=.025798416259686565:Re=.13251610353146012:Re=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Re=-.11098564237775424:Re=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Re=.15347826616466054:t[3]>4.500000000000001?Re=.10379320730958941:Re=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Re=.03159791088468647:Re=-.10612873364104258:Re=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Re=-.02335760775001469:Re=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Re=-.011164334474672973:Re=-.06594044410501655:t[207]>1e-35?Re=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Re=-.01725821503981916:Re=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Re=-.04226531631656534:Re=-.14409800530171432:Re=-.03245576341206398:t[8]>4214.500000000001?Re=.0895409165534886:t[247]>1e-35?Re=-.06506383629143335:t[118]>1e-35?Re=-.07214270121257443:t[8]>546.5000000000001?Re=-.004385020865473831:Re=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Re=.046278501133958524:Re=-.030835570926968044:t[0]>493.50000000000006?Re=-.12794504651610425:Re=.009415039807550776;let Me;t[304]>1e-35?Me=-.04717777269217453:t[76]>1e-35?Me=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Me=-.09648224457374217:t[132]>1e-35?Me=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Me=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Me=.10838431695638147:t[230]>1e-35?Me=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Me=.050071316251979:Me=-.006356941111525215:t[6]>8.500000000000002?Me=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Me=.10217402850540398:Me=-.048840949025349197:Me=-.03668313197909846:t[7]>39.50000000000001?Me=-.0562642841496003:t[10]>2.5000000000000004?Me=.09749777369987417:Me=-.04848223121417616:t[0]>5453.500000000001?Me=.08316648226133942:Me=-.0261979698267618:t[212]>1e-35?Me=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Me=.04837009746506856:Me=-.09184360565631328:Me=.0032411047845613606:t[0]>4733.500000000001?Me=.0977378556864798:Me=.010776545559325588:Me=-.012483310473120218:Me=-.049284121449103935:Me=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Me=-.08380361910948711:Me=.07375088778585813:Me=-.1084864186071348:Me=.0007819503469605476;let Ae;t[7]>17.500000000000004?t[115]>1e-35?Ae=.08741852531696623:t[167]>1e-35?Ae=.10078975495600809:Ae=-.0018324767784017562:t[290]>1e-35?Ae=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?Ae=.1379733311640402:Ae=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?Ae=-.09360083033774169:Ae=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?Ae=-.015599362579530679:t[0]>4593.500000000001?Ae=-.12029549262691491:Ae=-.018917032256501397:Ae=.04632831686576592:Ae=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?Ae=-.05894883236412263:Ae=.05213944998315824:Ae=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?Ae=.07577412405680808:Ae=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?Ae=-.0277076900736147:t[1]>65.50000000000001?Ae=-.023587471585763506:Ae=.10184896592433082:Ae=-.057699270527916825:Ae=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?Ae=.06566902102799584:t[10]>25.500000000000004?Ae=-.07033633753181047:Ae=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?Ae=-.08108035861059537:Ae=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?Ae=-.12431182772561139:Ae=.01886235886984271:Ae=.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 B0=ddc(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+P+D+N+B+L+j+M+O+q+Q+U+z+$+W+J+ne+H+re+ae+Be+ve+Ue+Pe+Z+ee+K+he+X+ue+je+ie+le+Ne+we+Le+rt+st+_t+kt+$t+Ht+Ie+F+be+Qe+fe+Se+Fe+te+Te+Ge+Y+se+me+Ce+He+$e+et+ct+bt+ht+We+ce+Re+Me+Ae+oe+ze+at+Vt+gr+cr+Mr+Hr+Gr+Yt+_r);return[1-B0,B0]}a(udc,"multilineModelPredict");function ddc(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(ddc,"sigmoid")});var J4i=I(N$=>{"use strict";p();Object.defineProperty(N$,"__esModule",{value:!0});N$.MultilineModelFeatures=N$.PromptFeatures=void 0;N$.hasComment=Wkr;N$.requestMultilineScore=mdc;var D$=z4i(),fdc=Y4i(),pdc={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},K4i={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function Wkr(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(pdc[r]??[]).some(l=>s.includes(l))}a(Wkr,"hasComment");var yBe=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=Wkr(e,-2,r),this.rstripSecondToLastLineHasComment=Wkr(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` +`)[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(` `),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]}};N$.PromptFeatures=yBe;var u_t=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new yBe(e,n),this.suffixFeatures=new yBe(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(K4i).length+1).fill(0);r[K4i[this.language]??0]=1;let n=new Array(Object.keys(D$.contextualFilterCharacterMap).length+1).fill(0);n[D$.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(D$.contextualFilterCharacterMap).length+1).fill(0);o[D$.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(D$.contextualFilterCharacterMap).length+1).fill(0);s[D$.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(D$.contextualFilterCharacterMap).length+1).fill(0);return c[D$.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};N$.MultilineModelFeatures=u_t;function hdc(t,e){return new u_t(t.prefix,t.suffix,e)}a(hdc,"constructMultilineFeatures");function mdc(t,e){let r=hdc(t,e).constructFeatures();return(0,fdc.multilineModelPredict)(r)[1]}a(mdc,"requestMultilineScore")});var Z4i=I(D6=>{"use strict";p();var gdc=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},Adc=D6&&D6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(D6,"__esModule",{value:!0});D6.StreamedCompletionSplitter=void 0;var ydc=Fs(),Edc=E4e(),_dc=lAe(),zkr=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}},Ykr=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 zkr(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 _dc.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(Edc.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}};D6.StreamedCompletionSplitter=Ykr;D6.StreamedCompletionSplitter=Ykr=gdc([Adc(5,ydc.IInstantiationService)],Ykr)});var sBi=I(Kkr=>{"use strict";p();Object.defineProperty(Kkr,"__esModule",{value:!0});Kkr.getGhostTextStrategy=xdc;var iBi=Fs(),X4i=wre(),JD=RE(),oBi=oy(),d_t=XAt(),eBi=Og(),vdc=eAe(),EBe=lAe(),Cdc=qkr(),bdc=o4e(),Sdc=jTr(),Tdc=J4i(),Idc=Z4i(),tBi=20;function rBi(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]}};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(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(rBi,"takeNLines");async function xdc(t,e,r,n,o,s,c){let l=t.get(iBi.IInstantiationService),u=t.get(oBi.ICompletionsFeaturesService),d=t.get(Sdc.ICompletionsBlockModeConfig),f=u.multilineAfterAcceptLines(c),h=d.forLanguage(e.textDocument.detectedLanguageId,c);switch(h){case JD.BlockMode.Server:return s?{blockMode:JD.BlockMode.Parsing,requestMultiline:!0,finishedCb:rBi(f),stop:[` +`).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:[` -`],maxTokens:tBi*f}:{blockMode:JD.BlockMode.Server,requestMultiline:!0,finishedCb:a(m=>{},"finishedCb")};case JD.BlockMode.Parsing:case JD.BlockMode.ParsingAndServer:case JD.BlockMode.MoreMultiline:default:{let m;try{m=await l.invokeFunction(wdc,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=vdc.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(nBi,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:JD.BlockMode.Parsing,requestMultiline:!0,finishedCb:rBi(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:tBi*f};return h===JD.BlockMode.MoreMultiline&&(g.blockMode=JD.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(nBi,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(xdc,"getGhostTextStrategy");function nBi(t,e,r,n,o,s,c,l,u){let d=t.get(oBi.ICompletionsFeaturesService),f=t.get(iBi.IInstantiationService);if(c&&e===JD.BlockMode.MoreMultiline&&EBe.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===EBe.BlockPositionType.EmptyBlock||o===EBe.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(bdc.ICompletionsCacheService);return{finishedCb:f.createInstance(Idc.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let E={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,Cdc.appendToCache)(m,E,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,d_t.parsingBlockFinished)(r,n):h=>{}}}a(nBi,"buildFinishedCallback");async function wdc(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,eBi.telemetry)(t,"ghostText.longFileMultilineSkip",eBi.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===JD.BlockMode.MoreMultiline&&EBe.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,EBe.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&Rdc(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,X4i.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,d_t.isEmptyBlockStartUtil)(r,n):o&&(0,X4i.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,Tdc.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(wdc,"shouldRequestMultiline");function Rdc(t,e){return e.lineAt(t).text.trim().length===0}a(Rdc,"isNewLine")});var fBi=I(LR=>{"use strict";p();var Pdc=LR&&LR.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ZD=LR&&LR.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(LR,"__esModule",{value:!0});LR.ForceMultiLine=LR.GhostTextComputer=void 0;LR.getGhostText=Jdc;var cBi=Ep(),kdc=qh(),Ddc=dkr(),Ndc=y0(),lBi=Fs(),Mdc=fkr(),Odc=zge(),Bdc=W5e(),Ldc=LSr(),vBe=RE(),r2r=oy(),Fdc=Il(),Udc=OAe(),Qdc=JSr(),qdc=e_t(),jdc=Fyt(),Hdc=f$(),Gdc=XAt(),Jkr=IAe(),Xkr=vkr(),Zkr=y4i(),GAe=Og(),f_t=eAe(),aBi=n4e(),$dc=CTr(),Vdc=lAe(),Wdc=o4e(),e2r=W4i(),uBi=GTr(),zdc=sBi(),M$=ZG(),hh=fAe(),Ydc={isCycling:!1,promptOnly:!1,isSpeculative:!1};function Kdc(t,e,r){let n=t.get(r2r.ICompletionsFeaturesService),o=(0,vBe.getConfig)(t,vBe.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,GAe.now)()-r.issuedTime;return Math.max(0,o-s)}a(Kdc,"getRemainingDebounceMs");function _Be(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(_Be,"isCompletionRequestCancelled");var p_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,Ndc.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(rfc,e.textDocument,l,n);await Odc.initializeTokenizers.catch(()=>{});try{this.contextProviderBridge.schedule(e,l,n?.opportunityId??"",d,r,n),this.notifierService.notifyRequest(e,l,d,r,n);let f=await this.getGhostTextWithoutAbortHandling(e,l,d,r,n,o,s,u),h=this.contextproviderStatistics.getStatisticsForCompletion(l),m=n?.opportunityId??"unknown";for(let[g,A]of h.getAllUsageStatistics())this.telemetryService.sendMSFTTelemetryEvent("context-provider.completion-stats",{requestId:l,opportunityId:m,providerId:g,resolution:A.resolution,usage:A.usage,usageDetails:JSON.stringify(A.usageDetails)},{});return f}catch(f){if((0,Udc.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,hh.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,GAe.now)();h.push([v,b-f]),f=b}if(a(m,"recordPerformance"),m("telemetry"),_Be(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,hh.mkBasicResultTelemetry)(n)};let g=Xdc(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,hh.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(Qdc.getEngineRequestInfo,n),y={...Ydc,...s,tokenizer:A.tokenizer},E=await this.instantiationService.invokeFunction(Jkr.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(Jkr.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,hh.mkBasicResultTelemetry)(n)};if(E.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,hh.mkBasicResultTelemetry)(n)};if(E.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,hh.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,hh.mkBasicResultTelemetry)(n)};if(E.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,hh.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,hh.mkBasicResultTelemetry)(n)};let _=this.instantiationService.invokeFunction(Kdc,y,n);return _>0&&(d.debug(`Debouncing ghost text request for ${_}ms`),await(0,aBi.delay)(_),_Be(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,hh.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,Jkr.trimLastLine)(e.textDocument.getText(f_t.LocationFactory.range(f_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(zdc.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(Zdc,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(Xkr.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,Gdc.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(ifc,e.textDocument,P,e.position,E,n,A,y);if(R===void 0&&!y.isCycling&&this.asyncCompletionManager.shouldWaitForAsyncCompletions(v,E.prompt)){d.trace("No cached choices, waiting for async completions from in-flight request");let U=await this.asyncCompletionManager.getFirstMatchingRequestWithTimeout(r,v,E.prompt,y.isSpeculative,D);if(m("asyncWait"),U){d.trace("Received choice from async completion");let z=!w.requestMultiline;R=[[(0,e2r.makeGhostAPIChoice)(U[0],{forceSingleLine:z})],M$.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(_Be(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,hh.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===vBe.BlockMode.MoreMultiline&&Vdc.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(Zkr.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0)),R&&(R[1]===M$.ResultType.Cache||R[1]===M$.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,hh.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,hh.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,hh.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let U=this.instantiationService.createInstance(e2r.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let z=await U.getAllCompletionsFromNetwork(P,D,o,w.finishedCb,l);if(z.type==="success"){d.trace(`Cycling network request returned ${z.value[0].length} choices`);let $=R?.[0]??[];z.value[0].forEach(W=>{$.findIndex(J=>J.completionText.trim()===W.completionText.trim())===-1&&$.push(W)}),d.trace(`After deduplication: ${$.length} unique choices`),R=[$,M$.ResultType.Cycling]}else if(R===void 0)return z}else{d.trace("Initiating network request for completions");let z=a((ne,H)=>(this.asyncCompletionManager.updateCompletion(r,ne),w.finishedCb(ne,H)),"finishedCb"),$=new Bdc.CancellationTokenSource,W=U.getCompletionsFromNetwork(P,D,$.token,z,l);this.asyncCompletionManager.queueCompletionRequest(r,v,E.prompt,$,W);let J=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,E.prompt,y.isSpeculative);if(J===void 0)return d.trace("Network request returned no results"),{type:"empty",reason:"received no results from async completions",telemetryData:(0,hh.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[J[0]],M$.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,hh.mkBasicResultTelemetry)(D)};let[B,L]=R;d.trace(`Final choices: ${B.length} from ${(0,hh.resultTypeToString)(L)}`);let j=B.map(U=>this.instantiationService.invokeFunction(Zkr.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0);d.trace(`Post-processed to ${j.length} choices`);let M=this.instantiationService.invokeFunction(vBe.getConfig,vBe.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),O=(0,GAe.now)()-n.issuedTime,q=Math.max(M-O,0);if(L!==M$.ResultType.TypingAsSuggested&&!y.isCycling&&q>0&&(d.debug(`Waiting ${q}ms before returning completion`),await(0,aBi.delay)(q),_Be(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,hh.mkCanceledResultTelemetry)(D)};let Q=[];for(let U of j){let z=nfc(e.textDocument,P,U,D),$=g?(0,Zkr.checkSuffix)(e.textDocument,e.position,U):0,J={completion:efc(U.choiceIndex,U.completionText,E.trailingWs),telemetry:z,isMiddleOfTheLine:g,suffixCoverage:$,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};Q.push(J)}return D.properties.clientCompletionId=Q[0]?.clientCompletionId,D.measurements.foundOffset=Q?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${Q.length} results from ${(0,hh.resultTypeToString)(L)} at ${D.measurements.foundOffset} offset`),_Be(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,hh.mkCanceledResultTelemetry)(D)}:(y.isSpeculative||(d.trace("Updating current ghost text as request is not speculative"),this.currentGhostText.setGhostText(v,E.prompt.suffix,j,L)),l.setHeaderRequestId(j[0]?.requestId.headerRequestId??r),m("complete"),d.trace(`Ghost text computation complete, returning ${Q.length} results`),{type:"success",value:[Q,L],telemetryData:(0,hh.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:L,performanceMetrics:h})})}};LR.GhostTextComputer=p_t;LR.GhostTextComputer=p_t=Pdc([ZD(0,lBi.IInstantiationService),ZD(1,kdc.ITelemetryService),ZD(2,Ldc.ICompletionsNotifierService),ZD(3,jdc.ICompletionsContextProviderBridgeService),ZD(4,uBi.ICompletionsCurrentGhostText),ZD(5,Hdc.ICompletionsContextProviderService),ZD(6,$dc.ICompletionsAsyncManagerService),ZD(7,r2r.ICompletionsFeaturesService),ZD(8,Fdc.ICompletionsLogTargetService),ZD(9,qdc.ICompletionsStatusReporter),ZD(10,cBi.ILogService)],p_t);async function Jdc(t,e,r,n,o,s,c){return t.get(lBi.IInstantiationService).createInstance(p_t).getGhostText(e,r,n,o,s,c)}a(Jdc,"getGhostText");function Zdc(t,e,r,n){let s=t.get(uBi.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=tfc(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),M$.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,M$.ResultType.Cache]}a(Zdc,"getLocalInlineSuggestion");function Xdc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,Mdc.isInlineSuggestionFromTextAfterCursor)(n)}a(Xdc,"isInlineSuggestion");var t2r=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};LR.ForceMultiLine=t2r;function efc(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(efc,"adjustLeadingWhitespace");function tfc(t,e,r,n){let o=t.get(cBi.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(Wdc.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,e2r.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(tfc,"getCompletionsFromCache");async function rfc(t,e,r,n){let o=t.get(r2r.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=GAe.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(rfc,"createTelemetryWithExp");function nfc(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,dBi(l,t),l.extendWithRequestId(o),l}a(nfc,"telemetryWithAddData");function ifc(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);dBi(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===Xkr.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==Xkr.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(f_t.LocationFactory.range(h.range.start,n)),g=e.getText(f_t.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Ddc.createSha256Hash)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...(0,GAe.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,GAe.telemetry)(t,"ghostText.issued",_),d}a(ifc,"telemetryIssued");function dBi(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(dBi,"addDocumentTelemetry")});var gBi=I(N6=>{"use strict";p();var ofc=N6&&N6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n2r=N6&&N6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(N6,"__esModule",{value:!0});N6.GhostText=void 0;var pBi=ri(),sfc=Fs(),afc=WTr(),cfc=l4i(),hBi=fBi(),lfc=skr(),ufc=ZG(),dfc=WAt(),mBi=fAe(),ffc=Il(),i2r=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){pfc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,afc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(mBi.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(hBi.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(lfc.setLastShown,e.textDocument,e.position,f),m=(0,cfc.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!==ufc.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(hBi.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,_=pBi.Range.create(y,pBi.Position.create(E.line,E.character-l));return{...A,range:_}});return{...u,value:g}}};N6.GhostText=i2r;N6.GhostText=i2r=ofc([n2r(0,sfc.IInstantiationService),n2r(1,ffc.ICompletionsLogTargetService),n2r(2,dfc.ICompletionsSpeculativeRequestCache)],i2r);function pfc(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}});mBi.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(pfc,"logCompletionLocation")});var ABi=I(g_t=>{"use strict";p();Object.defineProperty(g_t,"__esModule",{value:!0});g_t.LocalFileSystem=void 0;var h_t=require("fs"),hfc=require("path"),m_t=zG(),o2r=KG(),s2r=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await h_t.promises.readFile((0,o2r.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,o2r.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,o2r.fsPath)(e),n=await h_t.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,hfc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await h_t.promises.lstat(e);if(r.isSymbolicLink())try{let n=await h_t.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=m_t.FileType.Unknown;return e.isFile()&&(o=m_t.FileType.File),e.isDirectory()&&(o=m_t.FileType.Directory),r.isSymbolicLink()&&n&&(o|=m_t.FileType.SymbolicLink),o}};g_t.LocalFileSystem=s2r});var vBi=I(M6=>{"use strict";p();var mfc=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},CBe=M6&&M6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(M6,"__esModule",{value:!0});M6.CompositeRelatedFilesProvider=void 0;var gfc=Tre(),Afc=Fs(),$Ae=RE(),yfc=oy(),Efc=zG(),_fc=Il(),bBe=SAe(),Ane=zyt(),yBi=["cpp","c","cuda-cpp"],EBi=["typescript","javascript","typescriptreact","javascriptreact"],_Bi=["csharp"],vfc=new Map([...yBi.map(t=>[t,bBe.NeighboringFileType.RelatedCpp]),...EBi.map(t=>[t,bBe.NeighboringFileType.RelatedTypeScript]),..._Bi.map(t=>[t,bBe.NeighboringFileType.RelatedCSharpRoslyn])]);function Cfc(t){return vfc.get(t)??bBe.NeighboringFileType.RelatedOther}a(Cfc,"getNeighboringFileType");var a2r=class extends Ane.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(Cfc(s)===bBe.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),Ane.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),Ane.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return Ane.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),Ane.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return Ane.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)Ane.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 _Bi.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction($Ae.getConfig,$Ae.ConfigKey.RelatedFilesVSCodeCSharp):EBi.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction($Ae.getConfig,$Ae.ConfigKey.RelatedFilesVSCodeTypeScript):yBi.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction($Ae.getConfig,$Ae.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};M6.CompositeRelatedFilesProvider=a2r;M6.CompositeRelatedFilesProvider=a2r=mfc([CBe(0,Afc.IInstantiationService),CBe(1,gfc.IIgnoreService),CBe(2,yfc.ICompletionsFeaturesService),CBe(3,_fc.ICompletionsLogTargetService),CBe(4,Efc.ICompletionsFileSystemService)],a2r)});var A_t=I(yne=>{"use strict";p();Object.defineProperty(yne,"__esModule",{value:!0});yne.PositionOffsetTransformer=yne.PositionOffsetTransformerBase=void 0;yne.ensureDependenciesAreSet=Tfc;var CBi=bE(),bBi=r5e(),bfc=rdt(),Sfc=mme(),SBi=rdt();Object.defineProperty(yne,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return SBi.PositionOffsetTransformerBase},"get")});Object.defineProperty(yne,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return SBi.PositionOffsetTransformer},"get")});(0,bfc._setPositionOffsetTransformerDependencies)({StringEdit:CBi.StringEdit,StringReplacement:CBi.StringReplacement,TextReplacement:bBi.TextReplacement,TextEdit:bBi.TextEdit,TextLength:Sfc.TextLength});function Tfc(){}a(Tfc,"ensureDependenciesAreSet")});var E_t=I(y_t=>{"use strict";p();Object.defineProperty(y_t,"__esModule",{value:!0});y_t.RootedLineEdit=void 0;var TBi=xG(),Ifc=A_t(),xfc=XD();(0,Ifc.ensureDependenciesAreSet)();var c2r=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=TBi.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 xfc.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 TBi.LineEdit(r))}};y_t.RootedLineEdit=c2r});var XD=I(O$=>{"use strict";p();Object.defineProperty(O$,"__esModule",{value:!0});O$.Edits=O$.SingleEdits=O$.RootedEdit=void 0;var IBi=zu(),wfc=xG(),VAe=bE(),xBi=u2r(),Rfc=E_t(),SBe=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return wfc.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,IBi.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,IBi.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return Rfc.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)}};O$.RootedEdit=SBe;var l2r=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return VAe.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new __t(VAe.StringEdit,this.edits.map(e=>e.toEdit()))}};O$.SingleEdits=l2r;var __t=class t{static{a(this,"Edits")}static single(e){return new t(VAe.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=VAe.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(VAe.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,xBi.serializeStringEdit)(e))}static deserialize(e){return new t(VAe.StringEdit,e.map(r=>(0,xBi.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=SBe.toLineEdit(new SBe(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` +`],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(` --- -`)}};O$.Edits=__t});var u2r=I(WAe=>{"use strict";p();Object.defineProperty(WAe,"__esModule",{value:!0});WAe.serializeStringEdit=Dfc;WAe.serializeSingleEdit=PBi;WAe.deserializeStringEdit=Nfc;WAe.decomposeStringEdit=Ofc;var Pfc=Is(),RBi=bE(),kfc=dd(),wBi=XD();function Dfc(t){return t.replacements.map(e=>PBi(e))}a(Dfc,"serializeStringEdit");function PBi(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(PBi,"serializeSingleEdit");function Nfc(t){return new RBi.StringEdit(t.map(e=>Mfc(e)))}a(Nfc,"deserializeStringEdit");function Mfc(t){return new RBi.StringReplacement(new kfc.OffsetRange(t[0],t[1]),t[2])}a(Mfc,"deserializeSingleEdit");function Ofc(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 wBi.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,Pfc.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(v_t,"__esModule",{value:!0});v_t.DebugRecorderBookmark=void 0;var d2r=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};v_t.DebugRecorderBookmark=d2r});var MBi=I(C_t=>{"use strict";p();Object.defineProperty(C_t,"__esModule",{value:!0});C_t.DebugRecorder=void 0;var Bfc=u2r(),Lfc=kBi(),Ffc=s4(),Ufc=uMe(),DBi=Al(),NBi=Io(),Qfc=GY(),qfc=l8(),jfc=EA(),Hfc=y0(),Gfc=OT(),f2r=class extends NBi.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=Ufc.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,qfc.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 p2r(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,Ffc.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,NBi.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,Hfc.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,DBi.compareBy)(n=>n.sortTime,DBi.numberComparator)),r.map(n=>n.entry)}createBookmark(){return new Lfc.DebugRecorderBookmark(this.getNow())}};C_t.DebugRecorder=f2r;var p2r=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,jfc.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===Qfc.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new Gfc.StringText(n),this.creationTime=this.getNow(),this._baseValueTime=this.creationTime}handleSelections(e){this._edits.push({kind:"selections",selections:e,instant:this.getNow()})}handleEdit(e){e.isEmpty()||(this._edits.push({kind:"edit",edit:e,instant:this.getNow()}),this.cleanUpHistory())}cleanUpHistory(){let r=this.getNow()-3e5;for(;this._edits.length>0&&this._edits[0].instante.timeMs)break;if(n++,o.kind==="selections"){let s=o.selections.map(c=>[c.start,c.endExclusive]);r.push({entry:{kind:"selectionChanged",id:this.id,selection:s,time:o.instant},sortTime:o.instant})}else r.push({entry:{kind:"changed",id:this.id,v:n,edit:(0,Bfc.serializeStringEdit)(o.edit),time:o.instant},sortTime:o.instant})}return r}}});var OBi=I(b_t=>{"use strict";p();Object.defineProperty(b_t,"__esModule",{value:!0});b_t.CapturingToken=void 0;var h2r=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}};b_t.CapturingToken=h2r});var BBi=I(m2r=>{"use strict";p();Object.defineProperty(m2r,"__esModule",{value:!0});m2r.secondsToHumanReadableTime=$fc;function $fc(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($fc,"secondsToHumanReadableTime")});var FR=I(Wd=>{"use strict";p();var Vfc=Wd&&Wd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wfc=Wd&&Wd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zfc=Wd&&Wd.__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(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(oB,"__esModule",{value:!0});oB.PendingLoggedChatRequest=oB.IRequestLogger=oB.ChatRequestScheme=void 0;oB.resolveMarkdownContent=rpc;oB.resolveMarkdownIcon=npc;var qBi=FR(),epc=rn(),tpc=dd(),g2r=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 tpc.OffsetRange(n.index,n.index+o.length)}})}};oB.ChatRequestScheme=g2r;oB.IRequestLogger=(0,epc.createServiceIdentifier)("IRequestLogger");function rpc(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(rpc,"resolveMarkdownContent");function npc(t){return typeof t.icon=="function"?t.icon():t.icon}a(npc,"resolveMarkdownIcon");var A2r=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})}},y2r=class extends A2r{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===qBi.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===qBi.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})}};oB.PendingLoggedChatRequest=y2r});var _2r=I(YAe=>{"use strict";p();Object.defineProperty(YAe,"__esModule",{value:!0});YAe.NullSnippyService=YAe.ISnippyService=void 0;var ipc=rn();YAe.ISnippyService=(0,ipc.createServiceIdentifier)("ISnippyService");var E2r=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};YAe.NullSnippyService=E2r});var b2r=I(KAe=>{"use strict";p();Object.defineProperty(KAe,"__esModule",{value:!0});KAe.MovedText=KAe.LinesDiff=void 0;var v2r=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};KAe.LinesDiff=v2r;var C2r=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()))}};KAe.MovedText=C2r});var I_t=I(tN=>{"use strict";p();Object.defineProperty(tN,"__esModule",{value:!0});tN.RangeMapping=tN.DetailedLineRangeMapping=tN.LineRangeMapping=void 0;tN.lineRangeMappingFromRangeMappings=spc;tN.getLineRangeMapping=$Bi;tN.lineRangeMappingFromChange=apc;var opc=Al(),jBi=zu(),T_t=Is(),u1=Q2(),eN=O_(),sB=zp(),GBi=r5e(),TBe=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 u1.LineRange(s,u.original.startLineNumber),new u1.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new u1.LineRange(s,r+1),new u1.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 O6(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new T_t.BugIndicatingError("not a valid diff");return new O6(new sB.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new sB.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new O6(new sB.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new sB.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(HBi(this.original.endLineNumberExclusive,e)&&HBi(this.modified.endLineNumberExclusive,r))return new O6(new sB.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new sB.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new O6(sB.Range.fromPositions(new eN.Position(this.original.startLineNumber,1),JAe(new eN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),sB.Range.fromPositions(new eN.Position(this.modified.startLineNumber,1),JAe(new eN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new O6(sB.Range.fromPositions(JAe(new eN.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),JAe(new eN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),sB.Range.fromPositions(JAe(new eN.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),JAe(new eN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new T_t.BugIndicatingError}};tN.LineRangeMapping=TBe;function JAe(t,e){if(t.lineNumber<1)return new eN.Position(1,1);if(t.lineNumber>e.length)return new eN.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new eN.Position(t.lineNumber,r.length+1):t}a(JAe,"normalizePosition");function HBi(t,e){return t>=1&&t<=e.length}a(HBi,"isValidLineNumber");var IBe=class t extends TBe{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 GBi.TextEdit(n)}static fromRangeMappings(e){let r=u1.LineRange.join(e.map(o=>u1.LineRange.fromRangeInclusive(o.originalRange))),n=u1.LineRange.join(e.map(o=>u1.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()])}};tN.DetailedLineRangeMapping=IBe;var O6=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 T_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 GBi.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};tN.RangeMapping=O6;function spc(t,e,r,n=!1){let o=[];for(let s of(0,opc.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 IBe(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,jBi.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,jBi.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 u1.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new u1.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new IBe(s,c,[t])}a($Bi,"getLineRangeMapping");function apc(t){let e;t.originalEndLineNumber===0?e=new u1.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new u1.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new u1.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new u1.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new TBe(e,r)}a(apc,"lineRangeMappingFromChange")});var XAe=I(UR=>{"use strict";p();Object.defineProperty(UR,"__esModule",{value:!0});UR.DateTimeout=UR.InfiniteTimeout=UR.OffsetPair=UR.SequenceDiff=UR.DiffAlgorithmResult=void 0;var cpc=Al(),VBi=Is(),ZAe=dd(),S2r=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new xBe(ZAe.OffsetRange.ofLength(e.length),ZAe.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new xBe(ZAe.OffsetRange.ofLength(e.length),ZAe.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};UR.DiffAlgorithmResult=S2r;var xBe=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,cpc.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():Ene.zero,s?s.getStarts():new Ene(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new ZAe.OffsetRange(e.offset1,r.offset1),new ZAe.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 Ene(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Ene(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};UR.SequenceDiff=xBe;var Ene=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}};UR.OffsetPair=Ene;var T2r=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};UR.InfiniteTimeout=T2r;var I2r=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}};UR.DateTimeout=I2r});var x_t=I(_ne=>{"use strict";p();Object.defineProperty(_ne,"__esModule",{value:!0});_ne.LineRangeFragment=_ne.Array2D=void 0;_ne.isSpace=lpc;var x2r=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}};_ne.Array2D=x2r;function lpc(t){return t===32||t===9}a(lpc,"isSpace");var w2r=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(w_t,"__esModule",{value:!0});w_t.DynamicProgrammingDiffing=void 0;var WBi=dd(),wBe=XAe(),R2r=x_t(),P2r=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=wBe.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return wBe.DiffAlgorithmResult.trivial(e,r);let s=new R2r.Array2D(e.length,r.length),c=new R2r.Array2D(e.length,r.length),l=new R2r.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 wBe.SequenceDiff(new WBi.OffsetRange(A+1,d),new WBi.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 wBe.DiffAlgorithmResult(u,!1)}};w_t.DynamicProgrammingDiffing=P2r});var M2r=I(P_t=>{"use strict";p();Object.defineProperty(P_t,"__esModule",{value:!0});P_t.MyersDiffAlgorithm=void 0;var YBi=dd(),RBe=XAe(),k2r=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=RBe.InfiniteTimeout.instance){if(e.length===0||r.length===0)return RBe.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 R_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 RBe.SequenceDiff(new YBi.OffsetRange(y,g),new YBi.OffsetRange(E,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new RBe.DiffAlgorithmResult(m,!1)}};P_t.MyersDiffAlgorithm=k2r;var R_t=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},D2r=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}}},N2r=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 L2r=I(D_t=>{"use strict";p();Object.defineProperty(D_t,"__esModule",{value:!0});D_t.LinesSliceCharSequence=void 0;var O2r=aQ(),k_t=dd(),upc=O_(),KBi=zp(),dpc=x_t(),B2r=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=XBi(e>0?this.elements[e-1]:-1),n=XBi(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new upc.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)?KBi.Range.fromPositions(n,n):KBi.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!eye(this.elements[e]))return;let r=e;for(;r>0&&eye(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!eye(this.elements[e]))return;let r=e;for(;r>0&&eye(this.elements[r-1])&&!JBi(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,O2r.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new k_t.OffsetRange(r,n)}};D_t.LinesSliceCharSequence=B2r;function eye(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(eye,"isWordChar");function JBi(t){return t>=65&&t<=90}a(JBi,"isUpperCase");var fpc={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function ZBi(t){return fpc[t]}a(ZBi,"getCategoryBoundaryScore");function XBi(t){return t===10?8:t===13?7:(0,dpc.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(XBi,"getCategory")});var nLi=I(F2r=>{"use strict";p();Object.defineProperty(F2r,"__esModule",{value:!0});F2r.computeMovedLines=gpc;var ppc=XAe(),N_t=I_t(),aB=Al(),PBe=aQ(),hpc=bk(),d1=Q2(),eLi=L2r(),M_t=x_t(),mpc=M2r(),tLi=zp();function gpc(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=ypc(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=Epc(u,n,o,e,r,s);return(0,aB.pushMany)(c,d),c=_pc(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` -`).length>=15&&Apc(h,g=>g.length>=2)>=2}),c=vpc(t,c),c}a(gpc,"computeMovedLines");function Apc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(Apc,"countWhere");function ypc(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new M_t.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new M_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 N_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(ypc,"computeMovesFromSimpleDeletionsToSimpleInsertions");function Epc(t,e,r,n,o,s){let c=[],l=new hpc.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,aB.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 d1.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new d1.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,aB.reverseOrder)((0,aB.compareBy)(m=>m.modifiedLineRange.length,aB.numberComparator)));let d=new d1.LineRangeSet,f=new d1.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 N_t.LineRangeMapping(b,v)),d.addRange(v),f.addRange(b)}}c.sort((0,aB.compareBy)(m=>m.original.startLineNumber,aB.numberComparator));let h=new PBe.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,PBe.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)||!rLi(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new d1.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new d1.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!rLi(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new d1.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new d1.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new N_t.LineRangeMapping(new d1.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new d1.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(Epc,"computeUnchangedMoves");function rLi(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new mpc.MyersDiffAlgorithm().compute(new eLi.LinesSliceCharSequence([t],new tLi.Range(1,1,1,t.length),!1),new eLi.LinesSliceCharSequence([e],new tLi.Range(1,1,1,e.length),!1),r),s=0,c=ppc.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,M_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(rLi,"areLinesSimilar");function _pc(t){if(t.length===0)return t;t.sort((0,aB.compareBy)(r=>r.original.startLineNumber,aB.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(_pc,"joinCloseConsecutiveMoves");function vpc(t,e){let r=new PBe.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(vne,"__esModule",{value:!0});vne.optimizeSequenceDiffs=bpc;vne.removeShortMatches=Tpc;vne.extendDiffsToEntireWordIfAppropriate=Ipc;vne.removeVeryShortMatchingLinesBetweenDiffs=wpc;vne.removeVeryShortMatchingTextBetweenLongDiffs=Rpc;var Cpc=Al(),cB=dd(),lB=XAe();function bpc(t,e,r){let n=r;return n=iLi(t,e,n),n=iLi(t,e,n),n=Spc(t,e,n),n}a(bpc,"optimizeSequenceDiffs");function iLi(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(iLi,"joinSequenceDiffsByShifting");function Spc(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(oLi,"shiftDiffToBetterPosition");function Tpc(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 lB.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(Tpc,"removeShortMatches");function Ipc(t,e,r,n,o=!1){let s=lB.SequenceDiff.invert(r,t.length),c=[],l=new lB.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 lB.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 xpc(r,c)}a(Ipc,"extendDiffsToEntireWordIfAppropriate");function xpc(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(xpc,"mergeSequenceDiffs");function wpc(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(wpc,"removeVeryShortMatchingLinesBetweenDiffs");function Rpc(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let l=[n[0]];for(let u=1;u5||y.length>500)return!1;let _=t.getText(y).trim();if(_.length>20||_.split(/\r\n|\r|\n/).length>1)return!1;let v=t.countLinesIn(g.seq1Range),b=g.seq1Range.length,T=e.countLinesIn(g.seq2Range),w=g.seq2Range.length,R=t.countLinesIn(A.seq1Range),x=A.seq1Range.length,P=e.countLinesIn(A.seq2Range),D=A.seq2Range.length,N=130;function B(L){return Math.min(L,N)}return a(B,"cap"),Math.pow(Math.pow(B(v*40+b),1.5)+Math.pow(B(T*40+w),1.5),1.5)+Math.pow(Math.pow(B(R*40+x),1.5)+Math.pow(B(P*40+D),1.5),1.5)>(N**1.5)**1.5*1.3};a(h,"shouldJoinDiffs");let d=n[u],f=l[l.length-1];h(f,d)?(s=!0,l[l.length-1]=l[l.length-1].join(d)):l.push(d)}n=l}while(o++<10&&s);let c=[];return(0,Cpc.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 cB.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new cB.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=lB.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():lB.OffsetPair.zero,d?d.getStarts():lB.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(Rpc,"removeVeryShortMatchingTextBetweenLongDiffs")});var cLi=I(O_t=>{"use strict";p();Object.defineProperty(O_t,"__esModule",{value:!0});O_t.LineSequence=void 0;var U2r=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:aLi(this.lines[e-1]),n=e===this.lines.length?0:aLi(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]}};O_t.LineSequence=U2r;function aLi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(U_t,"__esModule",{value:!0});U_t.DefaultLinesDiffComputer=void 0;var Ppc=Al(),lLi=zu(),F_t=Q2(),uLi=dd(),dLi=zp(),B_t=OT(),L_t=b2r(),bne=I_t(),uB=XAe(),kpc=zBi(),Dpc=M2r(),Npc=nLi(),Cne=sLi(),fLi=cLi(),pLi=L2r(),Q2r=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new kpc.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new Dpc.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,Ppc.equals)(e,r,(x,P)=>x===P))return new L_t.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new L_t.LinesDiff([new bne.DetailedLineRangeMapping(new F_t.LineRange(1,e.length+1),new F_t.LineRange(1,r.length+1),[new bne.RangeMapping(new dLi.Range(1,1,e.length,e[e.length-1].length+1),new dLi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?uB.InfiniteTimeout.instance:new uB.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 fLi.LineSequence(u,e),h=new fLi.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,Cne.optimizeSequenceDiffs)(f,h,g),g=(0,Cne.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 B_t.ArrayText(e),T=new B_t.ArrayText(r),w=(0,bne.lineRangeMappingFromRangeMappings)(y,b,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,lLi.assertFn)(()=>{function x(D,N){if(D.lineNumber<1||D.lineNumber>N.length)return!1;let B=N[D.lineNumber-1];return!(D.column<1||D.column>B.length+1)}a(x,"validatePosition");function P(D,N){return!(D.startLineNumber<1||D.startLineNumber>N.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>N.length+1)}a(P,"validateRange");for(let D of w){if(!D.innerChanges)return!1;for(let N of D.innerChanges)if(!(x(N.modifiedRange.getStartPosition(),r)&&x(N.modifiedRange.getEndPosition(),r)&&x(N.originalRange.getStartPosition(),e)&&x(N.originalRange.getEndPosition(),e)))return!1;if(!P(D.modified,r)||!P(D.original,e))return!1}return!0}),new L_t.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,Npc.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new uB.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,bne.lineRangeMappingFromRangeMappings)(m.mappings,new B_t.ArrayText(r),new B_t.ArrayText(n),!0);return new L_t.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=Mpc(n).toRangeMapping2(e,r),d=new pLi.LinesSliceCharSequence(e,u.originalRange,s),f=new pLi.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&&uB.SequenceDiff.assertSorted(g),g=(0,Cne.optimizeSequenceDiffs)(d,f,g),m&&uB.SequenceDiff.assertSorted(g),g=(0,Cne.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findWordContaining(E)),m&&uB.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,Cne.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findSubWordContaining(E),!0),m&&uB.SequenceDiff.assertSorted(g)),g=(0,Cne.removeShortMatches)(d,f,g),m&&uB.SequenceDiff.assertSorted(g),g=(0,Cne.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&uB.SequenceDiff.assertSorted(g);let A=g.map(y=>new bne.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&bne.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};U_t.DefaultLinesDiffComputer=Q2r;function Mpc(t){return new bne.LineRangeMapping(new F_t.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new F_t.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(Mpc,"toLineRangeMapping")});var j2r=I(Rv=>{"use strict";p();Object.defineProperty(Rv,"__esModule",{value:!0});Rv.EditDataWithIndex=Rv.maxImperfectAgreementLength=Rv.maxAgreementOffset=void 0;Rv.tryRebase=Upc;Rv.checkEditConsistency=mLi;Rv.tryRebaseStringEdits=qpc;var Opc=XD(),Bpc=$_(),UE=bE(),tye=dd(),hLi=OT(),Lpc=q2r(),Fpc=!1;Rv.maxAgreementOffset=10;Rv.maxImperfectAgreementLength=5;var Q_t=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};Rv.EditDataWithIndex=Q_t;function Upc(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:Rv.maxImperfectAgreementLength}){let f=Date.now();try{return Qpc(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${Bpc.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(Upc,"tryRebase");function Qpc(t,e,r,n,o,s,c,l,u,d){if(!mLi(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.lengthUE.AnnotatedStringEdit.create(E))),g=gLi(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=UE.StringReplacement.replace(v,b);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:E})}return l==="strict"&&y.length>0&&new Opc.SingleEdits(r).apply(t)!==UE.StringEdit.create(y.map(E=>E.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(Qpc,"_tryRebase");function mLi(t,e,r,n,o=Fpc){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(mLi,"checkEditConsistency");function qpc(t,e,r,n,o={maxImperfectAgreementLength:Rv.maxImperfectAgreementLength}){return gLi(t,e.mapData(s=>new UE.VoidEditData),r,n,o)?.toStringEdit()}a(qpc,"tryRebaseStringEdits");function gLi(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 UE.AnnotatedStringReplacement(tye.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=$pc(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 UE.AnnotatedStringReplacement(new tye.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(;uRv.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 UE.AnnotatedStringReplacement(tye.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 Gpc(t){return Hpc.has(t)}a(Gpc,"isAutoClosePair");function $pc(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uRv.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&Gpc(l)&&jpc(l,e.newText.substring(o))?o:-1}a($pc,"agreementIndexOf");function Vpc(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new Lpc.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new hLi.StringText(t),f=new hLi.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 UE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(Vpc,"computeDiff")});var yLi=I(q_t=>{"use strict";p();Object.defineProperty(q_t,"__esModule",{value:!0});q_t.RejectionCollector=void 0;var Wpc=s4(),ALi=Io(),zpc=j2(),H2r=class extends ALi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new V2r(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,zpc.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new G2r(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,Wpc.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,ALi.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()}};q_t.RejectionCollector=H2r;var G2r=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 $2r(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}},$2r=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()}},V2r=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 ELi=I(H_t=>{"use strict";p();Object.defineProperty(H_t,"__esModule",{value:!0});H_t.RebaseFailureInfo=void 0;var Ypc=bE(),W2r=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 Ypc.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 = ${j_t(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${j_t(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}), ${j_t(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${j_t(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(` -`)}};H_t.RebaseFailureInfo=W2r;function j_t(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a(j_t,"toBacktickLiteral")});var vLi=I($_t=>{"use strict";p();Object.defineProperty($_t,"__esModule",{value:!0});$_t.NextEditCache=void 0;var kBe=Tl(),Kpc=s4(),Jpc=l9t(),_Li=Io(),Zpc=l8(),G_t=j2r(),Xpc=ELi(),z2r=class extends _Li.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 Jpc.LRUCache(50),(0,Zpc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new Y2r(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,Kpc.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(kBe.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,_Li.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(kBe.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(kBe.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(kBe.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(kBe.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()}};$_t.NextEditCache=z2r;var Y2r=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,G_t.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,G_t.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,G_t.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 Xpc.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,G_t.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 CLi=I(V_t=>{"use strict";p();Object.defineProperty(V_t,"__esModule",{value:!0});V_t.NextEditResult=void 0;var K2r=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};V_t.NextEditResult=K2r});var bLi=I(W_t=>{"use strict";p();Object.defineProperty(W_t,"__esModule",{value:!0});W_t.SpeculativeRequestManager=void 0;var ehc=Io(),J2r=class extends ehc.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 thc=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},DBe=rI&&rI.__param||function(t,e){return function(r,n){e(r,n,t)}},Z2r;Object.defineProperty(rI,"__esModule",{value:!0});rI.NextEditFetchRequest=rI.NextEditProvider=rI.NesOutcome=void 0;var rhc=require("path"),Pv=Tl(),rye=XD(),OBe=E_t(),NBe=sy(),nhc=ept(),kf=jAe(),ihc=s4(),X2r=Ep(),ohc=OBi(),shc=zAe(),ahc=_2r(),chc=Cp(),MBe=$_(),Wg=cw(),SLi=zu(),z_t=Yc(),lhc=nWe(),rDr=Is(),Y_t=Io(),TLi=j2(),ILi=iO(),uhc=SS(),kLi=y0(),xLi=xG(),Sne=bE(),dhc=O_(),eDr=dd(),wLi=OT(),fhc=j2r(),phc=yLi(),hhc=vLi(),K_t=CLi(),mhc=bLi();function ghc(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 eDr.OffsetRange(Math.min(u,c),Math.max(f,l))}a(ghc,"computeReducedWindow");function RLi(t,e){let n=new OBe.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r -`)?new Sne.StringEdit(n.replacements.map(o=>new Sne.StringReplacement(o.replaceRange,o.newText.replace(/\n/g,`\r -`)))):n}a(RLi,"convertLineEditToEdit");function PLi(t,e){return new lhc.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:Sne.StringEdit.empty,nextEdits:[],docId:n}}}throw new rDr.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:Sne.StringEdit.empty,nextEdits:[],docId:n}})}a(PLi,"createDocStateLookupMap");var BBe;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(BBe||(rI.NesOutcome=BBe={}));var tDr=Z2r=class extends Y_t.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 phc.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 hhc.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new mhc.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,TLi.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,TLi.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,Y_t.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(Pv.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 ILi.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(X2r.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(MBe.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 rDr.BugIndicatingError(`Document "${e.baseName}" not found`);let h=f.value.get(),m=f.selection.get(),g=this.determineNesConfigs(u,c),A=this._nextEditCache.lookupNextEdit(e,h,m);if(A?.rejected){d.trace("cached edit was previously rejected"),u.setStatus("previouslyRejectedCache"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected();let B=A.rebasedEdit??A.edit;return B&&this._rejectionCollector.reject(e,B),new K_t.NextEditResult(c.requestId,A.source,void 0)}let y,E,_,v,b=e,T=!1,w=!1,R=!1,x;if(A){d.trace("using cached edit");let B=A.rebasedEdit||A.edit;B&&(y={actualEdit:B,isFromCursorJump:A.isFromCursorJump}),T=!!A.rebasedEdit,w=A.subsequentN!==void 0&&A.subsequentN>0,R=A.source.isSpeculative,v=A.source,c.setIsCachedResult(A.source.log),E=h,u.setHeaderRequestId(v.headerRequestId),u.setIsFromCache(),u.setSubsequentEditOrder(A.rebasedEditIndex??A.subsequentN),c.recordingBookmark=v.log.recordingBookmark,x=A.baseCacheEntry??A}else{d.trace(`fetching next edit with shouldExpandEditWindow=${o}`);let B=this._configService.getExperimentBasedConfig(Pv.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new LBe(r.requestUuid,c,B,!1),u.setHeaderRequestId(v.headerRequestId);let L=f.value.get();d.trace("awaiting firstEdit promise");let j=await this.fetchNextEdit(v,f,g,o,d,u,l);d.trace("resolved firstEdit promise");let M=`First edit latency: ${Date.now()-this._lastTriggerTime} ms`;if(c.addLog(M),d.trace(M),j.isError())d.trace(`failed to fetch next edit ${j.err.toString()}`),u.setStatus(`noEdit:${j.err.kind}`),_=j.err;else if(b=j.val.docId??b,E=(b?this._workspace.getDocument(b):f).value.get(),b===f.id&&L.value!==E.value)d.trace("document changed while fetching next edit"),u.setStatus("docChanged"),c.setIsSkipped();else{let Q=j.val.rebasedEdit||j.val.edit;Q?(d.trace("fetch succeeded"),c.setResponseResults([Q]),y={actualEdit:Q,isFromCursorJump:j.val.isFromCursorJump},R=j.val.isFromSpeculativeRequest??!1,x=j.val.baseCacheEntry??j.val):(d.trace("empty edits"),u.setStatus("emptyEdits"))}}if(_ instanceof kf.NoNextEditReason.FetchFailure||_ instanceof kf.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${_.error}`),_.error;if(_ instanceof kf.NoNextEditReason.NoSuggestions)if(_.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new K_t.NextEditResult(c.requestId,v,{jumpToPosition:_.nextCursorPosition,targetDocumentId:_.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else _ instanceof kf.NoNextEditReason.GotCancelled&&c.setIsSkipped();let P=new K_t.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(OBe.RootedLineEdit.fromEdit(new rye.RootedEdit(h,new Sne.StringEdit([y.actualEdit])))),(0,SLi.assert)(E!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new K_t.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,z_t.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(Pv.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService),isEagerBackupRequest:this._configService.getExperimentBasedConfig(Pv.ConfigKey.TeamInternal.InlineEditsEagerBackupRequest,this._expService)};return e.setNESConfigs({...n}),r.addCodeblockToLog(JSON.stringify(n,null," ")),n}_processDoc(e){let r=e.lastEdit.base.getLines(),n=e.lastEdits,o=OBe.RootedLineEdit.fromEdit(new rye.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new kf.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 Wg.Result.error(new kf.NoNextEditReason.Unexpected(new Error("DocumentMissingInHistoryContext")));let h=r.value.get(),m=r.selection.get(),g=e.log;g.setRecentEdit(f);let A=m.at(0),y=a(N=>!N.requestEditWindow||!A||N.requestEditWindow.containsCursor(A),"cursorInRequestEditWindow"),E=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value,_=!this._pendingStatelessNextEditRequest||y(this._pendingStatelessNextEditRequest),v=(E||n.isAsyncCompletions)&&_&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0,b=this._specManager.pending,T=b?.docId===u&&b?.postEditContent===h.value&&!b.request.cancellationTokenSource.token.isCancellationRequested&&y(b.request),w=T?b?.request:void 0,R=w??v;if(R){w?(d.trace(`reusing speculative pending request (opportunityId=${w.opportunityId}, headerRequestId=${w.headerRequestId})`),this._specManager.consumePending()):d.trace(`reusing in-flight pending request (opportunityId=${R.opportunityId}, headerRequestId=${R.headerRequestId})`);let N=w?T:E,B=w?"speculative":"async";if(N){let L=await this._joinNextEditRequest(R,B,c,g,l);return c.setStatelessNextEditTelemetry(L.telemetry),w?(await R.firstEdit.p).map(M=>({...M,isFromSpeculativeRequest:!0})):L.nextEdit.isError()?L.nextEdit:R.firstEdit.p}else if(n.isEagerBackupRequest){d.trace("starting eager backup request in parallel with rebase attempt"),this._pendingStatelessNextEditRequest=null;let L=this._executeNewNextEditRequest(e,r,f,n,o,d,c,l),j=a(()=>{L.then(Q=>Q.nextEditRequest.cancellationTokenSource.cancel()).catch(()=>{})},"cancelBackupRequest"),M=await this._joinNextEditRequest(R,B,c,g,l),O=await R.firstEdit.p;if(O.isOk()&&O.val.edit){let Q=this._nextEditCache.tryRebaseCacheEntry(O.val,h,m);if(Q.edit)return d.trace("rebase succeeded, cancelling eager backup request"),j(),c.setStatelessNextEditTelemetry(M.telemetry),Wg.Result.ok(Q.edit);this._logRebaseFailure(Q.failureInfo,g)}if(l.isCancellationRequested)return d.trace("cancelled after rebase failed (eager backup path)"),j(),c.setStatelessNextEditTelemetry(M.telemetry),Wg.Result.error(new kf.NoNextEditReason.GotCancelled("afterFailedRebase"));d.trace("rebase failed, using eager backup request");let q=await L;return c.setStatelessNextEditTelemetry(q.nextEditResult.telemetry),q.nextEditResult.nextEdit.isError()?q.nextEditResult.nextEdit:q.nextEditRequest.firstEdit.p}else{let L=await this._joinNextEditRequest(R,B,c,g,l),j=await R.firstEdit.p;if(j.isOk()&&j.val.edit){let q=this._nextEditCache.tryRebaseCacheEntry(j.val,h,m);if(q.edit)return c.setStatelessNextEditTelemetry(L.telemetry),Wg.Result.ok(q.edit);this._logRebaseFailure(q.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(L.telemetry),Wg.Result.error(new kf.NoNextEditReason.GotCancelled("afterFailedRebase"));let O=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0;if(O){d.trace("reusing 2nd existing next edit request after rebase failed");let q=await this._joinNextEditRequest(O,"async",c,g,l);return c.setStatelessNextEditTelemetry(q.telemetry),q.nextEdit.isError()?q.nextEdit:O.firstEdit.p}d.trace("creating new next edit request after rebase failed")}}let x=await this._executeNewNextEditRequest(e,r,f,n,o,d,c,l),P=x.nextEditRequest,D=x.nextEditResult;return c.setStatelessNextEditTelemetry(D.telemetry),D.nextEdit.isError()?D.nextEdit:P.firstEdit.p}async _joinNextEditRequest(e,r,n,o,s){n.setHeaderRequestId(e.headerRequestId),n.setReusedRequest(r),n.setRequest(e),o.setRequestInput(e),o.setIsReusedInFlightResult(e.logContext);let c=this._hookupCancellation(e,s);try{return await e.result}finally{c.dispose()}}_logRebaseFailure(e,r){e&&r.setRebaseFailure(e)}async _executeNewNextEditRequest(e,r,n,o,s,c,l,u){let d=r.id,f=c.createSubLogger("_executeNewNextEditRequest"),h=this._debugRecorder?.getRecentLog(),m=e.log,g=Ahc(n.getDocumentAndIdx(d)),A=r.selection.get()[0],y=n.documents.map(L=>this._processDoc(L)),E=this._xtabHistoryTracker.getHistory(),_=new z_t.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(Pv.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,b=new kf.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(L=>L.nextEditDoc),g.idx,E,_,v,!1,m,e.log.recordingBookmark,h,e.providerRequestStartDateTime),T;this._pendingStatelessNextEditRequest&&(this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel(),this._pendingStatelessNextEditRequest=null,this._specManager.clearScheduled()),this._specManager.cancelIfMismatch(d,b.documentBeforeEdits.value,"superseded"),this._pendingStatelessNextEditRequest=b;let w=a(()=>{this._pendingStatelessNextEditRequest===b&&(this._pendingStatelessNextEditRequest=null)},"removeFromPending");l.setRequest(b),l.setStatus("requested"),m.setRequestInput(b);let R=this._hookupCancellation(b,u,o.isAsyncCompletions?(0,ihc.autorunWithChanges)(this,{value:r.value},L=>{L.value.changes.forEach(j=>{b.intermediateUserEdit&&!j.isEmpty()&&(b.intermediateUserEdit=b.intermediateUserEdit.compose(j),(0,fhc.checkEditConsistency)(b.documentBeforeEdits.value,b.intermediateUserEdit,L.value.value.value,f)||(b.intermediateUserEdit=void 0))})}):void 0),x=PLi(y,E),P=this._statelessNextEditProvider.provideNextEdit(b,f,m,b.cancellationTokenSource.token),D=-1,N=a((L,j)=>{++D;let M=f.createSubLogger("processEdit");M.trace(`processing edit #${D} (starts at 0)`),M.trace("resetting shouldExpandEditWindow to false due to receiving an edit"),this._shouldExpandEditWindow=!1;let O=x.get(L.targetDocument??d),q=L.edit,Q=new xLi.LineEdit([q]),z=RLi(Q,O.baseDocState).tryRebase(O.editsSoFar);if(z===void 0){M.trace(`edit ${D} is undefined after rebasing`),_.isSettled||_.complete(Wg.Result.error(new kf.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}O.editsSoFar=O.editsSoFar.compose(z);let $;if(z.replacements.length===0)M.trace(`WARNING: ${D} has no edits`);else if(z.replacements.length>1)M.trace(`WARNING: ${D} has ${z.replacements.length} edits, but expected only 1`);else{let W=z.replacements[0];O.nextEdits.push(W),$=this._nextEditCache.setKthNextEdit(O.docId,O.docContents,D===0?L.window:void 0,W,D,D===0?O.nextEdits:void 0,D===0?b.intermediateUserEdit:void 0,e,{isFromCursorJump:L.isFromCursorJump,originalEditWindow:L.originalWindow,cursorOffset:O.docId===d?A?.start:void 0}),M.trace(`populated cache for ${D}`)}return _.isSettled||(M.trace("resolving firstEdit promise"),m.setResult(new OBe.RootedLineEdit(O.docContents,Q)),_.complete($?Wg.Result.ok($):Wg.Result.error(new kf.NoNextEditReason.Unexpected(new Error("No cached edit"))))),O.docContents=z.applyOnText(O.docContents),$},"processEdit"),B=a((L,j)=>{let M=f.createSubLogger("streamEnd");if(D===-1&&L instanceof kf.NoNextEditReason.NoSuggestions&&(M.trace("resetting shouldExpandEditWindow to false due to NoSuggestions"),this._shouldExpandEditWindow=!1),x.get(d).nextEdits.length)M.trace(`${x.get(d).nextEdits.length} edits returned`);else if(M.trace(`no edit, reason: ${L.kind}`),L instanceof kf.NoNextEditReason.NoSuggestions){let{documentBeforeEdits:z,window:$}=L,W=$?ghc($,A,z):void 0;this._nextEditCache.setNoNextEdit(d,z,W,e)}_.isSettled||_.complete(Wg.Result.error(L));let q=x.get(d).nextEdits.length>0?Wg.Result.ok(void 0):Wg.Result.error(L),Q=new kf.StatelessNextEditResult(q,j);b.setResult(Q),R.dispose(),w();let U=this._specManager.consumeScheduled(b.headerRequestId);return U&&this._triggerSpeculativeRequest(U.suggestion),Q},"handleStreamEnd");try{let L=await P.next();if(L.done){let j=L.value.v;T=B(j,L.value.telemetryBuilder)}else{let j=L.value.v,M=L.value.telemetryBuilder;N(j,M),(async()=>{try{for(L=await P.next();!L.done;){let q=L.value.v;N(q,L.value.telemetryBuilder),this._specManager.consumeScheduled(b.headerRequestId),L=await P.next()}let O=L.value.v;B(O,L.value.telemetryBuilder)}catch(O){f.trace(`Error while streaming further edits: ${MBe.ErrorUtils.toString(O)}`);let q=new kf.NoNextEditReason.Unexpected(MBe.ErrorUtils.fromUnknown(O));B(q,M)}})(),T=new kf.StatelessNextEditResult(Wg.Result.ok(void 0),M)}}catch(L){throw b.setResultError(L),L}return{nextEditRequest:b,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new Y_t.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new z_t.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,Y_t.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(Pv.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(Pv.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(Pv.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(Pv.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(Pv.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===NBe.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 nhc.InlineEditRequestLogContext(n.uri,0,void 0),s=new ILi.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(X2r.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 eDr.OffsetRange(d,d),h=[f],m=new rye.RootedEdit(r.documentBeforeEdits,new Sne.StringEdit([r.edit])),g=new wLi.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(Pv.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===NBe.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=Z2r.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 LBe(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,kLi.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: ${MBe.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 wLi.StringText(s),_=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let B=this._workspace.getWorkspaceRoot(h),L=new Sne.StringEdit([l]),j=OBe.RootedLineEdit.fromEdit(new rye.RootedEdit(r.value.get(),L)).removeCommonSuffixPrefixLines().edit,M=new kf.StatelessNextEditDocument(h,B,N.languageId,r.value.get().getLines(),j,r.value.get(),rye.Edits.single(L),n);return{recentEdit:new rye.RootedEdit(r.value.get(),L),nextEditDoc:M,documentAfterEdits:E}}}),v=this._xtabHistoryTracker.getHistory(),b={kind:"edit",docId:h,edit:c};v.push(b);let T=new z_t.DeferredPromise,w=this._configService.getExperimentBasedConfig(Pv.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case NBe.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case NBe.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(Pv.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case NBe.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(Pv.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,SLi.assertNever)(w)}let x=new kf.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,rhc.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new ohc.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=PLi(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(Wg.Result.error(g.value.v)),e.setResult(new kf.StatelessNextEditResult(Wg.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 xLi.LineEdit([E]),b=RLi(_,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(Wg.Result.ok(w)),e.setResult(new kf.StatelessNextEditResult(Wg.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(Wg.Result.error(new kf.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new kf.StatelessNextEditResult(Wg.Result.error(new kf.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: ${MBe.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=BBe.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=BBe.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")}};rI.NextEditProvider=tDr;rI.NextEditProvider=tDr=Z2r=thc([DBe(5,Pv.IConfigurationService),DBe(6,ahc.ISnippyService),DBe(7,X2r.ILogService),DBe(8,chc.IExperimentationService),DBe(9,shc.IRequestLogger)],tDr);function Ahc(t){if(!t)throw new rDr.BugIndicatingError("expected value to be defined, but it was not");return t}a(Ahc,"assertDefined");var LBe=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,kLi.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};rI.NextEditFetchRequest=LBe});var qLi=I(mh=>{"use strict";p();Object.defineProperty(mh,"__esModule",{value:!0});mh.GLOB_SPLIT=mh.GLOBSTAR=void 0;mh.getEmptyExpression=Chc;mh.splitGlobAware=oDr;mh.isEmptyPattern=Phc;mh.match=Ohc;mh.parse=FLi;mh.isRelativePattern=ULi;mh.getBasenameTerms=Bhc;mh.getPathTerms=Lhc;mh.patternsEquals=Qhc;var yhc=Al(),iDr=Yc(),Ehc=j9t(),_hc=bk(),B$=EA(),vhc=bQ(),FBe=Qh();function Chc(){return Object.create(null)}a(Chc,"getEmptyExpression");mh.GLOBSTAR="**";mh.GLOB_SPLIT="/";var J_t="[/\\\\]",Z_t="[^/\\\\]",bhc=/\//g;function NLi(t,e){switch(t){case 0:return"";case 1:return`${Z_t}*?`;default:return`(?:${J_t}|${Z_t}+${J_t}${e?`|${J_t}${Z_t}+`:""})*?`}}a(NLi,"starsToRegExp");function oDr(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(oDr,"splitGlobAware");function LLi(t){if(!t)return"";let e="",r=oDr(t,mh.GLOB_SPLIT);if(r.every(n=>n===mh.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===mh.GLOBSTAR){if(n)return;e+=NLi(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===mh.GLOB_SPLIT?h="":h=(0,FBe.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${oDr(l,",").map(g=>LLi(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=Z_t;continue;case"*":e+=NLi(1);continue;default:e+=(0,FBe.escapeRegExpCharacters)(f)}}su===d,endsWith:n?FBe.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,Ehc.isEqualOrParent)(u,d,e.ignoreCase??!vhc.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=MLi.get(s);if(c)return OLi(c,t,o);let l;return Shc.test(r)?c=khc(r.substring(4),r,o):(l=Thc.exec(nDr(r,o)))?c=Dhc(l[1],r,o):(e.trimForExclusions?xhc:Ihc).test(r)?c=Nhc(r,o):(l=whc.exec(nDr(r,o)))?c=BLi(l[1].substring(1),r,!0,o):(l=Rhc.exec(nDr(r,o)))?c=BLi(l[1],r,!1,o):c=Mhc(r,o),MLi.set(s,c),OLi(c,t,o)}a(aDr,"parsePattern");function OLi(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,FBe.ltrim)(o.substring(e.base.length),B$.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(OLi,"wrapRelativePattern");function nDr(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(nDr,"trimForExclusions");function khc(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(khc,"trivia1");function Dhc(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(Dhc,"trivia2");function Nhc(t,e){let r=QLi(t.slice(1,-1).split(",").map(l=>aDr(l,e)).filter(l=>l!==rN),t),n=r.length;if(!n)return rN;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(Nhc,"trivia3");function BLi(t,e,r,n){let o=B$.sep===B$.posix.sep,s=o?t:t.replace(bhc,B$.sep),c=B$.sep+s,l=B$.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(BLi,"trivia4and5");function Mhc(t,e){try{let r=new RegExp(`^${LLi(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return rN}}a(Mhc,"toRegExp");function Ohc(t,e,r){return!t||typeof e!="string"?!1:FLi(t,r)(e)}a(Ohc,"match");function FLi(t,e={}){if(!t)return sDr;if(typeof t=="string"||ULi(t)){let r=aDr(t,e);if(r===rN)return sDr;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 Fhc(t,e)}a(FLi,"parse");function ULi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(ULi,"isRelativePattern");function Bhc(t){return t.allBasenames||[]}a(Bhc,"getBasenameTerms");function Lhc(t){return t.allPaths||[]}a(Lhc,"getPathTerms");function Fhc(t,e){let r=QLi(Object.getOwnPropertyNames(t).map(l=>Uhc(l,t[l],e)).filter(l=>l!==rN)),n=r.length;if(!n)return rN;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(Fhc,"parsedExpression");function Uhc(t,e,r){if(e===!1)return rN;let n=aDr(t,r);if(n===rN)return rN;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,iDr.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Uhc,"parseExpressionPattern");function QLi(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(QLi,"aggregateBasenameMatches");function Qhc(t,e){return(0,yhc.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(Qhc,"patternsEquals")});var evt=I(Rl=>{"use strict";p();var qhc=Rl&&Rl.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jhc=Rl&&Rl.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Hhc=Rl&&Rl.__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,jLi.isEqual)(r.uri,t)||r.uri.path===t.path||lDr(t,r))}a(cDr,"findNotebook");function lDr(t,e){if(t.scheme===UBe.Schemas.vscodeNotebookCell||t.scheme===UBe.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,jLi.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 Ghc(t,e){if(t.scheme!==UBe.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=HLi(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(Ghc,"getNotebookCellOutput");function HLi(t,e){let r=cDr(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(HLi,"getNotebookAndCellFromUri");function $hc(t){return t.scheme===UBe.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a($hc,"isNotebookCellOrNotebookChatInput");function Vhc(t){return t.scheme===UBe.Schemas.vscodeNotebookCell}a(Vhc,"isNotebookCell");function Whc(t){return t.path.endsWith(".ipynb")}a(Whc,"isJupyterNotebookUri");function zhc(t){return t.notebookType==="jupyter-notebook"}a(zhc,"isJupyterNotebook");function Yhc(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(Yhc,"serializeNotebookDocument");function Khc(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(Khc,"extractNotebookOutline");function GLi(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||VLi(e.include))}a(GLi,"isDocumentExcludePattern");function $Li(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a($Li,"isFilenamePattern");function VLi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(VLi,"isRelativePattern");function Jhc(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(Jhc,"isNotebookEditorContribution");function Zhc(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(Zhc,"extractEditorAssociation");function WLi(t,e){if(typeof e=="string"&&nye.match(e.toLowerCase(),(0,iye.basename)(t.fsPath).toLowerCase()))return!0;if(GLi(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(nye.match(r,(0,iye.basename)(t.fsPath).toLowerCase()))return!(n&&nye.match(n,(0,iye.basename)(t.fsPath).toLowerCase()))}return $Li(e)&&nye.match(e.filenamePattern,(0,iye.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&nye.match(e.excludeFileNamePattern,(0,iye.basename)(t.fsPath).toLowerCase())):!1}a(WLi,"notebookSelectorMatches");function zLi(t,e){let r=[];for(let n of e)n.filenamePattern&&nye.match(n.filenamePattern.toLowerCase(),(0,iye.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(zLi,"getNotebookEditorAssociations");function Xhc(t,e,r,n){if(cDr(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>WLi(t,l)));if(o.length===0)return!1;let s=zLi(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??X_t.default)===X_t.default)}a(Xhc,"_hasSupportedNotebooks")});var XLi=I(kv=>{"use strict";p();var emc=kv&&kv.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},tmc=kv&&kv.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(kv,"__esModule",{value:!0});kv.TelemetrySender=kv.NextEditProviderTelemetryBuilder=kv.DiagnosticsTelemetryBuilder=kv.LlmNESTelemetryBuilder=void 0;var YLi=FR(),rmc=s4(),ZLi=qh(),nmc=evt(),imc=Yc(),tvt=Io(),omc=GY(),KLi=l8(),JLi=b0(),rvt=class extends tvt.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===omc.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,nmc.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(JLi.Uri.parse(g.id.uri));if(y){let v=y.state.HEAD?.upstream?.remote,b=y.state.remotes.find(T=>T.name===v);b?.fetchUrl&&(d=b.pushUrl||b.fetchUrl)}let E=new Set,_=[...new Set(this._request.documents.map(v=>A.getRepository(JLi.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of _){let b=v?.state.HEAD?.upstream?.remote,T=v?.state.remotes.find(w=>w.name===b);T?.fetchUrl&&E.add(T.fetchUrl),T?.pushUrl&&E.add(T.pushUrl)}f=[...E]}}let h;if(e&&this.editCollectingInfo!==void 0){let g=this.editCollectingInfo.originalDoc.value,A;if(this._debugRecorder&&this._requestBookmark){let y=this._debugRecorder.getRecentLog(),E=JSON.stringify(y)?.length||0;A={entries:E>200*1024?void 0:y,entriesSize:E,requestTime:this._requestBookmark.timeMs}}h={text:g.length>200*1024?void 0:g,textLength:g.length,selection:this.editCollectingInfo.originalSelection.map(y=>({start:y.start,endExclusive:y.endExclusive})),edits:this.editCollectingInfo.edits.map(y=>y.edit.replacements.map(E=>({time:y.time.toISOString(),start:E.replaceRange.start,endExclusive:E.replaceRange.endExclusive,newText:E.newText}))).flat(),tags:[],recording:A}}let m=this._statelessNextEditTelemetry?.fetchStartedAt===void 0?void 0:this._statelessNextEditTelemetry.fetchStartedAt-this._startTime;return{providerId:this._providerId,headerRequestId:this._headerRequestId,nextEditProviderDuration:this._duration,isFromCache:this._isFromCache,reusedRequest:this._reusedRequest,subsequentEditOrder:this._subsequentEditOrder,documentsCount:r,editsCount:n,activeDocumentEditsCount:o,activeDocumentLanguageId:s,activeDocumentOriginalLineCount:c,fetchStartedAfterMs:m,hasNextEdit:this._hasNextEdit,wasPreviouslyRejected:this._wasPreviouslyRejected,isNotebook:l,notebookType:u,status:this._status,nextEditProviderError:this._nextEditProviderError,alternativeAction:h,...this._statelessNextEditTelemetry,activeDocumentRepository:d,repositoryUrls:f,nesConfigs:this._nesConfigs}}get originalSelectionLine(){return this.editCollectingInfo?.originalSelectionLine}constructor(e,r,n,o,s,c,l){super(),this._gitExtensionService=e,this._notebookService=r,this._workspaceService=n,this._providerId=o,this._doc=s,this._debugRecorder=c,this._requestBookmark=l,this._isFromCache=!1,this._hasNextEdit=!1,this._wasPreviouslyRejected=!1,this._status="new",this._startTime=Date.now(),this._doc&&(this.editCollectingInfo={originalDoc:this._doc.value.get(),originalSelection:this._doc.selection.get(),originalSelectionLine:this._doc.primarySelectionLine.get(),edits:[]},this._store.add((0,rmc.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}};kv.LlmNESTelemetryBuilder=rvt;var nvt=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}};kv.DiagnosticsTelemetryBuilder=nvt;var uDr=class t extends tvt.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 rvt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new nvt}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}};kv.NextEditProviderTelemetryBuilder=uDr;var dDr=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new tvt.DisposableStore,this._disposalTracker=new tvt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new imc.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,KLi.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,KLi.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()}},fDr=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 dDr(n,l=>this._sendAllPendingInIdlePhase({reason:"idle",details:{idleTimeoutMs:l}}),(l,u)=>this._sendAllPendingInIdlePhaseWithJump(l,u)),this._idleDetector.scheduleIdleTimer();let o=3e4,s=setTimeout(()=>{this._sendForEntry(e,{reason:"hard_cap",details:{hardCapTimeoutMs:o}})},o),c=this._map.get(e);c&&(c.hardCapTimeout=s)}_releaseIdleDetector(){this._idleDetector?.release(),this._idleDetector?.isDisposed&&(this._idleDetector=void 0)}_sendAllPendingInIdlePhase(e){let r=[];for(let[n,o]of this._map)o.hardCapTimeout!==void 0&&r.push(n);for(let n of r)this._sendForEntry(n,e)}_sendAllPendingInIdlePhaseWithJump(e,r){let n=[];for(let[o,s]of this._map)s.hardCapTimeout!==void 0&&n.push([o,s.builder]);for(let[o,s]of n){let c=s.doc?.id.uri,l=s.nesBuilder.originalSelectionLine,u=c!==void 0&&l!==void 0?{file:c,line:l}:void 0;this._sendForEntry(o,{reason:"user_jump",details:{from:u,to:{file:e,line:r}}})}}_sendForEntry(e,r){let n=this._map.get(e);if(!n)return;n.hardCapTimeout!==void 0&&(clearTimeout(n.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e);let o;try{o=n.builder.build(!0)}finally{n.builder.dispose()}this._doSendEnhancedTelemetry(o,r)}_removeEntry(e,r){clearTimeout(r.timeout),r.hardCapTimeout!==void 0&&(clearTimeout(r.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e)}_buildAndSendEnhancedTelemetry(e,r,n){let o;this._map.delete(e);try{o=r.build(!0)}finally{r.dispose()}this._doSendEnhancedTelemetry(o,n)}sendTelemetry(e,r){if(e){let o=this._map.get(e);o&&this._removeEntry(e,o)}let n=r.build(!0);r.isSent||(this._doSendTelemetry(n),r.markAsSent()),this._doSendEnhancedTelemetry(n,void 0)}sendTelemetryForBuilder(e){if(e.isSent)return;let r=e.build(!1);this._doSendTelemetry(r),e.markAsSent()}async _doSendTelemetry(e){let{opportunityId:r,headerRequestId:n,requestN:o,providerId:s,modelName:c,hadStatelessNextEditProviderCall:l,statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:f,reusedRequest:h,subsequentEditOrder:m,activeDocumentLanguageId:g,activeDocumentOriginalLineCount:A,nLinesOfCurrentFileInPrompt:y,wasPreviouslyRejected:E,isShown:_,isNotebook:v,notebookType:b,isNESForAnotherDoc:T,isActiveDocument:w,isEolDifferent:R,isMultilineEdit:x,isNextEditorRangeVisible:P,isNextEditorVisible:D,acceptance:N,disposalReason:B,logProbThreshold:L,documentsCount:j,editsCount:M,activeDocumentEditsCount:O,promptLineCount:q,promptCharCount:Q,hadLowLogProbSuggestion:U,nEditsSuggested:z,lineDistanceToMostRecentEdit:$,isCursorAtEndOfLine:W,isInlineSuggestion:J,debounceTime:ne,artificialDelay:H,hasNextEdit:re,notebookCellMarkerCount:ae,notebookCellMarkerIndex:Be,notebookId:ve,notebookCellLines:Ue,nextEditLogprob:Pe,supersededByOpportunityId:Z,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchStartedAfterMs:he,response:X,configIsDiagnosticsNESEnabled:ue,isNaturalLanguageDominated:je,diagnosticType:ie,diagnosticDroppedReasons:le,diagnosticHasExistingSameFileImport:Ne,diagnosticIsLocalImport:we,diagnosticAlternativeImportsCount:Le,diagnosticDistanceToUnknownDiagnostic:rt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:_t,hadDiagnosticsNES:kt,hadLlmNES:$t,pickedNES:Ht,xtabAggressivenessLevel:Ie,xtabUserHappinessScore:F,userAggressivenessSetting:be,modelConfig:Qe}=e,fe,Se,Fe,te;if(X!==void 0){let{response:Te,ttft:Ge,fetchResult:Y,fetchTime:se}=await X;Te.type===YLi.ChatFetchResponseType.Success&&(fe=Te.usage),Se=Ge,Fe=Y,te=se}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:g,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:N,disposalReason:B,supersededByOpportunityId:Z,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchResult:Fe,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:ie,diagnosticDroppedReasons:le,pickedNES:Ht,notebookType:b,notebookId:ve,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:ae>0?1:0,notebookCellMarkerCount:ae,notebookCellMarkerIndex:Be,logProbThreshold:L,documentsCount:j,editsCount:M,activeDocumentEditsCount:O,promptLineCount:q,promptCharCount:Q,hadLowLogProbSuggestion:this._boolToNum(U),nEditsSuggested:z,lineDistanceToMostRecentEdit:$,isCursorAtEndOfLine:this._boolToNum(W),isInlineSuggestion:this._boolToNum(J),debounceTime:ne,artificialDelay:H,fetchStartedAfterMs:he,ttft:Se,fetchTime:te,promptTokens:fe?.prompt_tokens,responseTokens:fe?.completion_tokens,cachedTokens:fe?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:fe?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:fe?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(re),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:Pe,hadDiagnosticsNES:this._boolToNum(kt),hadLlmNES:this._boolToNum($t),configIsDiagnosticsNESEnabled:this._boolToNum(ue),isNaturalLanguageDominated:this._boolToNum(je),diagnosticHasExistingSameFileImport:this._boolToNum(Ne),diagnosticIsLocalImport:this._boolToNum(we),diagnosticAlternativeImportsCount:Le,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("copilot-nes/provideInlineEdit",e,r)}async _doSendEnhancedTelemetry(e,r){let{opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,status:l,modelName:u,prompt:d,response:f,alternativeAction:h,postProcessingOutcome:m,activeDocumentRepository:g,repositoryUrls:A,cursorJumpModelName:y,cursorJumpPrompt:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:T,modelConfig:w,isFromCache:R}=e,x=f===void 0?f:await f,P=await T?.catch(()=>{});this._telemetryService.sendEnhancedGHTelemetryEvent("copilot-nes/provideInlineEdit",(0,ZLi.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==YLi.ChatFetchResponseType.Success?void 0:x.response.value,alternativeAction:h?JSON.stringify({...h,enhancedTelemetrySendingReason:r}):void 0,enhancedTelemetrySendingReason:!h&&r?JSON.stringify(r):void 0,postProcessingOutcome:m,activeDocumentRepository:g,repositories:JSON.stringify(A),cursorJumpModelName:y,cursorJumpPrompt:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:P,modelConfig:w}),{isFromCache:this._boolToNum(R)})}_boolToNum(e){return e===void 0?void 0:e?1:0}dispose(){for(let e of this._map.values())clearTimeout(e.timeout),e.hardCapTimeout!==void 0&&clearTimeout(e.hardCapTimeout),e.builder.dispose();this._map.clear(),this._idleDetector&&(this._idleDetector.forceDispose(),this._idleDetector=void 0)}};kv.TelemetrySender=fDr;kv.TelemetrySender=fDr=emc([tmc(1,ZLi.ITelemetryService)],fDr)});var hDr=I(oye=>{"use strict";p();Object.defineProperty(oye,"__esModule",{value:!0});oye.NullPowerService=oye.IPowerService=void 0;var e3i=bc(),smc=Fs();oye.IPowerService=(0,smc.createDecorator)("IPowerService");var pDr=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=e3i.Event.None,this.onDidResume=e3i.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};oye.NullPowerService=pDr});var B6=I(L$=>{"use strict";p();Object.defineProperty(L$,"__esModule",{value:!0});L$.FetchStreamRecorder=L$.FetchStreamSource=L$.IChatMLFetcher=void 0;var amc=rn(),cmc=Yc();L$.IChatMLFetcher=(0,amc.createServiceIdentifier)("IChatMLFetcher");var mDr=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new cmc.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)}};L$.FetchStreamSource=mDr;var gDr=class{static{a(this,"FetchStreamRecorder")}get firstTokenEmittedTime(){return this._firstTokenEmittedTime}constructor(e){this.deltas=[],this.callback=async(r,n,o)=>{this._firstTokenEmittedTime===void 0&&(o.text||o.beginToolCalls||typeof o.thinking?.text=="string"&&o.thinking?.text||o.thinking?.text?.length||o.copilotToolCalls||o.copilotToolCallStreamUpdates)&&(this._firstTokenEmittedTime=Date.now());let s=e?await e(r,n,o):void 0;return this.deltas.push(o),s}}};L$.FetchStreamRecorder=gDr});var ADr=I(ivt=>{"use strict";p();Object.defineProperty(ivt,"__esModule",{value:!0});ivt.IChatQuotaService=void 0;var lmc=rn();ivt.IChatQuotaService=(0,lmc.createServiceIdentifier)("IChatQuotaService")});var yDr=I(ovt=>{"use strict";p();Object.defineProperty(ovt,"__esModule",{value:!0});ovt.IConversationOptions=void 0;var umc=rn();ovt.IConversationOptions=(0,umc.createServiceIdentifier)("ConversationOptions")});var QBe=I(sye=>{"use strict";p();Object.defineProperty(sye,"__esModule",{value:!0});sye.getTextPart=fmc;sye.toTextPart=t3i;sye.toTextParts=pmc;sye.roleToString=hmc;var Tne=xo(),dmc=zu();function fmc(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===Tne.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===Tne.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a(fmc,"getTextPart");function t3i(t){return{type:Tne.Raw.ChatCompletionContentPartKind.Text,text:t}}a(t3i,"toTextPart");function pmc(t){return[t3i(t)]}a(pmc,"toTextParts");function hmc(t){switch(t){case Tne.Raw.ChatRole.System:return"system";case Tne.Raw.ChatRole.User:return"user";case Tne.Raw.ChatRole.Assistant:return"assistant";case Tne.Raw.ChatRole.Tool:return"tool";default:(0,dmc.assertNever)(t,`unknown role (${t})`)}}a(hmc,"roleToString")});var _Dr=I(aye=>{"use strict";p();Object.defineProperty(aye,"__esModule",{value:!0});aye.InteractionService=aye.IInteractionService=void 0;var mmc=rn(),r3i=y0();aye.IInteractionService=(0,mmc.createServiceIdentifier)("IInteractionService");var EDr=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,r3i.generateUuid)()}startInteraction(){this._interactionId=(0,r3i.generateUuid)()}get interactionId(){return this._interactionId}};aye.InteractionService=EDr});var CDr=I(svt=>{"use strict";p();Object.defineProperty(svt,"__esModule",{value:!0});svt.SSEParser=void 0;var vDr=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(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(Xi,"__esModule",{value:!0});Xi.getModelCapabilityOverride=Cmc;Xi.getModelId=F$;Xi.isHiddenModelA=bmc;Xi.isHiddenModelB=bDr;Xi.isHiddenModelE=avt;Xi.isHiddenModelF=cvt;Xi.isHiddenFamilyH=lvt;Xi.isHiddenModelK=Smc;Xi.isGpt54=SDr;Xi.isGpt55=TDr;Xi.isGpt55EconomicalSearchAndEditExp=Tmc;Xi.isGpt55LargePromptSectionsExp=Imc;Xi.isHiddenModelM=jBe;Xi.isGpt53Codex=IDr;Xi.isVSCModelA=uvt;Xi.isVSCModelB=dvt;Xi.isVSCModelReplaceStringSet=HBe;Xi.isVSCModelC=xmc;Xi.isVSCModelD=wmc;Xi.isGpt52CodexFamily=xDr;Xi.isGpt52Family=wDr;Xi.modelPrefersInstructionsInUserMessage=Rmc;Xi.modelPrefersInstructionsAfterHistory=Pmc;Xi.modelSupportsApplyPatch=kmc;Xi.modelPrefersJsonNotebookRepresentation=Dmc;Xi.modelSupportsReplaceString=Nmc;Xi.modelSupportsMultiReplaceString=d3i;Xi.modelCanUseReplaceStringExclusively=Mmc;Xi.modelShouldUseReplaceStringHealing=Omc;Xi.modelCanUseMcpResultImageURL=Bmc;Xi.modelCanUseImageURL=Lmc;Xi.modelSupportsPDFDocuments=Fmc;Xi.modelCanUseApplyPatchExclusively=Umc;Xi.modelNeedsStrongReplaceStringHint=Qmc;Xi.modelSupportsSimplifiedApplyPatchInstructions=qmc;Xi.isAnthropicFamily=GBe;Xi.isGeminiFamily=RDr;Xi.isMinimaxFamily=fvt;Xi.isGpt5PlusFamily=pvt;Xi.isGptCodexFamily=jmc;Xi.isGpt5Family=Hmc;Xi.isGptFamily=Gmc;Xi.isGpt51Family=$mc;Xi.getVerbosityForModelSync=Vmc;Xi.modelSupportsToolSearch=Wmc;Xi.modelSupportsContextEditing=zmc;var xm=dkr(),qBe=Tl(),c3i=Cp(),gmc=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],l3i=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],n3i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],i3i=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],o3i=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],s3i=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],a3i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],Amc=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],ymc=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],Emc=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],u3i="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",_mc=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"],vmc=["0902565c0c0fe145633a1f246ae551acc0f621249ef050428eba357fbd4655ee"];function Cmc(t,e){return e.getConfig(qBe.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(Cmc,"getModelCapabilityOverride");function F$(t){return"id"in t?t.id:t.model}a(F$,"getModelId");function bmc(t){let e=(0,xm.getCachedSha256Hash)(t.family);return gmc.includes(e)}a(bmc,"isHiddenModelA");function bDr(t){let e=(0,xm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return l3i.includes(e)}a(bDr,"isHiddenModelB");function avt(t){let e=(0,xm.getCachedSha256Hash)(t.family);return Amc.includes(e)}a(avt,"isHiddenModelE");function cvt(t){let e=(0,xm.getCachedSha256Hash)(t.family);return ymc.includes(e)}a(cvt,"isHiddenModelF");function lvt(t){let e=(0,xm.getCachedSha256Hash)(t.family);return _mc.includes(e)}a(lvt,"isHiddenFamilyH");function Smc(t){return(0,xm.getCachedSha256Hash)(t.family)===u3i}a(Smc,"isHiddenModelK");function SDr(t){let e=(0,xm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||Emc.includes(e)}a(SDr,"isGpt54");function TDr(t){let e=(0,xm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||l3i.includes(e)}a(TDr,"isGpt55");function Tmc(t,e){let r=t.get(qBe.IConfigurationService),n=t.get(c3i.IExperimentationService);return TDr(e)&&r.getExperimentBasedConfig(qBe.ConfigKey.EnableGpt55EconomicalSearchAndEdit,n)}a(Tmc,"isGpt55EconomicalSearchAndEditExp");function Imc(t,e){let r=t.get(qBe.IConfigurationService),n=t.get(c3i.IExperimentationService);return TDr(e)&&r.getExperimentBasedConfig(qBe.ConfigKey.EnableGpt55LargePromptSections,n)}a(Imc,"isGpt55LargePromptSectionsExp");function jBe(t){let e=(0,xm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return vmc.includes(e)}a(jBe,"isHiddenModelM");function IDr(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(IDr,"isGpt53Codex");function uvt(t){let e=(0,xm.getCachedSha256Hash)(F$(t)),r=(0,xm.getCachedSha256Hash)(t.family);return n3i.includes(e)||n3i.includes(r)}a(uvt,"isVSCModelA");function dvt(t){let e=(0,xm.getCachedSha256Hash)(F$(t)),r=(0,xm.getCachedSha256Hash)(t.family);return i3i.includes(e)||i3i.includes(r)}a(dvt,"isVSCModelB");function HBe(t){let e=(0,xm.getCachedSha256Hash)(F$(t)),r=(0,xm.getCachedSha256Hash)(t.family);return a3i.includes(e)||a3i.includes(r)}a(HBe,"isVSCModelReplaceStringSet");function xmc(t){let e=(0,xm.getCachedSha256Hash)(F$(t)),r=(0,xm.getCachedSha256Hash)(t.family);return o3i.includes(e)||o3i.includes(r)}a(xmc,"isVSCModelC");function wmc(t){let e=(0,xm.getCachedSha256Hash)(F$(t)),r=(0,xm.getCachedSha256Hash)(t.family);return s3i.includes(e)||s3i.includes(r)}a(wmc,"isVSCModelD");function xDr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(xDr,"isGpt52CodexFamily");function wDr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a(wDr,"isGpt52Family");function Rmc(t){return t.includes("claude-3.5-sonnet")}a(Rmc,"modelPrefersInstructionsInUserMessage");function Pmc(t){return t.includes("claude-3.5-sonnet")}a(Pmc,"modelPrefersInstructionsAfterHistory");function kmc(t){return HBe(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||xDr(t.family)||IDr(t.family)||uvt(t)||dvt(t)||wDr(t.family)||SDr(t)||bDr(t)||jBe(t)}a(kmc,"modelSupportsApplyPatch");function Dmc(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||xDr(t.family)||IDr(t.family)||wDr(t.family)||SDr(t)||bDr(t)||jBe(t)}a(Dmc,"modelPrefersJsonNotebookRepresentation");function Nmc(t){return RDr(t)||t.family.includes("grok-code")||d3i(t)||cvt(t)||fvt(t)||lvt(t)}a(Nmc,"modelSupportsReplaceString");function d3i(t){return GBe(t)||avt(t)||HBe(t)||fvt(t)||lvt(t)}a(d3i,"modelSupportsMultiReplaceString");function Mmc(t){return GBe(t)||t.family.includes("grok-code")||avt(t)||t.family.toLowerCase().includes("gemini-3")||HBe(t)||cvt(t)||fvt(t)||lvt(t)}a(Mmc,"modelCanUseReplaceStringExclusively");function Omc(t){return t.family.includes("gemini-2")}a(Omc,"modelShouldUseReplaceStringHealing");function Bmc(t){return!GBe(t)&&!avt(t)}a(Bmc,"modelCanUseMcpResultImageURL");function Lmc(t){return!0}a(Lmc,"modelCanUseImageURL");function Fmc(t){return GBe(t)||pvt(t)||jBe(t)}a(Fmc,"modelSupportsPDFDocuments");function Umc(t){return HBe(t)?!1:pvt(t)||uvt(t)||dvt(t)}a(Umc,"modelCanUseApplyPatchExclusively");function Qmc(t){return RDr(t)||cvt(t)}a(Qmc,"modelNeedsStrongReplaceStringHint");function qmc(t){return pvt(t)||uvt(t)||dvt(t)}a(qmc,"modelSupportsSimplifiedApplyPatchInstructions");function GBe(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(GBe,"isAnthropicFamily");function RDr(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,xm.getCachedSha256Hash)(e)===u3i}a(RDr,"isGeminiFamily");function fvt(t){return t.family.toLowerCase().includes("minimax")}a(fvt,"isMinimaxFamily");function pvt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(pvt,"isGpt5PlusFamily");function jmc(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(jmc,"isGptCodexFamily");function Hmc(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(Hmc,"isGpt5Family");function Gmc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a(Gmc,"isGptFamily");function $mc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a($mc,"isGpt51Family");function Vmc(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(Vmc,"getVerbosityForModelSync");function Wmc(t){let e=typeof t=="string"?t:F$(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s==="gpt-5-4"||s==="gpt-5-5"||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-sonnet-4-6")||!s.startsWith("claude-opus-4-1")&&s.startsWith("claude-opus-4-")},"matches");return n(e)||n(r)||jBe(r)}a(Wmc,"modelSupportsToolSearch");function zmc(t){let e=typeof t=="string"?t:F$(t),r=typeof t=="string"?t:t.family,n=a(l=>l.toLowerCase().replace(/\./g,"-"),"normalize"),o=n(e),s=n(r);if(o.includes("1m")||s.includes("1m"))return!1;let c=a(l=>l.startsWith("claude-haiku-4-5")||l.startsWith("claude-sonnet-4-6")||l.startsWith("claude-sonnet-4-5")||l.startsWith("claude-sonnet-4")||l.startsWith("claude-opus-4-6")||l.startsWith("claude-opus-4-5")||l.startsWith("claude-opus-4-1")||l.startsWith("claude-opus-4"),"matches");return c(o)||c(s)}a(zmc,"modelSupportsContextEditing")});var gvt=I(QR=>{"use strict";p();Object.defineProperty(QR,"__esModule",{value:!0});QR.CUSTOM_TOOL_SEARCH_NAME=void 0;QR.modelSupportsInterleavedThinking=Kmc;QR.modelSupportsMemory=Jmc;QR.isAnthropicContextEditingEnabled=Zmc;QR.modelSupportsExtendedCacheTtl=f3i;QR.isExtendedCacheTtlEnabled=Xmc;QR.isExtendedCacheTtlMessagesEnabled=e0c;QR.buildContextManagement=p3i;QR.getContextManagementFromConfig=t0c;var mvt=Tl(),hvt=$Be(),Ymc=FR();QR.CUSTOM_TOOL_SEARCH_NAME="tool_search";function Kmc(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(Kmc,"modelSupportsInterleavedThinking");function Jmc(t){let e=typeof t=="string"?t:(0,hvt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-haiku-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-sonnet-4")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4")},"matches");return n(e)||n(r)}a(Jmc,"modelSupportsMemory");function Zmc(t,e,r){return(typeof t=="string"?(0,hvt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,hvt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(mvt.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(Zmc,"isAnthropicContextEditingEnabled");function f3i(t){let e=typeof t=="string"?t:(0,hvt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-opus-4-7")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-haiku-4-5")},"matches");return n(e)||n(r)}a(f3i,"modelSupportsExtendedCacheTtl");function Xmc(t,e,r,n,o){return!f3i(t)||n!==Ymc.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(mvt.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(Xmc,"isExtendedCacheTtlEnabled");function e0c(t,e,r){return t?e.getExperimentBasedConfig(mvt.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(e0c,"isExtendedCacheTtlMessagesEnabled");function p3i(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(p3i,"buildContextManagement");function t0c(t,e,r){let n=t.getExperimentBasedConfig(mvt.ConfigKey.AnthropicContextEditingMode,e);return p3i(n,r)}a(t0c,"getContextManagementFromConfig")});var PDr=I(Avt=>{"use strict";p();Object.defineProperty(Avt,"__esModule",{value:!0});Avt.IToolDeferralService=void 0;var r0c=rn();Avt.IToolDeferralService=(0,r0c.createServiceIdentifier)("IToolDeferralService")});var MDr=I(QE=>{"use strict";p();var n0c=QE&&QE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i0c=QE&&QE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o0c=QE&&QE.__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_vt(n,r),e)}a(c0c,"arrayHash");function l0c(t,e){return e=dB(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=NDr(n,r),_vt(t[n],r)),e)}a(l0c,"objectHash");var u0c=a(t=>{if(typeof t=="string"&&t.length<250){let r=new Evt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof DDr.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(cye)},"hashAsync");QE.hashAsync=u0c;function kDr(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(kDr,"leftRotate");function cye(t,e=32){return t instanceof ArrayBuffer?(0,DDr.encodeHex)(DDr.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(cye,"toHexString");var Evt=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(yvt.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()),cye(this._h0)+cye(this._h1)+cye(this._h2)+cye(this._h3)+cye(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,kDr(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=kDr(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=kDr(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}};QE.StringSHA1=Evt});var lye=I(VBe=>{"use strict";p();Object.defineProperty(VBe,"__esModule",{value:!0});VBe.TelemetryData=void 0;VBe.eventPropertiesToSimpleObject=f0c;var d0c=y0(),ODr=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];p0c(r,this.properties)}};VBe.TelemetryData=ODr;function f0c(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(f0c,"eventPropertiesToSimpleObject");function p0c(t,e){e.unique_id=(0,d0c.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(p0c,"addRequiredProperties")});var h3i=I(BDr=>{"use strict";p();Object.defineProperty(BDr,"__esModule",{value:!0});BDr.extractThinkingDeltaFromChoice=g0c;function h0c(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(h0c,"getThinkingDeltaText");function m0c(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(m0c,"getThinkingDeltaId");function g0c(t){let e=t.message||t.delta;if(!e)return;let r=m0c(e),n=h0c(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(g0c,"extractThinkingDeltaFromChoice")});var bvt=I(Ine=>{"use strict";p();Object.defineProperty(Ine,"__esModule",{value:!0});Ine.SSEProcessor=void 0;Ine.splitChunk=g3i;Ine.convertToAPIJsonData=E0c;Ine.sendCommunicationErrorTelemetry=uye;var vvt=Ep(),m3i=lye(),A0c=h3i(),Cvt=k6(),wm=R6(),WBe=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}}},LDr=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}},FDr=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 LDr,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function g3i(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!==""),r]}a(g3i,"splitChunk");var UDr=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,Cvt.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new FDr,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,wm.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,wm.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]=g3i(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}`),uye(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&&y0c(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}`),uye(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new WBe(h.model||""),reason:wm.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),uye(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,Cvt.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,Cvt.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every(Cvt.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 WBe(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===wm.FinishedCompletionReason.FunctionCall||g.finish_reason===wm.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===wm.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===wm.FinishedCompletionReason.ToolCalls||g.finish_reason===wm.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??wm.FinishedCompletionReason.ClientTrimmed,filterReason:_0c(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:wm.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}`),uye(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),uye(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"?wm.FinishedCompletionReason.FunctionCall:wm.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:wm.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)}`)}};Ine.SSEProcessor=UDr;function y0c(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(y0c,"isCopilotConfirmation");function E0c(t){return{text:t.text.join(""),tokens:t.text}}a(E0c,"convertToAPIJsonData");function _0c(t){if(t.finish_reason===wm.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return wm.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return wm.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return wm.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return wm.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return wm.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return wm.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(_0c,"choiceToFilterReason");function uye(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=m3i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:vvt.LogLevel[vvt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=m3i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:vvt.LogLevel[vvt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a(uye,"sendCommunicationErrorTelemetry")});var KBe=I(dye=>{"use strict";p();Object.defineProperty(dye,"__esModule",{value:!0});dye.sendEngineMessagesLengthTelemetry=v3i;dye.sendEngineMessagesTelemetry=C3i;dye.sendResponsesApiCompactionTelemetry=D0c;dye.prepareChatCompletionForReturn=N0c;var v0c=xo(),E3i=MDr(),Tvt=bk(),_3i=y0(),C0c=QBe(),qDr=qh(),YBe=lye(),b0c=R6(),S0c=bvt();function v3i(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=YBe.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,qDr.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,qDr.multiplexProperties)(d.properties),d.measurements)}a(v3i,"sendEngineMessagesLengthTelemetry");var A3i=new Tvt.LRUCache(1e3),y3i=new Tvt.LRUCache(500),zBe=new Tvt.LRUCache(1e3),Svt={headerRequestId:null},QDr=new Tvt.LRUCache(100);function T0c(t){let e=zBe.get(t);if(e!==void 0){let r=e+1;return zBe.set(t,r),r}else return zBe.set(t,1),1}a(T0c,"updateHeaderRequestIdTracker");function I0c(t){let e=QDr.get(t);if(e!==void 0){let r=e+1;return QDr.set(t,r),r}else return QDr.set(t,1),1}a(I0c,"updateConversationTracker");function x0c(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,E3i.hash)(n).toString(),l=y3i.get(c);if(!l)l=(0,_3i.generateUuid)(),y3i.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(JBe,"__esModule",{value:!0});JBe.CompactionDataContainer=void 0;JBe.rawPartAsCompactionData=O0c;var M0c=xo(),b3i=fBe(),jDr=class extends M0c.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:b3i.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};JBe.CompactionDataContainer=jDr;function O0c(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===b3i.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(O0c,"rawPartAsCompactionData")});var I3i=I(ZBe=>{"use strict";p();Object.defineProperty(ZBe,"__esModule",{value:!0});ZBe.PhaseDataContainer=void 0;ZBe.rawPartAsPhaseData=L0c;var B0c=xo(),T3i=fBe(),HDr=class extends B0c.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:T3i.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};ZBe.PhaseDataContainer=HDr;function L0c(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===T3i.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(L0c,"rawPartAsPhaseData")});var R3i=I(fB=>{"use strict";p();Object.defineProperty(fB,"__esModule",{value:!0});fB.StatefulMarkerContainer=void 0;fB.rawPartAsStatefulMarker=w3i;fB.encodeStatefulMarker=F0c;fB.decodeStatefulMarker=U0c;fB.getAllStatefulMarkersAndIndicies=VDr;fB.getStatefulMarkerAndIndex=Q0c;fB.getIndexOfStatefulMarker=q0c;var GDr=xo(),x3i=fBe(),$Dr=class extends GDr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:x3i.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};fB.StatefulMarkerContainer=$Dr;function w3i(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===x3i.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(w3i,"rawPartAsStatefulMarker");function F0c(t,e){return new TextEncoder().encode(t+"\\"+e)}a(F0c,"encodeStatefulMarker");function U0c(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(U0c,"decodeStatefulMarker");function*VDr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===GDr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===GDr.Raw.ChatCompletionContentPartKind.Opaque){let o=w3i(n);o&&(yield{statefulMarker:o,index:e})}}}}a(VDr,"getAllStatefulMarkersAndIndicies");function Q0c(t,e){for(let r of VDr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(Q0c,"getStatefulMarkerAndIndex");function q0c(t,e){for(let r of VDr(e))if(r.statefulMarker.marker===t)return r.index}a(q0c,"getIndexOfStatefulMarker")});var D3i=I(L6=>{"use strict";p();var j0c=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]})),H0c=L6&&L6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),k3i=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();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();var V0c=Dv&&Dv.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},W0c=Dv&&Dv.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Dv,"__esModule",{value:!0});Dv.OpenAIResponsesProcessor=void 0;Dv.getResponsesApiCompactionThreshold=U3i;Dv.createResponsesRequestBody=cgc;Dv.getResponsesApiCompactionThresholdFromBody=lgc;Dv.responseApiInputToRawMessagesForLogging=ygc;Dv.processResponseFromChatEndpoint=xgc;Dv.sendCompletionOutputTelemetry=j3i;var eo=xo(),eNr=Al(),z0c=Yc(),Y0c=uQ(),K0c=u3(),J0c=CDr(),pB=SS(),Z0c=y0(),N3i=FR(),fye=Tl(),X0c=Ep(),F6=gvt(),egc=k6(),Df=R6(),tgc=PDr(),JDr=KBe(),rgc=U6(),ngc=Cp(),igc=$Be(),tNr=S3i(),ogc=I3i(),M3i=R3i(),sgc=Mkr(),agc=D3i();function U3i(t,e,r){if(t.getExperimentBasedConfig(fye.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!Df.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(U3i,"getResponsesApiCompactionThreshold");function cgc(t,e,r,n){let o=t.get(fye.IConfigurationService),s=t.get(ngc.IExperimentationService),c=(0,igc.getVerbosityForModelSync)(n),l=U3i(o,s,n),u=ugc(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(L=>L.function.name===F6.CUSTOM_TOOL_SEARCH_NAME),m=e.location===N3i.ChatLocation.Agent||e.location===N3i.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(tgc.IToolDeferralService):void 0,E=[];if(e.requestOptions?.tools)for(let L of e.requestOptions.tools)!L.function.name||L.function.name.length===0||L.function.name===F6.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(L.function.name)||E.push({...L.function,type:"function",strict:!1,parameters:L.function.parameters||{}});let _=[...E];A&&_.unshift({type:"tool_search",execution:"client",description:"Search for relevant tools by describing what you need. Returns tool definitions for tools matching your query.",parameters:{type:"object",properties:{query:{type:"string",description:"Natural language description of what tool capability you are looking for."}},required:["query"]}});let v=e.requestOptions?.tools?new Map(e.requestOptions.tools.map(L=>[L.function.name,L])):void 0,b=A?L=>!y.isNonDeferredTool(L):void 0,T={model:r,...dgc(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:Df.openAIContextManagementCompactionType,compact_threshold:l}]),T.truncation=o.getConfig(fye.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let w=e.modelCapabilities?.enableThinking===!1,R=o.getExperimentBasedConfig(fye.ConfigKey.ResponsesApiReasoningSummary,s),x=n.family==="gpt-5.3-codex-spark-preview"||w,P=o.getConfig(fye.ConfigKey.Advanced.ReasoningEffortOverride),D=n.supportsReasoningEffort?.length?P||e.modelCapabilities?.reasoningEffort||"medium":void 0,N=R==="off"||x?void 0:R;return(D||N)&&(T.reasoning={...D?{effort:D}:{},...N?{summary:N}:{}}),T.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(fye.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(T.prompt_cache_key=`${e.conversationId}:${n.family}`),T}a(cgc,"createResponsesRequestBody");function lgc(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===Df.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(lgc,"getResponsesApiCompactionThresholdFromBody");function ugc(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(rgc.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(ugc,"resolveWebSocketStatefulMarker");function dgc(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1}=o,u=pgc(e),d=u!==void 0?fgc(e[u]):void 0,f,h;if(n)h=(0,M3i.getIndexOfStatefulMarker)(n,e),h!==void 0&&(f=n);else if(!r){let E=(0,M3i.getStatefulMarkerAndIndex)(t,e);E&&(f=E.statefulMarker,h=E.index)}l&&(f=void 0,h=void 0);let m=new Set,g=new Set;if(h!==void 0||u!==void 0){for(let E of e)if(E.role===eo.Raw.ChatRole.Assistant&&E.toolCalls)for(let _ of E.toolCalls)_.function.name===F6.CUSTOM_TOOL_SEARCH_NAME&&m.add(_.id);else if(E.role===eo.Raw.ChatRole.Tool&&E.toolCallId&&m.has(E.toolCallId)&&s){let _=E.content.filter(v=>v.type===eo.Raw.ChatCompletionContentPartKind.Text).map(v=>v.text).join("");for(let v of O3i(_,s,c))g.add(v.name)}}h!==void 0?(e=e.slice(h+1),u!==void 0&&(u>h?e=e.slice(u-(h+1)):d&&(e=[d,...e]))):u!==void 0&&(e=e.slice(u));let y=[];for(let E of e)switch(E.role){case eo.Raw.ChatRole.Assistant:if(E.content.length){y.push(...Agc(E.content)),y.push(...mgc(E.content));let _=E.content.map(hgc).filter(pB.isDefined);if(_.length){let v={role:"assistant",content:_,type:"message",phase:ggc(E.content)};y.push(v)}}if(E.toolCalls)for(let _ of E.toolCalls)if(_.function.name===F6.CUSTOM_TOOL_SEARCH_NAME){m.add(_.id);let v={};try{v=JSON.parse(_.function.arguments||"{}")}catch{}y.push({type:"tool_search_call",execution:"client",call_id:_.id,status:"completed",arguments:v})}else{let v=g.has(_.function.name)?_.function.name:void 0;y.push({type:"function_call",name:_.function.name,arguments:_.function.arguments,call_id:_.id,...v?{namespace:v}:{}})}break;case eo.Raw.ChatRole.Tool:if(E.toolCallId)if(m.has(E.toolCallId)){let _=E.content.filter(b=>b.type===eo.Raw.ChatCompletionContentPartKind.Text).map(b=>b.text).join(""),v=s?O3i(_,s,c):[];for(let b of v)g.add(b.name);y.push({type:"tool_search_output",execution:"client",call_id:E.toolCallId,status:"completed",tools:v})}else{let _=E.content.filter(T=>T.type===eo.Raw.ChatCompletionContentPartKind.Text).map(T=>T.text).join(""),v=E.content.filter(T=>T.type===eo.Raw.ChatCompletionContentPartKind.Image).map(T=>({type:"input_image",detail:T.imageUrl.detail||"auto",image_url:T.imageUrl.url})),b=E.content.filter(T=>T.type===eo.Raw.ChatCompletionContentPartKind.Document).map(Q3i).filter(pB.isDefined);y.push({type:"function_call_output",call_id:E.toolCallId,output:_}),v.length&&y.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...v]}),b.length&&y.push({role:"user",content:[{type:"input_text",text:"PDF associated with the above tool call:"},...b]})}break;case eo.Raw.ChatRole.User:y.push({role:"user",content:E.content.map(B3i).filter(pB.isDefined)});break;case eo.Raw.ChatRole.System:y.push({role:"system",content:E.content.map(B3i).filter(pB.isDefined)});break}return{input:y,previous_response_id:f}}a(dgc,"rawMessagesToResponseAPI");function O3i(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==F6.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(O3i,"buildToolSearchOutputTools");function fgc(t){if(t.role!==eo.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===eo.Raw.ChatCompletionContentPartKind.Opaque&&(0,tNr.rawPartAsCompactionData)(r));if(e.length)return{role:eo.Raw.ChatRole.Assistant,content:e}}a(fgc,"createCompactionRoundTripMessage");function pgc(t){for(let e=t.length-1;e>=0;e--){let r=t[e];for(let n of r.content)if(n.type===eo.Raw.ChatCompletionContentPartKind.Opaque&&(0,tNr.rawPartAsCompactionData)(n))return e}}a(pgc,"getLatestCompactionMessageIndex");function Q3i(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(Q3i,"rawDocumentToResponsesInputFile");function B3i(t){switch(t.type){case eo.Raw.ChatCompletionContentPartKind.Text:return{type:"input_text",text:t.text};case eo.Raw.ChatCompletionContentPartKind.Image:return{type:"input_image",detail:t.imageUrl.detail||"auto",image_url:t.imageUrl.url};case eo.Raw.ChatCompletionContentPartKind.Document:return Q3i(t);case eo.Raw.ChatCompletionContentPartKind.Opaque:{let e=t.value;if(e.type==="input_text"||e.type==="input_image"||e.type==="input_file")return e}}}a(B3i,"rawContentToResponsesContent");function hgc(t){switch(t.type){case eo.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a(hgc,"rawContentToResponsesAssistantContent");function mgc(t){return(0,eNr.coalesce)(t.map(e=>{if(e.type===eo.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,sgc.rawPartAsThinkingData)(e);if(r)return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(mgc,"extractThinkingData");function ggc(t){for(let e of t)if(e.type===eo.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,ogc.rawPartAsPhaseData)(e);if(r)return r}}a(ggc,"extractPhaseData");function Agc(t){return(0,eNr.coalesce)(t.map(e=>{if(e.type===eo.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,tNr.rawPartAsCompactionData)(e);if(r)return{type:Df.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(Agc,"extractCompactionData");function ygc(t){let e=[],r=[],n=a(()=>{r.length>0&&e.push({role:eo.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)})},"flushPendingFunctionCalls");t.instructions&&e.push({role:eo.Raw.ChatRole.System,content:[{type:eo.Raw.ChatCompletionContentPartKind.Text,text:t.instructions}]});let o=typeof t.input=="string"?[{role:"user",content:t.input,type:"message"}]:t.input??[];for(let s of o)if("role"in s)switch(s.role){case"user":n(),e.push({role:eo.Raw.ChatRole.User,content:KDr(s.content).map(Ivt).filter(pB.isDefined)});break;case"system":case"developer":n(),e.push({role:eo.Raw.ChatRole.System,content:KDr(s.content).map(Ivt).filter(pB.isDefined)});break;case"assistant":n(),Egc(s)?e.push({role:eo.Raw.ChatRole.Assistant,content:s.content.map(vgc).filter(pB.isDefined)}):_gc(s)&&e.push({role:eo.Raw.ChatRole.Assistant,content:KDr(s.content).map(Ivt).filter(pB.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=Cgc(s.output);e.push({role:eo.Raw.ChatRole.Tool,content:c,toolCallId:s.call_id});break}case"reasoning":n(),e.push({role:eo.Raw.ChatRole.Assistant,content:[{type:eo.Raw.ChatCompletionContentPartKind.Text,text:`Reasoning summary: ${s.summary.map(c=>c.text).join(` +`),e.info(`[responsesAPI] Dumping SSE stream to ${s}`),new ANr(s)}catch{return Z3i}}a(Qgc,"createResponsesStreamDumper")});var zvt=I(Uv=>{"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(` -`)}`}]});break;default:{let c=s;if(c.type==="tool_search_call")r.push({id:c.call_id,type:"function",function:{name:F6.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(c.arguments??{})}});else if(c.type==="tool_search_output"){n();let l=c.tools.map(u=>u.name);e.push({role:eo.Raw.ChatRole.Tool,content:[{type:eo.Raw.ChatCompletionContentPartKind.Text,text:JSON.stringify(l)}],toolCallId:c.call_id})}break}}return r.length>0&&e.push({role:eo.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)}),e}a(ygc,"responseApiInputToRawMessagesForLogging");function Egc(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(Egc,"isResponseOutputMessage");function _gc(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(_gc,"isResponseInputItemMessage");function KDr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(KDr,"ensureContentArray");function Ivt(t){switch(t.type){case"input_text":return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"input_image":return{type:eo.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:t.image_url||"",detail:t.detail==="auto"?void 0:t.detail??void 0}};case"input_file":return{type:eo.Raw.ChatCompletionContentPartKind.Opaque,value:`[File Input - Filename: ${t.filename||"unknown"}]`}}}a(Ivt,"responseContentToRawContent");function vgc(t){switch(t.type){case"output_text":return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"refusal":return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:`[Refusal: ${t.refusal}]`}}}a(vgc,"responseOutputToRawContent");function Cgc(t){return typeof t=="string"?[{type:eo.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,eNr.coalesce)(t.map(Ivt))}a(Cgc,"responseFunctionOutputToRawContents");function ZDr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===Df.openAIContextManagementCompactionType}a(ZDr,"isCompactionItem");function bgc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(bgc,"hasOutputItem");function Sgc(t){return"response"in t&&Array.isArray(t.response.output)}a(Sgc,"hasResponseOutput");function Tgc(t){return t.output_index}a(Tgc,"getOutputItemIndex");function XDr(t){return ZDr(t)}a(XDr,"isCompactionOutputItem");function q3i(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(XDr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&XDr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(q3i,"getLatestCompactionOutput");function Igc(t,e){let r=q3i(t,e);return r?t.filter((n,o)=>!XDr(n)||o===r.outputIndex):t}a(Igc,"keepLatestCompactionOutput");async function xgc(t,e,r,n,o,s,c,l){return new z0c.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,Z0c.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,egc.getRequestId)(n.headers),m=t.createInstance(xvt,c,e,d,f,h,l),g=(0,agc.createResponsesStreamDumper)(d,r),A=new J0c.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&&(j3i(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(xgc,"processResponseFromChatEndpoint");function j3i(t,e,r,n){let o=(0,Df.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,JDr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(j3i,"sendCompletionOutputTelemetry");function wgc(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 Df.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return Df.FilterReason.SelfHarm;if(o.includes("sexual"))return Df.FilterReason.Sexual;if(o.includes("violence"))return Df.FilterReason.Violence;if(o.includes("hate"))return Df.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return Df.FilterReason.Hate;if(s.self_harm?.filtered)return Df.FilterReason.SelfHarm;if(s.sexual?.filtered)return Df.FilterReason.Sexual;if(s.violence?.filtered)return Df.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return Df.FilterReason.Copyright;if(r.source_type==="prompt")return Df.FilterReason.Prompt}a(wgc,"extractFilterReasonFromContentFilters");function L3i(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(L3i,"mapResponsesApiError");var xvt=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(bgc(e)&&ZDr(e.item)){let n=Tgc(e);r.push({item:e.item,outputIndex:n})}if(Sgc(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: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:` -`}),this.lastTextDeltaOutputIndex=s.output_index;let c=new K0c.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...F3i(c,l),top_logprobs:l.top_logprobs?.map(u=>F3i(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:F6.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:F6.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:F6.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=Igc(s.response.output,this.latestCompactionOutputIndex),l=q3i(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,JDr.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,JDr.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:Df.FinishedCompletionReason.Stop,message:{role:eo.Raw.ChatRole.Assistant,content:c.map(h=>{if(h.type==="message")return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:h.content.map(m=>m.type==="output_text"?m.text:m.refusal).join("")};if(h.type==="image_generation_call"&&h.result)return{type:eo.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:h.result}}}).filter(pB.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=Df.FinishedCompletionReason.Length:c==="content_filter"?(l=Df.FinishedCompletionReason.ContentFilter,u=wgc(s.content_filters)):l=Df.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:L3i(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,Df.FinishedCompletionReason.ServerError,{error:L3i(s.error)})}}}buildTerminalCompletion(e,r,n={}){let o=e.output??[];return{blockFinished:!0,choiceIndex:0,model:e.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.id,created:e.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:e.usage?{prompt_tokens:e.usage.input_tokens??0,completion_tokens:e.usage.output_tokens??0,total_tokens:e.usage.total_tokens??0,prompt_tokens_details:{cached_tokens:e.usage.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.usage.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}}:void 0,finishReason:r,filterReason:n.filterReason,error:n.error,message:{role:eo.Raw.ChatRole.Assistant,content:o.map(s=>{if(s.type==="message")return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:s.content.map(c=>c.type==="output_text"?c.text:c.refusal).join("")};if(s.type==="image_generation_call"&&s.result)return{type:eo.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:s.result}}}).filter(pB.isDefined)}}}};Dv.OpenAIResponsesProcessor=xvt;Dv.OpenAIResponsesProcessor=xvt=V0c([W0c(6,X0c.ILogService)],xvt);function F3i(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,Y0c.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(F3i,"mapLogProp")});var H3i=I(Rvt=>{"use strict";p();Object.defineProperty(Rvt,"__esModule",{value:!0});Rvt.ChatWebSocketTelemetrySender=void 0;var rNr=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})}};Rvt.ChatWebSocketTelemetrySender=rNr});var U6=I(f1=>{"use strict";p();var Rgc=f1&&f1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Pvt=f1&&f1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(f1,"__esModule",{value:!0});f1.ChatWebSocketManager=f1.NullChatWebSocketManager=f1.IChatWebSocketManager=void 0;f1.isCAPIWebSocketError=aNr;var Pgc=rn(),kgc=Is(),kvt=bc(),G3i=Io(),$3i=Tl(),Dgc=LE(),pye=Ep(),Ngc=qh(),Mgc=fy(),Ogc=wvt(),U$=H3i();f1.IChatWebSocketManager=(0,Pgc.createServiceIdentifier)("IChatWebSocketManager");var nNr=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(){}};f1.NullChatWebSocketManager=nNr;function aNr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(aNr,"isCAPIWebSocketError");var Bgc={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function Lgc(t){return Bgc[t.type]}a(Lgc,"getStreamTerminatingOutcome");var iNr=class extends G3i.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 oNr(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()}};f1.ChatWebSocketManager=iNr;f1.ChatWebSocketManager=iNr=Rgc([Pvt(0,pye.ILogService),Pvt(1,Dgc.ICAPIClientService),Pvt(2,Ngc.ITelemetryService),Pvt(3,$3i.IConfigurationService)],iNr);function Dvt(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(Dvt,"wsCloseCodeToString");var oNr=class extends G3i.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 kvt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new Mgc.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}`),U$.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,pye.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,pye.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})`:""}`),U$.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=Dvt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),U$.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,pye.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),U$.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}!aNr(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=Dvt(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})`),U$.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,pye.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}`),U$.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,Ogc.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 sNr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:O,closeCode:q,closeReason:Q,serverErrorMessage:U,serverErrorCode:z})=>{this._activeRequest===x&&(this._activeRequest=void 0);let $=Date.now()-(this._connectedTime??Date.now()),W=Date.now()-E,J=this._totalSentMessageCount-_,ne=this._totalReceivedMessageCount-v,H=this._totalSentCharacters-b,re=this._totalReceivedCharacters-T;U$.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:$,requestDurationMs:W,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters,requestSentMessageCount:J,requestReceivedMessageCount:ne,requestSentCharacters:H,requestReceivedCharacters:re,closeCode:q,closeReason:Q,serverErrorMessage:U,serverErrorCode:z})}),this._activeRequest=x;let P=n.onCancellationRequested(()=>{this._activeRequest===x&&(x.handleCancellation(),this._activeRequest=void 0)});x.done.finally(()=>P.dispose()).catch(()=>{});let{stream:D,...N}=e,B={type:"response.create",...N,initiator:r.userInitiated?"user":"agent"},L=JSON.stringify(B),j=L.length;this._totalSentMessageCount+=1,this._totalSentCharacters+=j;let M=Date.now()-(this._connectedTime??Date.now());return this._logService.debug(`[ChatWebSocketManager] Sending request for conversation ${this._conversationId} turn ${this._turnId} (totalSentMessageCount: ${this._totalSentMessageCount}, sentMessageCharacters: ${j})`),U$.ChatWebSocketTelemetrySender.sendRequestSentTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:M,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,sentMessageCharacters:j,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._ws.send(L),x}dispose(){this._activeRequest?.handleConnectionDisposed(),this._activeRequest=void 0,this._ws&&(this._ws.close(),this._ws=void 0),this._state=2,this._onDidDispose.fire(),super.dispose()}},sNr=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 kvt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new kvt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new kvt.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($3i.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,pye.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),aNr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=Lgc(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${Dvt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${Dvt(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 kgc.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 Q$=I(hye=>{"use strict";p();Object.defineProperty(hye,"__esModule",{value:!0});hye.IDomainService=hye.FEEDBACK_URL=void 0;var Fgc=rn();hye.FEEDBACK_URL="https://aka.ms/microsoft/vscode-copilot-release";hye.IDomainService=(0,Fgc.createServiceIdentifier)("IDomainService")});var Nvt=I(nI=>{"use strict";p();Object.defineProperty(nI,"__esModule",{value:!0});nI.HeaderContributors=nI.IHeaderContributors=nI.userAgentLibraryHeader=void 0;nI.stringifyUrlOrRequestMetadata=Wgc;nI.createCapiRequestBody=zgc;nI.canRetryOnceNetworkError=W3i;nI.postRequest=Ygc;nI.getRequest=Kgc;var Ugc=rn(),Qgc=Cle(),qgc=Is(),jgc=LE(),Hgc=qh(),Ggc=fy(),$gc=R6();nI.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var Vgc=30*1e3;function Wgc(t){return typeof t=="string"?t:JSON.stringify(t)}a(Wgc,"stringifyUrlOrRequestMetadata");function zgc(t,e,r){let n={messages:(0,$gc.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a(zgc,"createCapiRequestBody");function V3i(t,e){let r=t.get(Ggc.IFetcherService),n=t.get(Hgc.ITelemetryService),o=t.get(jgc.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:Qgc.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:Vgc,useFetcher:g,suppressIntegrationId:b?.suppressIntegrationId};if(m){let w=r.makeAbortController();m.onCancellationRequested(()=>{n.sendGHTelemetryEvent("networking.cancelRequest",{headerRequestId:d}),w.abort()}),T.signal=w.signal}return typeof E.urlOrRequestMetadata=="string"?r.fetch(E.urlOrRequestMetadata,T).catch(R=>{if(A&&W3i(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(E.urlOrRequestMetadata,T));throw r.isAbortError(R)?new qgc.CancellationError:R}):o.makeRequest(T,E.urlOrRequestMetadata)}a(V3i,"networkRequest");function W3i(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(W3i,"canRetryOnceNetworkError");function Ygc(t,e){return V3i(t,{...e,requestType:"POST"})}a(Ygc,"postRequest");function Kgc(t,e){return V3i(t,{...e,requestType:"GET"})}a(Kgc,"getRequest");nI.IHeaderContributors=(0,Ugc.createServiceIdentifier)("headerContributors");var cNr=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}};nI.HeaderContributors=cNr});var J3i=I(iI=>{"use strict";p();var Jgc=iI&&iI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zgc=iI&&iI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xgc=iI&&iI.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;or.charAt(0).toUpperCase()+r.slice(1)),enumDescriptions:t.map(r=>{switch(r){case"none":return Sp.t("No reasoning applied");case"minimal":return Sp.t("Minimal reasoning for fastest responses");case"low":return Sp.t("Faster responses with less reasoning");case"medium":return Sp.t("Balanced reasoning and speed");case"high":return Sp.t("Greater reasoning depth but slower");case"xhigh":return Sp.t("Highest reasoning depth but slowest");case"max":return Sp.t("Absolute maximum capability with no constraints");default:return r}}),default:K3i(t,e),group:"navigation"}}a(eAc,"buildReasoningEffortSchemaProperty");function tAc(t){let e=t.name.toLowerCase(),r=t.family.toLowerCase();if(r.includes("claude")||e.includes("claude")){if(e.includes("opus"))return Sp.t("Most capable Claude model. Excellent for complex analysis, coding tasks, and nuanced creative writing.");if(e.includes("sonnet"))return Sp.t("Balanced Claude model offering strong performance for everyday coding and chat tasks at faster speeds.");if(e.includes("haiku"))return Sp.t("Fastest and most compact Claude model. Ideal for quick responses and simple tasks.")}if(r.includes("gpt")||e.includes("gpt")||r.includes("codex")||e.includes("codex"))return e.includes("codex")||r.includes("codex")?Sp.t("OpenAI Codex model specialized for code generation, debugging, and software development tasks."):e.includes("mini")?Sp.t("Lightweight GPT model for quick responses and simple tasks with low latency."):e.includes("copilot")?Sp.t("GPT model fine-tuned for Copilot code completions."):e.includes("4o")?Sp.t("Optimized GPT-4 model with faster responses and multimodal capabilities."):e.includes("4.1")?Sp.t("Enhanced GPT-4 model with improved instruction following and coding performance."):Sp.t("OpenAI GPT model for coding and general assistance.");if(r.includes("gemini")||e.includes("gemini"))return e.includes("flash")?Sp.t("Fast and efficient Gemini model optimized for quick responses and high throughput."):e.includes("pro")?Sp.t("Google's advanced Gemini Pro model with strong reasoning and coding capabilities."):Sp.t("Google Gemini model with balanced performance for coding and general assistance.");if(r.includes("grok")||e.includes("grok"))return Sp.t("xAI Grok model optimized for fast code generation and development tasks.")}a(tAc,"getModelCapabilitiesDescription");function z3i(t){return t<.01?t.toExponential(2):t.toFixed(4).replace(/\.?0+$/,"")}a(z3i,"formatAicPrice");function rAc(t){return Sp.t("In: {0} \xB7 Out: {1} AICs/1M tokens",z3i(t.default.inputPrice),z3i(t.default.outputPrice))}a(rAc,"formatPricingLabel");var Y3i=1e6,lNr=1e9;function nAc(t){if(!t)return;let e=t.batch_size??Y3i,r=Y3i/e,n=t.default;if(n&&n.input_price!==void 0&&n.output_price!==void 0){let o={inputPrice:n.input_price*r,outputPrice:n.output_price*r,cachePrice:n.cache_price!==void 0?n.cache_price*r:void 0,contextMax:n.context_max},s,c=t.long_context;if(c&&c.input_price!==void 0&&c.output_price!==void 0){let l={inputPrice:c.input_price*r,outputPrice:c.output_price*r,cachePrice:c.cache_price!==void 0?c.cache_price*r:void 0,contextMax:c.context_max};(l.inputPrice!==o.inputPrice||l.outputPrice!==o.outputPrice||l.cachePrice!==o.cachePrice)&&(s=l)}return{default:o,longContext:s}}if(!(t.input_price===void 0||t.output_price===void 0))return{default:{inputPrice:t.input_price/lNr*r,outputPrice:t.output_price/lNr*r,cachePrice:t.cache_price!==void 0?t.cache_price/lNr*r:void 0}}}a(nAc,"normalizeTokenPrices")});var fFi=I(my=>{"use strict";p();var iAc=my&&my.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Z3i=my&&my.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(my,"__esModule",{value:!0});my.AnthropicMessagesProcessor=void 0;my.buildToolInputSchema=oFi;my.createMessagesRequestBody=lAc;my.rawMessagesToMessagesAPI=sFi;my.clearAllCacheControl=aFi;my.addToolsAndSystemCacheControl=cFi;my.addMessagesApiCacheControl=lFi;my.processResponseFromMessagesEndpoint=fAc;my.processNonStreamingResponseFromMessagesEndpoint=dFi;var nN=xo(),eFi=Yc(),oAc=CDr(),uNr=y0(),sAc=FR(),X3i=Tl(),tFi=Ep(),mye=gvt(),rFi=k6(),XBe=R6(),aAc=PDr(),nFi=KBe(),cAc=Cp(),iFi=qh();function oFi(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(oFi,"buildToolInputSchema");function lAc(t,e,r,n){let o=t.get(X3i.IConfigurationService),s=t.get(cAc.IExperimentationService),c=t.get(aAc.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===mye.CUSTOM_TOOL_SEARCH_NAME),u=[],d=[];if(e.requestOptions?.tools)for(let N of e.requestOptions.tools){if(!N.function.name||N.function.name.length===0)continue;let B=e.modelCapabilities?.enableToolSearch&&l&&!c.isNonDeferredTool(N.function.name),L={name:N.function.name,description:N.function.description||"",input_schema:oFi(N.function.parameters),...B?{defer_loading:!0}:{}};(B?d:u).push(L)}let f=[...u,...d],h=e.modelCapabilities?.reasoningEffort,m;if(e.modelCapabilities?.enableThinking){if(n.supportsAdaptiveThinking)m={type:"adaptive",display:"summarized"};else if(n.maxThinkingBudget&&n.minThinkingBudget){let B=e.postOptions.max_tokens??1024,L=n.minThinkingBudget??1024,j=16e30?new Set(f.map(N=>N.name)):void 0,b=sFi(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,mye.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,P=(0,mye.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;aFi(b),lFi(b,P),cFi(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:sAc.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(lAc,"createMessagesRequestBody");function sFi(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case nN.Raw.ChatRole.System:{n.push(...Mvt(c.content).filter(l=>l.type==="text"));break}case nN.Raw.ChatRole.User:{let l=Mvt(c.content);l.length>0&&r.push({role:"user",content:l});break}case nN.Raw.ChatRole.Assistant:{let l=Mvt(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 nN.Raw.ChatRole.Tool:{if(c.toolCallId){let l=Mvt(c.content),u=!1;for(let g of l)eLe(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===mye.CUSTOM_TOOL_SEARCH_NAME?uAc(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(sFi,"rawMessagesToMessagesAPI");function uAc(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(uAc,"tryParseToolReferences");function Mvt(t){let e=[],r=!1;for(let n of t){switch(n.type){case nN.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case nN.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 nN.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&eLe(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case nN.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 nN.Raw.ChatCompletionContentPartKind.Opaque:{if(n.value&&typeof n.value=="object"&&"type"in n.value){let o=n.value;if(o.type==="thinking"&&o.thinking){let s=Array.isArray(o.thinking.text)?o.thinking.text.join(""):o.thinking.text;s&&o.thinking.encrypted?e.push({type:"thinking",thinking:s,signature:o.thinking.encrypted}):o.thinking.encrypted&&!s&&e.push({type:"redacted_thinking",data:o.thinking.encrypted})}}break}}if(r&&e.length>0){let o=e.at(-1);eLe(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a(Mvt,"rawContentToAnthropicContent");function eLe(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(eLe,"contentBlockSupportsCacheControl");function aFi(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(aFi,"clearAllCacheControl");function cFi(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(cFi,"addToolsAndSystemCacheControl");function lFi(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"&&eLe(c))&&(dAc(s,e),n++)}}a(lFi,"addMessagesApiCacheControl");function dAc(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"&&eLe(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(dAc,"markLastCacheableBlock");async function fAc(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new eFi.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,uNr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,rFi.getRequestId)(n.headers),h=t.createInstance(Ovt,s,u,d,f),m=new oAc.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,XBe.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,nFi.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()}):dFi(e,r,n,o,s)}a(fAc,"processResponseFromMessagesEndpoint");function pAc(t){switch(t){case"refusal":return XBe.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return XBe.FinishedCompletionReason.Length;default:return XBe.FinishedCompletionReason.Stop}}a(pAc,"mapStopReason");function uFi(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(uFi,"buildAnthropicCompletion");async function dFi(t,e,r,n,o){return new eFi.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,rFi.getRequestId)(r.headers),u=c||(0,uNr.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=uFi({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,XBe.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,nFi.sendEngineMessagesTelemetry)(t,[v],b,!0,e),s.emitOne(E)},async()=>{await r.body.destroy()})}a(dFi,"processNonStreamingResponseFromMessagesEndpoint");var Ovt=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,uNr.generateUuid)();this.toolCallAccumulator.set(e.index,{id:o,name:e.content_block.name||"",arguments:""}),this.textAccumulator.length&&n({text:" "}),n({text:"",beginToolCalls:[{name:e.content_block.name||"",id:o}]})}else if(e.content_block?.type==="thinking"&&e.index!==void 0)this.thinkingAccumulator.set(e.index,{thinking:"",signature:""});else if(e.content_block?.type==="redacted_thinking"&&e.index!==void 0){let o=e.content_block.data;n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:o}})}return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text){let o=this.extractIPCodeCitations(e.copilot_annotations);return o.length>0?n({text:e.delta.text,ipCitations:o}):n({text:e.delta.text})}else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);return o&&(o.thinking+=e.delta.thinking),n({text:"",thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json,n({text:"",copilotToolCallStreamUpdates:[{id:o.id,name:o.name,arguments:o.arguments}]}))}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),n({text:"",copilotToolCalls:[{id:o.id,name:o.name,arguments:o.arguments}]}),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&s.signature&&(n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":if(e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheCreation1hTokens=e.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens,this.thinkingTokens=e.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens),e.copilot_usage&&typeof e.copilot_usage.total_nano_aiu=="number"&&(this.copilotUsage=e.copilot_usage),e.context_management)return this.contextManagementResponse=e.context_management,n({text:"",contextManagement:e.context_management});e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.delta?.stop_details&&(this.stopDetails=e.delta.stop_details);return;case"message_stop":{if(this.contextManagementResponse){let o=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_input_tokens||0),0),s=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_tool_uses||0),0),c=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_thinking_turns||0),0);this.logService.trace(`[messagesAPI] Anthropic context editing applied: cleared ${o} tokens, ${s} tool uses.`),this.telemetryService.sendMSFTTelemetryEvent("contextEditingApplied",{requestId:this.requestId,interactionId:this.requestId,model:this.model},{clearedTokens:o,clearedToolUses:s,clearedThinkingTurns:c})}if(this.stopReason==="refusal"){let o=this.stopDetails?.category??"unknown";this.logService.warn(`[messagesAPI] Refusal received: category='${o}' for model ${this.model}`),this.telemetryService.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:this.requestId,model:this.model,category:o})}return uFi({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}]})}}}};my.AnthropicMessagesProcessor=Ovt;my.AnthropicMessagesProcessor=Ovt=iAc([Z3i(4,tFi.ILogService),Z3i(5,iFi.ITelemetryService)],Ovt)});var pFi=I(Q6=>{"use strict";p();var hAc=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]})),mAc=Q6&&Q6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gAc=Q6&&Q6.__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===xne.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(AAc.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===xne.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===xne.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==xne.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:xne.Raw.ChatCompletionContentPartKind.Text,text:yAc})})}a(EAc,"filterHistoryImages")});var wne=I(p1=>{"use strict";p();var yFi=p1&&p1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Rm=p1&&p1.__param||function(t,e){return function(r,n){e(r,n,t)}},pNr;Object.defineProperty(p1,"__esModule",{value:!0});p1.RemoteAgentChatEndpoint=p1.ChatEndpoint=void 0;p1.defaultChatResponseProcessor=mNr;p1.defaultNonStreamChatResponseProcessor=xFi;var dNr=(fne(),_a(dne)),hFi=xo(),EFi=Yc(),mFi=nXe(),_Ac=y0(),_Fi=Fs(),vAc=kE(),vFi=B6(),CAc=FR(),bAc=QBe(),gye=Tl(),CFi=Ep(),gFi=gvt(),SAc=k6(),TAc=fy(),IAc=Nvt(),xAc=KBe(),bFi=U6(),wAc=bvt(),SFi=Cp(),RAc=qh(),TFi=PQ(),PAc=LE(),tLe=$Be(),IFi=Q$(),rLe=z5e(),kAc=J3i(),AFi=fFi(),fNr=wvt(),DAc=pFi();async function mNr(t,e,r,n,o,s,c){let u=(await wAc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return EFi.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,xAc.prepareChatCompletionForReturn)(t,e,f,s)})}a(mNr,"defaultChatResponseProcessor");async function xFi(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,bAc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,_Ac.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,SAc.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 EFi.AsyncIterableObject.fromArray(s)}a(xFi,"defaultNonStreamChatResponseProcessor");var Bvt=pNr=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,tLe.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer,this.showInModelPicker=e.model_picker_enabled,this.isPremium=e.billing?.is_premium,this.multiplier=e.billing?.multiplier,this.restrictedToSkus=e.billing?.restricted_to;let h=(0,kAc.normalizeTokenPrices)(e.billing?.token_prices);this.tokenPricing=h?{default:{inputPrice:h.default.inputPrice,outputPrice:h.default.outputPrice,cacheReadTokenPrice:h.default.cachePrice??0,contextMax:h.default.contextMax},longContext:h.longContext?{inputPrice:h.longContext.inputPrice,outputPrice:h.longContext.outputPrice,cacheReadTokenPrice:h.longContext.cachePrice??0,contextMax:h.longContext.contextMax}:void 0}:void 0,this.priceCategory=e.model_picker_price_category,this.isFallback=e.is_chat_fallback,this.supportsToolCalls=!!e.capabilities.supports.tool_calls,this.supportsVision=!!e.capabilities.supports.vision,this.supportsPrediction=!!e.capabilities.supports.prediction,this.supportsAdaptiveThinking=e.capabilities.supports.adaptive_thinking,this.minThinkingBudget=e.capabilities.supports.min_thinking_budget,this.maxThinkingBudget=e.capabilities.supports.max_thinking_budget,this.supportsReasoningEffort=e.capabilities.supports.reasoning_effort,this.supportsToolSearch=e.capabilities.supports.tool_search??(0,tLe.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,tLe.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(gye.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,gFi.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,gFi.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:dNr.RequestType.ChatResponses}:this.useMessagesApi?{type:dNr.RequestType.ChatMessages}:{type:dNr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(rLe.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(rLe.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(rLe.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(rLe.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(gye.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(rLe.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===hFi.OpenAI.ChatRole.System?{role:hFi.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(fNr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(AFi.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,IAc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,tLe.isAnthropicFamily)(this))return 20;if((0,tLe.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,DAc.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(gye.ConfigKey.TeamInternal.GeminiFunctionCallingMode,this._expService);o&&typeof e.tool_choice!="object"&&(e.tool_choice=o)}return e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,fNr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,fNr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,AFi.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?mNr(e,r,n,o,s,c,l):xFi(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(gye.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===CAc.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(pNr,(0,mFi.mixin)((0,mFi.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};p1.ChatEndpoint=Bvt;p1.ChatEndpoint=Bvt=pNr=yFi([Rm(1,IFi.IDomainService),Rm(2,vFi.IChatMLFetcher),Rm(3,TFi.ITokenizerProvider),Rm(4,_Fi.IInstantiationService),Rm(5,gye.IConfigurationService),Rm(6,SFi.IExperimentationService),Rm(7,bFi.IChatWebSocketManager),Rm(8,CFi.ILogService)],Bvt);var hNr=class extends Bvt{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 mNr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};p1.RemoteAgentChatEndpoint=hNr;p1.RemoteAgentChatEndpoint=hNr=yFi([Rm(2,IFi.IDomainService),Rm(3,PAc.ICAPIClientService),Rm(4,TAc.IFetcherService),Rm(5,RAc.ITelemetryService),Rm(6,vAc.IAuthenticationService),Rm(7,vFi.IChatMLFetcher),Rm(8,TFi.ITokenizerProvider),Rm(9,_Fi.IInstantiationService),Rm(10,gye.IConfigurationService),Rm(11,SFi.IExperimentationService),Rm(12,bFi.IChatWebSocketManager),Rm(13,CFi.ILogService)],hNr)});var wFi=I(sI=>{"use strict";p();var NAc=sI&&sI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},oI=sI&&sI.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(sI,"__esModule",{value:!0});sI.CopilotUtilityChatEndpoint=sI.CopilotUtilitySmallChatEndpoint=sI.CopilotChatEndpoint=void 0;var MAc=Fs(),OAc=kE(),BAc=B6(),LAc=Tl(),FAc=k4(),UAc=Ep(),QAc=fy(),qAc=U6(),jAc=Cp(),HAc=qh(),GAc=PQ(),$Ac=LE(),VAc=Q$(),WAc=wne(),nLe=class extends WAc.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)}}};sI.CopilotChatEndpoint=nLe;sI.CopilotChatEndpoint=nLe=NAc([oI(1,VAc.IDomainService),oI(2,$Ac.ICAPIClientService),oI(3,QAc.IFetcherService),oI(4,FAc.IEnvService),oI(5,HAc.ITelemetryService),oI(6,OAc.IAuthenticationService),oI(7,BAc.IChatMLFetcher),oI(8,GAc.ITokenizerProvider),oI(9,MAc.IInstantiationService),oI(10,LAc.IConfigurationService),oI(11,jAc.IExperimentationService),oI(12,qAc.IChatWebSocketManager),oI(13,UAc.ILogService)],nLe);var gNr=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(nLe,n)}};sI.CopilotUtilitySmallChatEndpoint=gNr;var ANr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(nLe,n)}};sI.CopilotUtilityChatEndpoint=ANr});var yNr=I(hB=>{"use strict";p();var zAc=hB&&hB.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},aI=hB&&hB.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(hB,"__esModule",{value:!0});hB.AutoChatEndpoint=void 0;hB.isAutoModel=dyc;var YAc=Fs(),KAc=kE(),JAc=B6(),ZAc=Tl(),XAc=k4(),eyc=Ep(),tyc=fy(),ryc=U6(),nyc=Cp(),iyc=qh(),oyc=PQ(),syc=LE(),ayc=Q$(),cyc=wne(),lyc=wFi(),iLe=class extends lyc.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(uyc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,E,_),this.discountRange=o}};hB.AutoChatEndpoint=iLe;hB.AutoChatEndpoint=iLe=zAc([aI(4,ayc.IDomainService),aI(5,syc.ICAPIClientService),aI(6,tyc.IFetcherService),aI(7,XAc.IEnvService),aI(8,iyc.ITelemetryService),aI(9,KAc.IAuthenticationService),aI(10,JAc.IChatMLFetcher),aI(11,oyc.ITokenizerProvider),aI(12,YAc.IInstantiationService),aI(13,ZAc.IConfigurationService),aI(14,nyc.IExperimentationService),aI(15,ryc.IChatWebSocketManager),aI(16,eyc.ILogService)],iLe);function uyc(t,e,r){let n;t instanceof cyc.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(uyc,"calculateAutoModelInfo");function dyc(t){return t&&(t.model===iLe.pseudoModelId||t instanceof iLe)?1:-1}a(dyc,"isAutoModel")});var _Nr=I(oLe=>{"use strict";p();Object.defineProperty(oLe,"__esModule",{value:!0});oLe.getImageTelemetryEventMeasurements=fyc;oLe.getImageTelemetryMeasurementsFromMessages=pyc;oLe.getImageTelemetryMeasurementsFromReferences=hyc;var NFi=d9t(),RFi="screenshot-focused-window";function MFi(){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(MFi,"createEmptyImageTelemetryMeasurements");function fyc(t){return t.imageCount>0?t:{}}a(fyc,"getImageTelemetryEventMeasurements");function pyc(t){let e=MFi();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=byc(n,"imageUrl"),s=ENr(o,"url");if(!s)continue;let c=myc(s,ENr(o,"mediaType"));c&&OFi(e,c)}return e}a(pyc,"getImageTelemetryMeasurementsFromMessages");function hyc(t){let e=MFi();for(let r of t??[]){let n=Aye(r.value);if(!n)continue;let o=ENr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=kFi(n.data)??kFi(n.value);OFi(e,{mimeType:o,byteLength:s?.byteLength??DFi(n.data)??DFi(n.value),dimensions:yyc(s,o),source:Eyc(r,n)})}return e}a(hyc,"getImageTelemetryMeasurementsFromReferences");function OFi(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),gyc(t,e.dimensions),BFi(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(OFi,"addImageTelemetryInput");function myc(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:_yc(r[2]),dimensions:Ayc(t),source:"unknown"}}a(myc,"getImageTelemetryInputFromUrl");function gyc(t,e){if(!e||!PFi(e.width)||!PFi(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(gyc,"addImageDimensions");function PFi(t){return Number.isFinite(t)&&t>0}a(PFi,"isValidDimension");function Ayc(t){try{return(0,NFi.getImageDimensions)(t)}catch{return}}a(Ayc,"getImageDimensionsFromDataUrl");function yyc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||BFi(r)==="unknown"))try{return(0,NFi.getImageDimensionsFromBytes)(t,r)}catch{return}}a(yyc,"getImageDimensionsFromBytes");function BFi(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(BFi,"normalizeMimeType");function Eyc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===RFi||e.id===RFi?"screenshot":e.isURL===!1?"file":"unknown"}a(Eyc,"getImageSourceFromReference");function _yc(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(_yc,"getBase64ByteLength");function kFi(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=Aye(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(vyc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(Cyc))return new Uint8Array(o)}a(kFi,"getByteData");function vyc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(vyc,"isArrayIndexKey");function Cyc(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(Cyc,"isByteValue");function DFi(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=Aye(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(DFi,"getByteLength");function byc(t,e){return Aye(Aye(t)?.[e])}a(byc,"getObjectProperty");function ENr(t,e){let r=Aye(t)?.[e];return typeof r=="string"?r:void 0}a(ENr,"getStringProperty");function Aye(t){return typeof t=="object"&&t!==null?t:void 0}a(Aye,"asRecord")});var UFi=I(yye=>{"use strict";p();Object.defineProperty(yye,"__esModule",{value:!0});yye.ChatFailKind=yye.FetchResponseKind=void 0;var LFi;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(LFi||(yye.FetchResponseKind=LFi={}));var FFi;(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"})(FFi||(yye.ChatFailKind=FFi={}))});var sLe=I(ku=>{"use strict";p();Object.defineProperty(ku,"__esModule",{value:!0});ku.FILE_TOOL_NAMES=ku.SHELL_TOOL_NAMES=ku.TOOL_PARAM_COMMAND_MAX_LEN=ku.GitHubCopilotAttr=ku.CopilotCliSdkAttr=ku.StdAttr=ku.CopilotChatAttr=ku.GenAiAttr=ku.GenAiToolType=ku.GenAiTokenType=ku.GenAiProviderName=ku.GenAiOperationName=void 0;ku.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};ku.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};ku.GenAiTokenType={INPUT:"input",OUTPUT:"output"};ku.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};ku.GenAiAttr={OPERATION_NAME:"gen_ai.operation.name",PROVIDER_NAME:"gen_ai.provider.name",REQUEST_MODEL:"gen_ai.request.model",REQUEST_TEMPERATURE:"gen_ai.request.temperature",REQUEST_MAX_TOKENS:"gen_ai.request.max_tokens",REQUEST_TOP_P:"gen_ai.request.top_p",REQUEST_FREQUENCY_PENALTY:"gen_ai.request.frequency_penalty",REQUEST_PRESENCE_PENALTY:"gen_ai.request.presence_penalty",REQUEST_SEED:"gen_ai.request.seed",REQUEST_STOP_SEQUENCES:"gen_ai.request.stop_sequences",RESPONSE_MODEL:"gen_ai.response.model",RESPONSE_ID:"gen_ai.response.id",RESPONSE_FINISH_REASONS:"gen_ai.response.finish_reasons",USAGE_INPUT_TOKENS:"gen_ai.usage.input_tokens",USAGE_OUTPUT_TOKENS:"gen_ai.usage.output_tokens",USAGE_CACHE_READ_INPUT_TOKENS:"gen_ai.usage.cache_read.input_tokens",USAGE_CACHE_CREATION_INPUT_TOKENS:"gen_ai.usage.cache_creation.input_tokens",USAGE_REASONING_TOKENS:"gen_ai.usage.reasoning_tokens",USAGE_REASONING_OUTPUT_TOKENS:"gen_ai.usage.reasoning.output_tokens",CONVERSATION_ID:"gen_ai.conversation.id",OUTPUT_TYPE:"gen_ai.output.type",TOKEN_TYPE:"gen_ai.token.type",AGENT_NAME:"gen_ai.agent.name",AGENT_ID:"gen_ai.agent.id",AGENT_VERSION:"gen_ai.agent.version",AGENT_DESCRIPTION:"gen_ai.agent.description",TOOL_NAME:"gen_ai.tool.name",TOOL_TYPE:"gen_ai.tool.type",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_DESCRIPTION:"gen_ai.tool.description",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",TOOL_DEFINITIONS:"gen_ai.tool.definitions"};ku.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"};ku.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};ku.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};ku.GitHubCopilotAttr={AGENT_TYPE:"github.copilot.agent.type",GIT_REPOSITORY:"github.copilot.git.repository",GIT_BRANCH:"github.copilot.git.branch",GIT_COMMIT_SHA:"github.copilot.git.commit_sha",GITHUB_ORG:"github.copilot.github.org",HOOK_DECISION:"github.copilot.hook.decision",HOOK_DURATION_SECONDS:"github.copilot.hook.duration",HOOK_TOOL_NAMES:"github.copilot.hook.tool_names",MCP_SERVER_NAME_HASH:"github.copilot.mcp.server.name_hash",MCP_SERVER_NAME:"github.copilot.mcp.server.name",TOOL_PARAM_COMMAND:"github.copilot.tool.parameters.command",TOOL_PARAM_FILE_PATH:"github.copilot.tool.parameters.file_path",TOOL_PARAM_EDIT_TYPE:"github.copilot.tool.parameters.edit_type",TOOL_PARAM_SKILL_NAME:"github.copilot.tool.parameters.skill_name",TOOL_PARAM_MCP_SERVER_NAME_HASH:"github.copilot.tool.parameters.mcp_server_name_hash",TOOL_PARAM_MCP_SERVER_NAME:"github.copilot.tool.parameters.mcp_server_name",TOOL_PARAM_MCP_TOOL_NAME:"github.copilot.tool.parameters.mcp_tool_name"};ku.TOOL_PARAM_COMMAND_MAX_LEN=256;ku.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);ku.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 CNr=I(qR=>{"use strict";p();Object.defineProperty(qR,"__esModule",{value:!0});qR.truncateForOTel=Syc;qR.toInputMessages=Tyc;qR.toOutputMessages=Iyc;qR.toSystemInstructions=xyc;qR.extractTextFromContent=vNr;qR.collectSystemTextsFromRequestBody=wyc;qR.normalizeProviderMessages=Ryc;qR.toToolDefinitions=jFi;qR.stringifyToolDefinitionsForOTel=Byc;qR.stringifyToolsRawForTelemetry=Lyc;function Syc(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(Syc,"truncateForOTel");function Tyc(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(Tyc,"toInputMessages");function Iyc(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(Iyc,"toOutputMessages");function xyc(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(xyc,"toSystemInstructions");function vNr(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(vNr,"extractTextFromContent");function wyc(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=vNr(n.content);o&&e.push(o)}}if(e.length===0){let n=vNr(t.system??t.instructions);n&&e.push(n)}return e}a(wyc,"collectSystemTextsFromRequestBody");function Ryc(t){return t.map(e=>{switch(e.type){case"function_call":return Pyc(e);case"function_call_output":return kyc(e);case"tool_search_output":return Dyc(e);case"reasoning":return Nyc(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(Ryc,"normalizeProviderMessages");function Pyc(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(Pyc,"normalizeResponsesFunctionCall");function kyc(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(kyc,"normalizeResponsesFunctionCallOutput");function Dyc(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(Dyc,"normalizeResponsesToolSearchOutput");function Nyc(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(Nyc,"normalizeResponsesReasoning");function jFi(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(jFi,"toToolDefinitions");var QFi=new WeakMap,qFi=new WeakMap,Lvt,Fvt;function Myc(t){return Lvt!==void 0&&Lvt===t?Lvt:(Lvt=t,t)}a(Myc,"internToolDefsString");function Oyc(t){return Fvt!==void 0&&Fvt===t?Fvt:(Fvt=t,t)}a(Oyc,"internToolsRawString");function Byc(t){if(!t||t.length===0)return;let e=QFi.get(t);if(e!==void 0)return e;let r=jFi(t);if(!r)return;let n=Myc(JSON.stringify(r));return QFi.set(t,n),n}a(Byc,"stringifyToolDefinitionsForOTel");function Lyc(t){if(!t)return;let e=qFi.get(t);if(e!==void 0)return e;let r=Oyc(JSON.stringify(t));return qFi.set(t,r),r}a(Lyc,"stringifyToolsRawForTelemetry")});var bNr=I(Uvt=>{"use strict";p();Object.defineProperty(Uvt,"__esModule",{value:!0});Uvt.resolveWorkspaceOTelMetadata=Fyc;Uvt.workspaceMetadataToOTelAttributes=Qyc;var HFi=kk(),GFi=ykr(),q$=sLe();function Fyc(t,e){let r=t.activeRepository?.get();return r?Uyc(r,e):{}}a(Fyc,"resolveWorkspaceOTelMetadata");function Uyc(t,e){let r,n=Array.from((0,GFi.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,GFi.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,HFi.isEqualOrParent)(e,t.rootUri)&&(o=(0,HFi.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(Uyc,"buildWorkspaceMetadata");function Qyc(t){if(!t)return{};let e={};if(t.headBranchName&&(e[q$.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[q$.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[q$.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[q$.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[q$.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[q$.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=qyc(t.remoteUrl);r&&(e[q$.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[q$.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a(Qyc,"workspaceMetadataToOTelAttributes");function qyc(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a(qyc,"extractGitHubOrg")});var $Fi=I(jR=>{"use strict";p();Object.defineProperty(jR,"__esModule",{value:!0});jR.emitInferenceDetailsEvent=jyc;jR.emitSessionStartEvent=Hyc;jR.emitToolCallEvent=Gyc;jR.emitAgentTurnEvent=$yc;jR.emitEditFeedbackEvent=Vyc;jR.emitEditHunkActionEvent=Wyc;jR.emitInlineDoneEvent=zyc;jR.emitEditSurvivalEvent=Yyc;jR.emitUserFeedbackEvent=Kyc;jR.emitCloudSessionInvokeEvent=Jyc;var Pm=sLe(),Eye=CNr(),Qvt=bNr();function jyc(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[Pm.GenAiAttr.OPERATION_NAME]:Pm.GenAiOperationName.CHAT,[Pm.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[Pm.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[Pm.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[Pm.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[Pm.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[Pm.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[Pm.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[Pm.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[Pm.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[Pm.GenAiAttr.INPUT_MESSAGES]=(0,Eye.truncateForOTel)(JSON.stringify(c?(0,Eye.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,Eye.toSystemInstructions)(c);l!==void 0&&(o[Pm.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,Eye.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,Eye.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[Pm.GenAiAttr.TOOL_DEFINITIONS]=(0,Eye.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(jyc,"emitInferenceDetailsEvent");function Hyc(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[Pm.GenAiAttr.REQUEST_MODEL]:r,[Pm.GenAiAttr.AGENT_NAME]:n})}a(Hyc,"emitSessionStartEvent");function Gyc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[Pm.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[Pm.StdAttr.ERROR_TYPE]:o}:{}})}a(Gyc,"emitToolCallEvent");function $yc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[Pm.GenAiAttr.USAGE_INPUT_TOKENS]:r,[Pm.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a($yc,"emitAgentTurnEvent");function Vyc(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,Qvt.workspaceMetadataToOTelAttributes)(u)})}a(Vyc,"emitEditFeedbackEvent");function Wyc(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,Qvt.workspaceMetadataToOTelAttributes)(l)})}a(Wyc,"emitEditHunkActionEvent");function zyc(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,Qvt.workspaceMetadataToOTelAttributes)(l)})}a(zyc,"emitInlineDoneEvent");function Yyc(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,Qvt.workspaceMetadataToOTelAttributes)(l)})}a(Yyc,"emitEditSurvivalEvent");function Kyc(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(Kyc,"emitUserFeedbackEvent");function Jyc(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(Jyc,"emitCloudSessionInvokeEvent")});var VFi=I(qvt=>{"use strict";p();Object.defineProperty(qvt,"__esModule",{value:!0});qvt.GenAiMetrics=void 0;var jc=sLe(),SNr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[jc.GenAiAttr.OPERATION_NAME]:n.operationName,[jc.GenAiAttr.PROVIDER_NAME]:n.providerName,[jc.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[jc.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[jc.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[jc.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[jc.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[jc.GenAiAttr.OPERATION_NAME]:o.operationName,[jc.GenAiAttr.PROVIDER_NAME]:o.providerName,[jc.GenAiAttr.TOKEN_TYPE]:n,[jc.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[jc.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[jc.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[jc.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[jc.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[jc.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[jc.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[jc.GenAiAttr.REQUEST_MODEL]:r})}static incrementSessionCount(e){e.incrementCounter("copilot_chat.session.count")}static recordEditAcceptance(e,r,n,o){e.incrementCounter("copilot_chat.edit.acceptance.count",1,{[jc.CopilotChatAttr.EDIT_SOURCE]:r,[jc.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[jc.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[jc.CopilotChatAttr.EDIT_SOURCE]:r,[jc.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[jc.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[jc.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[jc.CopilotChatAttr.EDIT_SOURCE]:r,[jc.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[jc.CopilotChatAttr.EDIT_SOURCE]:r,[jc.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[jc.CopilotChatAttr.LANGUAGE_ID]:n}:{}})}static incrementUserActionCount(e,r){e.incrementCounter("copilot_chat.user.action.count",1,{action:r})}static incrementUserFeedbackCount(e,r){e.incrementCounter("copilot_chat.user.feedback.count",1,{rating:r})}static incrementAgentEditResponseCount(e,r){e.incrementCounter("copilot_chat.agent.edit_response.count",1,{outcome:r})}static incrementAgentSummarizationCount(e,r){e.incrementCounter("copilot_chat.agent.summarization.count",1,{outcome:r})}static incrementPullRequestCount(e){e.incrementCounter("copilot_chat.pull_request.count")}static incrementCloudSessionCount(e,r){e.incrementCounter("copilot_chat.cloud.session.count",1,{partner_agent:r})}static incrementCloudPrReadyCount(e){e.incrementCounter("copilot_chat.cloud.pr_ready.count")}};qvt.GenAiMetrics=SNr});var INr=I(jvt=>{"use strict";p();Object.defineProperty(jvt,"__esModule",{value:!0});jvt.NoopOTelService=void 0;var WFi=bc(),zFi={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},TNr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=WFi.Event.None,this.onDidEmitSpanEvent=WFi.Event.None,this.config=e}startSpan(e,r){return zFi}startActiveSpan(e,r,n){return n(zFi)}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){}};jvt.NoopOTelService=TNr});var xNr=I(Rne=>{"use strict";p();Object.defineProperty(Rne,"__esModule",{value:!0});Rne.DEFAULT_OTLP_ENDPOINT=void 0;Rne.resolveOTelConfig=eEc;Rne.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function Zyc(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(Zyc,"parseResourceAttributes");function Xyc(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(Xyc,"parseOtlpEndpoint");function eEc(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return YFi(t);let r=t.settingDbSpanExporter??!1,n=(aLe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)||r,o=(aLe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)===!0;if(!n)return YFi(t);let s;aLe(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??Rne.DEFAULT_OTLP_ENDPOINT,d=Xyc(u,l)??Rne.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=aLe(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,g=tEc(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",_=aLe(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,v=e.OTEL_SERVICE_NAME??"copilot-chat",b=Zyc(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(eEc,"resolveOTelConfig");function YFi(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(YFi,"createDisabledConfig");function aLe(t){if(t!==void 0)return t==="true"||t==="1"}a(aLe,"envBool");function tEc(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(tEc,"parseMaxAttributeSizeChars")});var Gvt=I(Hvt=>{"use strict";p();Object.defineProperty(Hvt,"__esModule",{value:!0});Hvt.IOTelService=void 0;var rEc=rn();Hvt.IOTelService=(0,rEc.createServiceIdentifier)("IOTelService")});var KFi=I(wNr=>{"use strict";p();Object.defineProperty(wNr,"__esModule",{value:!0});wNr.normalizeResponseModel=nEc;function nEc(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(nEc,"normalizeResponseModel")});var XFi=I(Lr=>{"use strict";p();Object.defineProperty(Lr,"__esModule",{value:!0});Lr.workspaceMetadataToOTelAttributes=Lr.resolveWorkspaceOTelMetadata=Lr.normalizeResponseModel=Lr.IOTelService=Lr.DEFAULT_OTLP_ENDPOINT=Lr.resolveOTelConfig=Lr.NoopOTelService=Lr.truncateForOTel=Lr.toToolDefinitions=Lr.toSystemInstructions=Lr.toOutputMessages=Lr.toInputMessages=Lr.stringifyToolsRawForTelemetry=Lr.stringifyToolDefinitionsForOTel=Lr.normalizeProviderMessages=Lr.extractTextFromContent=Lr.collectSystemTextsFromRequestBody=Lr.GenAiMetrics=Lr.emitUserFeedbackEvent=Lr.emitToolCallEvent=Lr.emitSessionStartEvent=Lr.emitInlineDoneEvent=Lr.emitInferenceDetailsEvent=Lr.emitEditSurvivalEvent=Lr.emitEditHunkActionEvent=Lr.emitEditFeedbackEvent=Lr.emitCloudSessionInvokeEvent=Lr.emitAgentTurnEvent=Lr.TOOL_PARAM_COMMAND_MAX_LEN=Lr.StdAttr=Lr.SHELL_TOOL_NAMES=Lr.GitHubCopilotAttr=Lr.GenAiToolType=Lr.GenAiTokenType=Lr.GenAiProviderName=Lr.GenAiOperationName=Lr.GenAiAttr=Lr.FILE_TOOL_NAMES=Lr.CopilotCliSdkAttr=Lr.CopilotChatAttr=void 0;var HR=sLe();Object.defineProperty(Lr,"CopilotChatAttr",{enumerable:!0,get:a(function(){return HR.CopilotChatAttr},"get")});Object.defineProperty(Lr,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return HR.CopilotCliSdkAttr},"get")});Object.defineProperty(Lr,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return HR.FILE_TOOL_NAMES},"get")});Object.defineProperty(Lr,"GenAiAttr",{enumerable:!0,get:a(function(){return HR.GenAiAttr},"get")});Object.defineProperty(Lr,"GenAiOperationName",{enumerable:!0,get:a(function(){return HR.GenAiOperationName},"get")});Object.defineProperty(Lr,"GenAiProviderName",{enumerable:!0,get:a(function(){return HR.GenAiProviderName},"get")});Object.defineProperty(Lr,"GenAiTokenType",{enumerable:!0,get:a(function(){return HR.GenAiTokenType},"get")});Object.defineProperty(Lr,"GenAiToolType",{enumerable:!0,get:a(function(){return HR.GenAiToolType},"get")});Object.defineProperty(Lr,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return HR.GitHubCopilotAttr},"get")});Object.defineProperty(Lr,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return HR.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Lr,"StdAttr",{enumerable:!0,get:a(function(){return HR.StdAttr},"get")});Object.defineProperty(Lr,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return HR.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var mB=$Fi();Object.defineProperty(Lr,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return mB.emitAgentTurnEvent},"get")});Object.defineProperty(Lr,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return mB.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Lr,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return mB.emitEditFeedbackEvent},"get")});Object.defineProperty(Lr,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return mB.emitEditHunkActionEvent},"get")});Object.defineProperty(Lr,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return mB.emitEditSurvivalEvent},"get")});Object.defineProperty(Lr,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return mB.emitInferenceDetailsEvent},"get")});Object.defineProperty(Lr,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return mB.emitInlineDoneEvent},"get")});Object.defineProperty(Lr,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return mB.emitSessionStartEvent},"get")});Object.defineProperty(Lr,"emitToolCallEvent",{enumerable:!0,get:a(function(){return mB.emitToolCallEvent},"get")});Object.defineProperty(Lr,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return mB.emitUserFeedbackEvent},"get")});var iEc=VFi();Object.defineProperty(Lr,"GenAiMetrics",{enumerable:!0,get:a(function(){return iEc.GenAiMetrics},"get")});var gB=CNr();Object.defineProperty(Lr,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return gB.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Lr,"extractTextFromContent",{enumerable:!0,get:a(function(){return gB.extractTextFromContent},"get")});Object.defineProperty(Lr,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return gB.normalizeProviderMessages},"get")});Object.defineProperty(Lr,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return gB.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Lr,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return gB.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Lr,"toInputMessages",{enumerable:!0,get:a(function(){return gB.toInputMessages},"get")});Object.defineProperty(Lr,"toOutputMessages",{enumerable:!0,get:a(function(){return gB.toOutputMessages},"get")});Object.defineProperty(Lr,"toSystemInstructions",{enumerable:!0,get:a(function(){return gB.toSystemInstructions},"get")});Object.defineProperty(Lr,"toToolDefinitions",{enumerable:!0,get:a(function(){return gB.toToolDefinitions},"get")});Object.defineProperty(Lr,"truncateForOTel",{enumerable:!0,get:a(function(){return gB.truncateForOTel},"get")});var oEc=INr();Object.defineProperty(Lr,"NoopOTelService",{enumerable:!0,get:a(function(){return oEc.NoopOTelService},"get")});var JFi=xNr();Object.defineProperty(Lr,"resolveOTelConfig",{enumerable:!0,get:a(function(){return JFi.resolveOTelConfig},"get")});Object.defineProperty(Lr,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return JFi.DEFAULT_OTLP_ENDPOINT},"get")});var sEc=Gvt();Object.defineProperty(Lr,"IOTelService",{enumerable:!0,get:a(function(){return sEc.IOTelService},"get")});var aEc=KFi();Object.defineProperty(Lr,"normalizeResponseModel",{enumerable:!0,get:a(function(){return aEc.normalizeResponseModel},"get")});var ZFi=bNr();Object.defineProperty(Lr,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return ZFi.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Lr,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return ZFi.workspaceMetadataToOTelAttributes},"get")})});var kNr=I(j$=>{"use strict";p();Object.defineProperty(j$,"__esModule",{value:!0});j$.AbstractRequestLogger=void 0;j$.getCurrentCapturingToken=dEc;j$.storeCapturingTokenForCorrelation=fEc;j$.retrieveCapturingTokenByCorrelation=pEc;j$.runWithCapturingToken=hEc;var cEc=require("async_hooks"),lEc=zAe(),uEc=Io(),cLe=new cEc.AsyncLocalStorage,RNr=new Map;function dEc(){return cLe.getStore()}a(dEc,"getCurrentCapturingToken");function fEc(t){let e=cLe.getStore();e&&RNr.set(t,e)}a(fEc,"storeCapturingTokenForCorrelation");function pEc(t){let e=RNr.get(t);return e&&RNr.delete(t),e}a(pEc,"retrieveCapturingTokenByCorrelation");function hEc(t,e){return cLe.run(t,e)}a(hEc,"runWithCapturingToken");var PNr=class extends uEc.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return cLe.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new lEc.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return cLe.getStore()}};j$.AbstractRequestLogger=PNr});var e8i=I(DNr=>{"use strict";p();Object.defineProperty(DNr,"__esModule",{value:!0});DNr.isEncryptedThinkingDelta=mEc;function mEc(t){return t.encrypted!==void 0}a(mEc,"isEncryptedThinkingDelta")});var r8i=I($vt=>{"use strict";p();Object.defineProperty($vt,"__esModule",{value:!0});$vt.calculateLineRepetitionStats=AEc;$vt.isRepetitive=yEc;var gEc=[{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 AEc(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(AEc,"calculateLineRepetitionStats");function yEc(t){let e=t.slice();return e.reverse(),t8i(e)||t8i(e.filter(r=>r.trim().length>0))}a(yEc,"isRepetitive");function t8i(t){let e=EEc(t);for(let r of gEc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(EEc,"kmp_prefix_function")});var NNr=I(AB=>{"use strict";p();var _Ec=AB&&AB.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},H$=AB&&AB.__param||function(t,e){return function(r,n){e(r,n,t)}},GR;Object.defineProperty(AB,"__esModule",{value:!0});AB.OpenAIEndpoint=void 0;AB.isBYOKModel=DEc;var vEc=B6(),n8i=FR(),i8i=Tl(),CEc=Q$(),bEc=wne(),SEc=Ep(),TEc=k6(),IEc=Nvt(),xEc=U6(),wEc=Cp(),REc=PQ(),PEc=Fs();function kEc(t){return t.type===n8i.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===n8i.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 $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 -`+JSON.stringify(t.capiError):"Rate limit exceeded",rateLimitKey:"",retryAfter:void 0,isAuto:!1,capiError:t.capiError}:t}a(kEc,"hydrateBYOKErrorMessages");function DEc(t){return t?t instanceof Vvt||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(DEc,"isBYOKModel");var Vvt=class extends bEc.ChatEndpoint{static{a(this,"OpenAIEndpoint")}static{GR=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 GR._reservedHeaders.has(e)}_sanitizeCustomHeaders(e){if(!e)return{};let r=Object.entries(e);r.length>GR._maxCustomHeaderCount&&this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has ${r.length} custom headers, exceeding limit of ${GR._maxCustomHeaderCount}. Only first ${GR._maxCustomHeaderCount} will be processed.`);let n={},o=0;for(let[s,c]of r){if(o>=GR._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>GR._maxHeaderNameLength){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has header name exceeding ${GR._maxHeaderNameLength} characters, skipping.`);continue}if(!GR._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>GR._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,IEc.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(i8i.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,TEc.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(GR,r,this._apiKey,this._modelUrl)}async makeChatRequest2(e,r){let n={...e,ignoreStatefulMarker:e.ignoreStatefulMarker??!1},o=await super.makeChatRequest2(n,r);return kEc(o)}};AB.OpenAIEndpoint=Vvt;AB.OpenAIEndpoint=Vvt=GR=_Ec([H$(3,CEc.IDomainService),H$(4,vEc.IChatMLFetcher),H$(5,REc.ITokenizerProvider),H$(6,PEc.IInstantiationService),H$(7,i8i.IConfigurationService),H$(8,wEc.IExperimentationService),H$(9,xEc.IChatWebSocketManager),H$(10,SEc.ILogService)],Vvt)});var o8i=I(iN=>{"use strict";p();Object.defineProperty(iN,"__esModule",{value:!0});iN.EXTENSION_ID=iN.agentsToCommands=iN.GITHUB_PLATFORM_AGENT=void 0;iN.getAgentForIntent=MEc;var NEc=FR();iN.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";iN.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 MEc(t,e){if(Object.keys(iN.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(iN.agentsToCommands))if(!(e===NEc.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(MEc,"getAgentForIntent");iN.EXTENSION_ID="GitHub.copilot-chat"});var c8i=I(Wvt=>{"use strict";p();Object.defineProperty(Wvt,"__esModule",{value:!0});Wvt.ChatMLFetcherTelemetrySender=void 0;var s8i=yNr(),MNr=_Nr(),a8i=NNr();function OEc(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(OEc,"getTurnFromBaseTelemetry");var ONr=class{static{a(this,"ChatMLFetcherTelemetrySender")}static sendSuccessTelemetry(e,{chatCompletion:r,baseTelemetry:n,userInitiatedRequest:o,interactionType:s,chatEndpointInfo:c,requestBody:l,maxResponseTokens:u,promptTokenCount:d,timeToFirstToken:f,timeToFirstTokenEmitted:h,hasImageMessages:m,imageTelemetryMeasurements:g,transport:A,fetcher:y,bytesReceived:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}){e.sendTelemetryEvent("response.success",{github:!0,microsoft:!0},{reason:r.finishReason,filterReason:r.filterReason,source:n?.properties.messageSource??"unknown",initiatorType:o?"user":"agent",requestKind:s,conversationId:n?.properties.conversationId,model:c?.model,modelInvoked:r.model,apiType:c?.apiType,requestId:r.requestId.headerRequestId,gitHubRequestId:r.requestId.gitHubRequestId,associatedRequestId:n?.properties.associatedRequestId,parentRequestId:n?.properties.parentRequestId,reasoningEffort:l.reasoning?.effort??l.output_config?.effort,reasoningSummary:l.reasoning?.summary,modelCallId:b,...n?.properties.subType?{subType:n.properties.subType}:{},...n?.properties.parentModelCallId?{parentModelCallId:n.properties.parentModelCallId}:{},...n?.properties.iterationNumber?{iterationNumber:n.properties.iterationNumber}:{},...y?{fetcher:y}:{},transport:A,...n?.properties.retryAfterError?{retryAfterError:n.properties.retryAfterError}:{},...n?.properties.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.properties.retryAfterErrorGitHubRequestId}:{},...n?.properties.connectivityTestError?{connectivityTestError:n.properties.connectivityTestError}:{},...n?.properties.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.properties.connectivityTestErrorGitHubRequestId}:{},...n?.properties.retryAfterFilterCategory?{retryAfterFilterCategory:n.properties.retryAfterFilterCategory}:{}},{turn:OEc(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,MNr.getImageTelemetryEventMeasurements)(g),isBYOK:(0,a8i.isBYOKModel)(c),isAuto:(0,s8i.isAutoModel)(c),bytesReceived:E,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}static sendCancellationTelemetry(e,{source:r,requestId:n,model:o,apiType:s,transport:c,interactionType:l,conversationId:u,associatedRequestId:d,parentRequestId:f,retryAfterError:h,retryAfterErrorGitHubRequestId:m,connectivityTestError:g,connectivityTestErrorGitHubRequestId:A,retryAfterFilterCategory:y,fetcher:E,suspendEventSeen:_,resumeEventSeen:v},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:P,isVisionRequest:D,isBYOK:N,isAuto:B,bytesReceived:L,issuedTime:j,imageTelemetryMeasurements:M}){e.sendTelemetryEvent("response.cancelled",{github:!0,microsoft:!0},{apiType:s,source:r,requestId:n,model:o,requestKind:l,conversationId:u,associatedRequestId:d,parentRequestId:f,...E?{fetcher:E}:{},transport:c,...h?{retryAfterError:h}:{},...m?{retryAfterErrorGitHubRequestId:m}:{},...g?{connectivityTestError:g}:{},...A?{connectivityTestErrorGitHubRequestId:A}:{},...y?{retryAfterFilterCategory:y}:{}},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:P,timeToComplete:P,issuedTime:j,isVisionRequest:D,...(0,MNr.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:B,bytesReceived:L,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}static sendResponseErrorTelemetry(e,{processed:r,telemetryProperties:n,chatEndpointInfo:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:d,imageTelemetryMeasurements:f,transport:h,interactionType:m,fetcher:g,bytesReceived:A,issuedTime:y,wasRetried:E,suspendEventSeen:_,resumeEventSeen:v}){e.sendTelemetryEvent("response.error",{github:!0,microsoft:!0},{type:r.type,reason:r.reasonDetail||r.reason,source:n?.messageSource??"unknown",requestKind:m,requestId:r.requestId,gitHubRequestId:r.serverRequestId,model:o.model,apiType:o.apiType,conversationId:n?.conversationId,reasoningEffort:s.reasoning?.effort??s.output_config?.effort,reasoningSummary:s.reasoning?.summary,...g?{fetcher:g}:{},transport:h,associatedRequestId:n?.associatedRequestId,parentRequestId:n?.parentRequestId,...n?.retryAfterError?{retryAfterError:n.retryAfterError}:{},...n?.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.retryAfterErrorGitHubRequestId}:{},...n?.connectivityTestError?{connectivityTestError:n.connectivityTestError}:{},...n?.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.connectivityTestErrorGitHubRequestId}:{},...n?.retryAfterFilterCategory?{retryAfterFilterCategory:n.retryAfterFilterCategory}:{}},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:c,tokenCountMax:l,timeToFirstToken:u,timeToComplete:Date.now()-y,issuedTime:y,isVisionRequest:d?1:-1,...(0,MNr.getImageTelemetryEventMeasurements)(f),isBYOK:(0,a8i.isBYOKModel)(o),isAuto:(0,s8i.isAutoModel)(o),wasRetried:E?1:0,bytesReceived:A,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}};Wvt.ChatMLFetcherTelemetrySender=ONr});var g8i=I(lI=>{"use strict";p();var BEc=lI&&lI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Nv=lI&&lI.__param||function(t,e){return function(r,n){e(r,n,t)}},QNr;Object.defineProperty(lI,"__esModule",{value:!0});lI.ChatMLFetcherImpl=lI.AbstractChatMLFetcher=void 0;lI.createTelemetryData=m8i;lI.locationToIntent=Jvt;var LEc=xo(),FEc=kE(),UEc=B6(),QEc=ADr(),Wn=FR(),qEc=yDr(),lLe=QBe(),jEc=_Dr(),G$=Tl(),HEc=LE(),zvt=yNr(),uLe=wvt(),GEc=_Nr(),qNr=Ep(),BNr=k6(),$Ec=fy(),Yvt=Nvt(),cI=R6(),l8i=KBe(),h8i=U6(),u8i=bvt(),fn=UFi(),wn=XFi(),VEc=Gvt(),WEc=zAe(),LNr=kNr(),zEc=Cp(),jNr=qh(),vye=lye(),YEc=e8i(),Kvt=r8i(),KEc=$_(),d8i=Yc(),f8i=Is(),JEc=bc(),ZEc=Io(),XEc=Qh(),FNr=y0(),e_c=Fs(),p8i=NNr(),t_c=o8i(),r_c=hDr(),_ye=c8i(),Zvt=class extends ZEc.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new JEc.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}};lI.AbstractChatMLFetcher=Zvt;var HNr=class extends Zvt{static{a(this,"ChatMLFetcherImpl")}static{QNr=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??Jvt(c);E&&this._consecutiveWebSocketRetryFallbacks>=QNr._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,FNr.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,GEc.getImageTelemetryMeasurementsFromMessages)(l),D=vye.TelemetryData.createAndMarkAsIssued({...f,...g?{conversationId:g}:{},headerRequestId:T,baseModel:o.model,uiKind:Wn.ChatLocation.toString(c)}),N=this._requestLogger.logChatRequest(n,o,{messages:e.messages,model:o.model,ourRequestId:T,location:e.location,body:x,ignoreStatefulMarker:_,isConversationRequest:e.isConversationRequest,customMetadata:e.customMetadata}),B=-1,L=new UEc.FetchStreamRecorder(s),j=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),O,q,Q,U,z,$,W,J;try{let ne,H=n_c(e.messages,R,o,this._configurationService,this._experimentationService);if(!H.isValid)ne={type:fn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:fn.ChatFailKind.ValidationFailed,reason:H.reason};else{let ae,Be=a(()=>ae??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),ve;try{ve=await this._authenticationService.getCopilotToken()}catch{}O=ve?.username??this._authenticationService.copilotToken?.username;let Ue=await this._fetchAndStreamChat(o,x,D,L.callback,u.secretKey,ve,e.location,T,R.n,r,Be,h,E,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(ne=Ue.result,q=Ue.fetcher,Q=Ue.bytesReceived,U=Ue.statusCode,z=Ue.suspendEventSeen,$=Ue.resumeEventSeen,W=Ue.modelCallId,J=Ue.otelSpan,J?.setAttribute(wn.GenAiAttr.AGENT_NAME,n),J){let ee=(x.messages??x.input)?.filter(ue=>ue.role==="user"),K=ee?.[ee.length-1];if(K?.content){let ue=typeof K.content=="string"?K.content:JSON.stringify(K.content);J.setAttribute(wn.CopilotChatAttr.USER_REQUEST,(0,wn.truncateForOTel)(ue,this._otelService.config.maxAttributeSizeChars))}let he=(0,wn.collectSystemTextsFromRequestBody)(x),X=(0,wn.toSystemInstructions)(he);X&&J.setAttribute(wn.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,wn.truncateForOTel)(JSON.stringify(X),this._otelService.config.maxAttributeSizeChars))}if(J){let Z=x.messages??x.input;if(Z){let X=Z.filter(ue=>ue.role!=="system");J.setAttribute(wn.GenAiAttr.INPUT_MESSAGES,(0,wn.truncateForOTel)(JSON.stringify((0,wn.normalizeProviderMessages)(X)),this._otelService.config.maxAttributeSizeChars))}let ee=(0,wn.stringifyToolDefinitionsForOTel)(x.tools);ee&&J.setAttribute(wn.GenAiAttr.TOOL_DEFINITIONS,(0,wn.truncateForOTel)(ee,this._otelService.config.maxAttributeSizeChars));let K=i_c(x);K&&J.setAttribute(wn.CopilotChatAttr.REQUEST_OPTIONS,(0,wn.truncateForOTel)(JSON.stringify(K),this._otelService.config.maxAttributeSizeChars));let he=o_c(x);he&&J.setAttribute(wn.CopilotChatAttr.REQUEST_SHAPE,(0,wn.truncateForOTel)(JSON.stringify(he),this._otelService.config.maxAttributeSizeChars))}B=await Be();let Pe=d?.extensionId??t_c.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:Pe},tokenCount:B})}let re=Date.now()-D.issuedTime;switch(N?.markTimeToFirstToken(re),ne.type){case fn.FetchResponseKind.Success:{let ae=await this.processSuccessfulResponse(ne,l,P,x,T,w,B,re,L,D,o,h,v,b,q,Q,z,$,W);if(ae.type===Wn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){L.callback("",0,{text:"",retryReason:ae.category});let Be=ae.value[0];if(Be){let ve=ae.category===cI.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: ${Be} +`+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} -`:`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: ${Be} +`:`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} -`,Ue=[...l,{role:LEc.Raw.ChatRole.User,content:(0,lLe.toTextParts)(ve)}],Pe=await this.fetchMany({...e,debugName:"retry-"+n,messages:Ue,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:ae.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:j},r);if(N?.resolve(Pe,L.deltas),Pe.type===Wn.ChatFetchResponseType.Success)return Pe}}return{type:Wn.ChatFetchResponseType.Filtered,category:ae.category,reason:"Response got filtered.",requestId:ae.requestId,serverRequestId:ae.serverRequestId}}if(N?.resolve(ae,L.deltas),ae.type===Wn.ChatFetchResponseType.Success&&ae.usage){typeof ae.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(ae.usage.copilot_usage.total_nano_aiu,y??A);let Be=(0,wn.normalizeResponseModel)(o.model,ae.resolvedModel),ve={operationName:wn.GenAiOperationName.CHAT,providerName:wn.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:Be};ae.usage.prompt_tokens&&wn.GenAiMetrics.recordTokenUsage(this._otelService,ae.usage.prompt_tokens,"input",ve),ae.usage.completion_tokens&&wn.GenAiMetrics.recordTokenUsage(this._otelService,ae.usage.completion_tokens,"output",ve),J?.setAttributes({[wn.GenAiAttr.USAGE_INPUT_TOKENS]:ae.usage.prompt_tokens??0,[wn.GenAiAttr.USAGE_OUTPUT_TOKENS]:ae.usage.completion_tokens??0,[wn.GenAiAttr.RESPONSE_MODEL]:Be??o.model,[wn.GenAiAttr.RESPONSE_ID]:ae.requestId,[wn.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...ae.usage.prompt_tokens_details?.cached_tokens?{[wn.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:ae.usage.prompt_tokens_details.cached_tokens}:{},...ae.usage.prompt_tokens_details?.cache_creation_input_tokens?{[wn.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:ae.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[wn.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:re,...ae.serverRequestId?{[wn.CopilotChatAttr.SERVER_REQUEST_ID]:ae.serverRequestId}:{},...ae.usage.completion_tokens_details?.reasoning_tokens?{[wn.GenAiAttr.USAGE_REASONING_TOKENS]:ae.usage.completion_tokens_details.reasoning_tokens,[wn.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:ae.usage.completion_tokens_details.reasoning_tokens}:{},...typeof ae.usage.copilot_usage?.total_nano_aiu=="number"?{[wn.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:ae.usage.copilot_usage.total_nano_aiu}:{}})}if(J&&ae.type===Wn.ChatFetchResponseType.Success){let Be=L.deltas.map(Z=>Z.text).join(""),ve=L.deltas.filter(Z=>Z.copilotToolCalls?.length).flatMap(Z=>Z.copilotToolCalls.map(ee=>({type:"tool_call",id:ee.id,name:ee.name,arguments:ee.arguments}))),Ue=[];if(Be&&Ue.push({type:"text",content:Be}),Ue.push(...ve),Ue.length>0&&J.setAttribute(wn.GenAiAttr.OUTPUT_MESSAGES,(0,wn.truncateForOTel)(JSON.stringify([{role:"assistant",parts:Ue}]),this._otelService.config.maxAttributeSizeChars)),L.deltas.some(Z=>Z.thinking)){let ee=L.deltas.filter(K=>K.thinking&&!(0,YEc.isEncryptedThinkingDelta)(K.thinking)&&K.thinking.text).map(K=>{let he=K.thinking;return"encrypted"in he?"":Array.isArray(he.text)?he.text.join(""):he.text??""}).join("");J.setAttribute(wn.CopilotChatAttr.REASONING_CONTENT,(0,wn.truncateForOTel)(ee||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}return(0,wn.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},ae.type===Wn.ChatFetchResponseType.Success?{id:ae.requestId,model:(0,wn.normalizeResponseModel)(o.model,ae.resolvedModel),finishReasons:["stop"],inputTokens:ae.usage?.prompt_tokens,outputTokens:ae.usage?.completion_tokens}:void 0),J?.end(),J=void 0,re>0&&wn.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,re/1e3),E&&ae.type===Wn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),ae}case fn.FetchResponseKind.Canceled:return _ye.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:q,suspendEventSeen:z,resumeEventSeen:$},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:B,tokenCountMax:w,timeToFirstToken:re,timeToFirstTokenEmitted:D&&L.firstTokenEmittedTime?L.firstTokenEmittedTime-D.issuedTime:-1,timeToCancelled:Date.now()-D.issuedTime,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,p8i.isBYOKModel)(o),isAuto:(0,zvt.isAutoModel)(o),bytesReceived:Q,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}),N?.resolveWithCancelation(),J?.setAttributes({[wn.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[wn.CopilotChatAttr.CANCELED]:!0}),J?.end(),J=void 0,this.processCanceledResponse(ne,T,L,f);case fn.FetchResponseKind.Failed:{let ae=this.processFailedResponse(ne,T,(0,zvt.isAutoModel)(o)===1),ve=this._configurationService.getExperimentBasedConfig(G$.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(Z=>parseInt(Z.trim(),10)),Ue=j&&U!==void 0&&ve.includes(U),Pe=j&&E&&(ne.failKind===fn.ChatFailKind.ServerError||ne.failKind===fn.ChatFailKind.Unknown);if(Ue||Pe){let{retryResult:Z}=await this._retryAfterError({opts:e,processed:ae,telemetryProperties:f,requestBody:x,tokenCount:B,maxResponseTokens:w,timeToError:re,transport:b,actualFetcher:q,bytesReceived:Q,baseTelemetry:D,streamRecorder:L,imageTelemetryMeasurements:P,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:z,resumeEventSeen:$,interactionType:v});if(Z)return Z}return _ye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:ae,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:B,maxResponseTokens:w,timeToFirstToken:re,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:q,bytesReceived:Q,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:z,resumeEventSeen:$}),N?.resolve(ae),ae}}}catch(ne){J&&(J.setStatus(2,ne instanceof Error?ne.message:String(ne)),J.setAttribute(wn.StdAttr.ERROR_TYPE,ne instanceof Error?ne.constructor.name:"Error"),J.setAttribute(wn.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),J.recordException(ne),J.end());let H=Date.now()-D.issuedTime;ne.fetcherId&&(q=ne.fetcherId),ne.suspendEventSeen&&(z=!0),ne.resumeEventSeen&&($=!0);let re=this.processError(ne,T,ne.gitHubRequestId,O,(0,zvt.isAutoModel)(o)===1),ae=j&&re.type===Wn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(G$.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),Be=j&&E&&(re.type===Wn.ChatFetchResponseType.NetworkError||re.type===Wn.ChatFetchResponseType.Failed);if(ae||Be){let{retryResult:ve,connectivityTestError:Ue,connectivityTestErrorGitHubRequestId:Pe}=await this._retryAfterError({opts:e,processed:re,telemetryProperties:f,requestBody:x,tokenCount:B,maxResponseTokens:w,timeToError:H,transport:b,actualFetcher:q,bytesReceived:ne.bytesReceived,baseTelemetry:D,streamRecorder:L,imageTelemetryMeasurements:P,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:z,resumeEventSeen:$,interactionType:v});if(ve)return ve;f={...f,connectivityTestError:Ue,connectivityTestErrorGitHubRequestId:Pe}}return re.type===Wn.ChatFetchResponseType.Canceled?_ye.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:q,suspendEventSeen:z,resumeEventSeen:$},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:B,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:H,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,p8i.isBYOKModel)(o),isAuto:(0,zvt.isAutoModel)(o),bytesReceived:ne.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}):_ye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:re,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:B,maxResponseTokens:w,timeToFirstToken:H,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:q,bytesReceived:ne.bytesReceived,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:z,resumeEventSeen:$}),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,qNr.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(G$.ConfigKey.TeamInternal.FallbackNodeFetchOnNetworkProcessCrash,this._experimentationService),D=n.type===Wn.ChatFetchResponseType.NetworkError&&n.isNetworkProcessCrash===!0&&P,N=x||D?"node-fetch":r.useFetcher;this._logService.info(`Retrying chat request with ${N||"default"} fetcher after: ${n.reasonDetail||n.reason}`);let B=await this._checkNetworkConnectivity(N),L=B.connectivityTestError?this.scrubErrorDetail(B.connectivityTestError,b):void 0,j=B.connectivityTestErrorGitHubRequestId;if(!B.retryRequest)return this._logService.info("Not retrying chat request as network connectivity could not be re-established."),{connectivityTestError:L,connectivityTestErrorGitHubRequestId:j};_ye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:n,telemetryProperties:o,chatEndpointInfo:r.endpoint,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:this.filterImageMessages(r.messages),imageTelemetryMeasurements:A,transport:d,interactionType:R,fetcher:f,bytesReceived:h,issuedTime:m.issuedTime,wasRetried:!0,suspendEventSeen:T,resumeEventSeen:w}),g.callback("",0,{text:"",retryReason:y});let M=await this.fetchMany({...r,useWebSocket:!1,ignoreStatefulMarker:r.useWebSocket||r.ignoreStatefulMarker,debugName:E+r.debugName,userInitiatedRequest:!1,telemetryProperties:{...o,retryAfterError:n.reasonDetail||n.reason,retryAfterErrorGitHubRequestId:n.serverRequestId,connectivityTestError:L,connectivityTestErrorGitHubRequestId:j},enableRetryOnError:!1,useFetcher:N},v);return _?.resolve(M,g.deltas),r.useWebSocket&&M.type===Wn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks++,this._logService.info(`[ChatWebSocketManager] WebSocket request failed with successful HTTP fallback (${this._consecutiveWebSocketRetryFallbacks} consecutive).`),r.conversationId&&this._webSocketManager.closeConnection(r.conversationId)),{retryResult:M,connectivityTestError:L,connectivityTestErrorGitHubRequestId:j}}async _fetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w){let x=this._configurationService.getExperimentBasedConfig(G$.ConfigKey.TeamInternal.ChatRequestPowerSaveBlocker,this._experimentationService)&&l!==Wn.ChatLocation.Other?this._powerService.acquirePowerSaveBlocker():void 0,P=!1,D=!1,N=this._powerService.onDidSuspend(()=>{P=!0,this._logService.info(`System suspended during streaming request ${u} (${Wn.ChatLocation.toString(l)})`)}),B=this._powerService.onDidResume(()=>{D=!0,this._logService.info(`System resumed during streaming request ${u} (${Wn.ChatLocation.toString(l)})`)});try{return{...await this._doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w),suspendEventSeen:P||void 0,resumeEventSeen:D||void 0}}catch(L){throw P&&(L.suspendEventSeen=!0),D&&(L.resumeEventSeen=!0),L}finally{N.dispose(),B.dispose(),x?.dispose()}}async _doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w){if(f.isCancellationRequested)return{result:{type:fn.FetchResponseKind.Canceled,reason:"before fetch request"}};let R=typeof e.urlOrRequestMetadata=="string"?(()=>{try{return new URL(e.urlOrRequestMetadata).hostname}catch{return}})():void 0,x=(0,LNr.getCurrentCapturingToken)()?.chatSessionId,P=(0,LNr.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,LNr.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[wn.GenAiAttr.OPERATION_NAME]:wn.GenAiOperationName.CHAT,[wn.GenAiAttr.PROVIDER_NAME]:wn.GenAiProviderName.GITHUB,[wn.GenAiAttr.REQUEST_MODEL]:e.model,[wn.GenAiAttr.CONVERSATION_ID]:E?.requestId??u,[wn.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[wn.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[wn.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[wn.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[wn.StdAttr.SERVER_ADDRESS]:R}:{},...y?{[wn.CopilotChatAttr.SESSION_ID]:y}:{},...x?{[wn.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...P?{[wn.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:P}:{},...D?{[wn.CopilotChatAttr.DEBUG_LOG_LABEL]:D}:{}}}),B=Date.now();try{if(this._logService.debug(`modelMaxPromptTokens ${e.modelMaxPromptTokens}`),this._logService.debug(`modelMaxResponseTokens ${r.max_tokens??2048}`),this._logService.debug(`chat model ${e.model}`),e.ownsAuthorization||(s??=c?.token),!s&&!e.ownsAuthorization){let j=(0,Yvt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${j} due to missing key`),(0,u8i.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${j} due to missing key`),{result:{type:fn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:fn.ChatFailKind.TokenExpiredOrInvalid,reason:"key is missing"}}}return g&&A&&y?{...await this._doFetchViaWebSocket(e,r,n,o,s,l,u,A,y,f,h,m,E,b,T,w),otelSpan:N}:{...await this._doFetchViaHttp(e,r,n,o,s,l,u,d,f,m,E,_,v,b),otelSpan:N}}catch(L){throw N.setStatus(2,L instanceof Error?L.message:String(L)),N.setAttribute(wn.StdAttr.ERROR_TYPE,L instanceof Error?L.constructor.name:"Error"),N.recordException(L),L}finally{let L=(Date.now()-B)/1e3;wn.GenAiMetrics.recordOperationDuration(this._otelService,L,{operationName:wn.GenAiOperationName.CHAT,providerName:wn.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=Jvt(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,FNr.generateUuid)(),R=vye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Wn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,BNr.getRequestId)(T.responseHeaders);x.headerRequestId=l,R.extendWithRequestId(x),x.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",x.serverExperiments);for(let[M,O]of Object.entries(r))if(!(M==="messages"||M==="input")){if(M==="tools"){R.properties[`request.option.${M}`]=(0,wn.stringifyToolsRawForTelemetry)(O)??"undefined";continue}R.properties[`request.option.${M}`]=JSON.stringify(O)??"undefined"}this._telemetryService.sendGHTelemetryEvent("request.sent",R.properties,R.measurements),r.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,jNr.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,wn.stringifyToolsRawForTelemetry)(r.tools)}),R.measurements);let P=Date.now(),D=T.sendRequest(r,{userInitiated:!!m,turnId:u,requestId:l,model:e.model,countTokens:h,tokenCountMax:e.maxOutputTokens,modelMaxPromptTokens:e.modelMaxPromptTokens,summarizedAtRoundId:y,modeChanged:E},f),N=n.extendedBy({modelCallId:w}),B=this._instantiationService.createInstance(uLe.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,uLe.getResponsesApiCompactionThresholdFromBody)(r)),L=new d8i.AsyncIterableObject(async M=>{try{await new Promise((q,Q)=>{D.onEvent(U=>{let z=B.push(U,o);if(z&&((0,uLe.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,z,N),M.emitOne(z)),U.type==="response.completed"){let $=U.copilot_quota_snapshots;$&&typeof $=="object"&&this._chatQuotaService.processQuotaSnapshots($)}}),D.onCAPIError(U=>{let z=new Error(`${U.error.message} (${U.error.code})`);z.gitHubRequestId=x.gitHubRequestId,z.capiWebSocketError=U,Q(z)}),D.onError(U=>{if(U.gitHubRequestId=x.gitHubRequestId,(0,f8i.isCancellationError)(U)){Q(U);return}let z=R.extendedBy({error:U.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",z.properties,z.measurements);let $=Date.now()-P;R.measurements.totalTimeMs=$,R.properties.error=U.message,this._logService.debug(`request.error: [websocket], took ${$} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),Q(U)}),D.done.then(q,Q)});let O=Date.now()-P;R.measurements.totalTimeMs=O,this._logService.debug(`request.response: [websocket], took ${O} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",R.properties,R.measurements)}finally{let O=r.messages;if((!O||O.length===0)&&r.input)try{let q=(0,uLe.responseApiInputToRawMessagesForLogging)(r);O=(0,cI.rawMessageToCAPI)(q)}catch(q){this._logService.error("Failed to convert Response API input to messages for telemetry:",q),O=[]}(0,l8i.sendEngineMessagesTelemetry)(this._telemetryService,O??[],R,!1,this._logService)}}),j=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:fn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,h8i.isCAPIWebSocketError)(j)){let M=Date.now()-P;return R.measurements.totalTimeMs=M,R.properties.error=`${j.error.message} (${j.error.code})`,this._logService.debug(`request.error: [websocket capi error], took ${M} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),{result:await this._handleWebSocketCAPIError(j,x)}}return this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),{result:{type:fn.FetchResponseKind.Success,chatCompletions:L},modelCallId:w}}async _doFetchViaHttp(e,r,n,o,s,c,l,u,d,f,h,m,g,A){let y=(0,FNr.generateUuid)(),E=await this._fetchWithInstrumentation(e,l,r,s,c,d,f,{...h,modelCallId:y},m,g,A);if(d.isCancellationRequested){try{await E.body.destroy()}catch(T){this._logService.error(T,"Error destroying stream"),this._telemetryService.sendGHTelemetryException(T,"Error destroying stream")}return{result:{type:fn.FetchResponseKind.Canceled,reason:"after fetch request"},fetcher:E.fetcher,bytesReceived:E.bytesReceived}}if(E.status===200&&this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),E.status!==200){let T=m8i(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 d8i.AsyncIterableObject(async w=>{try{for await(let R of T)w.emitOne(R)}catch(R){throw R.fetcherId=E.fetcher,R.gitHubRequestId=b,R.bytesReceived=E.bytesReceived,R}})}catch(T){throw T.fetcherId=E.fetcher,T.gitHubRequestId=b,T.bytesReceived=E.bytesReceived,T}return E.headers.get("Copilot-Edits-Session")&&(this._authenticationService.speculativeDecodingEndpointToken=E.headers.get("Copilot-Edits-Session")??void 0),this._chatQuotaService.processQuotaHeaders(E.headers),{result:{type:fn.FetchResponseKind.Success,chatCompletions:v},fetcher:E.fetcher,bytesReceived:E.bytesReceived,modelCallId:y}}async _fetchWithInstrumentation(e,r,n,o,s,c,l,u,d,f,h){let m={"X-Interaction-Id":this._interactionService.interactionId,"X-Initiator":l?"user":"agent"};n.messages?.some(E=>Array.isArray(E.content)?E.content.some(_=>"image_url"in _):!1)&&e.supportsVision&&(m["Copilot-Vision-Request"]="true");let g=vye.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,wn.stringifyToolsRawForTelemetry)(_)??"undefined";continue}g.properties[`request.option.${E}`]=JSON.stringify(_)??"undefined"}g.properties.headerRequestId=r,this._telemetryService.sendGHTelemetryEvent("request.sent",g.properties,g.measurements),n.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,jNr.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,wn.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=Jvt(s);return this._instantiationService.invokeFunction(Yvt.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,BNr.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,Yvt.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,Yvt.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,uLe.responseApiInputToRawMessagesForLogging)(n);E=(0,cI.rawMessageToCAPI)(_)}catch(_){this._logService.error("Failed to convert Response API input to messages for telemetry:",_),E=[]}(0,l8i.sendEngineMessagesTelemetry)(this._telemetryService,E??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,BNr.getRequestId)(r.headers);n=o.headerRequestId||n,o.headerRequestId=n,this._chatQuotaService.processQuotaHeaders(r.headers),e.properties.error=`Response status was ${r.status}`,e.properties.status=String(r.status),this._telemetryService.sendGHTelemetryEvent("request.shownWarning",e.properties,e.measurements);let s=await r.text(),c;try{c=JSON.parse(s),c=c?.error??c}catch{}let l=`Server error: ${r.status}`,u=`${l} ${s}`;if(this._logService.error(u),400<=r.status&&r.status<500){if(r.status===400&&s.includes("off_topic"))return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.OffTopic,reason:"filtered as off_topic by intent classifier: message was not programming related"};if(r.status===401&&s.includes("authorize_url")&&c?.authorize_url)return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.InvalidPreviousResponseId,reason:c.message||"Invalid previous response ID",data:c};if(r.status===401||r.status===403)return this._authenticationService.resetCopilotToken(r.status),{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.TokenExpiredOrInvalid,reason:c?.message||`token expired or invalid: ${r.status}`};if(r.status===402){this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(r.status),await this._authenticationService.getCopilotToken());let d=r.headers.get("retry-after"),h=a(m=>{if(!m)return;let g=new Date(m);if(!isNaN(g.getDate()))return g;let A=parseInt(m,10);if(!isNaN(A))return new Date(Date.now()+A*1e3)},"convertToDate")(d);return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.QuotaExceeded,reason:c?.message??"Free tier quota exceeded",data:{capiError:c,retryAfter:h}}}if(r.status===404){let d;return c?d=JSON.stringify(c):d=s,{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service +`,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 -`+s};if(r.status===424)return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.AgentFailedDependency,reason:s};if(r.status===429){let d=s;return d=c?.message??c?.code,s.includes("extension_blocked")&&c?.code==="extension_blocked"&&c?.type==="rate_limit_error"?{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.RateLimited,reason:d,data:{retryAfter:r.headers.get("retry-after"),rateLimitKey:r.headers.get("x-ratelimit-exceeded"),capiError:c}}}if(r.status===466)return this._logService.info(s),{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,u8i.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.Unknown,reason:`Request Failed: ${r.status} ${s}`}}async processSuccessfulResponse(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b){let T=[];for await(let P of e.chatCompletions)_ye.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([cI.FinishedCompletionReason.Stop,cI.FinishedCompletionReason.ClientTrimmed,cI.FinishedCompletionReason.FunctionCall,cI.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,lLe.getTextPart)(P.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:b};let x=T.at(0);switch(x?.finishReason){case cI.FinishedCompletionReason.ContentFilter:return{type:Wn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??cI.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(P=>(0,lLe.getTextPart)(P.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case cI.FinishedCompletionReason.Length:return{type:Wn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,lLe.getTextPart)(x.message.content)};case cI.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,Kvt.calculateLineRepetitionStats)((0,lLe.getTextPart)(e.message.content)),o=(0,Kvt.isRepetitive)(e.tokens);if(o){let s=vye.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,Kvt.calculateLineRepetitionStats)(o);if((0,Kvt.isRepetitive)(s)){let d=vye.TelemetryData.createAndMarkAsIssued().extendedBy(n);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",d.properties,d.measurements)}c.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:r,finishReason:"canceled"},{numberOfRepetitions:c.numberOfRepetitions,lengthOfLine:c.mostRepeatedLine.length,totalLines:c.totalLines})}processCanceledResponse(e,r,n,o){return n&&n.deltas.length>0&&this.checkRepetitionInDeltas(n.deltas,r,o),{type:Wn.ChatFetchResponseType.Canceled,reason:e.reason,requestId:r,serverRequestId:void 0}}processFailedResponse(e,r,n){let o=e.modelRequestId?.gitHubRequestId,s=e.reason;if(e.failKind===fn.ChatFailKind.RateLimited)return{type:Wn.ChatFetchResponseType.RateLimited,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,rateLimitKey:e.data?.rateLimitKey||"",isAuto:n,capiError:e.data?.capiError};if(e.failKind===fn.ChatFailKind.QuotaExceeded)return{type:Wn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===fn.ChatFailKind.OffTopic)return{type:Wn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===fn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:Wn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.ServerError)return{type:Wn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.ContentFilter)return{type:Wn.ChatFetchResponseType.PromptFiltered,reason:s,category:cI.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.AgentUnauthorized)return{type:Wn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.AgentFailedDependency)return{type:Wn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.ExtensionBlocked){let c=typeof e.data?.retryAfter=="number"?e.data.retryAfter:300;return{type:Wn.ChatFetchResponseType.ExtensionBlocked,reason:s,requestId:r,retryAfter:c,learnMoreLink:e.data?.learnMoreLink??"",serverRequestId:o}}return e.failKind===fn.ChatFailKind.NotFound?{type:Wn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===fn.ChatFailKind.InvalidPreviousResponseId?{type:Wn.ChatFetchResponseType.InvalidStatefulMarker,reason:s,requestId:r,serverRequestId:o}:{type:Wn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o}}processError(e,r,n,o,s){let c=e?.capiWebSocketError;if(c)return this._handleWebSocketError(c,r,n,s);let l=this._fetcherService;if(l.isAbortError(e))return{type:Wn.ChatFetchResponseType.Canceled,reason:"network request aborted",requestId:r,serverRequestId:n};if((0,f8i.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(KEc.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,qNr.collectSingleLineErrorMessage)(e,!0),f=this.scrubErrorDetail(d,o);if(l.isInternetDisconnectedError(e))return{type:Wn.ChatFetchResponseType.NetworkError,reason:"It appears you're not connected to the internet, please check your network connection and try again.",reasonDetail:f,requestId:r,serverRequestId:n};if(l.isFetcherError(e)){let h=l.isNetworkProcessCrashedError(e);return{type:Wn.ChatFetchResponseType.NetworkError,reason:u,reasonDetail:f,requestId:r,serverRequestId:n,...h?{isNetworkProcessCrash:!0}:{}}}else return{type:Wn.ChatFetchResponseType.Failed,reason:"Error on conversation request. Check the log for more details.",reasonDetail:f,requestId:r,serverRequestId:n}}async _handleWebSocketCAPIError(e,r){let{code:n,message:o}=e.error,s={code:n,message:o},c=n.split(":")[0];return this._logService.error(`WebSocket CAPI error: ${o} (${n})`),c==="rate_limited"||c==="user_model_rate_limited"||c==="user_global_rate_limited"||c==="integration_rate_limited"||c==="model_overloaded"||c==="agent_mode_limit_exceeded"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.RateLimited,reason:o,data:{capiError:s}}:c==="quota_exceeded"||c==="free_quota_exceeded"||c==="overage_limit_reached"||c==="billing_not_configured"||c==="additional_spend_limit_reached"?(this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(402),await this._authenticationService.getCopilotToken()),{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o||"WebSocket server error"}`}}_handleWebSocketError(e,r,n,o){let{code:s,message:c}=e.error,l={code:s,message:c},u=s.split(":")[0];return u==="rate_limited"||u==="user_model_rate_limited"||u==="user_global_rate_limited"||u==="integration_rate_limited"||u==="model_overloaded"||u==="agent_mode_limit_exceeded"?{type:Wn.ChatFetchResponseType.RateLimited,reason:c,requestId:r,serverRequestId:n,retryAfter:void 0,rateLimitKey:"",isAuto:o,capiError:l}:u==="quota_exceeded"||u==="free_quota_exceeded"||u==="overage_limit_reached"||u==="billing_not_configured"||u==="additional_spend_limit_reached"?{type:Wn.ChatFetchResponseType.QuotaExceeded,reason:c,requestId:r,serverRequestId:n,capiError:l,retryAfter:void 0}:s==="content_filter"?{type:Wn.ChatFetchResponseType.PromptFiltered,reason:c,category:cI.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,XEc.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};lI.ChatMLFetcherImpl=HNr;lI.ChatMLFetcherImpl=HNr=QNr=BEc([Nv(0,$Ec.IFetcherService),Nv(1,jNr.ITelemetryService),Nv(2,WEc.IRequestLogger),Nv(3,qNr.ILogService),Nv(4,FEc.IAuthenticationService),Nv(5,jEc.IInteractionService),Nv(6,QEc.IChatQuotaService),Nv(7,HEc.ICAPIClientService),Nv(8,qEc.IConversationOptions),Nv(9,G$.IConfigurationService),Nv(10,zEc.IExperimentationService),Nv(11,r_c.IPowerService),Nv(12,e_c.IInstantiationService),Nv(13,h8i.IChatWebSocketManager),Nv(14,VEc.IOTelService)],HNr);function n_c(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:UNr("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:UNr("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:UNr("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>G$.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${G$.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-G$.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(n_c,"isValidChatPayload");function UNr(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(UNr,"asUnexpected");function m8i(t,e,r){return vye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Wn.ChatLocation.toString(e),headerRequestId:r})}a(m8i,"createTelemetryData");function Jvt(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(Jvt,"locationToIntent");function i_c(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(i_c,"pickCacheRelevantRequestOptions");function o_c(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(o_c,"pickRequestShapeMetadata")});var $Nr=I(Cye=>{"use strict";p();Object.defineProperty(Cye,"__esModule",{value:!0});Cye.NullSimilarFilesContextService=Cye.ISimilarFilesContextService=void 0;var s_c=rn();Cye.ISimilarFilesContextService=(0,s_c.createServiceIdentifier)("ISimilarFilesContextService");var GNr=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};Cye.NullSimilarFilesContextService=GNr});var VNr=I(Xvt=>{"use strict";p();Object.defineProperty(Xvt,"__esModule",{value:!0});Xvt.IDiffService=void 0;var a_c=rn();Xvt.IDiffService=(0,a_c.createServiceIdentifier)("IDiffService")});var A8i=I(WNr=>{"use strict";p();Object.defineProperty(WNr,"__esModule",{value:!0});WNr.createProxyXtabEndpoint=d_c;var c_c=(fne(),_a(dne)),l_c=Cle(),u_c=wne();function d_c(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:c_c.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:l_c.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(u_c.ChatEndpoint,r)}a(d_c,"createProxyXtabEndpoint")});var Pne=I(eCt=>{"use strict";p();Object.defineProperty(eCt,"__esModule",{value:!0});eCt.DocumentId=void 0;var f_c=nWe(),y8i=EA(),p_c=Ku(),zNr=class t{static{a(this,"DocumentId")}static{this._cache=new f_c.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=p_c.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,y8i.basename)(this.uri)}get extension(){return(0,y8i.extname)(this.uri)}toUri(){return this._uri}};eCt.DocumentId=zNr});var YNr=I(tCt=>{"use strict";p();Object.defineProperty(tCt,"__esModule",{value:!0});tCt.NextCursorLinePrediction=void 0;var E8i;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(E8i||(tCt.NextCursorLinePrediction=E8i={}))});var rCt=I($$=>{"use strict";p();Object.defineProperty($$,"__esModule",{value:!0});$$.NullUndesiredModelsManager=$$.IUndesiredModelsManager=$$.IInlineEditsModelService=void 0;var _8i=rn(),h_c=bc();$$.IInlineEditsModelService=(0,_8i.createServiceIdentifier)("IInlineEditsModelService");$$.IUndesiredModelsManager=(0,_8i.createServiceIdentifier)("IUndesiredModelsManager");var KNr=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=h_c.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};$$.NullUndesiredModelsManager=KNr});var v8i=I(q6=>{"use strict";p();Object.defineProperty(q6,"__esModule",{value:!0});q6.IgnoreWhitespaceOnlyChanges=q6.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;q6.editWouldDeleteWhatWasJustInserted=m_c;q6.editIsDeletion=XNr;q6.editWouldDeleteWhatWasJustInserted2=g_c;var JNr=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}};q6.IgnoreWhitespaceOnlyChanges=ZNr;function m_c(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!XNr(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(m_c,"editWouldDeleteWhatWasJustInserted");function XNr(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(XNr,"editIsDeletion");function g_c(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!XNr(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(g_c,"editWouldDeleteWhatWasJustInserted2")});var tMr=I(bye=>{"use strict";p();Object.defineProperty(bye,"__esModule",{value:!0});bye.NulSimulationTestContext=bye.ISimulationTestContext=void 0;var A_c=rn();bye.ISimulationTestContext=(0,A_c.createServiceIdentifier)("ISimulationTestContext");var eMr=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};bye.NulSimulationTestContext=eMr});var iCt=I(nCt=>{"use strict";p();Object.defineProperty(nCt,"__esModule",{value:!0});nCt.BaseAlternativeNotebookContentProvider=void 0;var rMr=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};nCt.BaseAlternativeNotebookContentProvider=rMr});var iMr=I(oN=>{"use strict";p();Object.defineProperty(oN,"__esModule",{value:!0});oN.DEFAULT_WORD_REGEXP=oN.USUAL_WORD_SEPARATORS=void 0;oN.ensureValidWordDefinition=C8i;oN.setDefaultGetWordAtTextConfig=C_c;oN.getWordAtText=b8i;var y_c=z8t(),E_c=Io(),__c=ale();oN.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function v_c(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of oN.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(v_c,"createWordRegExp");oN.DEFAULT_WORD_REGEXP=v_c();function C8i(t){let e=oN.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(C8i,"ensureValidWordDefinition");var nMr=new __c.LinkedList;nMr.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function C_c(t){let e=nMr.unshift(t);return(0,E_c.toDisposable)(e)}a(C_c,"setDefaultGetWordAtTextConfig");function b8i(t,e,r,n,o){if(e=C8i(e),o||(o=y_c.Iterable.first(nMr)),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),b8i(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=b_c(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(b8i,"getWordAtText");function b_c(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(b_c,"_findRegexMatchEnclosingPosition")});var S8i=I(oCt=>{"use strict";p();Object.defineProperty(oCt,"__esModule",{value:!0});oCt.toUint8=S_c;oCt.toUint32=T_c;function S_c(t){return t<0?0:t>255?255:t|0}a(S_c,"toUint8");function T_c(t){return t<0?0:t>4294967295?4294967295:t|0}a(T_c,"toUint32")});var T8i=I(V$=>{"use strict";p();Object.defineProperty(V$,"__esModule",{value:!0});V$.PrefixSumIndexOfResult=V$.ConstantTimePrefixSumComputer=V$.PrefixSumComputer=void 0;var I_c=Al(),Sye=S8i(),oMr=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,Sye.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,Sye.toUint32)(e),r=(0,Sye.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,Sye.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 Tye(o,e-c)}};V$.PrefixSumComputer=oMr;var sMr=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 Tye(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new Tye(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,I_c.arrayInsert)(this._values,e,r),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,r=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=o+n;for(let s=0;s0?this._prefixSum[this._values.length-1]:0,this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,r){this._values[e]!==r&&(this._values[e]=r,this._invalidate(e))}};V$.ConstantTimePrefixSumComputer=sMr;var Tye=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};V$.PrefixSumIndexOfResult=Tye});var cMr=I(sCt=>{"use strict";p();Object.defineProperty(sCt,"__esModule",{value:!0});sCt.PositionOffsetTransformer=void 0;var I8i=Qh(),x8i=bE(),x_c=dd(),w_c=T8i(),kne=b0(),aMr=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,I8i.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,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 `:` -`;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,I8i.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 kne.TextEdit(this.validateRange(n.range),n.newText));return new x8i.StringEdit(r.map(n=>new x8i.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new kne.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof kne.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 kne.Position(r,n):e}validateRange(e){return new kne.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};sCt.PositionOffsetTransformer=aMr});var uMr=I(Dne=>{"use strict";p();Object.defineProperty(Dne,"__esModule",{value:!0});Dne.SnapshotDocumentLine=Dne.TextDocumentSnapshot=void 0;Dne.isTextDocumentSnapshotJSON=P_c;var aCt=SS(),R8i=Ku(),w8i=iMr(),Iye=b0(),R_c=cMr();function P_c(t){return!t||typeof t!="object"?!1:(0,R8i.isUriComponents)(t.uri)&&(0,aCt.isString)(t._text)&&(0,aCt.isString)(t.languageId)&&(0,aCt.isNumber)(t.version)&&(0,aCt.isNumber)(t.eol)}a(P_c,"isTextDocumentSnapshotJSON");var lMr=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,R8i.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new R_c.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 Iye.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 cCt(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,w8i.getWordAtText)(r.character+1,w8i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new Iye.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 Iye.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 Iye.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};Dne.TextDocumentSnapshot=lMr;var cCt=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 Iye.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new Iye.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}};Dne.SnapshotDocumentLine=cCt});var dCt=I(uCt=>{"use strict";p();Object.defineProperty(uCt,"__esModule",{value:!0});uCt.AlternativeNotebookDocument=void 0;var P8i=iMr(),lCt=b0(),k_c=cMr(),D_c=uMr(),dMr=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new k_c.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,P8i.getWordAtText)(r.character+1,P8i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new lCt.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 lCt.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new D_c.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 lCt.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 lCt.Position(r,n):e}};uCt.AlternativeNotebookDocument=dMr});var fCt=I(xye=>{"use strict";p();Object.defineProperty(xye,"__esModule",{value:!0});xye.isUri=M_c;xye.isLocation=fMr;xye.toLocation=O_c;xye.isSymbolInformation=B_c;var dLe=b0(),N_c=Ku();function M_c(t){return N_c.URI.isUri(t)}a(M_c,"isUri");function fMr(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(fMr,"isLocation");function O_c(t){if(fMr(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new dLe.Location(t.uri,new dLe.Range(new dLe.Position(e.line,e.character),new dLe.Position(r.line,r.character)))}else if(fMr(t)&&t.range instanceof dLe.Range)return t}a(O_c,"toLocation");function B_c(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(B_c,"isSymbolInformation")});var hLe=I(gy=>{"use strict";p();Object.defineProperty(gy,"__esModule",{value:!0});gy.CellIdPatternRe=gy.EOL=gy.LineOfText=void 0;gy.summarize=F_c;gy.notebookCellToCellData=U_c;gy.getCellIdMap=Q_c;gy.normalizeCellId=q_c;gy.getNotebookId=j_c;gy.getCellId=mMr;gy.getDefaultLanguage=G_c;gy.requestHasNotebookRefs=V_c;gy.parseAndCleanStack=W_c;var k8i=fCt(),O8i=MDr(),L_c=Qh(),D8i=Ku(),hMr=b0(),pMr=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};gy.LineOfText=pMr;gy.EOL=` -`;function F_c(t){let e=t.kind===hMr.NotebookCellKind.Code?"code":"markdown",r=mMr(t),n=H_c(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(F_c,"summarize");function U_c(t){let e=new hMr.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(U_c,"notebookCellToCellData");function Q_c(t){let e=new Map;return t.getCells().forEach(r=>{e.set(mMr(r),r)}),e}a(Q_c,"getCellIdMap");var N8i=new WeakMap,pLe=8,fLe="#VSC-";gy.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${pLe}})\\b`,"gi");function q_c(t){return t.startsWith(fLe)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===pLe+3?`${fLe}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===pLe+7?`${fLe}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===pLe?`${fLe}${t}`:t}a(q_c,"normalizeCellId");var M8i=new WeakMap;function j_c(t){let e=M8i.get(t);if(e)return e;let r=new O8i.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),M8i.set(t,e),e}a(j_c,"getNotebookId");function mMr(t){let e=N8i.get(t);if(e)return e;let r=new O8i.StringSHA1;return r.update(t.document.uri.toString()),e=`${fLe}${r.digest().substring(0,pLe)}`,N8i.set(t,e),e}a(mMr,"getCellId");function H_c(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(H_c,"getCellCode");function G_c(t){let e=t.getCells().find(r=>r.kind===hMr.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(G_c,"getDefaultLanguage");var $_c=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function V_c(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&$_c.some(o=>n.includes(o))?!0:t.references.some(o=>(0,k8i.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,D8i.isUriComponents)(o.value)?e.hasSupportedNotebooks(D8i.URI.revive(o.value)):(0,k8i.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(V_c,"requestHasNotebookRefs");function W_c(t){try{let e=JSON.parse(t);return(0,L_c.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(W_c,"parseAndCleanStack")});var F8i=I(mLe=>{"use strict";p();Object.defineProperty(mLe,"__esModule",{value:!0});mLe.AlternativeJsonNotebookContentProvider=void 0;mLe.isJsonContent=Z_c;var z_c=(ofr(),_a(KJn)),Y_c=Yc(),B8i=Ku(),sN=b0(),K_c=iCt(),J_c=dCt(),wye=hLe(),L8i=4;function Z_c(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(Z_c,"isJsonContent");var pCt=class extends J_c.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,wye.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 sN.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new sN.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},gMr=class extends K_c.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 pCt(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==sN.NotebookCellKind.Markup:!0).map(c=>{let l=(0,wye.summarize)(c),u=X_c(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,L8i);return new pCt(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,wye.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,L8i).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(wye.EOL)}parseAlternateContentImpl(e,r,n){return new Y_c.AsyncIterableObject(async o=>{let s=B8i.URI.isUri(e)?new Map:(0,wye.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:sN.NotebookCellKind.Code,source:[]},f=B8i.URI.isUri(e)?"python":(0,wye.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"?sN.NotebookCellKind.Markup:sN.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,z_c.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=sN.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?sN.NotebookCellKind.Code:sN.NotebookCellKind.Markup,d.kind===sN.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=sN.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)})}};mLe.AlternativeJsonNotebookContentProvider=gMr;function X_c(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(X_c,"getCellCode")});var yMr=I(W$=>{"use strict";p();Object.defineProperty(W$,"__esModule",{value:!0});W$.wellKnownLanguages=void 0;W$.getLanguage=U8i;W$.getLanguageForResource=rvc;var evc=kk(),tvc=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"]}});W$.wellKnownLanguages=new Map(Object.entries(tvc).map(([t,e])=>[t,{languageId:t,...e}]));function U8i(t){return AMr(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(U8i,"getLanguage");function AMr(t){return W$.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a(AMr,"_getLanguage");function rvc(t){let e=(0,evc.extname)(t).toLowerCase();for(let r of W$.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return U8i("plaintext")}a(rvc,"getLanguageForResource")});var j8i=I(z$=>{"use strict";p();Object.defineProperty(z$,"__esModule",{value:!0});z$.AlternativeTextNotebookContentProvider=void 0;z$.generateCellTextMarker=vMr;z$.lineMightHaveCellMarker=CMr;z$.getBlockComment=Pye;z$.getLineCommentStart=kye;var _Mr=yMr(),nvc=fCt(),ivc=aQ(),Rye=b0(),ovc=iCt(),svc=dCt(),km=hLe();function vMr(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(vMr,"generateCellTextMarker");function CMr(t){return t.toLowerCase().includes("vscode.cell")}a(CMr,"lineMightHaveCellMarker");var hCt=class extends svc.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,km.summarize)(e),o=kye(this.notebook),s=vMr(n,o),c=e.document.eol===Rye.EndOfLine.LF?1:2,l=Pye(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===Rye.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,ivc.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}}},EMr=class extends ovc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(km.EOL);return r.length&&CMr(r[0])?(r.shift(),r.join(km.EOL)):e}getSummaryOfStructure(e,r,n){let o=Pye(e),s=kye(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,km.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(Q8i(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(km.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,nvc.isUri)(e),s=o?(0,km.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=kye(o?e:void 0),m=Pye(o?e:void 0),g=o?(0,_Mr.getLanguage)((0,km.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||_?q8i(E,g):void 0;if((v||_)&&b?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:Rye.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"?Rye.NotebookCellKind.Markup:Rye.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=Pye(r),o=kye(r),s=(0,km.getCellIdMap)(r),c=[],l=e.split(km.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(E=>E.cell===y));if(A){let y=u,E=km.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+km.EOL.length}return new hCt(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==Rye.NotebookCellKind.Markup:!0).map(d=>(0,km.summarize)(d)),o=Pye(e),s=kye(e),c=n.map(d=>({...Q8i(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(km.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 hCt(l,u,e)}};z$.AlternativeTextNotebookContentProvider=EMr;function Q8i(t,e,r){let n=vMr(t,e),o=t.source.join(km.EOL),s=t.language==="markdown"?`${n}${km.EOL}${r[0]}${km.EOL}`:`${n}${km.EOL}`;return{content:t.language==="markdown"?`${s}${o}${km.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(Q8i,"generateAlternativeCellTextContent");function Pye(t){return t?(0,_Mr.getLanguage)((0,km.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a(Pye,"getBlockComment");function kye(t){return t&&(0,_Mr.getLanguage)((0,km.getDefaultLanguage)(t)).lineComment.start||"#"}a(kye,"getLineCommentStart");function q8i(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:CMr(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(q8i,"extractCellParts")});var $8i=I(yLe=>{"use strict";p();Object.defineProperty(yLe,"__esModule",{value:!0});yLe.AlternativeXmlNotebookContentProvider=void 0;yLe.isXmlContent=G8i;var avc=yMr(),cvc=fCt(),lvc=aQ(),gLe=b0(),uvc=iCt(),dvc=dCt(),qE=hLe(),ALe="`}a(bMr,"generateCellMarker");function G8i(t){return t.includes(ALe)||t.includes(Y$)||t.includes(mCt)}a(G8i,"isXmlContent");var gCt=class extends dvc.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,qE.summarize)(e),o=bMr(n),s=e.document.eol===gLe.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,lvc.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}}},SMr=class extends uvc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(qE.EOL);return r.length&&(r[0].startsWith(ALe)||r[0].startsWith(mCt))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(Y$)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(Y$))),r.join(qE.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,qE.summarize)(c);o.push(bMr(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(Y$)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(qE.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,cvc.isUri)(e),s=o?(0,qE.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,avc.getLanguage)((0,qE.getDefaultLanguage)(e)).languageId:void 0;for await(let m of r){if(n.isCancellationRequested)break;let g=m.value;if((g.startsWith(ALe)||g.startsWith(mCt))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(Y$)),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:gLe.NotebookCellKind.Code},y=H8i(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"?gLe.NotebookCellKind.Markup:gLe.NotebookCellKind.Code),yield A}else g.startsWith(Y$)?(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(Y$),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,qE.getCellIdMap)(r),o=[],s=e.split(qE.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=qE.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+qE.EOL.length}return new gCt(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==gLe.NotebookCellKind.Markup:!0).map(l=>(0,qE.summarize)(l)).map(l=>{let d=`${bMr(l)}${qE.EOL}`;return{content:`${d}${l.source.join(qE.EOL)}${qE.EOL}${Y$}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(qE.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new gCt(s,c,e)}};yLe.AlternativeXmlNotebookContentProvider=SMr;function H8i(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(G8i(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(H8i,"extractCellParts")});var K8i=I(h1=>{"use strict";p();var pvc=h1&&h1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},V8i=h1&&h1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(h1,"__esModule",{value:!0});h1.AlternativeNotebookContentService=h1.IAlternativeNotebookContentService=void 0;h1.getAlternativeNotebookDocumentProvider=IMr;h1.inferAlternativeNotebookContentFormat=_vc;h1.getAltNotebookRange=vvc;var hvc=evt(),mvc=rn(),gvc=b0(),W8i=Tl(),Avc=$Be(),yvc=Cp(),z8i=F8i(),Evc=j8i(),Y8i=$8i();function IMr(t){switch(t){case"xml":return new Y8i.AlternativeXmlNotebookContentProvider;case"text":return new Evc.AlternativeTextNotebookContentProvider;case"json":return new z8i.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(IMr,"getAlternativeNotebookDocumentProvider");function _vc(t){return(0,Y8i.isXmlContent)(t)?"xml":(0,z8i.isJsonContent)(t)?"json":"text"}a(_vc,"inferAlternativeNotebookContentFormat");h1.IAlternativeNotebookContentService=(0,mvc.createServiceIdentifier)("IAlternativeNotebookContentService");var TMr=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,Avc.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig(W8i.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return IMr(e)}};h1.AlternativeNotebookContentService=TMr;h1.AlternativeNotebookContentService=TMr=pvc([V8i(0,W8i.IConfigurationService),V8i(1,yvc.IExperimentationService)],TMr);function vvc(t,e,r,n){let o=(0,hvc.findCell)(e,r);if(!o)return;let s=IMr(n).getAlternativeDocument(r);return new gvc.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(vvc,"getAltNotebookRange")});var Z8i=I(ELe=>{"use strict";p();Object.defineProperty(ELe,"__esModule",{value:!0});ELe.NotebookDocumentSnapshot=void 0;ELe.isNotebookDocumentSnapshotJSON=Svc;var ACt=SS(),Cvc=Ku(),xMr=b0(),J8i=K8i(),bvc=hLe();function Svc(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,Cvc.isUriComponents)(t.uri)&&(0,ACt.isString)(t._text)&&(0,ACt.isString)(t.languageId)&&(0,ACt.isNumber)(t.version)&&(0,ACt.isString)(t.alternativeFormat)}a(Svc,"isNotebookDocumentSnapshotJSON");var wMr=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,J8i.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,J8i.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,bvc.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new xMr.Selection(0,0,this.lineCount,0)}getWholeRange(){return new xMr.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 xMr.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}}};ELe.NotebookDocumentSnapshot=wMr});var PMr=I(Mv=>{"use strict";p();var Tvc=Mv&&Mv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ivc=Mv&&Mv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xvc=Mv&&Mv.__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,X8i.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return Mvc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,wvc.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return Nvc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>X8i.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};Mv.AbstractWorkspaceService=yCt;function Ovc(t,e){let r=t.getWorkspaceFolder(e);return r?kvc.posix.relative(r.path,e.path):e.path}a(Ovc,"getWorkspaceFileDisplayPath");var RMr=class extends yCt{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new Pvc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new K$.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new K$.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new K$.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new K$.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new K$.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new K$.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new K$.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new K$.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)}};Mv.NullWorkspaceService=RMr});var MMr=I(Nne=>{"use strict";p();Object.defineProperty(Nne,"__esModule",{value:!0});Nne.BatchedProcessor=Nne.TaskQueue=void 0;Nne.raceFilter=Bvc;var kMr=Yc(),e6i=Is(),DMr=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new kMr.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new kMr.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 e6i.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 e6i.CancellationError)}};Nne.TaskQueue=DMr;var NMr=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 kMr.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)}};Nne.BatchedProcessor=NMr;function Bvc(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(Bvc,"raceFilter")});var OMr=I(Dye=>{"use strict";p();Object.defineProperty(Dye,"__esModule",{value:!0});Dye.AsyncIterUtilsExt=Dye.AsyncIterUtils=void 0;var t6i;(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})(t6i||(Dye.AsyncIterUtils=t6i={}));var r6i;(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})(r6i||(Dye.AsyncIterUtilsExt=r6i={}))});var LMr=I(BMr=>{"use strict";p();Object.defineProperty(BMr,"__esModule",{value:!0});BMr.backwardCompatSetting=Lvc;function Lvc(t,e){return e(t)}a(Lvc,"backwardCompatSetting")});var i6i=I(uI=>{"use strict";p();Object.defineProperty(uI,"__esModule",{value:!0});uI.LineWithTokens=uI.Token=void 0;uI.getOrDeduceSelectionFromLastEdit=Uvc;uI.clipTokensToRange=n6i;uI.clipTokensToRangeAndAdjustOffsets=qvc;uI.removeTokensInRangeAndAdjustOffsets=jvc;uI.getTokensFromLogProbs=Hvc;uI.getTokensFromLinesWithTokens=Gvc;uI.mergeOffsetRangesAtDistance=$vc;var Fvc=Is(),Nye=dd();function Uvc(t){let e=new Nye.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):Qvc(t)}a(Uvc,"getOrDeduceSelectionFromLastEdit");function Qvc(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 Nye.OffsetRange(c,c))}a(Qvc,"deduceSelectionFromLastEdit");var ECt=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 Nye.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)}};uI.Token=ECt;function n6i(t,e){return t.filter(r=>e.intersects(r.range))}a(n6i,"clipTokensToRange");function qvc(t,e){return n6i(t,e).map(r=>r.deltaOffset(-e.start))}a(qvc,"clipTokensToRangeAndAdjustOffsets");function jvc(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(jvc,"removeTokensInRangeAndAdjustOffsets");function Hvc(t,e){let r=e;return t.content.map(n=>{let o=new ECt(n.token,n.logprob,r);return r+=o.range.length,o})}a(Hvc,"getTokensFromLogProbs");var FMr=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,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 `),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)}};uI.LineWithTokens=FMr;function Gvc(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(Gvc,"getTokensFromLinesWithTokens");function $vc(t,e){if(e<0)throw new Fvc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new Nye.OffsetRange(o.start-e,o.endExclusive+e)),n=new Nye.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new Nye.OffsetRange(o.start+e,o.endExclusive-e))}a($vc,"mergeOffsetRangesAtDistance")});var o6i=I(_Ct=>{"use strict";p();Object.defineProperty(_Ct,"__esModule",{value:!0});_Ct.DelaySession=void 0;var UMr=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)}};_Ct.DelaySession=UMr});var l6i=I(Tp=>{"use strict";p();var Vvc=Tp&&Tp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},vCt=Tp&&Tp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Tp,"__esModule",{value:!0});Tp.UserInteractionMonitor=Tp.MAX_INTERACTIONS_STORED=Tp.MAX_INTERACTIONS_CONSIDERED=Tp.ActionKind=void 0;Tp.getWindowWithIgnoredLimit=a6i;Tp.getUserHappinessScore=c6i;var Mye=Tl(),Mne=sy(),Wvc=Ep(),zvc=Cp(),Yvc=qh(),s6i=$_(),Kvc=o6i(),dI;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(dI||(Tp.ActionKind=dI={}));Tp.MAX_INTERACTIONS_CONSIDERED=10;Tp.MAX_INTERACTIONS_STORED=30;function a6i(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-Tp.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(a6i,"getWindowWithIgnoredLimit");function c6i(t,e){if(t.length===0)return .5;let r=a6i(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/Tp.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(c6i,"getUserHappinessScore");var QMr=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(dI.Accepted)}handleRejection(){this._recordUserAction(dI.Rejected)}handleIgnored(){this._recordUserAction(dI.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===dI.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-Tp.MAX_INTERACTIONS_STORED),e!==dI.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-Tp.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(Mye.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(Mye.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new Kvc.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===dI.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(Mye.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=Mne.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(Mye.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=Mne.AggressivenessLevel.High:c>=s.mediumThreshold?o=Mne.AggressivenessLevel.Medium:o=Mne.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=Mye.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return Mne.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,Mne.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:s6i.ErrorUtils.toString(s6i.ErrorUtils.fromUnknown(n)),configValue:r}),Mne.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return c6i(this._recentUserActionsForAggressiveness,e)}};Tp.UserInteractionMonitor=QMr;Tp.UserInteractionMonitor=QMr=Vvc([vCt(0,Mye.IConfigurationService),vCt(1,zvc.IExperimentationService),vCt(2,Wvc.ILogService),vCt(3,Yvc.ITelemetryService)],QMr)});var u6i=I(qMr=>{"use strict";p();Object.defineProperty(qMr,"__esModule",{value:!0});qMr.isImportStatement=Jvc;function Jvc(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(Jvc,"isImportStatement")});var p6i=I(CCt=>{"use strict";p();Object.defineProperty(CCt,"__esModule",{value:!0});CCt.IgnoreImportChangesAspect=void 0;var d6i=Bvr(),Zvc=Al(),f6i=u6i(),jMr=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,f6i.isImportStatement)(o,r))||Xvc(e,n).some(o=>(0,f6i.isImportStatement)(o,r))}static filterEdit(e,r,n=d6i.ImportChanges.None){if(n===d6i.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};CCt.IgnoreImportChangesAspect=jMr;function Xvc(t,e){return(0,Zvc.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(Xvc,"getOldLines")});var GMr=I(bCt=>{"use strict";p();Object.defineProperty(bCt,"__esModule",{value:!0});bCt.FetchStreamError=void 0;var HMr=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};bCt.FetchStreamError=HMr});var h6i=I(SCt=>{"use strict";p();Object.defineProperty(SCt,"__esModule",{value:!0});SCt.DiagnosticData=void 0;var eCc=kk(),$Mr=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,eCc.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}};SCt.DiagnosticData=$Mr});var J$=I(Oye=>{"use strict";p();Object.defineProperty(Oye,"__esModule",{value:!0});Oye.ResponseTags=Oye.PromptTags=void 0;var m6i;(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})(m6i||(Oye.PromptTags=m6i={}));var g6i;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(g6i||(Oye.ResponseTags=g6i={}))});var KMr=I(j6=>{"use strict";p();var tCc=j6&&j6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},rCc=j6&&j6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(j6,"__esModule",{value:!0});j6.LintErrors=void 0;var nCc=h6i(),$R=sy(),iCc=g$(),oCc=Is(),VMr=kk(),sCc=zp(),y6i=dd(),aCc=b0(),cCc=J$(),zMr=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 sCc.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,VMr.isEqual)(n,s)?ICt.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new YMr(s,l.message,l.severity===aCc.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=fCc(n,e.maxLineDistance),n=A6i(n),n=WMr(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,VMr.isEqual)(l.documentUri,o)?e:{...e,showCode:$R.LintOptionShowCode.NO};return TCt(l,this._document.lines,d)}).join(` -`),c=cCc.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)}};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} ${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=WMr(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 oCc.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,VMr.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===$R.LintOptionShowCode.NO)continue;if(E6i(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:$R.LintOptionWarning.YES,showCode:$R.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=WMr(r,$R.LintOptionWarning.YES),r=A6i(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:TCt(o,this._document.lines,e),formattedCode:TCt(o,this._document.lines,{...e,showCode:$R.LintOptionShowCode.YES}),formattedCodeWithSurrounding:TCt(o,this._document.lines,{...e,showCode:$R.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};j6.LintErrors=zMr;j6.LintErrors=zMr=tCc([rCc(2,iCc.ILanguageDiagnosticsService)],zMr);function TCt(t,e,r){let n=lCc(t,t.documentRange);if(r.showCode===$R.LintOptionShowCode.NO)return n;let o=uCc(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=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+` `+o.join(` -`)}a(TCt,"formatSingleDiagnostic");function lCc(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(lCc,"formatDiagnosticMessage");function uCc(t,e,r){let o=E6i(t,e).intersect(new y6i.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(fCc,"filterDiagnosticsByDistance");function A6i(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:ICt.compareFn(e.distance,r.distance))}a(A6i,"sortDiagnosticsByDistance");function WMr(t,e){switch(e){case $R.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case $R.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case $R.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(WMr,"filterDiagnosticsBySeverity");var ICt=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}},YMr=class extends nCc.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 Bye=I(xCt=>{"use strict";p();Object.defineProperty(xCt,"__esModule",{value:!0});xCt.toUniquePath=hCc;xCt.countTokensForLines=mCc;var pCc=GY();function hCc(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===pCc.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(hCc,"toUniquePath");function mCc(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(mCc,"countTokensForLines")});var _6i=I(JMr=>{"use strict";p();Object.defineProperty(JMr,"__esModule",{value:!0});JMr.getEditDiffHistory=yCc;var gCc=XD(),Z$=Al(),ACc=Bye();function yCc(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=ECc(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(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(` `);return g.length>0&&(A+=` -`),{promptPiece:A,nDiffs:m.length,totalTokens:h}}a(yCc,"getEditDiffHistory");function ECc(t,e){let r=[],n=gCc.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,Z$.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,Z$.pushMany)(r,d.map(g=>`-${g}`)),(0,Z$.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,ACc.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,Z$.pushMany)(c,r),c.join(` -`)}a(ECc,"generateDocDiff")});var ZMr=I(X$=>{"use strict";p();Object.defineProperty(X$,"__esModule",{value:!0});X$.count=_Cc;X$.findInsertionIndexInSortedArray=vCc;X$.max=CCc;X$.filterMap=bCc;X$.min=SCc;X$.batchArrayElements=TCc;function _Cc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(_Cc,"count");function vCc(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(vCc,"findInsertionIndexInSortedArray");function CCc(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(CCc,"max");function bCc(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a(bCc,"filterMap");function SCc(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var ICc=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]})),xCc=jE&&jE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wCc=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;oiOr(A.entries)):d=b6i(e,t.id,c,l).map(A=>T6i(A));let{snippets:f,docsInPrompt:h}=k6i(d,n,o);r&&I6i(r,f,o.languageContext.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers);let m;return o.neighborFiles.enabled&&s&&s.length>0&&(m=x6i(s,f,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:f.join(` +`),{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(` -`),documents:h,neighborSnippetsResult:m}}a(MCc,"getRecentCodeSnippets");function OCc(t,e,r){switch(e){case XMr.IncludeLineNumbersOption.WithSpaceAfter:return t.map((n,o)=>`${r+o}| ${n}`);case XMr.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case XMr.IncludeLineNumbersOption.None:return t;default:(0,PCc.assertNever)(e)}}a(OCc,"formatLinesWithLineNumbers");function wCt(t,e,r){let n=(0,rOr.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=OCc(e,r.includeLineNumbers,r.startLineOffset).join(` -`);return[v6i.PromptTags.RECENT_FILE.start,o,c,v6i.PromptTags.RECENT_FILE.end].join(` -`)}a(wCt,"formatCodeSnippet");function b6i(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(b6i,"collectRecentDocuments");function S6i(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(S6i,"collectRecentDocumentsGrouped");function BCc(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===tOr.RecentFileClippingStrategy.Proportional?S6i(e,t.id,n,o).map(u=>iOr(u.entries)):b6i(e,t.id,n,o).map(l=>T6i(l))}a(BCc,"prepareRecentCodeSnippets");function nOr(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(nOr,"selectFocalRangesWithinSpanCap");function T6i(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(T6i,"historyEntryToCodeSnippet");function iOr(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(iOr,"historyEntriesToCodeSnippet");function I6i(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===RCc.ContextKind.Snippet){let u=l.value,d=r-n(u);if(d<0)break;let f=eOr.DocumentId.create(l.uri.toString());e.push(wCt(f,u.split(/\r?\n/),{truncated:!1,includeLineNumbers:o,startLineOffset:0})),r=d}}return s-r}a(I6i,"appendLanguageContextSnippets");function x6i(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=eOr.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(wCt(eOr.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(x6i,"appendNeighborFileSnippets");function w6i(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,rOr.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(wCt(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(w6i,"clipFullDocument");function R6i(t,e,r,n){let o=t.getTransformer(),s=r*3,c=nOr(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,rOr.countTokensForLines)(h.slice(E,_),n)}return A}a(R6i,"computeFocalPageCost");function P6i(t,e,r,n,o,s,c){if(n<=0)return;let l=t.content.getTransformer(),u=e*3,d=nOr(t.focalRanges,b=>l.getPosition(b).lineNumber,u);if(d.length===0)return n;let f=Math.min(...d.map(b=>b.start)),h=Math.max(...d.map(b=>b.endExclusive-1)),m=l.getPosition(f),g=l.getPosition(h),{firstPageIdx:A,lastPageIdxIncl:y,budgetLeft:E}=(0,NCc.expandRangeToPageRange)(t.content.getLines(),new DCc.OffsetRange(m.lineNumber-1,g.lineNumber),e,n,o,!1);if(E===n||E<0)return;let _=A*e,v=t.content.getLines().slice(_,(y+1)*e);return c.docsInPrompt.add(t.id),c.snippets.push(wCt(t.id,v,{truncated:v.lengthy.focalRanges!==void 0&&y.focalRanges.length>0?R6i(y.content,y.focalRanges,n,e)??0:0),u=t.length,d=l.reduce((y,E)=>y+E,0);for(;u>0&&d>s;)u--,d-=l[u];if(u===0)return{snippets:[],docsInPrompt:new Set,tokensConsumed:0};let f=s-d,h=t.slice(0,u).map(y=>y.editEntryCount??1),m=h.reduce((y,E)=>y+E,0),g=h.map(y=>Math.floor(f*(y/m))),A=0;for(let y=0;y0)A=P6i(E,n,_.length,v,e,c,o)??v;else{let b=(0,C6i.batchArrayElements)(_,n);A=w6i(E,b,_.length,v,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-A}}a(FCc,"buildCodeSnippetsWithProportionalBudget")});var RCt=I(zd=>{"use strict";p();var UCc=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]})),QCc=zd&&zd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qCc=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 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;of.add(P)),w=x.tokensConsumed;break}case"languageContext":{r&&(w=(0,_Le.appendLanguageContextSnippets)(r,u,T,n,o.recentlyViewedDocuments.includeLineNumbers));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,_Le.appendNeighborFileSnippets)(s,d,f,T,n,o.recentlyViewedDocuments.includeLineNumbers),w=h.tokensConsumed);break}case"diffHistory":{let R={...o.diffHistory,maxTokens:T},x=(0,B6i.getEditDiffHistory)(t,e,f,n,R);m=x.promptPiece,g=x.nDiffs,A=x.totalTokens,w=x.totalTokens;break}default:(0,kCt.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?l1c(x):x;return{prompt:(u1c(v,D,d.languageContext.traitPosition)+T).trim(),nDiffsInPrompt:E,diffTokensInPrompt:_,neighborSnippetsResult:A}}a(s1c,"getUserPrompt");function a1c(t,e,r,n,o,s,c){c1c(c);let l=[],u=[],d=[],f=new Set;f.add(t.id);let h,m="",g=0,A=0,y=(0,LBe.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,LBe.buildCodeSnippetsUsingPagedClipping)(y,n,R);l.push(...x.snippets),x.docsInPrompt.forEach(P=>f.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(` -`),documents:f,neighborSnippetsResult:h,editDiffHistory:m,nDiffsInPrompt:g,diffTokensInPrompt:A}}a($Cc,"runGlobalBudgetCascade");function VCc(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(VCc,"validateGlobalBudget");function WCc(t){return`\`\`\` +`),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`\`\`\` ${t} -\`\`\``}a(WCc,"wrapInBackticks");function zCc(t,e,r){return r==="before"?M6i(t,e,2):M6i(e,t,2)}a(zCc,"addRelatedInformation");function M6i(t,e,r){let n=0;for(let s=t.length-1;s>=0&&t[s]===` +\`\`\``}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]===` `;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 Yl.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 Yl.PromptingStrategy.Xtab275EditIntentShort:case Yl.PromptingStrategy.Xtab275EditIntent:case Yl.PromptingStrategy.Xtab275:o=n;break;case Yl.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case Yl.PromptingStrategy.Xtab275Aggressiveness:o=`${n} -<|aggressive|>${r}<|/aggressive|>`;break;case Yl.PromptingStrategy.Xtab275AggressivenessHighLow:o=r===Yl.AggressivenessLevel.Medium?n:`${n} -<|aggressive|>${r}<|/aggressive|>`;break;case Yl.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 Yl.PromptingStrategy.SimplifiedSystemPrompt:case Yl.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 \`${gh.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 \`${gh.PromptTags.EDIT_WINDOW.start}\` and \`${gh.PromptTags.EDIT_WINDOW.end}\` tags with the following format, but do not include the tags themselves. +`.repeat(o)+e).trim()}a(S9i,"appendWithNewLineIfNeeded");function d1c(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 \`${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, 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 \`${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. 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. \`\`\` // Your revised code goes here -\`\`\``;break;default:(0,kCt.assertNever)(t)}return o===void 0?"":` +\`\`\``;break;default:(0,obt.assertNever)(t)}return o===void 0?"":` -${o}`}a(YCc,"getPostScript");function KCc(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===jCc.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(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: ${r.join(` -`)}`}a(KCc,"getRelatedInformation");function JCc(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(JCc,"truncateCode");zd.N_LINES_ABOVE=2;zd.N_LINES_BELOW=5;zd.N_LINES_AS_CONTEXT=15;function L6i(t,e,r,n,o,s){let c=Math.ceil(t.length/r);function l(m){let g=m*r,A=Math.min(g+r,t.length),y=t.slice(g,A);return(0,cOr.countTokensForLines)(y,o)}a(l,"computeTokensForPage");let u=Math.floor(e.start/r),d=Math.floor((e.endExclusive-1)/r),f=n-(0,HCc.range)(u,d+1).reduce((m,g)=>m+l(g),0);if(f<0)return{firstPageIdx:u,lastPageIdxIncl:d,budgetLeft:f};let h=f;if(s){h=f;for(let m=u-1;m>=0&&h>0;--m){let g=l(m),A=h-g;if(A<0)break;u=m,h=A}for(let m=d+1;m0;++m){let g=l(m),A=h-g;if(A<0)break;d=m,h=A}}else{let m=Math.floor(f/2);h=m;for(let g=u-1;g>=0&&h>0;--g){let A=l(g),y=h-A;if(y<0)break;u=g,h=y}h=m;for(let g=d+1;g0;++g){let A=l(g),y=h-A;if(y<0)break;d=g,h=y}}return{firstPageIdx:u,lastPageIdxIncl:d,budgetLeft:h}}a(L6i,"expandRangeToPageRange");function F6i(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,cOr.countTokensForLines)(s,r);if(c<0)return sOr.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=L6i(t,e,n,c,r,o.prioritizeAboveCursor),d=l*n,f=(u+1)*n;return sOr.Result.ok(new O6i.OffsetRange(d,f))}a(F6i,"clipPreservingRange");var PCt=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};zd.ClippedDocument=PCt;function U6i(t,e,r,n,o,s){let c=F6i(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 O6i.OffsetRange(l.start,l.start+u.length);return sOr.Result.ok(new PCt(u,d))}a(U6i,"createTaggedCurrentFileContentUsingPagedClipping");function oOr(t,e){switch(e){case Lye.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case Lye.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case Lye.IncludeLineNumbersOption.None:return[...t];default:(0,kCt.assertNever)(e)}}a(oOr,"addLineNumbers");function ZCc(t,e,r,n,o,s){let c=N6i.StringEdit.single(N6i.StringReplacement.insert(t.cursorOffset,gh.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=oOr(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[gh.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),gh.PromptTags.EDIT_WINDOW.start,...u,gh.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),gh.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=oOr(f,s.includeLineNumbers.currentFileContent),m=oOr(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 U6i(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` -`)}))}a(ZCc,"constructTaggedFile")});var Q6i=I(VR=>{"use strict";p();Object.defineProperty(VR,"__esModule",{value:!0});VR.xtab275SystemPrompt=VR.simplifiedPrompt=VR.nes41Miniv3SystemPrompt=VR.unifiedModelSystemPrompt=VR.systemPromptTemplate=void 0;var eV=J$();VR.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 ${eV.PromptTags.EDIT_WINDOW.start} and ${eV.PromptTags.EDIT_WINDOW.end} tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +`)}`}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. You have access to the following information to help you make informed suggestions: @@ -1223,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 ${eV.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 ${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. -Your task is to predict and complete the changes the developer would have made next in the ${eV.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 ${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. # Steps @@ -1236,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 ${eV.PromptTags.EDIT_WINDOW.start} and ${eV.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 ${dV.PromptTags.EDIT_WINDOW.start} and ${dV.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 ${eV.PromptTags.EDIT_WINDOW.start} or ${eV.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 ${dV.PromptTags.EDIT_WINDOW.start} or ${dV.PromptTags.EDIT_WINDOW.end} tags. \`\`\` // Your revised code goes here @@ -1248,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.`;VR.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.`;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. You have access to the following information to help you make informed suggestions: @@ -1277,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.`;VR.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.`;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. You have access to the following information to help you make informed suggestions: @@ -1305,15 +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.`;VR.simplifiedPrompt="Predict next code edit based on the context given by the user.";VR.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 NCt=I(tV=>{"use strict";p();Object.defineProperty(tV,"__esModule",{value:!0});tV.NullTerminalService=tV.ITerminalService=void 0;tV.isTerminalService=tbc;tV.isNullTerminalService=rbc;var XCc=rn(),DCt=bc(),ebc=Io();tV.ITerminalService=(0,XCc.createServiceIdentifier)("ITerminalService");var lOr=class t extends ebc.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new DCt.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new DCt.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new DCt.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new DCt.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){}};tV.NullTerminalService=lOr;function tbc(t){return t&&typeof t.createTerminal=="function"}a(tbc,"isTerminalService");function rbc(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(rbc,"isNullTerminalService")});var q6i=I(H6=>{"use strict";p();var nbc=H6&&H6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ibc=H6&&H6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(H6,"__esModule",{value:!0});H6.TerminalMonitor=void 0;var obc=NCt(),sbc=Io(),vLe=2e3,uOr=class extends sbc.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:abc(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,vLe*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<=vLe?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,vLe/2),contentEnd:n.slice(-vLe/2),length:n.length,truncatedChars:n.length-vLe},terminalCount:r};return JSON.stringify(s)}};H6.TerminalMonitor=uOr;H6.TerminalMonitor=uOr=nbc([ibc(0,obc.ITerminalService)],uOr);function abc(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(abc,"formatCwd")});var j6i=I(MCt=>{"use strict";p();Object.defineProperty(MCt,"__esModule",{value:!0});MCt.CurrentDocument=void 0;var cbc=Is(),dOr=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 cbc.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}};MCt.CurrentDocument=dOr});var V6i=I(OCt=>{"use strict";p();Object.defineProperty(OCt,"__esModule",{value:!0});OCt.getCurrentLine=ubc;OCt.isModelLineCompatible=dbc;var H6i=O_(),lbc=A_t();function ubc(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new H6i.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?pbc(n,o,e,r):!1}a(dbc,"isModelLineCompatible");var fbc=new Set(["()","[]","{}","<>",'""',"''","``"]);function pbc(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&&$6i(t.inserted,e.inserted):$6i(t.inserted,e.inserted)}a(pbc,"isUserEditCompatibleWithModelEdit");function $6i(t,e){return e.startsWith(t)?!0:fbc.has(t)?hbc(t,e):!1}a($6i,"isUserTypingCompatibleWithModelText");function hbc(t,e){let r=0;for(let n=0;n{"use strict";p();var mbc=aN&&aN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gbc=aN&&aN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Abc=aN&&aN.__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(Ebc,"parseEditIntentFromStreamShortName");async function _bc(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=BCt.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=BCt.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(_bc,"parseEditIntentFromStreamTags")});var FCt=I(Fye=>{"use strict";p();Object.defineProperty(Fye,"__esModule",{value:!0});Fye.linesWithBackticksRemoved=Cbc;Fye.constructMessages=bbc;Fye.charCount=Sbc;Fye.findMergeConflictMarkersRange=Tbc;var pOr=xo(),W6i=QBe(),vbc=dd();async function*Cbc(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(Cbc,"linesWithBackticksRemoved");function bbc({systemMsg:t,userMsg:e}){return[{role:pOr.Raw.ChatRole.System,content:(0,W6i.toTextParts)(t)},{role:pOr.Raw.ChatRole.User,content:(0,W6i.toTextParts)(e)}]}a(bbc,"constructMessages");function Sbc(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===pOr.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(Sbc,"charCount");function Tbc(t,e,r){for(let n=e.start;n>>>>>>"))return new vbc.OffsetRange(n,o+1)}}a(Tbc,"findMergeConflictMarkersRange")});var K6i=I(rV=>{"use strict";p();Object.defineProperty(rV,"__esModule",{value:!0});rV.ResponseParseResult=void 0;rV.handleEditWindowOnly=wbc;rV.handleCodeBlock=Rbc;rV.handleEditWindowWithEditIntent=Pbc;rV.handleUnifiedWithXml=kbc;var CLe=jAe(),z6i=xG(),Y6i=Q2(),Uye=J$(),Ibc=fOr(),xbc=FCt(),yB;(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})(yB||(rV.ResponseParseResult=yB={}));function wbc(t){return new yB.EditWindowLines(t)}a(wbc,"handleEditWindowOnly");function Rbc(t){return new yB.EditWindowLines((0,xbc.linesWithBackticksRemoved)(t))}a(Rbc,"handleCodeBlock");async function Pbc(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,Ibc.parseEditIntentFromStream)(t,e,r);return new yB.EditWindowLines(o,{intent:n,parseError:s})}a(Pbc,"handleEditWindowWithEditIntent");async function kbc(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new yB.Done(new CLe.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===Uye.ResponseTags.NO_CHANGE.start)return new yB.Done(new CLe.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===Uye.ResponseTags.INSERT.start)return new yB.DirectEdits(Dbc(o,e,r));if(c===Uye.ResponseTags.EDIT.start){let l=Nbc(o);return new yB.EditWindowLines(l)}return new yB.Done(new CLe.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(kbc,"handleUnifiedWithXml");async function*Dbc(t,e,r){let{editWindowLines:n,editWindowLineRange:o,cursorOriginalLinesOffset:s,cursorColumnZeroBased:c,editWindow:l,originalEditWindow:u,targetDocument:d,isFromCursorJump:f}=e,h=await t.next();if(h.done||h.value.includes(Uye.ResponseTags.INSERT.end))return new CLe.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new z6i.LineReplacement(new Y6i.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(Uye.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let E=o.start+s+2;return yield{edit:new z6i.LineReplacement(new Y6i.LineRange(E,E),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new CLe.NoNextEditReason.NoSuggestions(r,l)}a(Dbc,"generateInsertEdits");async function*Nbc(t){let e=await t.next();for(;!e.done;){if(e.value.includes(Uye.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(Nbc,"generateEditLines")});var r9i=I(Bne=>{"use strict";p();Object.defineProperty(Bne,"__esModule",{value:!0});Bne.XtabCustomDiffPatchResponseHandler=Bne.DuplicateAdditionsMode=void 0;Bne.tryRemoveDuplicateAdditions=t9i;var J6i=Pne(),One=sy();Object.defineProperty(Bne,"DuplicateAdditionsMode",{enumerable:!0,get:a(function(){return One.DuplicateAdditionsMode},"get")});var Z6i=jAe(),Mbc=$_(),Obc=Al(),Bbc=EA(),X6i=Ku(),e9i=xG(),Lbc=Q2(),Fbc=GMr(),Ubc=Bye(),Qbc=J$(),UCt=class t{static{a(this,"Patch")}constructor(e,r){this.filePath=e,this.lineNumZeroBased=r,this.removedLines=[],this.addedLines=[]}static ofLine(e){let r=e.match(/^(.+):(\d+)$/);if(!r)return null;let[,n,o]=r;return new t(n,parseInt(o,10))}addLine(e){let r=e.slice(1);return e.startsWith("-")?(this.removedLines.push(r),!0):e.startsWith("+")?(this.addedLines.push(r),!0):!1}toString(){return[`${this.filePath}:${this.lineNumZeroBased}`,...this.removedLines.map(e=>`-${e}`),...this.addedLines.map(e=>`+${e}`)].join(` -`)}};function hOr(t){return t.trim().length>1}a(hOr,"isMeaningfulLine");function t9i(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,Obc.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&hOr(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&hOr(c[0])&&hOr(c[1])){let l=c[0],u=c[1];for(let d=1;d{"use strict";p();var qbc=G6&&G6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},WR=G6&&G6.__param||function(t,e){return function(r,n){e(r,n,t)}},QCt;Object.defineProperty(G6,"__esModule",{value:!0});G6.XtabEndpoint=void 0;var jbc=kE(),Hbc=B6(),gOr=Tl(),Gbc=LE(),$bc=Q$(),Vbc=wne(),Wbc=Ep(),zbc=fy(),Ybc=U6(),Kbc=Cp(),Jbc=qh(),Zbc=PQ(),Xbc=Cle(),e1c=Fs(),AOr=class extends Vbc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{QCt=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:Xbc.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?{...QCt.chatModelInfo,id:n}:QCt.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(gOr.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig(gOr.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}}};G6.XtabEndpoint=AOr;G6.XtabEndpoint=AOr=QCt=qbc([WR(3,gOr.IConfigurationService),WR(4,$bc.IDomainService),WR(5,zbc.IFetcherService),WR(6,Gbc.ICAPIClientService),WR(7,Jbc.ITelemetryService),WR(8,jbc.IAuthenticationService),WR(9,Hbc.IChatMLFetcher),WR(10,Zbc.ITokenizerProvider),WR(11,e1c.IInstantiationService),WR(12,Kbc.IExperimentationService),WR(13,Ybc.IChatWebSocketManager),WR(14,Wbc.ILogService)],AOr)});var qCt=I(Qye=>{"use strict";p();Object.defineProperty(Qye,"__esModule",{value:!0});Qye.NullProxyModelsService=Qye.IProxyModelsService=void 0;var t1c=rn(),r1c=bc();Qye.IProxyModelsService=(0,t1c.createServiceIdentifier)("IProxyModelsService");var yOr=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=r1c.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};Qye.NullProxyModelsService=yOr});var i9i=I(Ov=>{"use strict";p();var n1c=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]})),i1c=Ov&&Ov.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o1c=Ov&&Ov.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},s1c=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;otypeof D=="boolean"?D?HCt.IncludeLineNumbersOption.WithSpaceAfter:HCt.IncludeLineNumbersOption.None:D),A=new _Or.PromptPieces(e.currentDocument,e.editWindowLinesRange,e.areaAroundEditWindowLinesRange,e.activeDoc,e.xtabHistory,d.lines,f,e.langCtx,e.aggressivenessLevel,m,this.computeTokens,{...e.opts,includePostScript:!1,lintOptions:h,recentlyViewedDocuments:{...e.opts.recentlyViewedDocuments,includeLineNumbers:g}}),{prompt:y}=(0,_Or.getUserPrompt)(A),E=(0,E1c.constructMessages)({systemMsg:c,userMsg:y});n?.setCursorJumpPrompt(E);let _=this.determineModelName();n?.setCursorJumpModelName(_);let v=await this.resolveEndpoint(_,s);if(!v)return cN.Result.fromString("endpointNotResolved");let{endpoint:b,usesResponsesApi:T}=v,w=this.configService.getConfig(lN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),R=this.configService.getExperimentBasedConfig(lN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionMaxResponseTokens,this.expService),x={max_tokens:T?Math.max(R,2048):R};w&&(x={...x,secretKey:w});let P=await b.makeChatRequest2({messages:E,debugName:"nes.nextCursorPosition",finishedCb:void 0,location:EOr.ChatLocation.Other,requestOptions:x},o);if(P.type!==EOr.ChatFetchResponseType.Success)return P.type===EOr.ChatFetchResponseType.NotFound&&(s.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),cN.Result.fromString(`fetchError:${P.type}`);try{n?.setCursorJumpResponse(P.value);let D=P.value.trim();return this.parseResponse(D,d.keptRange)}catch(D){return s.trace(`Failed to parse predicted line number from response '${P.value}': ${D}`),cN.Result.fromString(`failedToParseLine:"${P.value}". Error ${h1c.ErrorUtils.fromUnknown(D).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(lN.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(lN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(l1c.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:a1c.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:m1c.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(lN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??_1c}determineLintOptions(){let e=this.configService.getConfig(lN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...GCt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(lN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,GCt.parseLintOptionString)(r,GCt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):GCt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=v1c(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return cN.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?cN.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?cN.Result.fromString("crossFileEmptyFilePath"):cN.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?cN.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(v1c,"stripThinkTags")});var C9i=I(Ip=>{"use strict";p();var C1c=Ip&&Ip.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),b1c=Ip&&Ip.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),S1c=Ip&&Ip.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},T1c=Ip&&Ip.__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=$6.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(z1c.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(X1c.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(nSc.XtabNextCursorPredictor,$6.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new Rs.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new Rs.NoNextEditReason.ActiveDocumentHasNoEdits;return new Rs.WithStatelessProviderTelemetry(h,s.build(WCt.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,sV.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new Rs.WithStatelessProviderTelemetry(d.value,s.build(WCt.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof Rs.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new Rs.WithStatelessProviderTelemetry(f,s.build(WCt.Result.error(f)))}catch(c){let l=iV.ErrorUtils.fromUnknown(c),u=new Rs.NoNextEditReason.Unexpected(l);return new Rs.WithStatelessProviderTelemetry(u,s.build(WCt.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,W1c.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 Rs.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 COr.Position(r.endLineNumber,r.endColumn),E=new eSc.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,E,m,f,n,u);let _=y9i(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 YCt.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new Rs.RequestEditWindowWithCursorJump(w,l):new Rs.RequestEditWindow(w);let R=E.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,g9i.countTokensForLines)(R,$6.computeTokens)>x)return new Rs.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(Pe=>Pe.includes(f9i.PromptTags.CURSOR)),N=(0,oV.constructTaggedFile)(E,v,_,m,$6.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:ra.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}});if(N.isError())return new Rs.NoNextEditReason.PromptTooLarge("currentFile");let{clippedTaggedCurrentDoc:B,areaAroundCodeToEdit:L}=N.val;f.setNLinesOfCurrentFileInPrompt(B.lines.length);let{aggressivenessLevel:j,userHappinessScore:M}=this.userInteractionMonitor.getAggressivenessLevel(),O=this.configService.getExperimentBasedConfig(bi.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(O),f.setXtabAggressivenessLevel(j),M!==void 0&&f.setXtabUserHappinessScore(M);let q=await this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s);if(s.isCancellationRequested)return new Rs.NoNextEditReason.GotCancelled("afterLanguageContextAwait");let Q=m.neighborFiles.enabled?await(0,nV.raceCancellation)((0,nV.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset),n.getDebounceTime()),s):void 0;if(s.isCancellationRequested)return new Rs.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait");let U=new J1c.LintErrors(h.id,E,this.langDiagService,e.xtabEditHistory),z=new oV.PromptPieces(E,v,_,h,e.xtabEditHistory,B.lines,L,q,j,U,$6.computeTokens,m,Q),{prompt:$,nDiffsInPrompt:W,diffTokensInPrompt:J,neighborSnippetsResult:ne}=(0,oV.getUserPrompt)(z);f.setNDiffsInPrompt(W),f.setDiffTokensInPrompt(J),ne&&(f.setNNeighborSnippetsComputed(ne.nComputed),f.setNNeighborSnippetsInPrompt(ne.nIncluded),f.setNeighborSnippetIndicesInPrompt(ne.includedIndices));let H=ra.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),re=this.getPredictedOutput(h,R,H),ae=(0,bOr.constructMessages)({systemMsg:E9i(m.promptingStrategy),userMsg:$});d.setPrompt(ae),f.setPrompt(ae);let Be=3e4*4;if((0,bOr.charCount)(ae)>Be)return new Rs.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new Rs.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let Pe=U.getData();f.setLintErrors(Pe),d.setDiagnosticsData(Pe);let Z=this.terminalMonitor.getData();f.setTerminalOutput(Z),d.setTerminalData(Z)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset)),e.fetchIssued=!0;let Ue={endpoint:A,modelServiceConfig:g,messages:ae,clippedTaggedCurrentDoc:B,editWindowInfo:{editWindow:w,editWindowLines:R,cursorOriginalLinesOffset:b,editWindowLineRange:v},promptPieces:z,prediction:re,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,Ue,{shouldRemoveCursorTagFromResponse:D,responseFormat:H},{aggressivenessLevel:j,userHappinessScore:M},c,n,{tracer:u,logContext:d,telemetry:f},s)}_configureDebounceTimings(e,r,n,o,s,c){let l=r.isCursorAtEndOfLine();o.setIsCursorAtLineEnd(l);let u=(0,K1c.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(bi.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(bi.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,Bv.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(bi.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[Bv.AggressivenessSetting.Low]:{minResponseConfigKey:bi.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[Bv.AggressivenessSetting.Medium]:{minResponseConfigKey:bi.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[Bv.AggressivenessSetting.High]:{debounceConfigKey:bi.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[Bv.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(bi.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,m9i.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new V1c.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,F1c.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===s9i.ContextKind.Snippet&&await m(b)||g.push({context:b,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,nV.raceCancellation)((0,nV.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let E=Date.now(),_=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of _)v.kind===s9i.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(iV.ErrorUtils.fromUnknown(l)),s.tracer.trace(`Failed to fetch language context: ${l}`);return}}async*streamEditsWithFiltering(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEditsWithFiltering"),f={...l,tracer:d},h=this.streamEdits(e,r,n,o,s,c,f,u),m=0,g=await h.next();for(;!g.done;){let A=g.value.edit,[y,E]=this.filterEdit(e.getActiveDocument(),[A]);y.length===0?d.trace(`Filtered out an edit: ${A.toString()} using ${E.join(", ")} filter(s)`):(d.trace(`Yielding an edit: ${A.toString()}`),yield g.value,m++),g=await h.next()}return m===0&&g.value instanceof Rs.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 Q1c.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(bi.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new I1c.FetchStreamSource,E=new q1c.StopWatch,_="",v,b=new nV.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:$6.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:Nf.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===Nf.ChatFetchResponseType.Success?P.value:void 0)),T.then(P=>{P.type!==Nf.ChatFetchResponseType.Success?y.reject(new d9i.FetchStreamError(xOr(P))):y.resolve()}).catch(P=>{m.setError(iV.ErrorUtils.fromUnknown(P)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(iV.ErrorUtils.fromUnknown(P))}).finally(()=>{m.setFetchEndTime(),b.isSettled||b.complete(),m.setResponse(_)});let w=await Promise.race([b.p,T]);if(w&&w.type!==Nf.ChatFetchResponseType.Success)return w.type===Nf.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,aV.ModelNotFound.INSTANCE):w.type===Nf.ChatFetchResponseType.Unknown&&w.reason===Nf.RESPONSE_CONTAINED_NO_CHOICES?new aV.FetchFailure(new Rs.NoNextEditReason.NoSuggestions(u,l)):new aV.FetchFailure(xOr(w));let R=a9i.AsyncIterUtilsExt.splitLines(a9i.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(f9i.PromptTags.CURSOR,""):D}})();return new aV.Lines(x,()=>_,E)}async*_streamEditsImpl(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=l,{endpoint:A,messages:y,clippedTaggedCurrentDoc:E,editWindowInfo:_,promptPieces:v,prediction:b,originalEditWindow:T}=r,{editWindow:w,editWindowLines:R,cursorOriginalLinesOffset:x,editWindowLineRange:P}=_,D=e.getActiveDocument().id,N=await this._performFetch(A,y,b,e.headerRequestId,o,n.shouldRemoveCursorTagFromResponse,w,e.documentBeforeEdits,f,l);if(N instanceof aV.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof aV.FetchFailure)return N.reason;let{linesStream:B,getResponseSoFar:L,fetchRequestStopWatch:j}=N,M=s instanceof sV.Retrying&&s.reason==="cursorJump",O;try{switch(n.responseFormat){case ra.ResponseFormat.EditWindowOnly:{O=(0,Lne.handleEditWindowOnly)(B);break}case ra.ResponseFormat.CodeBlock:{O=(0,Lne.handleCodeBlock)(B);break}case ra.ResponseFormat.EditWindowWithEditIntent:case ra.ResponseFormat.EditWindowWithEditIntentShort:{let ne=n.responseFormat===ra.ResponseFormat.EditWindowWithEditIntentShort?h9i.EditIntentParseMode.ShortName:h9i.EditIntentParseMode.Tags;O=await(0,Lne.handleEditWindowWithEditIntent)(B,h,ne);break}case ra.ResponseFormat.CustomDiffPatch:{let ne=e.getActiveDocument(),H=v.currentDocument,ae=H.lines[E.keptRange.endExclusive-1].length,Be=H.transformer.getOffsetRange(new YCt.Range(E.keptRange.start+1,1,E.keptRange.endExclusive,ae+1)),ve=this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService);O=new Lne.ResponseParseResult.DirectEdits(tSc.XtabCustomDiffPatchResponseHandler.handleResponse(B,H,ne.id,ne.workspaceRoot,Be,h,ve));break}case ra.ResponseFormat.UnifiedWithXml:{O=await(0,Lne.handleUnifiedWithXml)(B,{editWindowLines:R,editWindowLineRange:P,cursorOriginalLinesOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,jye.assertNever)(n.responseFormat)}if(O instanceof Lne.ResponseParseResult.Done)return O.reason;if(O instanceof Lne.ResponseParseResult.DirectEdits)return yield*O.stream;if(O.editIntentMetadata){let{intent:ne,parseError:H}=O.editIntentMetadata;if(g.setEditIntent(ne),H&&g.setEditIntentParseError(H),!ra.EditIntent.shouldShowEdit(ne,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${ne}" with aggressiveness "${v.aggressivenessLevel}"`),new Rs.NoNextEditReason.FilteredOut(`editIntent:${ne} aggressivenessLevel:${v.aggressivenessLevel}`)}let q=O.lines,Q={emitFastCursorLineChange:o9i.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${j.elapsed()} ms`);let U=(0,U1c.backwardCompatSetting)(this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),ne=>{switch(ne){case!1:case void 0:return Bv.EarlyDivergenceCancellationMode.Off;case!0:return Bv.EarlyDivergenceCancellationMode.Cursor;case Bv.EarlyDivergenceCancellationMode.Off:case Bv.EarlyDivergenceCancellationMode.Cursor:case Bv.EarlyDivergenceCancellationMode.EditWindow:return ne;default:return Bv.EarlyDivergenceCancellationMode.Off}}),z=!1,$=U===Bv.EarlyDivergenceCancellationMode.Off?q:sSc(q,x,e,P,R,d,l,ne=>{z=ne},U),W=0,J=!1;for await(let ne of o9i.ResponseProcessor.diff(R,$,x,Q)){if(z)break;h.trace(`ResponseProcessor streamed edit #${W} with latency ${j.elapsed()} ms`);let H=[];if(ne.lineRange.startLineNumber===ne.lineRange.endLineNumberExclusive||ne.newLines.length===0||ne.lineRange.endLineNumberExclusive-ne.lineRange.startLineNumber===1&&ne.newLines.length===1){let re=new zCt.LineReplacement(new u9i.LineRange(ne.lineRange.startLineNumber+P.start,ne.lineRange.endLineNumberExclusive+P.start),ne.newLines);H.push(re)}else{let re=R.slice(ne.lineRange.startLineNumber-1,ne.lineRange.endLineNumberExclusive-1).join(` -`),ae=await this.diffService.computeDiff(re,ne.newLines.join(` -`),{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1});h.trace(`Ran diff for #${W} with latency ${j.elapsed()} ms`);let Be=P.start+ne.lineRange.startLineNumber;for(let ve of ae.changes){let Ue=new zCt.LineReplacement(new u9i.LineRange(Be+ve.original.startLineNumber-1,Be+ve.original.endLineNumberExclusive-1),ne.newLines.slice(ve.modified.startLineNumber-1,ve.modified.endLineNumberExclusive-1));H.push(Ue)}}m.setResponse(L());for(let re of H){if(h.trace(`extracting edit #${W}: ${re.toString()}`),!J){J=!0;let ae=this.determineArtificialDelayMs(c,h,g);if(ae&&(await(0,nV.timeout)(ae),h.trace(`Artificial delay of ${ae} ms completed`),u.isCancellationRequested))return new Rs.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:re,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},W++}}return z?new Rs.NoNextEditReason.GotCancelled(U===Bv.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new Rs.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(q){return q instanceof d9i.FetchStreamError?q.reason:(m.setError(q),new Rs.NoNextEditReason.Unexpected(iV.ErrorUtils.fromUnknown(q)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new Rs.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof sV.Retrying)return m;if(SOr(e))return l.trace("Skipping cursor prediction: user typed during request"),new Rs.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,l,u,s);if(s.isCancellationRequested)return new Rs.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(SOr(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new Rs.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=$6.getNextCursorColumn(b);switch(g){case $Ct.NextCursorLinePrediction.Jump:{let w=new COr.Position(v,T);return new Rs.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case $Ct.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new YCt.Range(v,T,v,T),n,o,s,new sV.Retrying("cursorJump"),d);default:(0,jye.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,c9i.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new Rs.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,c9i.isAbsolute)(e.filePath)?l9i.URI.file(e.filePath):l9i.URI.joinPath(m,e.filePath),A=P1c.DocumentId.create(g.toString()),y=e.lineNumber+1,E=new COr.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case $Ct.NextCursorLinePrediction.Jump:return new Rs.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A);case $Ct.NextCursorLinePrediction.OnlyWithEdit:{let _;try{_=await this.workspaceService.openTextDocument(g)}catch(w){return u.trace(`Failed to open target file for cross-file edit: ${iV.ErrorUtils.fromUnknown(w).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new Rs.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A)}if(l.isCancellationRequested)return new Rs.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(SOr(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new Rs.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new H1c.StringText(_.getText()),b=new Rs.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,D1c.LanguageId.create(_.languageId),v.getLines(),zCt.LineEdit.empty,v,new k1c.Edits(j1c.StringEdit,[])),T=new Rs.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[b],0,n.xtabEditHistory,new nV.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(T,new YCt.Range(y,1,y,1),s,c,l,new sV.Retrying("cursorJump"),f)}default:(0,jye.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(bi.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(bi.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??oV.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(bi.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${oV.N_LINES_BELOW}`),u=oV.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new TOr.OffsetRange(d,f),g=(0,bOr.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(bi.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 TOr.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...ra.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:wOr(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService)},languageContext:_9i(e.languageId,{enabled:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(bi.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(bi.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetEnabled,this.expService)?{totalTokens:this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetTotalTokens,this.expService),order:ra.GlobalBudgetOptions.DEFAULT_ORDER,shares:ra.GlobalBudgetOptions.DEFAULT_SHARES}:void 0},n=this.modelService.selectedModelConfiguration(),o=ra.applyStrategyConfig(n);return{promptOptions:wOr(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(bi.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance(rSc.XtabEndpoint,r,n,e):(0,w1c.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n){return this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService)?{type:"content",content:v9i(e,r,n)}:void 0}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof sV.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,nV.timeout)(c,s)}catch{}}determineArtificialDelayMs(e,r,n){if(this.simulationCtx.isInSimulationTests)return;let o=e.getArtificialDelay();if(!(o<=0))return r.trace(`Enforcing artificial delay of ${o} ms`),n.setArtificialDelay(o),o}filterEdit(e,r){let n=this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsAllowImportChanges,this.expService),o=[l=>({filterName:"IgnoreImportChangesAspect",filteredEdits:Y1c.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:VCt.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(bi.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:VCt.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(bi.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=VCt.editWouldDeleteWhatWasJustInserted;break;case"v2":l=VCt.editWouldDeleteWhatWasJustInserted2;break;default:(0,jye.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new zCt.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(bi.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:A9i(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}};Ip.XtabProvider=IOr;Ip.XtabProvider=IOr=$6=S1c([uN(0,N1c.IInlineEditsModelService),uN(1,O1c.ISimulationTestContext),uN(2,$1c.IInstantiationService),uN(3,L1c.IWorkspaceService),uN(4,x1c.IDiffService),uN(5,bi.IConfigurationService),uN(6,B1c.IExperimentationService),uN(7,m9i.ILanguageContextProviderService),uN(8,M1c.ILanguageDiagnosticsService),uN(9,R1c.IIgnoreService),uN(10,Z1c.ISimilarFilesContextService)],IOr);function A9i(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(A9i,"filterOutEditsWithSubstrings");function y9i(t){let e=t.cursorLineOffset,r=Math.max(0,e-oV.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+oV.N_LINES_AS_CONTEXT+1);return new TOr.OffsetRange(r,n)}a(y9i,"computeAreaAroundEditWindowLinesRange");function xOr(t){switch(t.type){case Nf.ChatFetchResponseType.Canceled:return new Rs.NoNextEditReason.GotCancelled("afterFetchCall");case Nf.ChatFetchResponseType.OffTopic:case Nf.ChatFetchResponseType.Filtered:case Nf.ChatFetchResponseType.PromptFiltered:case Nf.ChatFetchResponseType.Length:case Nf.ChatFetchResponseType.RateLimited:case Nf.ChatFetchResponseType.QuotaExceeded:case Nf.ChatFetchResponseType.ExtensionBlocked:case Nf.ChatFetchResponseType.AgentUnauthorized:case Nf.ChatFetchResponseType.AgentFailedDependency:case Nf.ChatFetchResponseType.InvalidStatefulMarker:return new Rs.NoNextEditReason.Uncategorized(iV.ErrorUtils.fromUnknown(t));case Nf.ChatFetchResponseType.BadRequest:case Nf.ChatFetchResponseType.NotFound:case Nf.ChatFetchResponseType.Failed:case Nf.ChatFetchResponseType.NetworkError:case Nf.ChatFetchResponseType.Unknown:return new Rs.NoNextEditReason.FetchFailure(iV.ErrorUtils.fromUnknown(t))}}a(xOr,"mapChatFetcherErrorToNoNextEditReason");function wOr(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?oSc(t.lintOptions,e.lintOptions):t.lintOptions}}a(wOr,"overrideModelConfig");var iSc={...ra.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function oSc(t,e){return{...t??iSc,...e}}a(oSc,"mergeLintOptions");function E9i(t){switch(t){case ra.PromptingStrategy.UnifiedModel:return bLe.unifiedModelSystemPrompt;case ra.PromptingStrategy.Codexv21NesUnified:case ra.PromptingStrategy.SimplifiedSystemPrompt:return bLe.simplifiedPrompt;case ra.PromptingStrategy.PatchBased:case ra.PromptingStrategy.PatchBased01:case ra.PromptingStrategy.PatchBased02:case ra.PromptingStrategy.PatchBased02WithRecentLineNumbers:case ra.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case ra.PromptingStrategy.Xtab275:case ra.PromptingStrategy.XtabAggressiveness:case ra.PromptingStrategy.Xtab275Aggressiveness:case ra.PromptingStrategy.Xtab275AggressivenessHighLow:case ra.PromptingStrategy.Xtab275EditIntent:case ra.PromptingStrategy.Xtab275EditIntentShort:return bLe.xtab275SystemPrompt;case ra.PromptingStrategy.Nes41Miniv3:return bLe.nes41Miniv3SystemPrompt;case ra.PromptingStrategy.CopilotNesXtab:case void 0:return bLe.systemPromptTemplate;default:(0,jye.assertNever)(t)}}a(E9i,"pickSystemPrompt");function _9i(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(_9i,"determineLanguageContextOptions");function v9i(t,e,r){if(r===ra.ResponseFormat.UnifiedWithXml)return["",...e,""].join(` -`);if(r===ra.ResponseFormat.EditWindowOnly)return e.join(` -`);if(r===ra.ResponseFormat.EditWindowWithEditIntent)return["<|edit_intent|>high<|/edit_intent|>",...e].join(` -`);if(r===ra.ResponseFormat.EditWindowWithEditIntentShort)return["H",...e].join(` -`);if(r===ra.ResponseFormat.CodeBlock)return["```",...e,"```"].join(` -`);if(r===ra.ResponseFormat.CustomDiffPatch){let n=t.workspaceRoot?.path;return`${(0,g9i.toUniquePath)(t.id,n)}:`}else(0,jye.assertNever)(r)}a(v9i,"getPredictionContents");async function*sSc(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 G1c.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(E=>{if(E>=o.length)return!1;switch(u){case Bv.EarlyDivergenceCancellationMode.Cursor:return E===e;case Bv.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let E of t){if(A(y)){let _=n.start+y,v=(0,p9i.getCurrentLine)(f,_,d,g);if(v!==void 0){let b=o[y];if(v!==b&&!(0,p9i.isModelLineCompatible)(b,v,E)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${E}" current="${v}"`),s.cancel();return}}}yield E,y++}}a(sSc,"linesWithIntermediateEditDivergenceCheck")});var b9i=I(EB=>{"use strict";p();var aSc=EB&&EB.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},KCt=EB&&EB.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(EB,"__esModule",{value:!0});EB.StaticGitHubAuthenticationService=void 0;EB.setCopilotToken=fSc;var cSc=Tl(),lSc=Ep(),JCt=kE(),uSc=a5e(),dSc=wQ(),ZCt=class extends JCt.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:JCt.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:JCt.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 JCt.MinimalModeError;return}return this._permissiveGitHubSession}else return this._anyGitHubSession}async getCopilotToken(e){return await super.getCopilotToken(e)}setCopilotToken(e){this._tokenStore.copilotToken=e,this.fireAuthenticationChange("setCopilotToken")}getAnyAdoSession(e){return Promise.resolve(void 0)}getAdoAccessTokenBase64(e){return Promise.resolve(void 0)}};EB.StaticGitHubAuthenticationService=ZCt;EB.StaticGitHubAuthenticationService=ZCt=aSc([KCt(1,lSc.ILogService),KCt(2,dSc.ICopilotTokenStore),KCt(3,uSc.ICopilotTokenManager),KCt(4,cSc.IConfigurationService)],ZCt);function fSc(t,e){if(!(t instanceof ZCt))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(fSc,"setCopilotToken")});var w9i=I(Lv=>{"use strict";p();Object.defineProperty(Lv,"__esModule",{value:!0});Lv.GraphQLErrorType=void 0;Lv.getErrorCode=I9i;Lv.derivePullRequestState=pSc;Lv.makeGitHubAPIRequest=x9i;Lv.makeGitHubGraphQLRequest=Hye;Lv.makeSearchGraphQLRequest=hSc;Lv.getPullRequestFromGlobalId=mSc;Lv.addPullRequestCommentGraphQLRequest=gSc;Lv.closePullRequest=ASc;Lv.makeGitHubAPIRequestWithPagination=ySc;Lv.getAssignableActorsWithSuggestedActors=ESc;Lv.getAssignableActorsWithAssignableUsers=_Sc;function S9i(t){return typeof t=="object"&&t!==null}a(S9i,"isObject");var T9i;(function(t){t.Unprocessable="UNPROCESSABLE"})(T9i||(Lv.GraphQLErrorType=T9i={}));function I9i(t){if(!S9i(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(S9i(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(I9i,"getErrorCode");function pSc(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(pSc,"derivePullRequestState");async function x9i(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(x9i,"makeGitHubAPIRequest");async function Hye(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(Hye,"makeGitHubGraphQLRequest");async function hSc(t,e,r,n,o,s,c=20){let l=` +- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;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(` +`),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=` query FetchCopilotAgentPullRequests($searchQuery: String!, $first: Int!, $after: String) { search(query: $searchQuery, type: ISSUE, first: $first, after: $after) { nodes { @@ -1355,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 Hye(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(hSc,"makeSearchGraphQLRequest");async function mSc(t,e,r,n,o,s){let c=` + `;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=` query GetPullRequestGlobal($globalId: ID!) { node(id: $globalId) { ... on PullRequest { @@ -1390,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 Hye(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=I9i(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(mSc,"getPullRequestFromGlobalId");async function gSc(t,e,r,n,o,s,c){let l=` + `;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=` mutation AddPullRequestComment($pullRequestId: ID!, $body: String!) { addComment(input: {subjectId: $pullRequestId, body: $body}) { commentEdge { @@ -1406,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 Hye(t,e,r,n,l,o,{pullRequestId:s,body:c},"github-graphql-add-pr-comment"))?.data?.addComment?.commentEdge?.node||null}a(gSc,"addPullRequestCommentGraphQLRequest");async function ASc(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await x9i(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(ASc,"closePullRequest");async function ySc(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(ySc,"makeGitHubAPIRequestWithPagination");async function ESc(t,e,r,n,o,s,c){let l=` + `;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=` query GetSuggestedActors($owner: String!, $name: String!, $first: Int!, $after: String) { repository(owner: $owner, name: $name) { suggestedActors( @@ -1427,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 Hye(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(ESc,"getAssignableActorsWithSuggestedActors");async function _Sc(t,e,r,n,o,s,c){let l=` + `,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=` query GetAssignableUsers($owner: String!, $name: String!, $first: Int!, $after: String) { repository(owner: $owner, name: $name) { assignableUsers(first: $first, after: $after) { @@ -1444,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 Hye(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(_Sc,"getAssignableActorsWithAssignableUsers")});var k9i=I(zR=>{"use strict";p();Object.defineProperty(zR,"__esModule",{value:!0});zR.BaseOctoKitService=zR.PermissiveAuthRequiredError=zR.VSCodeTeamId=zR.IOctoKitService=zR.IGithubRepositoryService=void 0;var P9i=rn(),R9i=uQ(),V6=w9i();zR.IGithubRepositoryService=(0,P9i.createServiceIdentifier)("IGithubRepositoryService");zR.IOctoKitService=(0,P9i.createServiceIdentifier)("IOctoKitService");zR.VSCodeTeamId=1682102;var ROr=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};zR.PermissiveAuthRequiredError=ROr;var POr=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,V6.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,V6.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,V6.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repos/${e}/${r}/pulls/${n}/files`,"GET",o,{version:"2022-11-28",callSite:"github-rest-get-pr-files"})||[]}async closePullRequestWithToken(e,r,n,o){return(0,V6.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,V6.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,R9i.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(XCt,"__esModule",{value:!0});XCt.NullBaseOctoKitService=void 0;var vSc=k9i(),kOr=class extends vSc.BaseOctoKitService{static{a(this,"NullBaseOctoKitService")}async getGitHubOutageStatus(){return 0}async getCurrentAuthedUser(){}async getCurrentAuthedUserWithToken(e){return{avatar_url:"",login:"NullUser",name:"Null User"}}async _makeGHAPIRequest(e,r,n,o,s,c){}};XCt.NullBaseOctoKitService=kOr});var B9i=I(Pl=>{"use strict";p();var sbt=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},Du=Pl&&Pl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Pl,"__esModule",{value:!0});Pl.CopilotTokenManagerFromGitHubToken=Pl.CopilotTokenManagerFromDeviceId=Pl.RefreshableCopilotTokenManager=Pl.StaticExtendedTokenInfoCopilotTokenManager=Pl.FixedCopilotTokenManager=Pl.BaseCopilotTokenManager=Pl.tokenErrorString=void 0;Pl.createStaticGitHubTokenProvider=bSc;Pl.getOrCreateTestingCopilotTokenManager=SSc;var DOr=(fne(),_a(dne)),CSc=bc(),N9i=Io(),ebt=bWe(),O9i=Tl(),abt=LE(),cbt=Q$(),$ye=k4(),lbt=D9i(),ubt=Ep(),TLe=fy(),dbt=qh(),M9i=lye(),W6=fgt(),tbt=a5e();Pl.tokenErrorString='Tests: either GITHUB_PAT, GITHUB_OAUTH_TOKEN, or GITHUB_OAUTH_TOKEN+VSCODE_COPILOT_CHAT_TOKEN must be set unless running from an IS_SCENARIO_AUTOMATION environment. Run "npm run get_token" to get credentials.';function bSc(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!($ye.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Pl.tokenErrorString)}}a(bSc,"createStaticGitHubTokenProvider");function SSc(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new ebt.SyncDescriptor(nbt,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new ebt.SyncDescriptor(obt,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new ebt.SyncDescriptor(rbt,[process.env.GITHUB_PAT]);if($ye.isScenarioAutomation)return new ebt.SyncDescriptor(ibt,[t]);throw new Error(Pl.tokenErrorString)}a(SSc,"getOrCreateTestingCopilotTokenManager");var Gye=class extends N9i.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 CSc.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,N9i.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=M9i.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,tbt.nowSeconds)()+s.refresh_in+60;let l=o??"unknown",u={...s,copilot_plan:n?.copilot_plan??s.sku??"",quota_snapshots:n?.quota_snapshots,quota_reset_date:n?.quota_reset_date,codex_agent_enabled:n?.codex_agent_enabled,token_based_billing:n?.token_based_billing,organization_login_list:n?.organization_login_list??[],username:l,isVscodeTeamMember:(0,W6.containsVSCodeOrg)(s.organization_list??[])},d=M9i.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,tbt.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:DOr.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:DOr.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,TLe.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,W6.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,W6.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,W6.isStandardErrorEnvelope)(n)?{...r,body:n,kind:"error"}:(this.sendTokenValidationTelemetry(o),{...r,body:void 0,kind:"parse-failed",parseError:"Response is not valid: "+JSON.stringify(n)})}sendTokenValidationTelemetry(e){e.strategy!=="strict"&&this._telemetryService.sendMSFTTelemetryEvent("copilotTokenFetching.validation",{strategy:e.strategy,strictError:e.strictError,fallbackError:e.fallbackError})}async fetchCopilotUserInfo(e){let r={callSite:"copilot-token-user-info",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0};return await(await this._capiClientService.makeRequest(r,{type:DOr.RequestType.CopilotUserInfo})).json()}};Pl.BaseCopilotTokenManager=Gye;var rbt=class extends Gye{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,W6.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,W6.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new W6.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Pl.FixedCopilotTokenManager=rbt;Pl.FixedCopilotTokenManager=rbt=sbt([Du(1,ubt.ILogService),Du(2,dbt.ITelemetryService),Du(3,abt.ICAPIClientService),Du(4,cbt.IDomainService),Du(5,TLe.IFetcherService),Du(6,$ye.IEnvService)],rbt);var nbt=class extends Gye{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 W6.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Pl.StaticExtendedTokenInfoCopilotTokenManager=nbt;Pl.StaticExtendedTokenInfoCopilotTokenManager=nbt=sbt([Du(1,ubt.ILogService),Du(2,dbt.ITelemetryService),Du(3,abt.ICAPIClientService),Du(4,cbt.IDomainService),Du(5,TLe.IFetcherService),Du(6,$ye.IEnvService)],nbt);var SLe=class extends Gye{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,tbt.nowSeconds)()+300||e){let r=await this.authenticateAndGetToken();if(r.kind==="failure")throw Error(`Failed to get copilot token: ${r.reason.toString()} ${r.message??""}`);this.copilotToken={...r}}return new W6.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,tbt.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Pl.RefreshableCopilotTokenManager=SLe;var ibt=class extends SLe{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)}};Pl.CopilotTokenManagerFromDeviceId=ibt;Pl.CopilotTokenManagerFromDeviceId=ibt=sbt([Du(1,ubt.ILogService),Du(2,dbt.ITelemetryService),Du(3,cbt.IDomainService),Du(4,abt.ICAPIClientService),Du(5,TLe.IFetcherService),Du(6,$ye.IEnvService),Du(7,O9i.IConfigurationService)],ibt);var obt=class extends SLe{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)}};Pl.CopilotTokenManagerFromGitHubToken=obt;Pl.CopilotTokenManagerFromGitHubToken=obt=sbt([Du(2,ubt.ILogService),Du(3,dbt.ITelemetryService),Du(4,cbt.IDomainService),Du(5,abt.ICAPIClientService),Du(6,TLe.IFetcherService),Du(7,$ye.IEnvService),Du(8,O9i.IConfigurationService)],obt)});var L9i=I(z6=>{"use strict";p();var TSc=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},NOr=z6&&z6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(z6,"__esModule",{value:!0});z6.ChatQuotaService=void 0;var ISc=(fne(),_a(dne)),xSc=bc(),wSc=Io(),RSc=kE(),PSc=LE(),kSc=Ep(),MOr=class extends wSc.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 xSc.Emitter),this.onDidChange=this._onDidChange.event,this._rateLimitInfo={session:void 0,weekly:void 0},this._register(this._authService.onDidAuthenticationChange(()=>{this._processUserInfoQuotaSnapshot(this._authService.copilotToken?.quotaInfo)}))}get quotaInfo(){return this._quotaInfo}get rateLimitInfo(){return this._rateLimitInfo}get quotaExhausted(){return!this._quotaInfo||this._quotaInfo.additionalUsageEnabled?!1:this._quotaInfo.unlimited?!this._quotaInfo.hasQuota:this._quotaInfo.percentRemaining<=0}get additionalUsageEnabled(){return this._quotaInfo?this._quotaInfo.additionalUsageEnabled:!1}getCreditsForTurn(e){return this._turnCredits.get(e)}setLastCopilotUsage(e,r){let n=e/1e9;n>0&&this._turnCredits.set(r,(this._turnCredits.get(r)??0)+n)}resetTurnCredits(e){this._turnCredits.delete(e)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(e){let r=this._authService.copilotToken?.isFreeUser?e.get("x-quota-snapshot-chat"):e.get("x-quota-snapshot-premium_models")||e.get("x-quota-snapshot-premium_interactions");if(!r)return;let n=this._processHeaderValue(r);if(!n)return;this._quotaInfo=n,this._logService.trace(`[ChatQuota] processQuotaHeaders: ${JSON.stringify(n)}`);let o=e.get("x-usage-ratelimit-session"),s=e.get("x-usage-ratelimit-weekly");this._rateLimitInfo.session=o?this._processHeaderValue(o):void 0,this._rateLimitInfo.weekly=s?this._processHeaderValue(s):void 0,this._onDidChange.fire()}processQuotaSnapshots(e){let r=this._authService.copilotToken?.isFreeUser?e.chat:e.premium_models??e.premium_interactions;if(r)try{let n=parseInt(r.entitlement,10),o=r.reset_date?new Date(r.reset_date):(()=>{let s=new Date;return s.setMonth(s.getMonth()+1),s})();this._quotaInfo={quota:n,unlimited:n===-1,hasQuota:r.has_quota??!0,percentRemaining:r.percent_remaining,additionalUsageUsed:r.overage_count,additionalUsageEnabled:r.overage_permitted,resetDate:o},this._logService.trace(`[ChatQuota] processQuotaSnapshots: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}catch(n){console.error("Failed to process quota snapshots",n)}}async refreshQuota(){let e=this._authService.anyGitHubSession?.accessToken;if(e)try{let r={callSite:"copilot-quota-refresh",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},o=await(await this._capiClientService.makeRequest(r,{type:ISc.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()}};z6.ChatQuotaService=MOr;z6.ChatQuotaService=MOr=TSc([NOr(0,RSc.IAuthenticationService),NOr(1,kSc.ILogService),NOr(2,PSc.ICAPIClientService)],MOr)});var U9i=I(fbt=>{"use strict";p();Object.defineProperty(fbt,"__esModule",{value:!0});fbt.DefaultsOnlyConfigurationService=void 0;var F9i=Tl(),OOr=class extends F9i.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=F9i.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};fbt.DefaultsOnlyConfigurationService=OOr});var q9i=I(pbt=>{"use strict";p();Object.defineProperty(pbt,"__esModule",{value:!0});pbt.computeDiff=NSc;pbt.computeDiffSync=Q9i;var DSc=q2r();async function NSc(t,e,r){return Q9i(t,e,r)}a(NSc,"computeDiff");function Q9i(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new DSc.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(Q9i,"computeDiffSync")});var $9i=I(dN=>{"use strict";p();var MSc=dN&&dN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),OSc=dN&&dN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),G9i=dN&&dN.__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=qSc([j9i.join(__dirname,"diffWorker.js"),j9i.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new BSc.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 QSc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:FOr(o.changes),moves:o.moves.map(c=>new USc.MovedText(new BOr.LineRangeMapping(new hbt.LineRange(c[0],c[1]),new hbt.LineRange(c[2],c[3])),FOr(c[4])))}}};dN.DiffServiceImpl=LOr;function FOr(t){return t.map(e=>new BOr.DetailedLineRangeMapping(new hbt.LineRange(e[0],e[1]),new hbt.LineRange(e[2],e[3]),e[4]?.map(r=>new BOr.RangeMapping(new H9i.Range(r[0],r[1],r[2],r[3]),new H9i.Range(r[4],r[5],r[6],r[7])))))}a(FOr,"toLineRangeMappings");function qSc(t){for(let e of t)if((0,FSc.existsSync)(e))return e}a(qSc,"firstExistingPath")});var W9i=I(Y6=>{"use strict";p();var jSc=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},V9i=Y6&&Y6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Y6,"__esModule",{value:!0});Y6.CAPIClientImpl=void 0;var HSc=k4(),GSc=fy(),$Sc=LE(),UOr=class extends $Sc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};Y6.CAPIClientImpl=UOr;Y6.CAPIClientImpl=UOr=jSc([V9i(0,GSc.IFetcherService),V9i(1,HSc.IEnvService)],UOr)});var Y9i=I(K6=>{"use strict";p();var VSc=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},QOr=K6&&K6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(K6,"__esModule",{value:!0});K6.DomainService=void 0;var WSc=bc(),zSc=Io(),YSc=wQ(),Vye=Tl(),KSc=LE(),z9i="github-enterprise.uri",qOr=class extends zSc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new WSc.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(`${Vye.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(z9i))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(Vye.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(Vye.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(Vye.ConfigKey.Shared.AuthProvider)===Vye.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(z9i):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)}};K6.DomainService=qOr;K6.DomainService=qOr=VSc([QOr(0,Vye.IConfigurationService),QOr(1,YSc.ICopilotTokenStore),QOr(2,KSc.ICAPIClientService)],qOr)});var K9i=I(Wye=>{"use strict";p();Object.defineProperty(Wye,"__esModule",{value:!0});Wye.NullNativeEnvService=Wye.NullEnvService=void 0;var JSc=bc(),ZSc=Ku(),mbt=k4(),XSc=KOe(),gbt=class t extends mbt.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 JSc.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 mbt.OperatingSystem.Linux}getEditorInfo(){return new mbt.NameAndVersion("simulation-tests-editor",XSc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new mbt.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};Wye.NullEnvService=gbt;var jOr=class extends gbt{static{a(this,"NullNativeEnvService")}get userHome(){return ZSc.URI.file("/home/testuser")}};Wye.NullNativeEnvService=jOr});var HOr=I(Abt=>{"use strict";p();Object.defineProperty(Abt,"__esModule",{value:!0});Abt.IGitExtensionService=void 0;var eTc=rn();Abt.IGitExtensionService=(0,eTc.createServiceIdentifier)("IGitExtensionService")});var J9i=I(ybt=>{"use strict";p();Object.defineProperty(ybt,"__esModule",{value:!0});ybt.NullGitExtensionService=void 0;var tTc=bc(),GOr=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=tTc.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};ybt.NullGitExtensionService=GOr});var Z9i=I(J6=>{"use strict";p();var rTc=J6&&J6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},nTc=J6&&J6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(J6,"__esModule",{value:!0});J6.ObservableGit=void 0;var iTc=Io(),cV=j2(),oTc=HOr(),$Or=class extends iTc.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,cV.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,cV.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,cV.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,cV.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,cV.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,cV.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,cV.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,cV.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};J6.ObservableGit=$Or;J6.ObservableGit=$Or=rTc([nTc(0,oTc.IGitExtensionService)],$Or)});var _bt=I(kl=>{"use strict";p();Object.defineProperty(kl,"__esModule",{value:!0});kl.lengthZero=void 0;kl.lengthDiff=cTc;kl.lengthIsZero=lTc;kl.toLength=Fne;kl.lengthToObj=uTc;kl.lengthGetLineCount=dTc;kl.lengthGetColumnCountIfZeroLineCount=fTc;kl.lengthAdd=eUi;kl.sumLengths=pTc;kl.lengthEquals=hTc;kl.lengthDiffNonNegative=mTc;kl.lengthLessThan=gTc;kl.lengthLessThanEqual=ATc;kl.lengthGreaterThanEqual=yTc;kl.lengthToPosition=ETc;kl.positionToLength=_Tc;kl.lengthsToRange=vTc;kl.lengthOfRange=CTc;kl.lengthCompare=bTc;kl.lengthOfString=STc;kl.lengthOfStringObj=TTc;kl.lengthHash=ITc;kl.lengthMax=xTc;var X9i=Qh(),sTc=O_(),aTc=zp(),Ebt=mme();function cTc(t,e,r,n){return t!==r?Fne(r-t,n):Fne(0,n-e)}a(cTc,"lengthDiff");kl.lengthZero=0;function lTc(t){return t===0}a(lTc,"lengthIsZero");var HE=2**26;function Fne(t,e){return t*HE+e}a(Fne,"toLength");function uTc(t){let e=t,r=Math.floor(e/HE),n=e-r*HE;return new Ebt.TextLength(r,n)}a(uTc,"lengthToObj");function dTc(t){return Math.floor(t/HE)}a(dTc,"lengthGetLineCount");function fTc(t){return t}a(fTc,"lengthGetColumnCountIfZeroLineCount");function eUi(t,e){let r=t+e;return e>=HE&&(r=r-t%HE),r}a(eUi,"lengthAdd");function pTc(t,e){return t.reduce((r,n)=>eUi(r,e(n)),kl.lengthZero)}a(pTc,"sumLengths");function hTc(t,e){return t===e}a(hTc,"lengthEquals");function mTc(t,e){let r=t,n=e;if(n-r<=0)return kl.lengthZero;let s=Math.floor(r/HE),c=Math.floor(n/HE),l=n-c*HE;if(s===c){let u=r-s*HE;return Fne(0,l-u)}else return Fne(c-s,l)}a(mTc,"lengthDiffNonNegative");function gTc(t,e){return t=e}a(yTc,"lengthGreaterThanEqual");function ETc(t){let e=t,r=Math.floor(e/HE),n=e-r*HE;return new sTc.Position(r+1,n+1)}a(ETc,"lengthToPosition");function _Tc(t){return Fne(t.lineNumber-1,t.column-1)}a(_Tc,"positionToLength");function vTc(t,e){let r=t,n=Math.floor(r/HE),o=r-n*HE,s=e,c=Math.floor(s/HE),l=s-c*HE;return new aTc.Range(n+1,o+1,c+1,l+1)}a(vTc,"lengthsToRange");function CTc(t){return t.startLineNumber===t.endLineNumber?new Ebt.TextLength(0,t.endColumn-t.startColumn):new Ebt.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(CTc,"lengthOfRange");function bTc(t,e){return t-e}a(bTc,"lengthCompare");function STc(t){let e=(0,X9i.splitLines)(t);return Fne(e.length-1,e[e.length-1].length)}a(STc,"lengthOfString");function TTc(t){let e=(0,X9i.splitLines)(t);return new Ebt.TextLength(e.length-1,e[e.length-1].length)}a(TTc,"lengthOfStringObj");function ITc(t){return t}a(ITc,"lengthHash");function xTc(t,e){return t>e?t:e}a(xTc,"lengthMax")});var zOr=I(vbt=>{"use strict";p();Object.defineProperty(vbt,"__esModule",{value:!0});vbt.TextEditInfo=void 0;var VOr=_bt(),WOr=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,VOr.lengthToObj)(this.startOffset)}...${(0,VOr.lengthToObj)(this.endOffset)}) -> ${(0,VOr.lengthToObj)(this.newLength)}`}};vbt.TextEditInfo=WOr});var rUi=I(YOr=>{"use strict";p();Object.defineProperty(YOr,"__esModule",{value:!0});YOr.combineTextEditInfos=PTc;var wTc=Al(),I0=_bt(),RTc=zOr();function PTc(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new wTc.ArrayQueue(tUi(t)),n=tUi(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,I0.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,I0.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,I0.lengthIsZero)(d)||f.push(new ILe(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,I0.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new RTc.TextEditInfo(m.startOffset,f,(0,I0.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=I0.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,I0.sumLengths)(f,g=>g.lengthBefore),m=(0,I0.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,I0.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(PTc,"combineTextEditInfos");var ILe=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,I0.lengthDiffNonNegative)(e,this.lengthAfter);return(0,I0.lengthEquals)(r,I0.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,I0.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,I0.lengthToObj)(this.lengthBefore)} -> ${(0,I0.lengthToObj)(this.lengthAfter)}`}};function tUi(t){let e=[],r=I0.lengthZero;for(let n of t){let o=(0,I0.lengthDiffNonNegative)(r,n.startOffset);(0,I0.lengthIsZero)(o)||e.push(new ILe(!1,o,o));let s=(0,I0.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new ILe(!0,s,n.newLength)),r=n.endOffset}return e}a(tUi,"toLengthMapping")});var iUi=I(zye=>{"use strict";p();Object.defineProperty(zye,"__esModule",{value:!0});zye.SingleTextEditLength=zye.TextLengthEdit=void 0;var kTc=zp(),nUi=mme(),DTc=rUi(),xLe=_bt(),NTc=zOr(),KOr=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new wLe(n.range,nUi.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,xLe.lengthToObj)(n.newLength);return new wLe((0,xLe.lengthsToRange)(n.startOffset,n.endOffset),new nUi.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new NTc.TextEditInfo((0,xLe.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,xLe.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,xLe.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,DTc.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return kTc.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};zye.TextLengthEdit=KOr;var wLe=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};zye.SingleTextEditLength=wLe});var oUi=I(Yye=>{"use strict";p();Object.defineProperty(Yye,"__esModule",{value:!0});Yye.DocumentHistory=Yye.HistoryContext=void 0;var MTc=zu(),OTc=XD(),JOr=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,MTc.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}}};Yye.HistoryContext=JOr;var ZOr=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 OTc.RootedEdit(this.base,this.lastEdits.compose())}};Yye.DocumentHistory=ZOr});var dUi=I(Kye=>{"use strict";p();Object.defineProperty(Kye,"__esModule",{value:!0});Kye.NesHistoryContextProvider=void 0;Kye.sum=PLe;Kye.editExtends=uUi;var sUi=Io(),aUi=j2(),BTc=SS(),RLe=bE(),LTc=r5e(),FTc=OT(),Cbt=XD(),UTc=E_t(),cUi=iUi(),QTc=s4(),kLe=uMe(),lUi=oUi(),XOr=class extends sUi.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new t5r(50),this._register((0,aUi.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,kLe.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,aUi.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new e5r(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,QTc.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,sUi.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 lUi.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,kLe.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};Kye.NesHistoryContextProvider=XOr;var e5r=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 FTc.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=LTc.TextEdit.fromStringEdit(e,this._currentValue),o=cUi.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return PLe(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&uUi(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,kLe.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,kLe.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new Cbt.Edits(RLe.StringEdit,this._edits.map(o=>o.edit));return{history:new lUi.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=RLe.StringEdit.empty,o=cUi.TextLengthEdit.empty,s,c=0,l=RLe.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,kLe.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,BTc.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=PLe(u.textLengthEdit.edits,b=>b.range.endLineNumber-b.range.startLineNumber+b.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||PLe(u.edit.replacements,b=>b.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||PLe(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=RLe.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=Cbt.RootedEdit.toLineEdit(new Cbt.RootedEdit(r,y)),v=new UTc.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 Cbt.Edits(RLe.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function PLe(t,e){let r=0;for(let n of t)r+=e(n);return r}a(PLe,"sum");function uUi(t,e){let r=e.getNewRanges();return t.replacements.every(n=>qTc(n.replaceRange,r))}a(uUi,"editExtends");function qTc(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(qTc,"doesTouch");var t5r=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 hUi=I(fN=>{"use strict";p();var jTc=fN&&fN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},fUi=fN&&fN.__param||function(t,e){return function(r,n){e(r,n,t)}},n5r;Object.defineProperty(fN,"__esModule",{value:!0});fN.NesXtabHistoryTracker=fN.XtabEditMergeStrategy=void 0;var i5r=zu(),HTc=Io(),GTc=ale(),$Tc=j2(),VTc=l8(),Sbt=Tl(),WTc=Cp(),bbt=XD(),Z6=Lvr(),zTc=s4(),r5r=uMe(),o5r;(function(t){t.sameStartLine={kind:Z6.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:Z6.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:Z6.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case Z6.DiffHistoryMergeStrategy.Proximity:return e(s);case Z6.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case Z6.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,i5r.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(o5r||(fN.XtabEditMergeStrategy=o5r={}));function pUi(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(pUi,"areLineEditsWithinProximity");var s5r=class extends HTc.Disposable{static{a(this,"NesXtabHistoryTracker")}static{n5r=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 GTc.LinkedList,this.maxHistorySize=r??n5r.MAX_HISTORY_SIZE,this.mergeStrategy=(0,VTc.derived)(s=>o5r.fromConfig(this._configurationService.getExperimentBasedConfigObservable(Sbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(Sbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(Sbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,$Tc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,zTc.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,r5r.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case Z6.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case Z6.DiffHistoryMergeStrategy.Proximity:return pUi(r,e,o.lineGap);case Z6.DiffHistoryMergeStrategy.Hybrid:return(0,r5r.now)()-n<=o.splitAfterMs&&pUi(r,e,o.lineGap)}}handleEdits(e,r){(0,i5r.assert)(r.previous!==void 0,"Document has previous version"),(0,i5r.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 bbt.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=bbt.RootedEdit.toLineEdit(l),d=bbt.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new bbt.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,r5r.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)}}}};fN.NesXtabHistoryTracker=s5r;fN.NesXtabHistoryTracker=s5r=n5r=jTc([fUi(2,Sbt.IConfigurationService),fUi(3,WTc.IExperimentationService)],s5r)});var mUi=I(Tbt=>{"use strict";p();Object.defineProperty(Tbt,"__esModule",{value:!0});Tbt.IVSCodeExtensionContext=void 0;var YTc=rn();Tbt.IVSCodeExtensionContext=(0,YTc.createServiceIdentifier)("IVSCodeExtensionContext")});var bUi=I(hN=>{"use strict";p();var EUi=hN&&hN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},lV=hN&&hN.__param||function(t,e){return function(r,n){e(r,n,t)}},NLe;Object.defineProperty(hN,"__esModule",{value:!0});hN.UndesiredModels=hN.InlineEditsModelService=void 0;var KTc=ZMr(),_Ui=MMr(),gUi=$_(),JTc=Al(),AUi=zu(),vUi=bc(),CUi=Io(),Jye=j2(),ZTc=wQ(),pN=Tl(),XTc=mUi(),eIc=Ep(),tIc=qCt(),rIc=Cp(),nIc=qh(),DLe=sy(),iIc=rCt(),c5r=class extends CUi.Disposable{static{a(this,"InlineEditsModelService")}static{NLe=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:DLe.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:DLe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:DLe.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,Jye.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,Jye.observableFromEvent)(this,this._proxyModelsService.onModelListUpdated,()=>this._proxyModelsService.nesModels),this._preferredModelNameObs=this._configService.getExperimentBasedConfigObservable(pN.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService),this._localModelConfigObs=this._configService.getConfigObservable(pN.ConfigKey.Advanced.InlineEditsXtabProviderModelConfiguration),this._expBasedModelConfigObs=this._configService.getExperimentBasedConfigObservable(pN.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString,this._expService),this._defaultModelConfigObs=this._configService.getExperimentBasedConfigObservable(pN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString,this._expService),this._useSlashModelsObs=this._configService.getExperimentBasedConfigObservable(pN.ConfigKey.TeamInternal.InlineEditsUseSlashModels,this._expService),this._undesiredModelsObs=(0,Jye.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new _Ui.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,Jye.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,Jye.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,Jye.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=vUi.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(pN.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(pN.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(pN.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,pN.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,KTc.filterMap)(r,f=>{if((0,DLe.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,JTc.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 a5r(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 a5r(r[0])}return a5r(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,AUi.assertNever)(e.source)}}determineDefaultModel(e,r){if(r){let n=this.parseModelConfigString(r,pN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString);if(n)return{...n,source:"expDefaultConfig"}}return e?.isFcv1()?NLe.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?NLe.COPILOT_NES_CALLISTO:NLe.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,AUi.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=DLe.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=gUi.ErrorUtils.toString(gUi.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};hN.InlineEditsModelService=c5r;hN.InlineEditsModelService=c5r=NLe=EUi([lV(0,ZTc.ICopilotTokenStore),lV(1,tIc.IProxyModelsService),lV(2,iIc.IUndesiredModelsManager),lV(3,pN.IConfigurationService),lV(4,rIc.IExperimentationService),lV(5,nIc.ITelemetryService),lV(6,eIc.ILogService)],c5r);function a5r(t){let{source:e,...r}=t;return r}a(a5r,"toModelConfiguration");var yUi;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends CUi.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new vUi.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new _Ui.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=EUi([lV(0,XTc.IVSCodeExtensionContext)],r),t.Manager=r})(yUi||(hN.UndesiredModels=yUi={}))});var SUi=I(Ibt=>{"use strict";p();Object.defineProperty(Ibt,"__esModule",{value:!0});Ibt.NullLanguageContextProviderService=void 0;var oIc=Io(),l5r=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return oIc.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};Ibt.NullLanguageContextProviderService=l5r});var TUi=I(xbt=>{"use strict";p();Object.defineProperty(xbt,"__esModule",{value:!0});xbt.TestLanguageDiagnosticsService=void 0;var sIc=bc(),aIc=bk(),cIc=g$(),u5r=class extends cIc.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new aIc.ResourceMap,this._onDidChangeDiagnostics=new sIc.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())}};xbt.TestLanguageDiagnosticsService=u5r});var IUi=I(Rbt=>{"use strict";p();Object.defineProperty(Rbt,"__esModule",{value:!0});Rbt.ResponseStream=void 0;var lIc=$_(),wbt=cw(),uIc=Yc(),dIc=SS(),d5r=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new uIc.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return wbt.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return wbt.Result.error(l)}}),this.stream=fIc(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,dIc.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}}};Rbt.ResponseStream=d5r;async function*fIc(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=lIc.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?wbt.Result.error(n):wbt.Result.ok(r))}}a(fIc,"streamWithAggregation")});var xUi=I(f5r=>{"use strict";p();Object.defineProperty(f5r,"__esModule",{value:!0});f5r.jsonlStreamToCompletions=pIc;async function*pIc(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(pIc,"jsonlStreamToCompletions")});var RUi=I(X6=>{"use strict";p();var hIc=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},p5r=X6&&X6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(X6,"__esModule",{value:!0});X6.CompletionsFetchService=void 0;var mIc=OMr(),wUi=$_(),Une=cw(),gIc=I0r(),AIc=kE(),yIc=k6(),EIc=fy(),_Ic=zAe(),uV=n_t(),vIc=IUi(),CIc=xUi(),h5r=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=Une.Result.error(new uV.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=mIc.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,CIc.jsonlStreamToCompletions)(f),m=new vIc.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=Une.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new uV.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>SIc(d.val.body).catch(()=>"")),h=Une.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())),Une.Result.error(new uV.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=bIc(u,s);return Une.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,yIc.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return Une.Result.error(new uV.Completions.RequestCancelled);let l=wUi.ErrorUtils.fromUnknown(c);return Une.Result.error(new uV.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 uV.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof uV.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof uV.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:gIc.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}}};X6.CompletionsFetchService=h5r;X6.CompletionsFetchService=h5r=hIc([p5r(0,AIc.IAuthenticationService),p5r(1,EIc.IFetcherService),p5r(2,_Ic.IRequestLogger)],h5r);async function*bIc(t,e){try{for await(let r of t)yield r}catch(r){throw wUi.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(bIc,"streamWithCleanup");async function SIc(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(SIc,"collectAsyncIterableToString")});var kUi=I(Pbt=>{"use strict";p();Object.defineProperty(Pbt,"__esModule",{value:!0});Pbt.WireTypes=void 0;var dV=bG(),PUi;(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,dV.vObj)({promptStrategy:(0,dV.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,dV.vObj)({serviceType:(0,dV.vString)(),name:(0,dV.vString)(),provider:(0,dV.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,dV.vObj)({models:(0,dV.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={}))})(PUi||(Pbt.WireTypes=PUi={}))});var NUi=I(e9=>{"use strict";p();var TIc=e9&&e9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},kbt=e9&&e9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(e9,"__esModule",{value:!0});e9.ProxyModelsService=void 0;var IIc=require("util"),m5r=$_(),xIc=wk(),wIc=bc(),RIc=Io(),DUi=j2(),PIc=wQ(),kIc=LE(),DIc=kUi(),NIc=Ep(),MIc=fy(),g5r=class extends RIc.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 wIc.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let s=(0,DUi.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,DUi.autorun)(c=>{let l=s.read(c),u=new xIc.CancellationTokenSource;this._fetchLatestModels(l,u.token).then(d=>{d!==void 0&&(u.token.isCancellationRequested||(0,IIc.isDeepStrictEqual)(this._models,d)||(this._models=d,this._onModelListUpdated.fire()))}).catch(d=>{let f=m5r.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=m5r.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=DIc.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=m5r.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};e9.ProxyModelsService=g5r;e9.ProxyModelsService=g5r=TIc([kbt(0,PIc.ICopilotTokenStore),kbt(1,kIc.ICAPIClientService),kbt(2,MIc.IFetcherService),kbt(3,NIc.ILogService)],g5r)});var MUi=I(Dbt=>{"use strict";p();Object.defineProperty(Dbt,"__esModule",{value:!0});Dbt.NullRequestLogger=void 0;var OIc=kNr(),BIc=bc(),A5r=class extends OIc.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=BIc.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};Dbt.NullRequestLogger=A5r});var D5r=I(Ad=>{"use strict";p();var I5r=Ad&&Ad.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},mN=Ad&&Ad.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Ad,"__esModule",{value:!0});Ad.SimpleExperimentationService=Ad.LogLevel=Ad.ILanguageContextProviderService=Ad.IIgnoreService=Ad.IExperimentationService=Ad.IEndpointProvider=Ad.ICAPIClientService=Ad.IAuthenticationService=void 0;Ad.createNESProvider=Rxc;Ad.createInlineCompletionsProvider=kxc;var LIc=wsi(),OUi=hte(),BUi=AIi(),LUi=Sge(),FIc=pgt(),FUi=LSr(),UIc=FSr(),Fv=RE(),UUi=GSr(),QIc=Mki(),qIc=oy(),QUi=gTr(),jIc=zG(),qUi=CTr(),jUi=o4e(),HUi=jTr(),GUi=GTr(),$Ui=skr(),E5r=WAt(),HIc=gBi(),GIc=ABi(),MLe=Il(),$Ic=OAe(),VIc=qSr(),VUi=Ukr(),WUi=YSr(),zUi=e_t(),YUi=jRr(),KUi=Fyt(),OLe=Lyt(),JUi=f$(),ZUi=Jyt(),WIc=vBi(),zIc=zyt(),XUi=oCr(),e7i=e1(),t7i=c5e(),r7i=Gre(),YIc=MBi(),KIc=DLi(),_5r=XLi(),n7i=hDr(),JIc=g8i(),i7i=$Nr(),ZIc=C9i(),x5r=kE();Object.defineProperty(Ad,"IAuthenticationService",{enumerable:!0,get:a(function(){return x5r.IAuthenticationService},"get")});var XIc=a5e(),o7i=wQ(),exc=b9i(),txc=B9i(),rxc=B6(),nxc=ADr(),ixc=L9i(),oxc=yDr(),s7i=_Dr(),_B=Tl(),sxc=U9i(),axc=VNr(),cxc=$9i(),w5r=LE();Object.defineProperty(Ad,"ICAPIClientService",{enumerable:!0,get:a(function(){return w5r.ICAPIClientService},"get")});var lxc=Q$(),R5r=z5e();Object.defineProperty(Ad,"IEndpointProvider",{enumerable:!0,get:a(function(){return R5r.IEndpointProvider},"get")});var p7i=W9i(),uxc=Y9i(),Qne=k4(),dxc=K9i(),fxc=HOr(),h7i=J9i(),BLe=Tre();Object.defineProperty(Ad,"IIgnoreService",{enumerable:!0,get:a(function(){return BLe.IIgnoreService},"get")});var pxc=Pne(),hxc=ept(),y5r=rCt(),mxc=Z9i(),gxc=dUi(),Axc=hUi(),yxc=bUi(),P5r=Myt();Object.defineProperty(Ad,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return P5r.ILanguageContextProviderService},"get")});var m7i=SUi(),g7i=g$(),A7i=TUi(),gN=Ep(),Exc=n_t(),_xc=RUi(),k5r=fy(),a7i=U6(),vxc=INr(),Cxc=xNr(),bxc=Gvt(),Sxc=qCt(),Txc=NUi(),y7i=zAe(),E7i=MUi(),c7i=tMr(),l7i=_2r(),FLe=Cp();Object.defineProperty(Ad,"IExperimentationService",{enumerable:!0,get:a(function(){return FLe.IExperimentationService},"get")});var _7i=qh(),u7i=lye(),Ixc=bvr(),d7i=NCt(),f7i=PQ(),v5r=PMr(),v7i=rn(),xxc=wk(),LLe=bc(),Bbt=Io(),wxc=y0(),mi=bWe(),C7i=Fs(),qne;(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"})(qne||(Ad.LogLevel=qne={}));function Rxc(t){return Pxc(t).createInstance(C5r,t)}a(Rxc,"createNESProvider");var C5r=class extends Bbt.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(ZIc.XtabProvider),l=r.createInstance(mxc.ObservableGit),u=new gxc.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig(_B.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new Axc.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new YIc.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(KIc.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance(_5r.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=pxc.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,wxc.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new hxc.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new _5r.NextEditProviderTelemetryBuilder(new h7i.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 jne&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=_B.globalConfigRegistry.configs.get(`${_B.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};C5r=I5r([mN(1,C7i.IInstantiationService),mN(2,FLe.IExperimentationService),mN(3,_B.IConfigurationService),mN(4,v5r.IWorkspaceService)],C5r);function Pxc(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o}=t,s=new v7i.InstantiationServiceBuilder;s.define(_B.IConfigurationService,new mi.SyncDescriptor(Nbt,[t.configOverrides??new Map])),s.define(FLe.IExperimentationService,new mi.SyncDescriptor(jne,[t.waitForTreatmentVariables])),s.define(c7i.ISimulationTestContext,new mi.SyncDescriptor(c7i.NulSimulationTestContext)),s.define(v5r.IWorkspaceService,new mi.SyncDescriptor(v5r.NullWorkspaceService)),s.define(axc.IDiffService,new mi.SyncDescriptor(cxc.DiffServiceImpl,[!1])),s.define(gN.ILogService,new mi.SyncDescriptor(gN.LogServiceImpl,[[o||new gN.ConsoleLog(void 0,gN.LogLevel.Trace)]])),s.define(fxc.IGitExtensionService,new mi.SyncDescriptor(h7i.NullGitExtensionService)),s.define(P5r.ILanguageContextProviderService,new mi.SyncDescriptor(m7i.NullLanguageContextProviderService)),s.define(g7i.ILanguageDiagnosticsService,t.languageDiagnosticsService||new mi.SyncDescriptor(A7i.TestLanguageDiagnosticsService)),s.define(BLe.IIgnoreService,new mi.SyncDescriptor(BLe.NullIgnoreService)),s.define(l7i.ISnippyService,new mi.SyncDescriptor(l7i.NullSnippyService)),s.define(lxc.IDomainService,new mi.SyncDescriptor(uxc.DomainService)),s.define(w5r.ICAPIClientService,new mi.SyncDescriptor(p7i.CAPIClientImpl)),s.define(o7i.ICopilotTokenStore,new mi.SyncDescriptor(o7i.CopilotTokenStore)),s.define(Qne.IEnvService,new mi.SyncDescriptor(dxc.NullEnvService)),s.define(k5r.IFetcherService,new mi.SyncDescriptor(Mbt,[e])),s.define(_7i.ITelemetryService,new mi.SyncDescriptor(Obt,[n])),s.define(x5r.IAuthenticationService,new mi.SyncDescriptor(exc.StaticGitHubAuthenticationService,[(0,txc.createStaticGitHubTokenProvider)()])),s.define(XIc.ICopilotTokenManager,r),s.define(n7i.IPowerService,new mi.SyncDescriptor(n7i.NullPowerService)),s.define(rxc.IChatMLFetcher,new mi.SyncDescriptor(JIc.ChatMLFetcherImpl)),s.define(a7i.IChatWebSocketManager,new mi.SyncDescriptor(a7i.NullChatWebSocketManager)),s.define(bxc.IOTelService,new vxc.NoopOTelService((0,Cxc.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),s.define(nxc.IChatQuotaService,new mi.SyncDescriptor(ixc.ChatQuotaService)),s.define(s7i.IInteractionService,new mi.SyncDescriptor(s7i.InteractionService)),s.define(y7i.IRequestLogger,new mi.SyncDescriptor(E7i.NullRequestLogger)),s.define(f7i.ITokenizerProvider,new mi.SyncDescriptor(f7i.TokenizerProvider,[!1])),s.define(oxc.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),s.define(Sxc.IProxyModelsService,new mi.SyncDescriptor(Txc.ProxyModelsService)),s.define(y5r.IInlineEditsModelService,new mi.SyncDescriptor(yxc.InlineEditsModelService)),s.define(y5r.IUndesiredModelsManager,t.undesiredModelsManager||new mi.SyncDescriptor(y5r.NullUndesiredModelsManager)),s.define(d7i.ITerminalService,t.terminalService||new mi.SyncDescriptor(d7i.NullTerminalService)),s.define(i7i.ISimilarFilesContextService,new mi.SyncDescriptor(i7i.NullSimilarFilesContextService)),s.define(R5r.IEndpointProvider,new b5r);let c=new Fv.InMemoryConfigProvider(new Fv.DefaultsOnlyConfigProvider);return t.configOverrides&&c.setOverrides(t.configOverrides),s.define(Fv.ICompletionsConfigProvider,c),s.seal()}a(Pxc,"setupServices");var Nbt=class extends sxc.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)}},b5r=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=LLe.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},jne=class extends Bbt.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new LLe.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()}};Ad.SimpleExperimentationService=jne;Ad.SimpleExperimentationService=jne=I5r([mN(1,_B.IConfigurationService)],jne);var Mbt=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=LLe.Event.None,this.onDidCompleteFetch=LLe.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 k5r.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)}},Obt=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,u7i.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,u7i.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function kxc(t){return Dxc(t).createInstance(S5r)}a(kxc,"createInlineCompletionsProvider");var S5r=class extends Bbt.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(HIc.GhostText)}updateTreatmentVariables(e){this._expService instanceof jne&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=_B.globalConfigRegistry.configs.get(`${_B.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}this._completionsConfigProvider instanceof Fv.InMemoryConfigProvider&&this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(e))}async getInlineCompletions(e,r,n,o){let s=new _5r.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??xxc.CancellationToken.None,o,new LIc.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};S5r=I5r([mN(0,C7i.IInstantiationService),mN(1,FLe.IExperimentationService),mN(2,E5r.ICompletionsSpeculativeRequestCache),mN(3,gN.ILogService),mN(4,_B.IConfigurationService),mN(5,Fv.ICompletionsConfigProvider)],S5r);var T5r=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,Ixc.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function Dxc(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new gN.ConsoleLog(void 0,gN.LogLevel.Trace),f=new v7i.InstantiationServiceBuilder;f.define(MLe.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case MLe.LogLevel.DEBUG:return qne.Debug;case MLe.LogLevel.INFO:return qne.Info;case MLe.LogLevel.WARN:return qne.Warning;case MLe.LogLevel.ERROR:return qne.Error;default:return qne.Info}}}),f.define(x5r.IAuthenticationService,r),f.define(gN.ILogService,new mi.SyncDescriptor(gN.LogServiceImpl,[[d||new gN.ConsoleLog(void 0,gN.LogLevel.Trace)]])),f.define(BLe.IIgnoreService,t.ignoreService||new BLe.NullIgnoreService),f.define(_7i.ITelemetryService,new mi.SyncDescriptor(Obt,[new T5r(c)])),f.define(_B.IConfigurationService,new mi.SyncDescriptor(Nbt,[t.configOverrides??new Map])),f.define(FLe.IExperimentationService,new mi.SyncDescriptor(jne,[t.waitForTreatmentVariables])),f.define(R5r.IEndpointProvider,t.endpointProvider),f.define(w5r.ICAPIClientService,t.capiClientService||new mi.SyncDescriptor(p7i.CAPIClientImpl)),f.define(k5r.IFetcherService,new mi.SyncDescriptor(Mbt,[e])),f.define(OUi.ICompletionsTelemetryService,new mi.SyncDescriptor(OUi.CompletionsTelemetryServiceBridge)),f.define(r7i.ICompletionsRuntimeModeService,r7i.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(jUi.ICompletionsCacheService,new jUi.CompletionsCache);let h=new Fv.InMemoryConfigProvider(new Fv.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define(Fv.ICompletionsConfigProvider,h),f.define($Ui.ICompletionsLastGhostText,new $Ui.LastGhostText),f.define(GUi.ICompletionsCurrentGhostText,new GUi.CurrentGhostText),f.define(E5r.ICompletionsSpeculativeRequestCache,new E5r.SpeculativeRequestCache),f.define(VIc.ICompletionsNotificationSender,new class{async showWarningMessage(m,...g){return await t.notificationSender.showWarningMessage(m,...g)}}),f.define(Fv.ICompletionsEditorAndPluginInfo,new class{getEditorInfo(){return t.editorInfo}getEditorPluginInfo(){return t.editorPluginInfo}getRelatedPluginInfo(){return t.relatedPluginInfo}}),f.define(BUi.ICompletionsExtensionStatus,new BUi.CopilotExtensionStatus),f.define(qIc.ICompletionsFeaturesService,new mi.SyncDescriptor(QIc.Features)),f.define(UIc.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(zUi.ICompletionsStatusReporter,new class extends zUi.StatusReporter{didChange(m){n.didChange(m)}}),f.define(LUi.ICompletionsCopilotTokenManager,new mi.SyncDescriptor(LUi.CopilotTokenManagerImpl,[!1])),f.define(e7i.ICompletionsTextDocumentManagerService,new mi.SyncDescriptor(class extends e7i.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(QUi.ICompletionsFileReaderService,new mi.SyncDescriptor(QUi.FileReader)),f.define(HUi.ICompletionsBlockModeConfig,new mi.SyncDescriptor(HUi.ConfigBlockModeConfig)),f.define(XUi.ICompletionsTelemetryUserConfigService,new mi.SyncDescriptor(XUi.TelemetryUserConfig)),f.define(ZUi.ICompletionsRecentEditsProviderService,new mi.SyncDescriptor(ZUi.FullRecentEditsProvider,[void 0])),f.define(FUi.ICompletionsNotifierService,new mi.SyncDescriptor(FUi.CompletionNotifier)),f.define(VUi.ICompletionsOpenAIFetcherService,new mi.SyncDescriptor(VUi.LiveOpenAIFetcher)),f.define(Exc.ICompletionsFetchService,new mi.SyncDescriptor(_xc.CompletionsFetchService)),f.define(WUi.ICompletionsModelManagerService,new mi.SyncDescriptor(WUi.AvailableModelsManager,[!0])),f.define(qUi.ICompletionsAsyncManagerService,new mi.SyncDescriptor(qUi.AsyncCompletionManager)),f.define(KUi.ICompletionsContextProviderBridgeService,new mi.SyncDescriptor(KUi.ContextProviderBridge)),f.define(UUi.ICompletionsUserErrorNotifierService,new mi.SyncDescriptor(UUi.UserErrorNotifier)),f.define(zIc.ICompletionsRelatedFilesProviderService,new mi.SyncDescriptor(WIc.CompositeRelatedFilesProvider)),f.define(jIc.ICompletionsFileSystemService,new GIc.LocalFileSystem),f.define(OLe.ICompletionsContextProviderRegistryService,new mi.SyncDescriptor(OLe.CachedContextProviderRegistry,[OLe.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(t7i.ICompletionsPromiseQueueService,new t7i.PromiseQueue),f.define(FIc.ICompletionsCitationManager,new class{register(){return Bbt.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define(JUi.ICompletionsContextProviderService,new JUi.ContextProviderStatistics),f.define(YUi.ICompletionsPromptFactoryService,new mi.SyncDescriptor(YUi.CompletionsPromptFactory)),f.define($Ic.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(OLe.ICompletionsDefaultContextProviders,new OLe.DefaultContextProvidersContainer),f.define(Qne.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=LLe.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?Qne.OperatingSystem.Macintosh:process.platform==="win32"?Qne.OperatingSystem.Windows:Qne.OperatingSystem.Linux,this.uriScheme="",this.extensionId=t.editorPluginInfo.name,this.appRoot=t.editorInfo.root??"",this.shell=""}isProduction(){return Fv.BuildInfo.isProduction()}isPreRelease(){return Fv.BuildInfo.isPreRelease()}isSimulation(){return t.isRunningInTest===!0}getBuildType(){return Fv.BuildInfo.getBuildType()===Fv.BuildType.DEV?"dev":"prod"}getVersion(){return Fv.BuildInfo.getVersion()}getBuild(){return Fv.BuildInfo.getBuild()}getName(){return t.editorInfo.name}getEditorInfo(){return new Qne.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new Qne.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(P5r.ILanguageContextProviderService,t.languageContextProvider??new m7i.NullLanguageContextProviderService),f.define(g7i.ILanguageDiagnosticsService,t.languageDiagnosticsService||new mi.SyncDescriptor(A7i.TestLanguageDiagnosticsService)),f.define(y7i.IRequestLogger,new mi.SyncDescriptor(E7i.NullRequestLogger)),f.seal()}a(Dxc,"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 m1=_e(()=>{p();a(Qt,"__classPrivateFieldSet");a(xe,"__classPrivateFieldGet")});var iEe,Zbt=_e(()=>{p();iEe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return iEe=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 s9(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var WLe,oEe=_e(()=>{p();a(s9,"isAbortError");WLe=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,Ah,Ay,hV,sEe,aEe,cEe,lEe,uEe,dEe,fEe,pEe,hEe,Mf=_e(()=>{p();oEe();fr=class extends Error{static{a(this,"AnthropicError")}},Ah=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 hV({message:n,cause:WLe(r)});let s=r,c=s?.error?.type;return e===400?new aEe(e,s,n,o,c):e===401?new cEe(e,s,n,o,c):e===403?new lEe(e,s,n,o,c):e===404?new uEe(e,s,n,o,c):e===409?new dEe(e,s,n,o,c):e===422?new fEe(e,s,n,o,c):e===429?new pEe(e,s,n,o,c):e>=500?new hEe(e,s,n,o,c):new t(e,s,n,o,c)}},Ay=class extends Ah{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},hV=class extends Ah{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},sEe=class extends hV{static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},aEe=class extends Ah{static{a(this,"BadRequestError")}},cEe=class extends Ah{static{a(this,"AuthenticationError")}},lEe=class extends Ah{static{a(this,"PermissionDeniedError")}},uEe=class extends Ah{static{a(this,"NotFoundError")}},dEe=class extends Ah{static{a(this,"ConflictError")}},fEe=class extends Ah{static{a(this,"UnprocessableEntityError")}},pEe=class extends Ah{static{a(this,"RateLimitError")}},hEe=class extends Ah{static{a(this,"InternalServerError")}}});function Xbt(t){return typeof t!="object"?{}:t??{}}function m4r(t){if(!t)return!0;for(let e in t)return!1;return!0}function HQi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var LRc,jQi,$E,h4r,GQi,e1t,vB=_e(()=>{p();Mf();LRc=/^[a-z][a-z0-9+.-]*:/i,jQi=a(t=>LRc.test(t),"isAbsoluteURL"),$E=a(t=>($E=Array.isArray,$E(t)),"isArray"),h4r=$E;a(Xbt,"maybeObj");a(m4r,"isEmptyObj");a(HQi,"hasOwn");GQi=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"),e1t=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var yN,mEe=_e(()=>{p();yN=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 YR,zLe=_e(()=>{p();YR="0.98.0"});function FRc(){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 QRc(){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 zQi,URc,$Qi,VQi,WQi,YLe,t1t=_e(()=>{p();zLe();zQi=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a(FRc,"getDetectedPlatform");URc=a(()=>{let t=FRc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":YR,"X-Stainless-OS":VQi(Deno.build.os),"X-Stainless-Arch":$Qi(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":YR,"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":YR,"X-Stainless-OS":VQi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":$Qi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=QRc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":YR,"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":YR,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(QRc,"getBrowserInfo");$Qi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),VQi=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"),YLe=a(()=>WQi??(WQi=URc()),"getPlatformHeaders")});function YQi(){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 g4r(...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 r1t(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return g4r({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function KLe(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 KQi(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 gEe=_e(()=>{p();a(YQi,"getDefaultFetch");a(g4r,"makeReadableStream");a(r1t,"ReadableStreamFrom");a(KLe,"ReadableStreamToAsyncIterable");a(KQi,"CancelReadableStream")});var JQi,ZQi=_e(()=>{p();JQi=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var A4r,y4r,E4r,XQi,_4r=_e(()=>{p();A4r="RFC3986",y4r=a(t=>String(t),"default_formatter"),E4r={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:y4r},XQi="RFC1738"});function tqi(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function C4r(t,e){if($E(t)){let r=[];for(let n=0;n{p();_4r();vB();n1t=a((t,e)=>(n1t=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),n1t(t,e)),"has"),CB=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),v4r=1024,eqi=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=v4r?s.slice(l,l+v4r):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===XQi&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=CB[h];continue}if(h<2048){d[d.length]=CB[192|h>>6]+CB[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=CB[224|h>>12]+CB[128|h>>6&63]+CB[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=CB[240|h>>18]+CB[128|h>>12&63]+CB[128|h>>6&63]+CB[128|h&63]}c+=d.join("")}return c},"encode");a(tqi,"is_buffer");a(C4r,"maybe_map")});function HRc(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function sqi(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(b4r))!==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(b4r)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&$E(v)&&(v=C4r(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,x0.encoder,E,"key",g):e;v=""}if(HRc(v)||tqi(v)){if(u){let N=y?e:u(e,x0.encoder,E,"key",g);return[A?.(N)+"="+A?.(u(v,x0.encoder,E,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&$E(v))y&&u&&(v=C4r(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if($E(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&&$E(v)&&v.length===1?P+"[]":P;if(o&&$E(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:x0.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:x0.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:x0.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:x0.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?x0.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:x0.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:x0.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:x0.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:x0.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:x0.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:x0.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:x0.strictNullHandling}}function aqi(t,e={}){let r=t,n=GRc(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):$E(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=iqi[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 iqi,oqi,nqi,x0,b4r,cqi=_e(()=>{p();rqi();_4r();vB();iqi={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},oqi=a(function(t,e){Array.prototype.push.apply(t,$E(e)?e:[e])},"push_to_array"),x0={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:eqi,encodeValuesOnly:!1,format:A4r,formatter:y4r,indices:!1,serializeDate(t){return(nqi??(nqi=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(HRc,"is_non_nullish_primitive");b4r={};a(sqi,"inner_stringify");a(GRc,"normalize_stringify_options");a(aqi,"stringify")});function lqi(t){return aqi(t,{arrayFormat:"brackets"})}var S4r=_e(()=>{p();cqi();a(lqi,"stringifyQuery")});function o1t(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new Hc(`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 Hc(`Refusing to send credential over non-https token endpoint "${t}"`)}async function s1t(t,e){let r=await WRc(t),n;try{n=JSON.parse(r)}catch{throw new Hc(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,g1(r),e)}if(!n.access_token)throw new Hc(`Token endpoint response missing access_token: ${JSON.stringify(g1(n))}`,t.status,g1(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new Hc(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,g1(n),e);return n}function g1(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=T4r?t:t.slice(0,T4r)+`... <${t.length-T4r} more chars>`}return JSON.stringify(g1(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))VRc.has(r)&&(e[r]=n);return e}return null}async function a1t(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 Hc(`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 Hc(`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 c1t(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 WRc(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>uqi){let l=uqi-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 dqi,fqi,i1t,$ne,pqi,hqi,AEe,mqi,uqi,T4r,VRc,Hc,yEe=_e(()=>{p();Mf();dqi="urn:ietf:params:oauth:grant-type:jwt-bearer",fqi="refresh_token",i1t="/v1/oauth/token",$ne="oauth-2025-04-20",pqi="oidc-federation-2026-04-01",hqi=120,AEe=30,mqi=5,uqi=1<<20;a(o1t,"requireSecureTokenEndpoint");a(s1t,"parseTokenResponse");T4r=2e3,VRc=new Set(["error","error_description","error_uri"]);a(g1,"redactSensitive");a(a1t,"checkCredentialsFileSafety");a(c1t,"writeCredentialsFileAtomic");a(WRc,"readLimitedText");Hc=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 EN(){return Math.floor(Date.now()/1e3)}var JLe=_e(()=>{p();a(EN,"nowAsSeconds")});var l1t,gqi=_e(()=>{p();yEe();JLe();l1t=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-EN();return n>hqi?r.token:n>AEe?(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||EN()-this.lastAdvisoryError{this.lastAdvisoryError=EN(),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 Aa,ZLe=_e(()=>{p();Aa=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 Eqi(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 EEe(t){let e;return(Aqi??(e=new globalThis.TextEncoder,Aqi=e.encode.bind(e)))(t)}function I4r(t){let e;return(yqi??(e=new globalThis.TextDecoder,yqi=e.decode.bind(e)))(t)}var Aqi,yqi,u1t=_e(()=>{p();a(Eqi,"concatBytes");a(EEe,"encodeUTF8");a(I4r,"decodeUTF8")});var _qi=_e(()=>{p();Mf();u1t()});function XLe(){}function d1t(t,e,r){return!e||f1t[t]>f1t[r]?XLe:e[t].bind(e)}function dl(t){let e=t.logger,r=t.logLevel??"off";if(!e)return zRc;let n=vqi.get(e);if(n&&n[0]===r)return n[1];let o={error:d1t("error",e,r),warn:d1t("warn",e,r),info:d1t("info",e,r),debug:d1t("debug",e,r)};return vqi.set(e,[r,o]),o}var f1t,x4r,zRc,vqi,a9,c9=_e(()=>{p();vB();f1t={off:0,error:200,warn:300,info:400,debug:500},x4r=a((t,e,r)=>{if(t){if(HQi(f1t,t))return t;dl(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(f1t))}`)}},"parseLogLevel");a(XLe,"noop");a(d1t,"makeLogFn");zRc={error:XLe,warn:XLe,info:XLe,debug:XLe},vqi=new WeakMap;a(dl,"loggerFor");a9=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 w4r=_e(()=>{p();vB();_qi();ZLe();c9();Zbt();mEe();S4r()});function Cqi(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(!YRc.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var p1t,YRc,bqi,Sqi,R4r,KRc,Tqi,P4r=_e(()=>{p();t1t();w4r();p1t="1.0",YRc=/^[A-Za-z0-9_.-]+$/;a(Cqi,"validateProfileName");bqi=a(async t=>{var e,r;let n=await R4r();if(n===null)return null;let o=t??await Tqi();if(o===null)return null;Cqi(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=Aa("ANTHROPIC_ORGANIZATION_ID"),m=Aa("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=Aa("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:Aa("ANTHROPIC_WORKSPACE_ID"),base_url:Aa("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:Aa("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:Aa("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=Aa("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=Aa("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=Aa("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=Aa("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=Aa("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=Aa("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=Aa("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),Sqi=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await R4r();if(!r)return null;let n=e??await Tqi();return n?(Cqi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),R4r=a(async()=>{if(!KRc())return null;let t=await import("node:path"),e=Aa("ANTHROPIC_CONFIG_DIR");if(e)return e;if(YLe()["X-Stainless-OS"]==="Windows"){let s=Aa("APPDATA");if(s)return t.join(s,"Anthropic");let c=Aa("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=Aa("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=Aa("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),KRc=a(()=>{let t=YLe()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),Tqi=a(async()=>{let t=await R4r();if(!t)return null;let e=Aa("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 k4r(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 Iqi(t){if(!t)throw new fr("Identity token value is empty");return()=>t}var xqi=_e(()=>{p();Mf();a(k4r,"identityTokenFromFile");a(Iqi,"identityTokenFromValue")});function wqi(t){return async()=>{o1t(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new Hc(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:dqi,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}${i1t}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${$ne},${pqi}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${YR} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new Hc(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=g1(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 Hc(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await s1t(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new Hc(`Token endpoint response missing required fields: ${JSON.stringify(g1(c))}`,o.status,g1(c),s);return{token:c.access_token,expiresAt:EN()+l}}}var Rqi=_e(()=>{p();yEe();JLe();zLe();a(wqi,"oidcFederationProvider")});function Pqi(t){return async e=>{let r=await import("node:fs");await a1t(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new Hc(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new Hc(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new Hc(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||EN()"");throw new Hc(`User OAuth refresh failed (HTTP ${f.status}): ${g1(E)}`,f.status,g1(E),h)}let m=await s1t(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new Hc(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(g1(m))}`,f.status,g1(m),h);let A=EN()+g,y=m.refresh_token||l;return await c1t(t.credentialsPath,{...o,version:p1t,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var kqi=_e(()=>{p();P4r();yEe();JLe();zLe();a(Pqi,"userOAuthProvider")});function D4r(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=JRc(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 Dqi(t,e){let r=await bqi(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 Sqi(n,e)??void 0}};return D4r(s,t)}function JRc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=ZRc(o);if(!s)throw new Hc("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 Hc("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 Hc("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=wqi({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?XRc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new Hc("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return Pqi({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 Hc(`authentication.type "${o}" is not a known authentication type`)}}}function ZRc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Hc(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Hc('identity_token.source "file" requires a non-empty path');return k4r(t.identity_token.path)}let e=Aa("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return k4r(e);let r=Aa("ANTHROPIC_IDENTITY_TOKEN");return r?Iqi(r):null}function XRc(t,e,r,n){return async o=>{let s=await import("node:fs");await a1t(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||EN(){p();ZLe();P4r();yEe();JLe();xqi();Rqi();kqi();a(D4r,"resolveCredentialsFromConfig");a(Dqi,"defaultCredentials");a(JRc,"buildProvider");a(ZRc,"resolveIdentityTokenProvider");a(XRc,"cachedExchangeProvider")});function ePc(t,e){for(let o=e??0;o{p();m1();u1t();l9=class{static{a(this,"LineDecoder")}constructor(){pI.set(this,void 0),hI.set(this,void 0),Qt(this,pI,new Uint8Array,"f"),Qt(this,hI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?EEe(e):e;Qt(this,pI,Eqi([xe(this,pI,"f"),r]),"f");let n=[],o;for(;(o=ePc(xe(this,pI,"f"),xe(this,hI,"f")))!=null;){if(o.carriage&&xe(this,hI,"f")==null){Qt(this,hI,o.index,"f");continue}if(xe(this,hI,"f")!=null&&(o.index!==xe(this,hI,"f")+1||o.carriage)){n.push(I4r(xe(this,pI,"f").subarray(0,xe(this,hI,"f")-1))),Qt(this,pI,xe(this,pI,"f").subarray(xe(this,hI,"f")),"f"),Qt(this,hI,null,"f");continue}let s=xe(this,hI,"f")!==null?o.preceding-1:o.preceding,c=I4r(xe(this,pI,"f").subarray(0,s));n.push(c),Qt(this,pI,xe(this,pI,"f").subarray(o.index),"f"),Qt(this,hI,null,"f")}return n}flush(){return xe(this,pI,"f").length?this.decode(` -`):[]}};pI=new WeakMap,hI=new WeakMap;l9.NEWLINE_CHARS=new Set([` -`,"\r"]);l9.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(ePc,"findNewlineIndex");a(Mqi,"findDoubleNewlineIndex")});async function*tPc(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 M4r,n=new l9,o=KLe(t.body);for await(let s of rPc(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*rPc(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"?EEe(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=Mqi(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function nPc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var e3e,bB,M4r,O4r=_e(()=>{p();m1();Mf();gEe();N4r();gEe();oEe();vB();u1t();c9();Mf();bB=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,e3e.set(this,void 0),this.controller=r,Qt(this,e3e,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?dl(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 tPc(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=e1t(u.data)??u.data,f=d?.error?.type;throw new Ah(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(s9(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 l9,u=KLe(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(s9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(e3e=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,e3e,"f")),new t(()=>o(r),this.controller,xe(this,e3e,"f"))]}toReadableStream(){let e=this,r;return g4r({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=EEe(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(tPc,"_iterSSEMessages");a(rPc,"iterSSEChunks");M4r=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]=nPc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(nPc,"partition")});async function h1t(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return dl(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):bB.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 B4r(m,r)}return await r.text()})();return dl(t).debug(`[${n}] response parsed`,a9({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function B4r(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 L4r=_e(()=>{p();O4r();c9();a(h1t,"defaultParseResponse");a(B4r,"addRequestID")});var t3e,Vne,m1t=_e(()=>{p();m1();L4r();Vne=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=h1t){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,t3e.set(this,void 0),Qt(this,t3e,e,"f")}_thenUnwrap(e){return new t(xe(this,t3e,"f"),this.responsePromise,async(r,n)=>B4r(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,t3e,"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)}};t3e=new WeakMap});var g1t,A1t,r3e,KR,ya,yd=_e(()=>{p();m1();Mf();L4r();m1t();vB();A1t=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){g1t.set(this,void 0),Qt(this,g1t,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,g1t,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(g1t=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},r3e=class extends Vne{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await h1t(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},KR=class extends A1t{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:{...Xbt(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...Xbt(this.options.query),after_id:e}}:null}},ya=class extends A1t{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:{...Xbt(this.options.query),page:e}}:null}}});function Wne(t,e,r){return U4r(),new File(t,e??"unknown_file",r)}function n3e(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 oPc(t){let e=typeof t=="function"?t:t.fetch,r=Oqi.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 Oqi.set(e,n),n}var U4r,Q4r,_Ee,Oqi,sPc,aPc,F4r,vEe=_e(()=>{p();gEe();U4r=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(Wne,"makeFile");a(n3e,"getName");Q4r=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),_Ee=a(async(t,e,r=!0)=>({...t,body:await sPc(t.body,e,r)}),"multipartFormRequestOptions"),Oqi=new WeakMap;a(oPc,"supportsFormData");sPc=a(async(t,e,r=!0)=>{if(!await oPc(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])=>F4r(n,o,s,r))),n},"createForm"),aPc=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),F4r=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,Wne([await r.blob()],n3e(r,n),o))}else if(Q4r(r))t.append(e,Wne([await new Response(r1t(r)).blob()],n3e(r,n)));else if(aPc(r))t.append(e,Wne([r],n3e(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>F4r(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>F4r(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 y1t(t,e,r){if(U4r(),t=await t,e||(e=n3e(t,!0)),cPc(t))return t instanceof File&&e==null&&r==null?t:Wne([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(lPc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),Wne(await q4r(o),e,r)}let n=await q4r(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 Wne(n,e,r)}async function q4r(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(Bqi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(Q4r(t))for await(let r of t)e.push(...await q4r(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${uPc(t)}`)}return e}function uPc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var Bqi,cPc,lPc,Lqi=_e(()=>{p();vEe();vEe();Bqi=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"),cPc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&Bqi(t),"isFileLike"),lPc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(y1t,"toFile");a(q4r,"getBytes");a(uPc,"propsForError")});var j4r=_e(()=>{p();Lqi()});var Fqi=_e(()=>{p()});var gi,Nl=_e(()=>{p();gi=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*fPc(t){if(!t)return;if(Uqi 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():h4r(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=h4r(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 Uqi,vt,Ec=_e(()=>{p();vB();Uqi=Symbol.for("brand.privateNullableHeaders");a(fPc,"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 fPc(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{[Uqi]:!0,values:e,nulls:r}},"buildHeaders")});function E1t(t){return typeof t=="object"&&t!==null&&i3e in t}function H4r(t,e){let r=new Set;if(t)for(let n of t)E1t(n)&&r.add(n[i3e]);if(e){for(let n of e)if(E1t(n)&&r.add(n[i3e]),Array.isArray(n.content))for(let o of n.content)E1t(o)&&r.add(o[i3e])}return Array.from(r)}function _1t(t,e){let r=H4r(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function Qqi(t){return E1t(t)?{"x-stainless-helper":t[i3e]}:{}}var i3e,o3e=_e(()=>{p();i3e=Symbol("anthropic.sdk.stainlessHelper");a(E1t,"wasCreatedByStainlessHelper");a(H4r,"collectStainlessHelpers");a(_1t,"stainlessHelperHeader");a(Qqi,"stainlessHelperHeaderFromFile")});function jqi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var qqi,pPc,or,Of=_e(()=>{p();Mf();a(jqi,"encodeURIPath");qqi=Object.freeze(Object.create(null)),pPc=a((t=jqi)=>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??qqi)??qqi)?.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 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: ${s.map(m=>m.error).join(` `)} ${c} -${h}`)}return c},"path"),"createPathTagFunction"),or=pPc(jqi)});var CEe,G4r=_e(()=>{p();Nl();yd();Ec();o3e();vEe();Of();CEe=class extends gi{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",KR,{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",_Ee({body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},Qqi(o.file),r?.headers])},this._client))}}});var bEe,$4r=_e(()=>{p();Nl();yd();Ec();Of();bEe=class extends gi{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",KR,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var SEe,V4r=_e(()=>{p();Nl();yd();Ec();Of();SEe=class extends gi{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",ya,{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 Gqi=I(v1t=>{"use strict";p();Object.defineProperty(v1t,"__esModule",{value:!0});v1t.timingSafeEqual=void 0;function Hqi(t,e=""){if(!t)throw new Error(e)}a(Hqi,"assert");function APc(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)),Hqi(t instanceof DataView),Hqi(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var yPc=mI&&mI.__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(mI,"__esModule",{value:!0});var Dm=256,W4r=(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&Dm,l|=d&Dm,l|=f&Dm,l|=h&Dm;if(c>>4,l|=u&Dm,l|=d&Dm),c>>2,l|=f&Dm),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=Dm;return r+=(42-e&e-44)>>>8&-Dm+e-43+62,r+=(46-e&e-48)>>>8&-Dm+e-47+63,r+=(47-e&e-58)>>>8&-Dm+e-48+52,r+=(64-e&e-91)>>>8&-Dm+e-65+0,r+=(96-e&e-123)>>>8&-Dm+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})();mI.Coder=W4r;var s3e=new W4r;function EPc(t){return s3e.encode(t)}a(EPc,"encode");mI.encode=EPc;function _Pc(t){return s3e.decode(t)}a(_Pc,"decode");mI.decode=_Pc;var $qi=(function(t){yPc(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=Dm;return n+=(44-r&r-46)>>>8&-Dm+r-45+62,n+=(94-r&r-96)>>>8&-Dm+r-95+63,n+=(47-r&r-58)>>>8&-Dm+r-48+52,n+=(64-r&r-91)>>>8&-Dm+r-65+0,n+=(96-r&r-123)>>>8&-Dm+r-97+26,n},e})(W4r);mI.URLSafeCoder=$qi;var Vqi=new $qi;function vPc(t){return Vqi.encode(t)}a(vPc,"encodeURLSafe");mI.encodeURLSafe=vPc;function CPc(t){return Vqi.decode(t)}a(CPc,"decodeURLSafe");mI.decodeURLSafe=CPc;mI.encodedLength=function(t){return s3e.encodedLength(t)};mI.maxDecodedLength=function(t){return s3e.maxDecodedLength(t)};mI.decodedLength=function(t){return s3e.decodedLength(t)}});var Yqi=I((zqi,C1t)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof C1t=="object"&&typeof C1t.exports=="object"?C1t.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(zqi,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(h,m,g,A,y){for(var E,_,v,b,T,w,R,x,P,D,N,B,L;y>=64;){for(E=m[0],_=m[1],v=m[2],b=m[3],T=m[4],w=m[5],R=m[6],x=m[7],D=0;D<16;D++)N=A+D*4,h[D]=(g[N]&255)<<24|(g[N+1]&255)<<16|(g[N+2]&255)<<8|g[N+3]&255;for(D=16;D<64;D++)P=h[D-2],B=(P>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,P=h[D-15],L=(P>>>7|P<<25)^(P>>>18|P<<14)^P>>>3,h[D]=(B+h[D-7]|0)+(L+h[D-16]|0);for(D=0;D<64;D++)B=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&w^~T&R)|0)+(x+(e[D]+h[D]|0)|0)|0,L=((E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10))+(E&_^E&v^_&v)|0,x=R,R=w,w=T,T=b+B|0,b=v,v=_,_=E,E=B+L|0;m[0]+=E,m[1]+=_,m[2]+=v,m[3]+=b,m[4]+=T,m[5]+=w,m[6]+=R,m[7]+=x,A+=64,y-=64}return A}a(r,"hashBlocks");var n=(function(){function h(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return a(h,"Hash"),h.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},h.prototype.clean=function(){for(var m=0;m0){for(;this.bufferLength<64&&g>0;)this.buffer[this.bufferLength++]=m[A++],g--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(g>=64&&(A=r(this.temp,this.state,m,A,g),g%=64);g>0;)this.buffer[this.bufferLength++]=m[A++],g--;return this},h.prototype.finish=function(m){if(!this.finished){var g=this.bytesHashed,A=this.bufferLength,y=g/536870912|0,E=g<<3,_=g%64<56?64:128;this.buffer[A]=128;for(var v=A+1;v<_-8;v++)this.buffer[v]=0;this.buffer[_-8]=y>>>24&255,this.buffer[_-7]=y>>>16&255,this.buffer[_-6]=y>>>8&255,this.buffer[_-5]=y>>>0&255,this.buffer[_-4]=E>>>24&255,this.buffer[_-3]=E>>>16&255,this.buffer[_-2]=E>>>8&255,this.buffer[_-1]=E>>>0&255,r(this.temp,this.state,this.buffer,0,_),this.finished=!0}for(var v=0;v<8;v++)m[v*4+0]=this.state[v]>>>24&255,m[v*4+1]=this.state[v]>>>16&255,m[v*4+2]=this.state[v]>>>8&255,m[v*4+3]=this.state[v]>>>0&255;return this},h.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},h.prototype._saveState=function(m){for(var g=0;gthis.blockSize)new n().update(m).finish(g).clean();else for(var A=0;A1&&m.update(h),g&&m.update(g),m.update(A),m.finish(h),A[0]++}a(l,"fillBuffer");var u=new Uint8Array(t.digestLength);function d(h,m,g,A){m===void 0&&(m=u),A===void 0&&(A=32);for(var y=new Uint8Array([1]),E=c(m,h),_=new o(E),v=new Uint8Array(_.digestLength),b=v.length,T=new Uint8Array(A),w=0;w>>24&255,_[1]=R>>>16&255,_[2]=R>>>8&255,_[3]=R>>>0&255,y.reset(),y.update(m),y.update(_),y.finish(b);for(var x=0;x{"use strict";p();Object.defineProperty(TEe,"__esModule",{value:!0});TEe.Webhook=TEe.WebhookVerificationError=void 0;var bPc=Gqi(),Kqi=Wqi(),SPc=Yqi(),Jqi=300,z4r=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}},mV=class t extends z4r{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};TEe.WebhookVerificationError=mV;var b1t=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=Kqi.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 mV("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,bPc.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new mV("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,${Kqi.encode(SPc.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new mV("Invalid Signature Headers");if(r-n>Jqi)throw new mV("Message timestamp too old");if(n>r+Jqi)throw new mV("Message timestamp too new");return new Date(n*1e3)}};TEe.Webhook=b1t;b1t.prefix="whsec_"});var Xqi,IEe,Y4r=_e(()=>{p();Nl();Xqi=de(Zqi(),1),IEe=class extends gi{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 Xqi.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var xEe,K4r=_e(()=>{p();Nl();yd();Ec();Of();xEe=class extends gi{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/agents/${e}/versions?beta=true`,ya,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var zne,J4r=_e(()=>{p();Nl();K4r();K4r();yd();Ec();Of();zne=class extends gi{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new xEe(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",ya,{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])})}};zne.Versions=xEe});function Yne(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 S1t=_e(()=>{p();a(Yne,"linkAbort")});function gV(t,e){return t instanceof Ah&&t.status===e}function eji(t){return t instanceof Ah&&typeof t.status=="number"&&t.status>=400&&t.status<500}function AV(t){return eji(t)&&!gV(t,408)&&!gV(t,409)&&!gV(t,429)}function tji(t,e,r){return Math.min(e*2**t,r)}function Z4r(t,e){return t+Math.random()*(e-t)}function rji(t){return t*(1-Math.random()*.25)}var a3e=_e(()=>{p();Mf();a(gV,"isStatus");a(eji,"is4xx");a(AV,"isFatal4xx");a(tji,"backoff");a(Z4r,"jitter");a(rji,"applyJitter")});function T1t(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 X4r=_e(()=>{p();Mf();Ec();a(T1t,"copyClientForHelper")});function kPc(t){return tji(t,RPc,PPc)}function DPc(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${iEe()}`:iEe()}var wEe,I1t,JR,x1t,w1t,R1t,c3e,l3e,REe,wPc,RPc,PPc,yV,P1t=_e(()=>{p();m1();Mf();c9();mEe();Zbt();S1t();Ec();a3e();X4r();a3e();wPc=999,RPc=1e3,PPc=6e4,yV=class{static{a(this,"WorkPoller")}constructor(e){wEe.set(this,void 0),I1t.set(this,!1),JR.set(this,void 0),x1t.set(this,void 0),w1t.set(this,void 0),R1t.set(this,void 0),c3e.set(this,void 0),l3e.set(this,void 0),REe.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??DPc(),Qt(this,wEe,T1t(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),Qt(this,w1t,e.autoStop??!0,"f"),Qt(this,R1t,e.drain??!1,"f"),Qt(this,c3e,e.blockMs===void 0?wPc:e.blockMs,"f"),Qt(this,l3e,e.reclaimOlderThanMs??null,"f"),Qt(this,REe,e.requestOptions,"f"),Qt(this,JR,new AbortController,"f"),Qt(this,x1t,Yne(e.signal,xe(this,JR,"f")),"f")}get signal(){return xe(this,JR,"f").signal}abort(){xe(this,JR,"f").abort()}async*[(wEe=new WeakMap,I1t=new WeakMap,JR=new WeakMap,x1t=new WeakMap,w1t=new WeakMap,R1t=new WeakMap,c3e=new WeakMap,l3e=new WeakMap,REe=new WeakMap,Symbol.asyncIterator)](){if(xe(this,I1t,"f"))throw new fr("Cannot iterate over a consumed WorkPoller");Qt(this,I1t,!0,"f");let e=dl(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!xe(this,JR,"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,c3e,"f")!==null?{block_ms:xe(this,c3e,"f")}:{},...xe(this,l3e,"f")!==null?{reclaim_older_than_ms:xe(this,l3e,"f")}:{}},{headers:vt([xe(this,REe,"f")?.headers]),signal:xe(this,JR,"f").signal})}catch(o){if(xe(this,JR,"f").signal.aborted)return;if(AV(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=rji(kPc(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await yN(s,xe(this,JR,"f").signal);continue}if(r=0,n==null){if(xe(this,R1t,"f"))return;await yN(Z4r(1e3,3e3),xe(this,JR,"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:vt([xe(this,REe,"f")?.headers]),signal:xe(this,JR,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(xe(this,w1t,"f"))try{await xe(this,wEe,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,REe,"f")?.headers])})}catch(o){gV(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{xe(this,x1t,"f").call(this)}}};a(kPc,"backoff");a(DPc,"defaultWorkerId")});var PEe,EV,kEe,k1t,nji=_e(()=>{p();m1();k1t=class{static{a(this,"AsyncQueue")}constructor(){PEe.set(this,[]),EV.set(this,[]),kEe.set(this,!1)}push(e){if(xe(this,kEe,"f"))return!1;let r=xe(this,EV,"f").shift();return r?r({done:!1,value:e}):xe(this,PEe,"f").push(e),!0}close(){if(!xe(this,kEe,"f"))for(Qt(this,kEe,!0,"f");xe(this,EV,"f").length>0;)xe(this,EV,"f").shift()({done:!0,value:void 0})}next(e){return xe(this,PEe,"f").length>0?Promise.resolve({done:!1,value:xe(this,PEe,"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,EV,"f").indexOf(n);s>=0&&xe(this,EV,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");xe(this,EV,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return xe(this,PEe,"f").shift()}};PEe=new WeakMap,EV=new WeakMap,kEe=new WeakMap});var _o,Kne=_e(()=>{p();_o=class extends Error{static{a(this,"ToolError")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}}});function eBr(t){return"name"in t?t.name:t.mcp_server_name}function NPc(t){return t instanceof _o?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function iji(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:NPc(n),isError:!0}}}var oji=_e(()=>{p();Kne();a(eBr,"toolName");a(NPc,"toolErrorContent");a(iji,"runRunnableTool")});function fji(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function UPc(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 QPc(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 w0,D1t,yy,N1t,d3e,O1t,VE,DEe,SB,Jne,u9,f3e,NEe,M1t,pji,sji,aji,cji,tBr,u3e,rBr,lji,hji,MPc,uji,OPc,BPc,LPc,dji,FPc,_V,B1t=_e(()=>{p();m1();Mf();c9();mEe();a3e();S1t();nji();Ec();oji();MPc="SessionToolRunner",uji=500,OPc=1e4,BPc=12e4,LPc=3e4,dji=3,FPc=6e4;a(fji,"isEndTurnIdle");_V=class{static{a(this,"SessionToolRunner")}constructor(e,r){w0.add(this),D1t.set(this,!1),yy.set(this,void 0),N1t.set(this,void 0),d3e.set(this,void 0),O1t.set(this,void 0),VE.set(this,void 0),DEe.set(this,new Set),SB.set(this,new Set),Jne.set(this,new k1t),u9.set(this,0),f3e.set(this,null),NEe.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??FPc,Qt(this,VE,dl(r.client),"f"),Qt(this,O1t,new Map(r.tools.map(n=>[eBr(n),n])),"f"),Qt(this,yy,new AbortController,"f"),Qt(this,N1t,Yne(r.signal,xe(this,yy,"f")),"f"),Qt(this,d3e,r.requestOptions,"f")}get signal(){return xe(this,yy,"f").signal}abort(){xe(this,yy,"f").abort()}async*[(D1t=new WeakMap,yy=new WeakMap,N1t=new WeakMap,d3e=new WeakMap,O1t=new WeakMap,VE=new WeakMap,DEe=new WeakMap,SB=new WeakMap,Jne=new WeakMap,u9=new WeakMap,f3e=new WeakMap,NEe=new WeakMap,w0=new WeakSet,Symbol.asyncIterator)](){if(xe(this,D1t,"f"))throw new fr("Cannot iterate over a consumed SessionToolRunner");Qt(this,D1t,!0,"f"),xe(this,VE,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=xe(this,w0,"m",pji).call(this).catch(r=>{xe(this,yy,"f").signal.aborted||xe(this,VE,"f").error("stream loop failed",{error:String(r)}),xe(this,yy,"f").abort()});try{for(;;){let n=await xe(this,Jne,"f").next(xe(this,yy,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=xe(this,Jne,"f").tryShift())!==void 0;)yield r}finally{xe(this,yy,"f").abort(),xe(this,w0,"m",u3e).call(this),await e;try{await xe(this,w0,"m",hji).call(this)}catch(r){xe(this,VE,"f").warn("drain failed",{error:String(r)})}xe(this,Jne,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){xe(this,VE,"f").warn("tool.close failed",{tool:eBr(r),error:String(n)})}xe(this,N1t,"f").call(this)}}};M1t=a(function(){return{...xe(this,d3e,"f"),headers:vt([{"x-stainless-helper":MPc},xe(this,d3e,"f")?.headers]),signal:xe(this,yy,"f").signal}},"_SessionToolRunner_requestOptions"),pji=a(async function(){let e=xe(this,yy,"f"),r=uji;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},xe(this,w0,"m",M1t).call(this));await xe(this,w0,"m",sji).call(this);for await(let o of n)if(r=uji,await xe(this,w0,"m",cji).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),AV(n))throw xe(this,VE,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;xe(this,VE,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await yN(r,e.signal),r=Math.min(r*2,OPc)}},"_SessionToolRunner_streamLoop"),sji=a(async function(){let e=xe(this,yy,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},xe(this,w0,"m",M1t).call(this)))xe(this,w0,"m",aji).call(this,s,r),n=fji(s)}catch(s){e.signal.throwIfAborted(),xe(this,VE,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)xe(this,DEe,"f").delete(c.id);return}let o=r.filter(s=>!xe(this,SB,"f").has(s.id));n&&o.length===0?xe(this,w0,"m",tBr).call(this):xe(this,w0,"m",u3e).call(this);for(let s of o)await xe(this,w0,"m",rBr).call(this,s)},"_SessionToolRunner_reconcile"),aji=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(xe(this,DEe,"f").add(e.id),xe(this,SB,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?xe(this,SB,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&xe(this,SB,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),cji=a(async function(e){switch(fji(e)?xe(this,w0,"m",tBr).call(this):xe(this,w0,"m",u3e).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return xe(this,DEe,"f").has(e.id)||(xe(this,DEe,"f").add(e.id),await xe(this,w0,"m",rBr).call(this,e)),!1;case"user.tool_result":return xe(this,SB,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return xe(this,SB,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return xe(this,VE,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),xe(this,yy,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),tBr=a(function(){xe(this,w0,"m",u3e).call(this),!(this.maxIdleMs<=0)&&Qt(this,NEe,setTimeout(()=>{xe(this,VE,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),xe(this,yy,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),u3e=a(function(){xe(this,NEe,"f")!==void 0&&(clearTimeout(xe(this,NEe,"f")),Qt(this,NEe,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),rBr=a(async function(e){var r,n;if(!xe(this,SB,"f").has(e.id)){xe(this,VE,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Qt(this,u9,(r=xe(this,u9,"f"),r++,r),"f");try{let o=xe(this,O1t,"f").get(e.name);if(!o){xe(this,VE,"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,Jne,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=Yne(xe(this,yy,"f").signal,l),d=setTimeout(()=>l.abort(),BPc);try{let m=await iji(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=UPc(e,c,QPc(s)),h=await xe(this,w0,"m",lji).call(this,f,e.id);xe(this,Jne,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{Qt(this,u9,(n=xe(this,u9,"f"),n--,n),"f"),xe(this,u9,"f")===0&&xe(this,f3e,"f")?.call(this)}}},"_SessionToolRunner_execute"),lji=a(async function(e,r){let n=xe(this,yy,"f"),o;for(let s=0;sQt(this,f3e,e,"f")),yN(LPc)]),Qt(this,f3e,null,"f"),xe(this,u9,"f")>0&&xe(this,VE,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(UPc,"buildResultEvent");a(QPc,"toSessionContent")});var mji=_e(()=>{p();w4r()});function Zne(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 gji=_e(()=>{p();nBr();mji();a(Zne,"betaTool")});function MEe(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var iBr=_e(()=>{p();a(MEe,"promiseWithResolvers")});async function jPc(t){try{return await gI.realpath(t)}catch{return t}}async function HPc(t){let e=[],r=t;for(;;){let n;try{n=await gI.realpath(r)}catch{let o=!1;try{o=(await gI.lstat(r)).isSymbolicLink()}catch{}if(o){r=R0.resolve(R0.dirname(r),await gI.readlink(r));continue}let s=R0.dirname(r);if(s===r)return t;e.push(R0.basename(r)),r=s;continue}return e.length?R0.join(n,...e.reverse()):n}}async function yji(t,e,r){let n=r?.allowOutside??!1;if(R0.isAbsolute(e)){if(!n)throw new _o(`absolute path ${JSON.stringify(e)} not permitted`);return R0.resolve(e)}let o=await jPc(R0.resolve(t)),s=R0.resolve(o,e);if(n)return s;let c=await HPc(s),l=o.endsWith(R0.sep)?o:o+R0.sep;if(c!==o&&!c.startsWith(l))throw new _o(`path ${JSON.stringify(e)} escapes workdir`);return c}async function oBr(t,e){let r=R0.dirname(t),n=R0.join(r,`.tmp-${process.pid}-${(0,Aji.randomUUID)()}`),o;try{o=await gI.open(n,"wx",qPc),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await gI.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await gI.unlink(n).catch(()=>{}),s}}function h3e(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 gI,R0,Aji,p3e,qPc,sBr=_e(()=>{p();gI=de(require("node:fs/promises"),1),R0=de(require("node:path"),1),Aji=require("node:crypto");Kne();p3e=493,qPc=420;a(jPc,"realpathOrSelf");a(HPc,"canonicalize");a(yji,"confineToRoot");a(oBr,"atomicWriteFile");a(h3e,"fsErrorMessage")});async function Sji(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=dl(e),o=await e.beta.sessions.retrieve(r),s=Ey.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await cBr(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=Ey.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=Ey.resolve(s,f);if(h!==s&&!h.startsWith(s+Ey.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 A1.rm(h,{recursive:!0,force:!0}),await A1.mkdir(h,{recursive:!0,mode:p3e}),c.push(h),await lBr(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 A1.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 cBr(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 $Pc(t){for(let e of t.split(` -`)){let r=e.trim();if(r&&(Ey.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new fr(`refusing to extract unsafe archive member: ${r}`)}}function VPc(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 aBr(t,e){try{let{stdout:r}=await GPc(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 WPc(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 lBr(t,e){let r=Ey.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new fr("skill download response had no body");await(0,bji.pipeline)(Cji.Readable.fromWeb(t.body),Eji.createWriteStream(r));let n=Ey.join(Ey.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await zPc(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await aBr(c,s?["-Z1",r]:["-tf",r]);$Pc(l),VPc(await aBr(c,s?["-Z",r]:["-tvf",r]));let u=WPc(l);await A1.mkdir(n,{recursive:!0,mode:p3e}),await aBr(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?Ey.join(n,u):n;for(let f of await A1.readdir(d))await A1.rename(Ey.join(d,f),Ey.join(e,f))}finally{await A1.rm(r,{force:!0}),await A1.rm(n,{recursive:!0,force:!0})}}async function zPc(t,e){let r=await A1.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 A1,Eji,Ey,_ji,vji,Cji,bji,GPc,Tji=_e(()=>{p();A1=de(require("node:fs/promises"),1),Eji=de(require("node:fs"),1),Ey=de(require("node:path"),1),_ji=require("node:child_process"),vji=require("node:util"),Cji=require("node:stream"),bji=require("node:stream/promises");Mf();c9();sBr();GPc=(0,vji.promisify)(_ji.execFile);a(Sji,"setupSkills");a(cBr,"resolveSkillVersion");a($Pc,"assertSafeMemberNames");a(VPc,"assertNoSpecialMembers");a(aBr,"runArchiveTool");a(WPc,"archiveTopDir");a(lBr,"extractSkillArchive");a(zPc,"readHead")});var Fji={};Ri(Fji,{BashSession:()=>F1t,betaAgentToolset20260401:()=>XPc,betaBashTool:()=>Dji,betaEditTool:()=>Oji,betaGlobTool:()=>Bji,betaGrepTool:()=>Lji,betaReadTool:()=>Nji,betaWriteTool:()=>Mji,extractSkillArchive:()=>lBr,resolvePath:()=>OEe,resolveSkillVersion:()=>cBr,setupSkills:()=>Sji});function XPc(t){return[Dji(t),Nji(t),Mji(t),Oji(t),Bji(t),Lji(t)]}function OEe(t,e){return yji(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function ekc(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function Dji(t){let e,r=Promise.resolve();return Zne({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=MEe();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 F1t(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??kji,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 Nji(t){return Zne({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 OEe(t,e),o;try{let f=await WE.stat(n);if(!f.isFile())throw new _o(`read: ${e} is not a regular file`);if(f.size>dBr)throw new _o(`read: ${e} is ${f.size} bytes, exceeds ${dBr}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await WE.readFile(n,"utf8")}catch(f){throw f instanceof _o?f:new _o(`read: ${h3e(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=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(` `),u=Math.max(0,s-1),d=c>0?c:l.length;return l.slice(u,d).join(` -`)},"run")})}function Mji(t){return Zne({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 OEe(t,e);try{await WE.mkdir(Bf.dirname(n),{recursive:!0,mode:p3e}),await oBr(n,r??"")}catch(o){throw new _o(`write: ${h3e(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function Oji(t){return Zne({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 OEe(t,e),c;try{let d=await WE.stat(s);if(!d.isFile())throw new _o(`edit: ${e} is not a regular file`);if(d.size>xji)throw new _o(`edit: ${e} is ${d.size} bytes, exceeds ${xji}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await WE.readFile(s,"utf8")}catch(d){throw d instanceof _o?d:new _o(`edit: ${h3e(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 oBr(s,u)}catch(d){throw new _o(`edit: write: ${h3e(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function Bji(t){return Zne({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=Bf.resolve(t.workdir),o=e;if(Bf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new _o("glob: absolute pattern not permitted");n=Bf.parse(e).root,o=Bf.relative(n,e)}else r&&(n=await OEe(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 ZPc(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=Bf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!nkc(n,l))continue;let u=0;try{u=(await WE.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,KPc).map(c=>c.path).join(` -`))},"run")})}function Lji(t){return Zne({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=Bf.resolve(t.workdir);r&&(o=await OEe(t,r));let s=await akc();return s?tkc(s,e,o,n?.signal):rkc(e,o,n?.signal)},"run")})}function tkc(t,e,r,n){return new Promise((o,s)=>{let c=fBr.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>g3e&&(d=!0,l=l.slice(0,g3e),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 ${g3e} 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 rkc(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=g3e,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${g3e} bytes]`),!1):(o.push(u),!0)),"push");if((await WE.stat(e).catch(()=>null))?.isFile()?await wji(e,n,c):await skc(e,"",u=>wji(Bf.join(e,u),n,c),r),r?.aborted)throw new _o("grep: aborted");return o.length===0?"no matches":o.join(` -`)}async function wji(t,e,r){let n=U1t.createReadStream(t,{encoding:"utf8"}),o=Pji.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>YPc)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function nkc(t,e){let r=Bf.relative(t,e);return r===""||!r.startsWith(".."+Bf.sep)&&r!==".."&&!Bf.isAbsolute(r)}async function skc(t,e,r,n){let o=okc;async function s(c,l){if(l>ikc)return!0;if(n?.aborted)return!1;let u;try{u=await WE.readdir(Bf.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?Bf.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 akc(){let t=(process.env.PATH??"").split(Bf.delimiter);for(let e of t){let r=Bf.join(e,"rg");try{return await WE.access(r,U1t.constants.X_OK),r}catch{}}return null}var WE,U1t,Bf,fBr,Rji,Pji,L1t,Qv,y1,m3e,Xne,ZR,uBr,Iji,kji,dBr,xji,g3e,YPc,KPc,JPc,ZPc,F1t,ikc,okc,Uji=_e(()=>{p();m1();WE=de(require("node:fs/promises"),1),U1t=de(require("node:fs"),1),Bf=de(require("node:path"),1),fBr=de(require("node:child_process"),1),Rji=de(require("node:crypto"),1),Pji=de(require("node:readline"),1);Mf();Kne();gji();iBr();sBr();Tji();Iji=100*1024,kji=12e4,dBr=256*1024,xji=dBr,g3e=100*1024,YPc=2e3,KPc=200,JPc=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,ZPc=WE.glob;a(XPc,"betaAgentToolset20260401");a(OEe,"resolvePath");a(ekc,"scrubbedShellEnv");F1t=class{static{a(this,"BashSession")}constructor(e,r=ekc()){L1t.add(this),Qv.set(this,void 0),y1.set(this,""),m3e.set(this,!1),Xne.set(this,!1),ZR.set(this,null),Qt(this,Qv,fBr.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),xe(this,Qv,"f").stdout.setEncoding("utf8"),xe(this,Qv,"f").stderr.setEncoding("utf8"),xe(this,Qv,"f").stdout.on("data",n=>xe(this,L1t,"m",uBr).call(this,n)),xe(this,Qv,"f").stderr.on("data",n=>xe(this,L1t,"m",uBr).call(this,n)),xe(this,Qv,"f").once("close",()=>{Qt(this,Xne,!0,"f");let n=xe(this,ZR,"f");Qt(this,ZR,null,"f"),n?.resolve()})}get closed(){return xe(this,Xne,"f")}async exec(e,r={}){if(xe(this,Xne,"f"))throw new fr("bash session terminated");let n=r.timeoutMs??kji,o=r.signal;if(o?.aborted)throw new fr("bash command aborted");Qt(this,y1,"","f"),Qt(this,m3e,!1,"f");let s=`__ANT_CMD_${Rji.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} +`)},"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} } &1; printf '\\n${c}%d\\n' $? -`;if(xe(this,Qv,"f").stdin.write(l),xe(this,y1,"f").indexOf(s)<0){let{promise:g,resolve:A}=MEe();Qt(this,ZR,{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,ZR,null,"f")}}let u=xe(this,y1,"f").indexOf(s);if(u<0)throw new fr("bash session terminated");let f=xe(this,y1,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=xe(this,y1,"f").slice(0,u).replace(JPc,"").replace(/\n+$/,"");return xe(this,m3e,"f")&&(m=`[output truncated] -${m}`),{output:m,exitCode:h}}close(){if(xe(this,Xne,"f"))return;Qt(this,Xne,!0,"f");let e=xe(this,ZR,"f");Qt(this,ZR,null,"f"),e?.resolve(),xe(this,Qv,"f").stdout.destroy(),xe(this,Qv,"f").stderr.destroy(),xe(this,Qv,"f").stdin.destroy();try{process.kill(-xe(this,Qv,"f").pid,"SIGKILL")}catch{xe(this,Qv,"f").kill("SIGKILL")}xe(this,Qv,"f").unref()}};Qv=new WeakMap,y1=new WeakMap,m3e=new WeakMap,Xne=new WeakMap,ZR=new WeakMap,L1t=new WeakSet,uBr=a(function(e){if(Qt(this,y1,xe(this,y1,"f")+e,"f"),xe(this,y1,"f").length>Iji&&(Qt(this,y1,xe(this,y1,"f").slice(xe(this,y1,"f").length-Iji),"f"),Qt(this,m3e,!0,"f")),xe(this,ZR,"f")&&xe(this,y1,"f").indexOf(xe(this,ZR,"f").sentinel)>=0){let r=xe(this,ZR,"f");Qt(this,ZR,null,"f"),r.resolve()}},"_BashSession_append");a(Dji,"betaBashTool");a(Nji,"betaReadTool");a(Mji,"betaWriteTool");a(Oji,"betaEditTool");a(Bji,"betaGlobTool");a(Lji,"betaGrepTool");a(tkc,"runRipgrep");a(rkc,"runWalkGrep");a(wji,"grepFile");a(nkc,"isWithin");ikc=40,okc=5e4;a(skc,"walk");a(akc,"findRg")});async function lkc(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){gV(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function ukc(t,e,r,n,o){let s=Qji,c=ckc,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,Qji))),(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(),AV(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 yN(s,r.signal),r.signal.throwIfAborted(),await l()}var Q1t,A3e,pBr,Qji,ckc,BEe,hBr=_e(()=>{p();m1();Mf();c9();ZLe();mEe();a3e();S1t();Ec();B1t();P1t();X4r();Qji=3e4,ckc="NO_HEARTBEAT",BEe=class{static{a(this,"EnvironmentWorker")}constructor(e){Q1t.add(this),A3e.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,A3e,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,A3e,"f"),s=new yV({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,Q1t,"m",pBr).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??Aa("ANTHROPIC_WORK_ID"),n=e?.environmentId??Aa("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??Aa("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??Aa("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,Q1t,"m",pBr).call(this,c,s,e?.signal??xe(this,A3e,"f"))}};A3e=new WeakMap,Q1t=new WeakSet,pBr=a(async function(e,r,n){let o=dl(this.client),s=T1t(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(()=>(Uji(),Fji)),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=Yne(n,h),g=ukc(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 _V(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 lkc(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(lkc,"forceStop");a(ukc,"heartbeatLoop")});var vV,mBr=_e(()=>{p();Nl();yd();Ec();Of();P1t();hBr();P1t();hBr();vV=class extends gi{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`,ya,{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 yV({...e,client:this._client})}worker(e){return new BEe({...e,client:this._client})}};vV.WorkPoller=yV;vV.EnvironmentWorker=BEe});var eie,gBr=_e(()=>{p();Nl();mBr();mBr();yd();Ec();Of();eie=class extends gi{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new vV(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",ya,{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])})}};eie.Work=vV});var LEe,ABr=_e(()=>{p();Nl();yd();Ec();Of();LEe=class extends gi{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`,ya,{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 FEe,yBr=_e(()=>{p();Nl();yd();Ec();Of();FEe=class extends gi{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`,ya,{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 CV,EBr=_e(()=>{p();Nl();ABr();ABr();yBr();yBr();yd();Ec();Of();CV=class extends gi{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new LEe(this._client),this.memoryVersions=new FEe(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",ya,{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])})}};CV.Memories=LEe;CV.MemoryVersions=FEe});var UEe=_e(()=>{p();Mf()});var QEe,_Br=_e(()=>{p();Mf();gEe();N4r();QEe=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new l9;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(KLe(e.body),r)}}});var qEe,vBr=_e(()=>{p();Nl();yd();Ec();_Br();UEe();Of();qEe=class extends gi{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",KR,{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)=>QEe.fromResponse(l.response,l.controller))}}});var q1t,CBr=_e(()=>{p();q1t={"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 qji(t){return t?.output_format??t?.output_config?.format}function bBr(t,e,r){let n=qji(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}:SBr(t,e,r)}function SBr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=Akc(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 Akc(t,e){let r=qji(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 TBr=_e(()=>{p();Mf();a(qji,"getOutputFormat");a(bBr,"maybeParseBetaMessage");a(SBr,"parseBetaMessage");a(Akc,"parseBetaOutputFormat")});var ykc,jEe,Ekc,_kc,j1t,IBr=_e(()=>{p();ykc=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),jEe(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),jEe(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),jEe(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),jEe(t);break;case"delimiter":return t=t.slice(0,t.length-1),jEe(t);break}return t},"strip"),Ekc=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"),_kc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),j1t=a(t=>JSON.parse(_kc(Ekc(jEe(ykc(t))))),"partialParse")});var xBr=_e(()=>{p();O4r()});function $ji(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var XR,bV,HEe,y3e,H1t,E3e,_3e,G1t,v3e,d9,C3e,$1t,V1t,tie,W1t,z1t,b3e,wBr,jji,Y1t,RBr,PBr,kBr,Hji,Gji,K1t,Vji=_e(()=>{p();m1();IBr();UEe();oEe();xBr();TBr();Gji="__json_buf";a($ji,"tracksToolInput");K1t=class t{static{a(this,"BetaMessageStream")}constructor(e,r){XR.add(this),this.messages=[],this.receivedMessages=[],bV.set(this,void 0),HEe.set(this,null),this.controller=new AbortController,y3e.set(this,void 0),H1t.set(this,()=>{}),E3e.set(this,()=>{}),_3e.set(this,void 0),G1t.set(this,()=>{}),v3e.set(this,()=>{}),d9.set(this,{}),C3e.set(this,!1),$1t.set(this,!1),V1t.set(this,!1),tie.set(this,!1),W1t.set(this,void 0),z1t.set(this,void 0),b3e.set(this,void 0),Y1t.set(this,n=>{if(Qt(this,$1t,!0,"f"),s9(n)&&(n=new Ay),n instanceof Ay)return Qt(this,V1t,!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,y3e,new Promise((n,o)=>{Qt(this,H1t,n,"f"),Qt(this,E3e,o,"f")}),"f"),Qt(this,_3e,new Promise((n,o)=>{Qt(this,G1t,n,"f"),Qt(this,v3e,o,"f")}),"f"),xe(this,y3e,"f").catch(()=>{}),xe(this,_3e,"f").catch(()=>{}),Qt(this,HEe,e,"f"),Qt(this,b3e,r?.logger??console,"f")}get response(){return xe(this,W1t,"f")}get request_id(){return xe(this,z1t,"f")}async withResponse(){Qt(this,tie,!0,"f");let e=await xe(this,y3e,"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,HEe,{...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,Y1t,"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,XR,"m",RBr).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,XR,"m",PBr).call(this,u);if(l.controller.signal?.aborted)throw new Ay;xe(this,XR,"m",kBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(Qt(this,W1t,e,"f"),Qt(this,z1t,e?.headers.get("request-id"),"f"),xe(this,H1t,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,C3e,"f")}get errored(){return xe(this,$1t,"f")}get aborted(){return xe(this,V1t,"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,tie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Qt(this,tie,!0,"f"),await xe(this,_3e,"f")}get currentMessage(){return xe(this,bV,"f")}async finalMessage(){return await this.done(),xe(this,XR,"m",wBr).call(this)}async finalText(){return await this.done(),xe(this,XR,"m",jji).call(this)}_emit(e,...r){if(xe(this,C3e,"f"))return;e==="end"&&(Qt(this,C3e,!0,"f"),xe(this,G1t,"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,tie,"f")&&!n?.length&&Promise.reject(o),xe(this,E3e,"f").call(this,o),xe(this,v3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,tie,"f")&&!n?.length&&Promise.reject(o),xe(this,E3e,"f").call(this,o),xe(this,v3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,XR,"m",wBr).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,XR,"m",RBr).call(this),this._connected(null);let s=bB.fromReadableStream(e,this.controller);for await(let c of s)xe(this,XR,"m",PBr).call(this,c);if(s.controller.signal?.aborted)throw new Ay;xe(this,XR,"m",kBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(bV=new WeakMap,HEe=new WeakMap,y3e=new WeakMap,H1t=new WeakMap,E3e=new WeakMap,_3e=new WeakMap,G1t=new WeakMap,v3e=new WeakMap,d9=new WeakMap,C3e=new WeakMap,$1t=new WeakMap,V1t=new WeakMap,tie=new WeakMap,W1t=new WeakMap,z1t=new WeakMap,b3e=new WeakMap,Y1t=new WeakMap,XR=new WeakSet,wBr=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"),jji=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"),RBr=a(function(){this.ended||Qt(this,bV,void 0,"f")},"_BetaMessageStream_beginRequest"),PBr=a(function(r){if(this.ended)return;let n=xe(this,XR,"m",Hji).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":{$ji(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(bBr(n,xe(this,HEe,"f"),{logger:xe(this,b3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{Qt(this,bV,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),kBr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,bV,"f");if(!r)throw new fr("request ended without sending any chunks");return Qt(this,bV,void 0,"f"),bBr(r,xe(this,HEe,"f"),{logger:xe(this,b3e,"f")})},"_BetaMessageStream_endRequest"),Hji=a(function(r){let n=xe(this,bV,"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&&$ji(o)){let s=o[Gji]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,Gji,{value:s,enumerable:!1,writable:!0}),s)try{c.input=j1t(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,Y1t,"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 bB(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var Wji,zji=_e(()=>{p();Wji=`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,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: 1. Task Overview The user's core request and success criteria Any clarifications or constraints they specified @@ -1486,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 Ckc(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 S3e,GEe,rie,P0,E1,AI,f9,SV,T3e,Yji,DBr,$Ee,NBr=_e(()=>{p();m1();Kne();Mf();Ec();iBr();zji();o3e();$Ee=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){S3e.add(this),this.client=e,GEe.set(this,!1),rie.set(this,!1),P0.set(this,void 0),E1.set(this,void 0),AI.set(this,void 0),f9.set(this,void 0),SV.set(this,void 0),T3e.set(this,0),Qt(this,P0,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...H4r(r.tools,r.messages)].join(", ");Qt(this,E1,{...n,headers:vt([{"x-stainless-helper":s},n?.headers])},"f"),Qt(this,SV,MEe(),"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*[(GEe=new WeakMap,rie=new WeakMap,P0=new WeakMap,E1=new WeakMap,AI=new WeakMap,f9=new WeakMap,SV=new WeakMap,T3e=new WeakMap,S3e=new WeakSet,Yji=a(async function(){let r=xe(this,P0,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(xe(this,AI,"f")!==void 0)try{let d=await xe(this,AI,"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,P0,"f").params.max_tokens},{signal:xe(this,E1,"f").signal,headers:vt([xe(this,E1,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new fr("Expected text response for compaction");return xe(this,P0,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(xe(this,GEe,"f"))throw new fr("Cannot iterate over a consumed stream");Qt(this,GEe,!0,"f"),Qt(this,rie,!0,"f"),Qt(this,f9,void 0,"f");try{for(;;){let r;try{if(xe(this,P0,"f").params.max_iterations&&xe(this,T3e,"f")>=xe(this,P0,"f").params.max_iterations)break;Qt(this,rie,!1,"f"),Qt(this,f9,void 0,"f"),Qt(this,T3e,(e=xe(this,T3e,"f"),e++,e),"f"),Qt(this,AI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=xe(this,P0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},xe(this,E1,"f")),Qt(this,AI,r.finalMessage(),"f"),xe(this,AI,"f").catch(()=>{}),yield r):(Qt(this,AI,this.client.beta.messages.create({...s,stream:!1},xe(this,E1,"f")),"f"),yield xe(this,AI,"f")),!await xe(this,S3e,"m",Yji).call(this)){if(!xe(this,rie,"f")){let{role:u,content:d}=await xe(this,AI,"f");xe(this,P0,"f").params.messages.push({role:u,content:d})}let l=await xe(this,S3e,"m",DBr).call(this,xe(this,P0,"f").params.messages.at(-1));if(l)xe(this,P0,"f").params.messages.push(l);else if(!xe(this,rie,"f"))break}}finally{r&&r.abort()}}if(!xe(this,AI,"f"))throw new fr("ToolRunner concluded without a message from the server");xe(this,SV,"f").resolve(await xe(this,AI,"f"))}catch(r){throw Qt(this,GEe,!1,"f"),xe(this,SV,"f").promise.catch(()=>{}),xe(this,SV,"f").reject(r),Qt(this,SV,MEe(),"f"),r}}setMessagesParams(e){typeof e=="function"?xe(this,P0,"f").params=e(xe(this,P0,"f").params):xe(this,P0,"f").params=e,Qt(this,rie,!0,"f"),Qt(this,f9,void 0,"f")}setRequestOptions(e){typeof e=="function"?Qt(this,E1,e(xe(this,E1,"f")),"f"):Qt(this,E1,{...xe(this,E1,"f"),...e},"f")}async generateToolResponse(e=xe(this,E1,"f").signal){let r=await xe(this,AI,"f")??this.params.messages.at(-1);return r?xe(this,S3e,"m",DBr).call(this,r,e):null}done(){return xe(this,SV,"f").promise}async runUntilDone(){if(!xe(this,GEe,"f"))for await(let e of this);return this.done()}get params(){return xe(this,P0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};DBr=a(async function(e,r=xe(this,E1,"f").signal){return xe(this,f9,"f")!==void 0?xe(this,f9,"f"):(Qt(this,f9,Ckc(xe(this,P0,"f").params,e,{...xe(this,E1,"f"),signal:r}),"f"),xe(this,f9,"f"))},"_BetaToolRunner_generateToolResponse");a(Ckc,"generateToolResponse")});function Jji(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 Kji,bkc,p9,MBr=_e(()=>{p();UEe();vBr();Nl();CBr();Ec();o3e();TBr();Vji();NBr();Kne();vBr();NBr();Kne();Kji={"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"},bkc=["claude-mythos-preview","claude-opus-4-6"],p9=class extends gi{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new qEe(this._client)}create(e,r){let n=Jji(e),{betas:o,...s}=n;s.model in Kji&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${Kji[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),bkc.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=q1t[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=_1t(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=>SBr(n,e,{logger:this._client.logger??console}))}stream(e,r){return K1t.createMessage(this,e,r)}countTokens(e,r){let n=Jji(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 $Ee(this._client,e,r)}};a(Jji,"transformOutputFormat");p9.Batches=qEe;p9.BetaToolRunner=$Ee;p9.ToolError=_o});var nie,OBr=_e(()=>{p();Nl();yd();Ec();Of();B1t();B1t();nie=class extends gi{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/events?beta=true`,ya,{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 _V(e,{...r,client:this._client})}};nie.SessionToolRunner=_V});var VEe,BBr=_e(()=>{p();Nl();yd();Ec();Of();VEe=class extends gi{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`,ya,{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 WEe,LBr=_e(()=>{p();Nl();yd();Ec();Of();WEe=class extends gi{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`,ya,{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 iie,FBr=_e(()=>{p();Nl();LBr();LBr();yd();Ec();Of();iie=class extends gi{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new WEe(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`,ya,{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])})}};iie.Events=WEe});var h9,UBr=_e(()=>{p();Nl();OBr();OBr();BBr();BBr();FBr();FBr();yd();Ec();Of();h9=class extends gi{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new nie(this._client),this.resources=new VEe(this._client),this.threads=new iie(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",ya,{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])})}};h9.Events=nie;h9.Resources=VEe;h9.Threads=iie});var zEe,QBr=_e(()=>{p();Nl();yd();Ec();vEe();Of();zEe=class extends gi{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(or`/v1/skills/${e}/versions?beta=true`,_Ee({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`,ya,{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 oie,qBr=_e(()=>{p();Nl();QBr();QBr();yd();Ec();vEe();Of();oie=class extends gi{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new zEe(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",_Ee({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",ya,{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])})}};oie.Versions=zEe});var YEe,jBr=_e(()=>{p();Nl();yd();Ec();Of();YEe=class extends gi{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`,ya,{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,HBr=_e(()=>{p();Nl();jBr();jBr();yd();Ec();Of();sie=class extends gi{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new YEe(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",ya,{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=YEe});var zg,GBr=_e(()=>{p();Nl();G4r();G4r();$4r();$4r();V4r();V4r();Y4r();Y4r();J4r();J4r();gBr();gBr();EBr();EBr();MBr();MBr();UBr();UBr();qBr();qBr();HBr();HBr();zg=class extends gi{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new bEe(this._client),this.messages=new p9(this._client),this.agents=new zne(this._client),this.environments=new eie(this._client),this.sessions=new h9(this._client),this.vaults=new sie(this._client),this.memoryStores=new CV(this._client),this.files=new CEe(this._client),this.skills=new oie(this._client),this.webhooks=new IEe(this._client),this.userProfiles=new SEe(this._client)}};zg.Models=bEe;zg.Messages=p9;zg.Agents=zne;zg.Environments=eie;zg.Sessions=h9;zg.Vaults=sie;zg.MemoryStores=CV;zg.Files=CEe;zg.Skills=oie;zg.Webhooks=IEe;zg.UserProfiles=SEe});var aie,$Br=_e(()=>{p();Nl();Ec();aie=class extends gi{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 Zji(t){return t?.output_config?.format}function VBr(t,e,r){let n=Zji(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}:WBr(t,e,r)}function WBr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=Mkc(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 Mkc(t,e){let r=Zji(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 zBr=_e(()=>{p();Mf();a(Zji,"getOutputFormat");a(VBr,"maybeParseMessage");a(WBr,"parseMessage");a(Mkc,"parseOutputFormat")});function rHi(t){return t.type==="tool_use"||t.type==="server_tool_use"}var eP,TV,KEe,I3e,J1t,x3e,w3e,Z1t,R3e,m9,P3e,X1t,eSt,cie,tSt,rSt,k3e,YBr,Xji,KBr,JBr,ZBr,XBr,eHi,tHi,nSt,nHi=_e(()=>{p();m1();oEe();UEe();xBr();IBr();zBr();tHi="__json_buf";a(rHi,"tracksToolInput");nSt=class t{static{a(this,"MessageStream")}constructor(e,r){eP.add(this),this.messages=[],this.receivedMessages=[],TV.set(this,void 0),KEe.set(this,null),this.controller=new AbortController,I3e.set(this,void 0),J1t.set(this,()=>{}),x3e.set(this,()=>{}),w3e.set(this,void 0),Z1t.set(this,()=>{}),R3e.set(this,()=>{}),m9.set(this,{}),P3e.set(this,!1),X1t.set(this,!1),eSt.set(this,!1),cie.set(this,!1),tSt.set(this,void 0),rSt.set(this,void 0),k3e.set(this,void 0),KBr.set(this,n=>{if(Qt(this,X1t,!0,"f"),s9(n)&&(n=new Ay),n instanceof Ay)return Qt(this,eSt,!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,I3e,new Promise((n,o)=>{Qt(this,J1t,n,"f"),Qt(this,x3e,o,"f")}),"f"),Qt(this,w3e,new Promise((n,o)=>{Qt(this,Z1t,n,"f"),Qt(this,R3e,o,"f")}),"f"),xe(this,I3e,"f").catch(()=>{}),xe(this,w3e,"f").catch(()=>{}),Qt(this,KEe,e,"f"),Qt(this,k3e,r?.logger??console,"f")}get response(){return xe(this,tSt,"f")}get request_id(){return xe(this,rSt,"f")}async withResponse(){Qt(this,cie,!0,"f");let e=await xe(this,I3e,"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,KEe,{...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,KBr,"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,eP,"m",JBr).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,eP,"m",ZBr).call(this,u);if(l.controller.signal?.aborted)throw new Ay;xe(this,eP,"m",XBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(Qt(this,tSt,e,"f"),Qt(this,rSt,e?.headers.get("request-id"),"f"),xe(this,J1t,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,P3e,"f")}get errored(){return xe(this,X1t,"f")}get aborted(){return xe(this,eSt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,m9,"f")[e]||(xe(this,m9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,m9,"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,m9,"f")[e]||(xe(this,m9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{Qt(this,cie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Qt(this,cie,!0,"f"),await xe(this,w3e,"f")}get currentMessage(){return xe(this,TV,"f")}async finalMessage(){return await this.done(),xe(this,eP,"m",YBr).call(this)}async finalText(){return await this.done(),xe(this,eP,"m",Xji).call(this)}_emit(e,...r){if(xe(this,P3e,"f"))return;e==="end"&&(Qt(this,P3e,!0,"f"),xe(this,Z1t,"f").call(this));let n=xe(this,m9,"f")[e];if(n&&(xe(this,m9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,cie,"f")&&!n?.length&&Promise.reject(o),xe(this,x3e,"f").call(this,o),xe(this,R3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,cie,"f")&&!n?.length&&Promise.reject(o),xe(this,x3e,"f").call(this,o),xe(this,R3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,eP,"m",YBr).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,eP,"m",JBr).call(this),this._connected(null);let s=bB.fromReadableStream(e,this.controller);for await(let c of s)xe(this,eP,"m",ZBr).call(this,c);if(s.controller.signal?.aborted)throw new Ay;xe(this,eP,"m",XBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(TV=new WeakMap,KEe=new WeakMap,I3e=new WeakMap,J1t=new WeakMap,x3e=new WeakMap,w3e=new WeakMap,Z1t=new WeakMap,R3e=new WeakMap,m9=new WeakMap,P3e=new WeakMap,X1t=new WeakMap,eSt=new WeakMap,cie=new WeakMap,tSt=new WeakMap,rSt=new WeakMap,k3e=new WeakMap,KBr=new WeakMap,eP=new WeakSet,YBr=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"),Xji=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"),JBr=a(function(){this.ended||Qt(this,TV,void 0,"f")},"_MessageStream_beginRequest"),ZBr=a(function(r){if(this.ended)return;let n=xe(this,eP,"m",eHi).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":{rHi(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(VBr(n,xe(this,KEe,"f"),{logger:xe(this,k3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{Qt(this,TV,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),XBr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,TV,"f");if(!r)throw new fr("request ended without sending any chunks");return Qt(this,TV,void 0,"f"),VBr(r,xe(this,KEe,"f"),{logger:xe(this,k3e,"f")})},"_MessageStream_endRequest"),eHi=a(function(r){let n=xe(this,TV,"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&&rHi(o)){let s=o[tHi]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,tHi,{value:s,enumerable:!1,writable:!0}),s&&(c.input=j1t(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 bB(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var JEe,eLr=_e(()=>{p();Nl();yd();Ec();_Br();UEe();Of();JEe=class extends gi{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",KR,{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)=>QEe.fromResponse(s.response,s.controller))}}});var IV,iHi,Bkc,tLr=_e(()=>{p();Nl();Ec();o3e();nHi();zBr();eLr();eLr();CBr();IV=class extends gi{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new JEe(this._client)}create(e,r){e.model in iHi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${iHi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),Bkc.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=q1t[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=_1t(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=>WBr(n,e,{logger:this._client.logger??console}))}stream(e,r){return nSt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},iHi={"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"},Bkc=["claude-mythos-preview","claude-opus-4-6"];IV.Batches=JEe});var lie,rLr=_e(()=>{p();Nl();yd();Ec();Of();lie=class extends gi{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",KR,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var oHi=_e(()=>{p();Fqi();GBr();$Br();tLr();rLr()});var nLr,iLr,iSt,sHi,aHi,cHi,Lf,TB,oLr=_e(()=>{p();m1();Zbt();vB();mEe();oEe();t1t();gEe();ZQi();S4r();zLe();Mf();yEe();gqi();Nqi();yd();j4r();oHi();m1t();$Br();rLr();GBr();tLr();t1t();Ec();ZLe();c9();vB();aHi="\\n\\nHuman:",cHi="\\n\\nAssistant:",Lf=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=Aa("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=Aa("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(nLr.add(this),this._requestAuthFlags=new WeakMap,iSt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:Aa("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:Aa("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&&zQi())throw new fr(`It looks like you're running in a browser-like environment. +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. 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??iLr.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=x4r(c.logLevel,"ClientOptions.logLevel",this)??x4r(Aa("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??YQi(),Qt(this,iSt,JQi,"f");let u=Aa("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=D4r(c.config,this._credentialResolverOptions());this._authState.provider=h.provider,this._authState.tokenCache=this._makeTokenCache(h.provider),this._authState.extraHeaders=h.extraHeaders,this._applyCredentialBaseURL(h.baseURL)}else c.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(c.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,this._baseURLIsExplicit||(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{dl(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{dl(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new l1t(e,r=>{dl(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await Dqi(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 lqi(e)}getUserAgent(){return`${this.constructor.name}/JS ${YR}`}defaultIdempotencyKey(){return`stainless-node-retry-${iEe()}`}makeStatusError(e,r,n,o){return Ah.generate(e,r,n,o)}buildURL(e,r,n){let o=!xe(this,nLr,"m",sHi).call(this)&&n||this.baseURL,s=jQi(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!m4r(c)||!m4r(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($ne)||o.append("anthropic-beta",$ne),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 Vne(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(dl(this).debug(`[${d}] sending request`,a9({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new Ay;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(WLe),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new Ay;let v=s9(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return dl(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),dl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,a9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw dl(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),dl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,a9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new sEe:new hV({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 KQi(g.body),dl(this).info(`${E} - ${x}`),dl(this).debug(`[${d}] response error (${x})`,a9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";dl(this).info(`${E} - ${v}`);let b=await g.text().catch(x=>WLe(x).message),T=e1t(b),w=T?void 0:b;throw dl(this).debug(`[${d}] response error (${v})`,a9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return dl(this).info(E),dl(this).debug(`[${d}] response start`,a9({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 r3e(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 yN(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&&GQi("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))}:{},...YLe(),...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:r1t(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,iSt,"f").call(this,{body:e,headers:n})}};iLr=Lf,iSt=new WeakMap,nLr=new WeakSet,sHi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");Lf.Anthropic=iLr;Lf.HUMAN_PROMPT=aHi;Lf.AI_PROMPT=cHi;Lf.DEFAULT_TIMEOUT=6e5;Lf.AnthropicError=fr;Lf.APIError=Ah;Lf.APIConnectionError=hV;Lf.APIConnectionTimeoutError=sEe;Lf.APIUserAbortError=Ay;Lf.NotFoundError=uEe;Lf.ConflictError=dEe;Lf.RateLimitError=pEe;Lf.BadRequestError=aEe;Lf.AuthenticationError=cEe;Lf.InternalServerError=hEe;Lf.PermissionDeniedError=lEe;Lf.UnprocessableEntityError=fEe;Lf.toFile=y1t;TB=class extends Lf{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new aie(this),this.messages=new IV(this),this.models=new lie(this),this.beta=new zg(this)}};TB.Completions=aie;TB.Messages=IV;TB.Models=lie;TB.Beta=zg});var nBr=_e(()=>{p();oLr();j4r();m1t();oLr();yd();Mf()});var ULr=I((W4h,fVi)=>{p();var z3e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,A5c=typeof AbortController=="function",YSt=A5c?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new lVi}abort(){this.signal.dispatchEvent("abort")}},y5c=typeof AbortSignal=="function",E5c=typeof YSt.AbortSignal=="function",lVi=y5c?AbortSignal:E5c?YSt.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))}},LLr=new Set,MLr=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;KSt(r)&&FLr(r,`${t} option`,`options.${e}`,m_e)},"deprecatedOption"),OLr=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(KSt(r)){let{prototype:n}=m_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);FLr(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),_5c=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(KSt(r)){let{prototype:n}=m_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);FLr(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),uVi=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),KSt=a(t=>!LLr.has(t),"shouldWarn"),FLr=a((t,e,r,n)=>{LLr.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;uVi(o,"DeprecationWarning",t,n)},"warn"),hie=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),dVi=a(t=>hie(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?h_e:null:null,"getUintArray"),h_e=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},BLr=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=dVi(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&&!hie(r))throw new TypeError("max option must be a nonnegative integer");let R=r?dVi(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 BLr(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(!hie(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=hie(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!hie(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";KSt(x)&&(LLr.add(x),uVi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&MLr("stale","allowStale"),T&&MLr("maxAge","ttl"),b&&MLr("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new h_e(this.max),this.starts=new h_e(this.max),this.setItemTTL=(n,o,s=z3e.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?z3e.now():0};let e=0,r=a(()=>{let n=z3e.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 h_e(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!hie(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!hie(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 OLr("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=z3e.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=z3e.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 YSt,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 OLr("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 OLr("reset","clear"),this.clear}get length(){return _5c("length","size"),this.size}static get AbortController(){return YSt}static get AbortSignal(){return lVi}};fVi.exports=m_e});var jLr=I((K4h,pVi)=>{"use strict";p();var Y3e=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}},QLr=class extends Y3e{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)}},qLr=class extends Y3e{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};pVi.exports={FetchBaseError:Y3e,FetchError:QLr,AbortError:qLr}});var y9=I((X4h,mVi)=>{"use strict";p();var{constants:{MAX_LENGTH:v5c}}=require("buffer"),{pipeline:JSt,PassThrough:C5c}=require("stream"),{promisify:b5c}=require("util"),{createGunzip:S5c,createInflate:T5c,createBrotliDecompress:I5c,constants:{Z_SYNC_FLUSH:hVi}}=require("zlib"),x5c=hk()("helix-fetch:utils"),w5c=b5c(JSt),R5c=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),P5c=a((t,e,r,n)=>{if(!R5c(t,e))return r;let o=a(s=>{s&&(x5c(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return JSt(r,S5c({flush:hVi,finishFlush:hVi}),o);case"deflate":case"x-deflate":return JSt(r,T5c(),o);case"br":return JSt(r,I5c(),o);default:return r}},"decodeStream"),k5c=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"),ZSt=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)?D5c(t,e):N5c(t,e);default:return 0}},"calcSize"),D5c=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:ZSt(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),N5c=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+=ZSt(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=ZSt(t[o],e)}),r},"calcObjectSize"),M5c=a(t=>ZSt(t,new WeakSet),"sizeof"),O5c=a(async t=>{let e=new C5c,r=0,n=[];return e.on("data",o=>{if(r+o.length>v5c)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await w5c(t,e),Buffer.concat(n,r)},"streamToBuffer");mVi.exports={decodeStream:P5c,isPlainObject:k5c,sizeof:M5c,streamToBuffer:O5c}});var eTt=I((rBh,EVi)=>{"use strict";p();var{PassThrough:gVi,Readable:E9}=require("stream"),{types:{isAnyArrayBuffer:yVi}}=require("util"),{FetchError:B5c,FetchBaseError:L5c}=jLr(),{streamToBuffer:F5c}=y9(),U5c=Buffer.alloc(0),iP=Symbol("Body internals"),Q5c=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),AVi=a(async t=>{if(t[iP].disturbed)throw new TypeError("Already read");if(t[iP].error)throw new TypeError(`Stream had error: ${t[iP].error.message}`);t[iP].disturbed=!0;let{stream:e}=t[iP];return e===null?U5c:F5c(e)},"consume"),XSt=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=E9.from(e.toString()):e instanceof E9?r=e:Buffer.isBuffer(e)?r=E9.from(e):yVi(e)?r=E9.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=E9.from(e):r=E9.from(String(e)),this[iP]={stream:r,disturbed:!1,error:null},e instanceof E9&&r.on("error",n=>{let o=n instanceof L5c?n:new B5c(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[iP].error=o})}get body(){return this[iP].stream}get bodyUsed(){return this[iP].disturbed}async buffer(){return AVi(this)}async arrayBuffer(){return Q5c(await this.buffer())}async text(){return(await AVi(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(XSt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var q5c=a(t=>{if(t[iP].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[iP],r=e;if(e instanceof E9){r=new gVi;let n=new gVi;e.pipe(r),e.pipe(n),t[iP].stream=n}return r},"cloneStream"),j5c=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)||yVi(t)||t instanceof E9?null:"text/plain; charset=utf-8","guessContentType");EVi.exports={Body:XSt,cloneStream:q5c,guessContentType:j5c}});var g_e=I((oBh,bVi)=>{"use strict";p();var{validateHeaderName:_Vi,validateHeaderValue:vVi}=require("http"),{isPlainObject:H5c}=y9(),_9=Symbol("Headers internals"),K3e=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof _Vi=="function")_Vi(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"),CVi=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof vVi=="function")vVi(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"),tTt=class t{static{a(this,"Headers")}constructor(e={}){if(this[_9]={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(H5c(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[_9].map.set(K3e(e),CVi(r,e))}has(e){return this[_9].map.has(K3e(e))}get(e){let r=this[_9].map.get(K3e(e));return r===void 0?null:r}append(e,r){let n=K3e(e),o=CVi(r,e),s=this[_9].map.get(n);this[_9].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[_9].map.delete(K3e(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[_9].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[_9].map)}};Object.defineProperties(tTt.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));bVi.exports={Headers:tTt}});var HLr=I((cBh,SVi)=>{"use strict";p();var{EventEmitter:G5c}=require("events"),IN=Symbol("AbortSignal internals"),A_e=class{static{a(this,"AbortSignal")}constructor(){this[IN]={eventEmitter:new G5c,onabort:null,aborted:!1}}get aborted(){return this[IN].aborted}get onabort(){return this[IN].onabort}set onabort(e){this[IN].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,r){this[IN].eventEmitter.removeListener(e,r)}addEventListener(e,r){this[IN].eventEmitter.on(e,r)}dispatchEvent(e){let r={type:e,target:this},n=`on${e}`;typeof this[IN][n]=="function"&&this[n](r),this[IN].eventEmitter.emit(e,r)}fire(){this[IN].aborted=!0,this.dispatchEvent("abort")}};Object.defineProperties(A_e.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var nTt=class extends A_e{static{a(this,"TimeoutSignal")}constructor(e){if(!Number.isInteger(e))throw new TypeError(`Expected an integer, got ${typeof e}`);super(),this[IN].timerId=setTimeout(()=>{this.fire()},e)}clear(){clearTimeout(this[IN].timerId)}};Object.defineProperties(nTt.prototype,{clear:{enumerable:!0}});var rTt=Symbol("AbortController internals"),iTt=class{static{a(this,"AbortController")}constructor(){this[rTt]={signal:new A_e}}get signal(){return this[rTt].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[rTt].signal.aborted||this[rTt].signal.fire()}};Object.defineProperties(iTt.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});SVi.exports={AbortController:iTt,AbortSignal:A_e,TimeoutSignal:nTt}});var J3e=I((dBh,xVi)=>{"use strict";p();var{randomBytes:$5c}=require("crypto"),{Readable:V5c}=require("stream"),$Lr=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"),W5c=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"),TVi=a(t=>`--${t}--\r +`);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 \r -`,"getFooter"),IVi=a((t,e,r)=>{let n="";return n+=`--${t}\r -`,n+=`Content-Disposition: form-data; name="${e}"`,$Lr(r)&&(n+=`; filename="${r.name}"\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 `,n+=`Content-Type: ${r.type||"application/octet-stream"}`),`${n}\r \r -`},"getHeader");async function*z5c(t,e){for(let[r,n]of t)yield IVi(e,r,n),$Lr(n)?yield*n.stream():yield n,yield`\r -`;yield TVi(e)}a(z5c,"formDataIterator");var Y5c=a((t,e)=>{let r=0;for(let[n,o]of t)r+=Buffer.byteLength(IVi(e,n,o)),r+=$Lr(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r -`);return r+=Buffer.byteLength(TVi(e)),r},"getFormDataLength"),GLr=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=$5c(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=Y5c(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return V5c.from(z5c(this.fd,this.boundary))}};xVi.exports={isFormData:W5c,FormDataSerializer:GLr}});var RVi=I((mBh,wVi)=>{"use strict";p();var{AbortSignal:hBh}=HLr(),{Body:K5c,cloneStream:J5c,guessContentType:Z5c}=eTt(),{Headers:X5c}=g_e(),{isPlainObject:e4c}=y9(),{isFormData:t4c,FormDataSerializer:r4c}=J3e(),n4c=20,DV=Symbol("Request internals"),oTt=class t extends K5c{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?J5c(n):null),l=new X5c(r.headers||n&&n.headers||{});if(t4c(c)&&!l.has("content-type")){let h=new r4c(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(e4c(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=Z5c(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[DV]={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=n4c: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[DV].method}get url(){return this[DV].parsedURL.toString()}get headers(){return this[DV].headers}get redirect(){return this[DV].redirect}get cache(){return this[DV].cache}get signal(){return this[DV].signal}clone(){return new t(this)}get init(){return this[DV].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(oTt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});wVi.exports={Request:oTt}});var VLr=I((yBh,PVi)=>{"use strict";p();var{Body:i4c,cloneStream:o4c,guessContentType:s4c}=eTt(),{Headers:a4c}=g_e(),{isPlainObject:c4c}=y9(),{isFormData:l4c,FormDataSerializer:u4c}=J3e(),xN=Symbol("Response internals"),sTt=class t extends i4c{static{a(this,"Response")}constructor(e=null,r={}){let n=new a4c(r.headers),o=e;if(l4c(o)&&!n.has("content-type")){let s=new u4c(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(c4c(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=s4c(o);s&&n.set("content-type",s)}super(o),this[xN]={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[xN].url||""}get status(){return this[xN].status}get statusText(){return this[xN].statusText}get ok(){return this[xN].status>=200&&this[xN].status<300}get redirected(){return this[xN].counter>0}get headers(){return this[xN].headers}get httpVersion(){return this[xN].httpVersion}get decoded(){return this[xN].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(o4c(this),{...this[xN]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(sTt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});PVi.exports={Response:sTt}});var DVi=I((CBh,kVi)=>{"use strict";p();var d4c=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),f4c=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),p4c=new Set([500,502,503,504]),h4c={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},m4c={"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 g4c(t){return t?p4c.has(t.status):!0}a(g4c,"isErrorResponse");function WLr(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(WLr,"parseCacheControl");function A4c(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(A4c,"formatCacheControl");kVi.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=WLr(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=WLr(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":A4c(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())&&f4c.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||d4c.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=WLr(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)h4c[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()&&g4c(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&&!m4c[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 BVi=I((TBh,OVi)=>{"use strict";p();var y4c=DVi(),{Headers:E4c}=g_e(),NVi=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),MVi=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),zLr=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new y4c(NVi(e),MVi(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(NVi(e))}responseHeaders(e){return new E4c(this.policy.responseHeaders(MVi(e)))}timeToLive(){return this.policy.timeToLive()}};OVi.exports=zLr});var UVi=I((wBh,FVi)=>{"use strict";p();var{Readable:_4c}=require("stream"),{Headers:LVi}=g_e(),{Response:v4c}=VLr(),NV=Symbol("CacheableResponse internals"),C4c=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),YLr=class t extends v4c{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new LVi(r.headers);this[NV]={headers:n,bufferedBody:e}}get headers(){return this[NV].headers}set headers(e){if(e instanceof LVi)this[NV].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return _4c.from(this[NV].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[NV].bufferedBody}async arrayBuffer(){return C4c(this[NV].bufferedBody)}async text(){return this[NV].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[NV].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},b4c=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 YLr(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");FVi.exports={cacheableResponse:b4c}});var aTt=I((kBh,QVi)=>{"use strict";p();var KLr=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};QVi.exports={RequestAbortedError:KLr}});var $Vi=I((MBh,GVi)=>{"use strict";p();var jVi=require("http"),HVi=require("https"),{Readable:S4c}=require("stream"),v9=hk()("helix-fetch:h1"),{RequestAbortedError:qVi}=aTt(),{decodeStream:T4c}=y9(),I4c=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 HVi.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new jVi.Agent(n),r.httpAgent):void 0},"getAgent"),x4c=a(t=>{t.h1={}},"setupContext"),w4c=a(async({h1:t})=>{t.httpAgent&&(v9("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(v9("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),R4c=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?T4c(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"),P4c=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?HVi:jVi,o=I4c(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)=>{v9(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{v9(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{v9(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(v9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new qVi),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new qVi);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(v9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u(R4c(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(v9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(v9(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof S4c?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");GVi.exports={request:P4c,setupContext:x4c,resetContext:w4c}});var YVi=I((LBh,zVi)=>{"use strict";p();var{connect:k4c,constants:D4c}=require("http2"),{Readable:N4c}=require("stream"),Ed=hk()("helix-fetch:h2"),{RequestAbortedError:VVi}=aTt(),{decodeStream:M4c}=y9(),{NGHTTP2_CANCEL:Z3e}=D4c,O4c=300*1e3,B4c=5e3,L4c=a(t=>{t.h2={sessionCache:{}}},"setupContext"),F4c=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),Ed(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),WVi=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?M4c(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"),U4c=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=B4c}}}=t,d=o[":path"],f=`${e}${d}`;Ed(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(Z3e)},"rejectPush")),n.on("push",(h,m)=>{Ed(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{Ed(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(Z3e)}),l&&l(f,o,WVi(h,n,r))}),n.on("aborted",()=>{Ed(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{Ed(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{Ed(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),Q4c=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=O4c,pushPromiseHandler:h,pushHandler:m}=u,g={...r},{method:A,headers:y,socket:E,body:_,decode:v}=g;return E&&delete g.socket,y.host&&(y[":authority"]=y.host,delete y.host),new Promise((b,T)=>{let w=d[n];if(!w||w.closed||w.destroyed){let N=!(t.options.rejectUnauthorized===!1||u.rejectUnauthorized===!1),B={...u,rejectUnauthorized:N};E&&!E.inUse&&(B.createConnection=()=>(Ed(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E)),w=k4c(n,{...B,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{Ed(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{Ed(`session ${n} established`),Ed(`caching session ${n}`),d[n]=w}),w.on("localSettings",j=>{Ed(`session ${n} localSettings: ${JSON.stringify(j)}`)}),w.on("remoteSettings",j=>{Ed(`session ${n} remoteSettings: ${JSON.stringify(j)}`)}),w.once("close",()=>{Ed(`session ${n} closed`),d[n]===w&&(Ed(`discarding cached session ${n}`),delete d[n])}),w.once("error",j=>{Ed(`session ${n} encountered error: ${j}`),d[n]===w&&(Ed(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(j,M,O)=>{Ed(`session ${n} encountered frameError: type: ${j}, code: ${M}, id: ${O}`)}),w.once("goaway",(j,M,O)=>{Ed(`session ${n} received GOAWAY frame: errorCode: ${j}, lastStreamID: ${M}, opaqueData: ${O?O.toString():void 0}`)}),w.on("stream",(j,M,O)=>{U4c(t,n,v,j,M,O)})}else E&&E.id!==w.socket.id&&!E.inUse&&(Ed(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());Ed(`${A} ${e.host}${l}`);let R,{signal:x}=g,P=a(()=>{x.removeEventListener("abort",P),T(new VVi),R&&R.close(Z3e)},"onAbortSignal");if(x){if(x.aborted){T(new VVi);return}x.addEventListener("abort",P)}let D=a(N=>{Ed(`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(WVi(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",P),R.rstCode!==Z3e&&(Ed(`${g.method} ${e.href} failed with: ${N.message}`),R.close(Z3e),T(N))}),R.once("frameError",(N,B,L)=>{w.off("error",D),Ed(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${B}, id: ${L}`)}),R.on("push",(N,B)=>{Ed(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${B}`)}),_ instanceof N4c?_.pipe(R):(_&&R.write(_),R.end())})},"request");zVi.exports={request:Q4c,setupContext:L4c,resetContext:F4c}});var JVi=I((QBh,KVi)=>{"use strict";p();var{EventEmitter:q4c}=require("events"),j4c=a(()=>{let t={},e=new q4c;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");KVi.exports=j4c});var ZVi=I((HBh,H4c)=>{H4c.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 nWi=I((GBh,rWi)=>{"use strict";p();var{Readable:G4c}=require("stream"),$4c=require("tls"),{types:{isAnyArrayBuffer:V4c}}=require("util"),W4c=ULr(),JLr=hk()("helix-fetch:core"),{RequestAbortedError:cTt}=aTt(),ZLr=$Vi(),lTt=YVi(),z4c=JVi(),{isPlainObject:Y4c}=y9(),{isFormData:K4c,FormDataSerializer:J4c}=J3e(),{version:Z4c}=ZVi(),XLr="h2",e3r="h2c",t3r="http/1.0",gie="http/1.1",X4c=100,eBc=3600*1e3,tBc=[XLr,gie,t3r],rBc=`helix-fetch/${Z4c}`,nBc={method:"GET",compress:!0,decode:!0},XVi=0,eWi=z4c(),tWi=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new cTt;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new cTt);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof cTt||(JLr(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=$4c.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),XVi+=1,s.id=XVi,s.secureConnecting=!1,JLr(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),iBc=a(async(t,e)=>{let r=await eWi.acquire(t.origin);try{return r||(r=await tWi(t,e)),r}finally{eWi.release(t.origin,r)}},"connect"),oBc=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=gie,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=e3r,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 iBc(e,d);return o=f.alpnProtocol,o||(o=gie),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),sBc=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),aBc=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 tWi(e,d);return{protocol:f.alpnProtocol||gie,socket:f}}return{protocol:l.alpnProtocol||gie,socket:l}},"getProtocolAndSocketFromFactory"),cBc=a(async(t,e,r)=>{let n=new URL(e),o={...nBc,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=sBc(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(K4c(o.body)){let d=new J4c(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":Y4c(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):V4c(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 G4c||(!(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 aBc(t.socketFactory,n,o,t.alpnProtocols):await oBc(t,n,c);switch(JLr(`${n.host} -> ${l}`),l){case XLr:try{return await lTt.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 e3r:return lTt.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case t3r:case gie:return ZLr.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),lBc=a(async t=>(t.alpnCache.clear(),Promise.all([ZLr.resetContext(t),lTt.resetContext(t)])),"resetContext"),uBc=a(t=>{let{options:{alpnProtocols:e=tBc,alpnCacheTTL:r=eBc,alpnCacheSize:n=X4c,userAgent:o=rBc,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new W4c({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,ZLr.setupContext(t),lTt.setupContext(t)},"setupContext");rWi.exports={request:cBc,setupContext:uBc,resetContext:lBc,RequestAbortedError:cTt,ALPN_HTTP2:XLr,ALPN_HTTP2C:e3r,ALPN_HTTP1_1:gie,ALPN_HTTP1_0:t3r}});var oWi=I((WBh,iWi)=>{"use strict";p();var dBc=hk()("helix-fetch:core"),{request:fBc,setupContext:pBc,resetContext:hBc,RequestAbortedError:mBc,ALPN_HTTP2:gBc,ALPN_HTTP2C:ABc,ALPN_HTTP1_1:yBc,ALPN_HTTP1_0:EBc}=nWi(),r3r=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},pBc(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:mBc,ALPN_HTTP2:gBc,ALPN_HTTP2C:ABc,ALPN_HTTP1_1:yBc,ALPN_HTTP1_0:EBc}}async request(e,r){return fBc(this,e,r)}setCA(e){this.options.ca=e}async reset(){return dBc("resetting context"),hBc(this)}};iWi.exports=new r3r().api()});var uWi=I((KBh,lWi)=>{"use strict";p();var{EventEmitter:_Bc}=require("events"),{Readable:X3e}=require("stream"),n3r=hk()("helix-fetch"),vBc=ULr(),{Body:CBc}=eTt(),{Headers:a3r}=g_e(),{Request:Aie}=RVi(),{Response:o3r}=VLr(),{FetchBaseError:bBc,FetchError:eFe,AbortError:uTt}=jLr(),{AbortController:SBc,AbortSignal:TBc,TimeoutSignal:IBc}=HLr(),xBc=BVi(),{cacheableResponse:wBc}=UVi(),{sizeof:RBc}=y9(),{isFormData:PBc}=J3e(),{context:kBc,RequestAbortedError:DBc}=oWi(),sWi=["GET","HEAD"],NBc=500,MBc=100*1024*1024,i3r="push",aWi=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof Aie&&typeof r>"u"?e:new Aie(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 uTt("The operation was aborted.");throw o.init.body instanceof X3e&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof X3e)&&!PBc(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof X3e&&m.destroy(w),w instanceof TypeError?w:w instanceof DBc?new uTt("The operation was aborted."):new eFe(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new uTt("The operation was aborted.");o.init.body instanceof X3e&&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 eFe(`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 eFe(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new a3r(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 X3e)throw l&&l.removeEventListener("abort",A),new eFe("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),aWi(t,new Aie(R,x))}default:}}return l&&(b.once("end",()=>{l.removeEventListener("abort",A)}),b.once("error",()=>{l.removeEventListener("abort",A)})),new o3r(b,{url:o.url,status:y,statusText:E,headers:v,httpVersion:_,decoded:T,counter:o.counter})},"fetch"),cWi=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!sWi.includes(e.method))return r;let n=new xBc(e,r,{shared:!1});if(n.storable()){let o=await wBc(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),OBc=a(async(t,e,r)=>{let n=new Aie(e,r);if(t.options.maxCacheSize!==0&&sWi.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 a3r(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await aWi(t,n);return n.cache!=="no-store"?cWi(t,n,s):s},"cachingFetch"),BBc=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"),LBc=a(t=>new IBc(t),"timeoutSignal"),s3r=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:MBc,o=NBc;n===0&&(n=1,o=1);let s=a(({response:l},u)=>RBc(l),"sizeCalculation");this.cache=new vBc({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new _Bc,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 o3r(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:E}))}),this.context=kBc(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:CBc,Headers:a3r,Request:Aie,Response:o3r,AbortController:SBc,AbortSignal:TBc,FetchBaseError:bBc,FetchError:eFe,AbortError:uTt,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:BBc,timeoutSignal:LBc,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 OBc(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on(i3r,e)}offPush(e){return this.eventEmitter.off(i3r,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){n3r(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new Aie(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(n3r(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){n3r(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await cWi(this,new Aie(e,{headers:r}),n);this.eventEmitter.emit(i3r,e,o)}};lWi.exports=new s3r().api()});var fWi=I((XBh,dWi)=>{"use strict";p();dWi.exports=uWi()});var MWi=I((r8h,NWi)=>{"use strict";p();function DWi(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(DWi,"validateParameter");function uLc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(uLc,"hasOwnProperty");function dLc(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(dLc,"defineOperation");NWi.exports={defineOperation:dLc,validateParameter:DWi}});var p3r=I((o8h,LWi)=>{"use strict";p();var b_e=P6e()("kerberos"),C_e=b_e.KerberosClient,OWi=b_e.KerberosServer,OV=MWi().defineOperation,fLc=1,pLc=2,hLc=4,mLc=8,gLc=16,ALc=32,yLc=64,ELc=128,_Lc=256,BWi=0,vLc=9,CLc=6;C_e.prototype.step=OV(C_e.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);C_e.prototype.wrap=OV(C_e.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);C_e.prototype.unwrap=OV(C_e.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);OWi.prototype.step=OV(OWi.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var bLc=OV(b_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}]),SLc=OV(b_e.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),TLc=OV(b_e.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:BWi}},{name:"callback",type:"function",required:!1}]),ILc=OV(b_e.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);LWi.exports={initializeClient:TLc,initializeServer:ILc,principalDetails:SLc,checkPassword:bLc,GSS_C_DELEG_FLAG:fLc,GSS_C_MUTUAL_FLAG:pLc,GSS_C_REPLAY_FLAG:hLc,GSS_C_SEQUENCE_FLAG:mLc,GSS_C_CONF_FLAG:gLc,GSS_C_INTEG_FLAG:ALc,GSS_C_ANON_FLAG:yLc,GSS_C_PROT_READY_FLAG:ELc,GSS_C_TRANS_FLAG:_Lc,GSS_C_NO_OID:BWi,GSS_MECH_OID_KRB5:vLc,GSS_MECH_OID_SPNEGO:CLc}});var FWi=I((a8h,xLc)=>{xLc.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 QWi=I((c8h,UWi)=>{"use strict";p();var wLc=require("dns"),RLc=p3r(),h3r=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=PLc(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();wLc.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}`;RLc.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 PLc(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=kLc(t),r(null,o)})}}a(PLc,"firstTransition");function kLc(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=DLc(t),r(null,o||"")})}}a(kLc,"secondTransition");function DLc(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=NLc(t),r(null,c)})})}}a(DLc,"thirdTransition");function NLc(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(NLc,"fourthTransition");UWi.exports={MongoAuthProcess:h3r}});var jWi=I((d8h,nFe)=>{"use strict";p();var qWi=p3r();nFe.exports=qWi;nFe.exports.Kerberos=qWi;nFe.exports.version=FWi().version;nFe.exports.processes={MongoAuthProcess:QWi().MongoAuthProcess}});var mio={};Ri(mio,{AbortError:()=>C1,DirectConnectError:()=>uP,DirectConnectTransport:()=>g8r,EXIT_REASONS:()=>p8c,HOOK_EVENTS:()=>Fxt,InMemorySessionStore:()=>AFr,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>h8c,createSdkMcpServer:()=>VYc,deleteSession:()=>VXc,filterEscalatingDefaultMode:()=>kXc,foldSessionSummary:()=>cJi,forkSession:()=>WXc,getSessionInfo:()=>HXc,getSessionMessages:()=>qXc,getSubagentMessages:()=>JXc,importSessionToStore:()=>zXc,listSessions:()=>jXc,listSubagents:()=>KXc,parseDirectConnectUrl:()=>YYc,query:()=>UXc,renameSession:()=>GXc,resolveSettings:()=>NXc,startup:()=>QXc,tagSession:()=>$Xc,tool:()=>$Yc});function D3c(t){return this[t]}function B3c(t,e){this[t]=O3c.bind(null,e)}function gFr(t=d8c){let e=new AbortController;return(0,nJi.setMaxListeners)(t,e.signal),e}function iJi(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 f8c(t,e){t(Error(e))}function wie(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(f8c,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function Q8r(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=g8c.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(!m8c.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function cJi(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=_8c(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)}v8c(c,l);for(let[d,f]of Object.entries(A8c)){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 y8c(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=FV(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=FV(r.customTitle)||FV(r.aiTitle)||void 0,s=o||FV(r.lastPrompt)||FV(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:FV(r.gitBranch)||void 0,cwd:FV(r.cwd)||e||void 0,tag:FV(r.tag)||void 0,createdAt:E8c(r.createdAt)}:null}function FV(t){return typeof t=="string"?t:void 0}function E8c(t){return typeof t=="number"?t:void 0}function _8c(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function v8c(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=Q8r(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function lJi(){return process.versions.bun!==void 0}function KE(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 m8e(){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 w8c(t){var e=I8c.call(t,sFe),r=t[sFe];try{t[sFe]=void 0;var n=!0}catch{}var o=x8c.call(t);return n&&(e?t[sFe]=r:delete t[sFe]),o}function D8c(t){return k8c.call(t)}function B8c(t){return t==null?t===void 0?O8c:M8c:Rzi&&Rzi in Object(t)?R8c(t):N8c(t)}function L8c(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function j8c(t){if(!M9(t))return!1;var e=g8e(t);return e==U8c||e==Q8c||e==F8c||e==q8c}function G8c(t){return!!Pzi&&Pzi in t}function z8c(t){if(t!=null){try{return W8c.call(t)}catch{}try{return t+""}catch{}}return""}function n6c(t){if(!M9(t)||$8c(t))return!1;var e=q8r(t)?r6c:J8c;return e.test(Y8c(t))}function o6c(t,e){return t?.[e]}function a6c(t,e){var r=s6c(t,e);return i6c(r)?r:void 0}function l6c(){this.__data__=QFe?QFe(null):{},this.size=0}function d6c(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function g6c(t){var e=this.__data__;if(QFe){var r=e[t];return r===p6c?void 0:r}return m6c.call(e,t)?e[t]:void 0}function _6c(t){var e=this.__data__;return QFe?e[t]!==void 0:E6c.call(e,t)}function b6c(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=QFe&&e===void 0?C6c:e,this}function yve(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function L6c(t,e){var r=this.__data__,n=Qxt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Eve(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 l9c(){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 AJi(...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 yJi(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return AJi({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function V8r(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 u9c(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 f9c(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 wi(`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 _Ji(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new Zl(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new Zl(`Refusing to send credential over non-https token endpoint "${t}"`)}async function vJi(t,e){let r=await E9c(t),n;try{n=JSON.parse(r)}catch{throw new Zl(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,dP(r),e)}if(!n.access_token)throw new Zl(`Token endpoint response missing access_token: ${JSON.stringify(dP(n))}`,t.status,dP(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new Zl(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,dP(n),e);return n}function dP(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=F3r?t:t.slice(0,F3r)+`... <${t.length-F3r} more chars>`}return JSON.stringify(dP(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))y9c.has(r)&&(e[r]=n);return e}return null}async function CJi(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new Zl(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new Zl(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function bJi(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 E9c(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>Lzi){let l=Lzi-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 Rie(){return Math.floor(Date.now()/1e3)}function _9c(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 z8r(t){let e;return(Fzi??(e=new globalThis.TextEncoder,Fzi=e.encode.bind(e)))(t)}function Qzi(t){let e;return(Uzi??(e=new globalThis.TextDecoder,Uzi=e.decode.bind(e)))(t)}function xFe(){}function QTt(t,e,r){return!e||CIt[t]>CIt[r]?xFe:e[t].bind(e)}function Yg(t){let e=t.logger,r=t.logLevel??"off";if(!e)return v9c;let n=jzi.get(e);if(n&&n[0]===r)return n[1];let o={error:QTt("error",e,r),warn:QTt("warn",e,r),info:QTt("info",e,r),debug:QTt("debug",e,r)};return jzi.set(e,[r,o]),o}function TJi(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(!C9c.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function Hzi(t){if(!t)throw new wi("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 wi(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new wi(`Identity token file at ${t} is empty`);return n}}function I9c(t){if(!t)throw new wi("Identity token value is empty");return()=>t}function x9c(t){return async()=>{_Ji(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new Zl(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:p9c,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}${EJi}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${vIt},${m9c}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${VV} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new Zl(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=dP(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new Zl(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await vJi(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new Zl(`Token endpoint response missing required fields: ${JSON.stringify(dP(c))}`,o.status,dP(c),s);return{token:c.access_token,expiresAt:Rie()+l}}}function w9c(t){return async e=>{let r=await import("node:fs");await CJi(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new Zl(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new Zl(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new Zl(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||Rie()"");throw new Zl(`User OAuth refresh failed (HTTP ${f.status}): ${dP(E)}`,f.status,dP(E),h)}let m=await vJi(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new Zl(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(dP(m))}`,f.status,dP(m),h);let A=Rie()+g,y=m.refresh_token||l;return await bJi(t.credentialsPath,{...o,version:SJi,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function xJi(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=P9c(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 R9c(t,e){let r=await b9c(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 S9c(n,e)??void 0}};return xJi(s,t)}function P9c(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=k9c(o);if(!s)throw new Zl("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new Zl("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new Zl("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=x9c({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?D9c(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new Zl("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return w9c({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new Zl(`authentication.type "${o}" is not a known authentication type`)}}}function k9c(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Zl(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Zl('identity_token.source "file" requires a non-empty path');return Hzi(t.identity_token.path)}let e=Kl("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return Hzi(e);let r=Kl("ANTHROPIC_IDENTITY_TOKEN");return r?I9c(r):null}function D9c(t,e,r,n){return async o=>{let s=await import("node:fs");await CJi(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||Rie()0&&(yield e)}function L9c(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function wJi(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return Yg(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):Oie.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 RJi(u,r)}return await r.text()})();return Yg(t).debug(`[${n}] response parsed`,Iie({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function RJi(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 H_e(t,e,r){return PJi(),new File(t,e??"unknown_file",r)}function sIt(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 F9c(t){let e=typeof t=="function"?t:t.fetch,r=Gzi.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 Gzi.set(e,n),n}async function H9c(t,e,r){if(PJi(),t=await t,e||(e=sIt(t,!0)),q9c(t))return t instanceof File&&e==null&&r==null?t:H_e([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(j9c(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),H_e(await TFr(o),e,r)}let n=await TFr(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 H_e(n,e,r)}async function TFr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(DJi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(kJi(t))for await(let r of t)e.push(...await TFr(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${G9c(t)}`)}return e}function G9c(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*$9c(t){if(!t)return;if(NJi 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():Dzi(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=Dzi(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 MJi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function aIt(t){return typeof t=="object"&&t!==null&&BFe in t}function OJi(t,e){let r=new Set;if(t)for(let n of t)aIt(n)&&r.add(n[BFe]);if(e){for(let n of e)if(aIt(n)&&r.add(n[BFe]),Array.isArray(n.content))for(let o of n.content)aIt(o)&&r.add(o[BFe])}return Array.from(r)}function BJi(t,e){let r=OJi(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function W9c(t){return aIt(t)?{"x-stainless-helper":t[BFe]}:{}}function FJi(t){return t?.output_format??t?.output_config?.format}function Vzi(t,e,r){let n=FJi(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}:UJi(t,e,r)}function UJi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=z9c(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 z9c(t,e){let r=FJi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new wi(`Failed to parse structured output: ${n}`)}}function Kzi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function Zzi(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function eUc(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 MIt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function eYi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new wi("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 qJi(t){return t?.output_config?.format}function tYi(t,e,r){let n=qJi(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}:jJi(t,e,r)}function jJi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=rUc(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 rUc(t,e){let r=qJi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new wi(`Failed to parse structured output: ${n}`)}}function oYi(t){return t.type==="tool_use"||t.type==="server_tool_use"}function A8e(t){return t instanceof Error?t:Error(String(t))}function lIt(t){return t instanceof Error?t.message:String(t)}function II(t){if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code}function y8e(t){return II(t)==="ENOENT"}function GJi(t){return II(t)==="EISDIR"}function sUc(t){let e=II(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function lUc(t,e,r){let n=`${t}.tmp.${(0,WJi.randomBytes)(4).toString("hex")}`;try{await(0,PB.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,PB.rename)(n,t)}catch(o){let s=II(o);if(s!==void 0&&aUc.has(s)){try{await(0,PB.copyFile)(n,t)}catch(c){throw cUc.has(II(c)??"")&&await(0,PB.unlink)(t).catch(()=>{}),c}await(0,PB.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,PB.unlink)(n).catch(()=>{}),o}}function HIt(){return uUc.getStore()??new kFr}function zJi(){if(N_e)return N_e;if(!KE(process.env.DEBUG_CLAUDE_AGENT_SDK))return Pie=null,N_e=Promise.resolve(),N_e;let t=(0,PFr.join)(vve(),"debug");return Pie=(0,PFr.join)(t,`sdk-${(0,$Ji.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${Pie} -`),N_e=HIt().mkdir(t).catch(()=>{}),N_e}function dUc(){return zJi(),Pie??null}function cP(t){if(Pie===null)return;let e=`${new Date().toISOString()} ${t} -`;zJi().then(()=>{Pie&&HIt().append(Pie,e).catch(()=>{})})}function fUc(){this.__data__=new qxt,this.size=0}function hUc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function gUc(t){return this.__data__.get(t)}function yUc(t){return this.__data__.has(t)}function vUc(t,e){var r=this.__data__;if(r instanceof qxt){var n=r.__data__;if(!fJi||n.length<_Uc-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new H8r(n)}return r.set(t,e),this.size=r.size,this}function Cve(t){var e=this.__data__=new qxt(t);this.size=e.size}function TUc(t,e,r){e=="__proto__"&&GIt?GIt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function wUc(t,e,r){var n=t[e];(!(xUc.call(t,e)&&Uxt(n,r))||r===void 0&&!(e in t))&&Z8r(t,e,r)}function RUc(t,e,r,n){var o=!r;r||(r={});for(var s=-1,c=e.length;++s-1&&t%1==0&&t-1&&t%1==0&&t<=zUc}function _7c(t){return bve(t)&&e6r(t.length)&&!!_d[g8e(t)]}function C7c(t){return function(e){return t(e)}}function R7c(t,e){var r=ZV(t),n=!r&&VFe(t),o=!r&&!n&&X8r(t),s=!r&&!n&&!o&&XJi(t),c=r||n||o||s,l=c?DUc(t.length,String):[],u=l.length;for(var d in t)(e||w7c.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Hxt(d,u)))&&l.push(d);return l}function D7c(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||k7c;return t===r}function N7c(t,e){return function(r){return t(e(r))}}function O7c(t){return t!=null&&e6r(t.length)&&!q8r(t)}function B7c(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function Q7c(t){if(!M9(t))return L7c(t);var e=eZi(t),r=[];for(var n in t)n=="constructor"&&(e||!U7c.call(t,n))||r.push(n);return r}function j7c(t){return t6r(t)?P7c(t,!0):q7c(t)}function G7c(t,e){if(e)return t.slice();var r=t.length,n=pYi?pYi(r):new t.constructor(r);return t.copy(n),n}function $7c(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 rqc(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function iqc(t){return nqc.register(t)}function sqc(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 aqc(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 cqc(t,e){if(!e)return!0;let r=sqc(t);return aqc(r,e)}function lqc(t){return/^[\\/]{2}/.test(t)}function uqc(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function yYi(t){try{return uqc(lZi.realpathSync.native(t))}catch{return null}}function dqc(t,e){let r=(0,kB.resolve)(e).toLowerCase(),n=(0,kB.resolve)(t).toLowerCase();if((0,kB.dirname)(n)===r||n.startsWith(r+kB.sep))return!0;let o=yYi(e)?.toLowerCase();if(o==null)return!1;let s=yYi((0,kB.dirname)((0,kB.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+kB.sep)}function uZi(t,e){if(lqc(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 xI(){return pqc}function hqc(t,e){t.destroyed||t.write(e)}function mqc(t){hqc(process.stderr,t)}function gqc(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Aqc(t,e,r=e+"s"){return t===1?e:r}function yqc(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function Cqc(t){return vqc.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function bqc(t){vYi??=Cqc(!0);for(let e of vYi)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 $xt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function xqc(t){if(!BFr()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=Iqc();return cqc(t,e)}async function pZi(t,e,r=Rqc){if(CFe<0?CFe=await(0,XE.stat)(t).then(n=>n.size).catch(()=>0):CFe+=e,!(CFe<=r||K3r)){K3r=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,XE.rename)(t,n)}catch(o){y8e(o)||(await(0,XE.unlink)(n).catch(()=>{}),await(0,XE.rename)(t,n).catch(()=>(0,XE.unlink)(t).catch(()=>{})))}CFe=0}finally{K3r=!1}}}function hZi(t){return LFr=(0,jie.join)(t,`${cZi()}.txt`),LFr}async function Pqc(t,e,r,n){t&&await(0,XE.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,XE.appendFile)(r,n)}catch(s){if(!GJi(s))throw s;o=hZi(r),await(0,XE.appendFile)(o,n)}await pZi(o,Buffer.byteLength(n)).catch(FFr),gZi()}function FFr(){}function kqc(){if(!tIt){let t=null;tIt=tqc({writeFn:a(e=>{let r=mZi(),n=(0,jie.dirname)(r),o=t!==n;if(t=n,BFr()){if(o)try{xI().mkdirSync(n)}catch{}let s=r;try{xI().appendFileSync(r,e)}catch(c){if(!GJi(c))throw c;s=hZi(r),xI().appendFileSync(s,e)}pZi(s,Buffer.byteLength(e)).catch(FFr),gZi();return}Y3r=Y3r.then(Pqc.bind(null,o,n,r,e)).catch(FFr)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:BFr()}),iqc(async()=>{tIt?.dispose(),await Y3r})}return tIt}function Jl(t,{level:e}={level:"debug"}){if(OFr[e]t.endsWith(e))}function qqc(t,e){return(0,sJi.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 jqc(){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 Hqc(t,e=process.platform,r=process.arch,n=AZi.existsSync,o=jqc()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${M_e}-linux-${r}-android`]:e==="linux"?o?[`${M_e}-linux-${r}-musl`,`${M_e}-linux-${r}`]:[`${M_e}-linux-${r}`,`${M_e}-linux-${r}-musl`]:[`${M_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 Gqc(){return{eventQueue:[],sink:null}}function a6r(t,e){let r=$qc;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function yZi(t){a6r("tengu_feature_ok",{feature_name:t})}function EZi(t,e,r){a6r("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function Vqc(t,e,r){a6r("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function x9(t,e,r){try{let n=await e();return yZi(t),n}catch(n){throw EZi(t,r?.(n)??"error"),n}}function zqc(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 FFe(t){if(typeof t=="string")return zqc(t);if(Array.isArray(t))return t.map(FFe);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[FFe(r)]=FFe(n);return e}return t}function Yqc(){return process.platform==="win32"}function Jqc(t){let e=J3r.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,TZi.join)(r,"System32","where.exe");try{let o=(0,SZi.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:Kqc,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!dqc(c,s))return J3r.set(t,c),c;return null}catch(o){return Zqc(o)&&J3r.set(t,null),null}}function Zqc(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 Xqc(t){return!Yqc()||t.includes("/")||t.includes("\\")?t:Jqc(t)}async function E8e(t){let e=Xqc("git");if(e===null)return[];try{let{stdout:r}=await ejc(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 tjc(t){let e=0;for(let r=0;ro&&(n=IZi(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function GFr(t,e){let r=(0,vZi.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` -`)||await(0,HFr.once)(r,"drain");r.end(),await(0,HFr.once)(r,"finish")}catch(n){throw r.destroy(),n}}function xZi(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=Q8r(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function njc(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=Q8r(r,e);if(n!==void 0)return n}return e.commandFallback}async function wZi(t){try{let e=await(0,DN.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe(k9),o=await e.read(n,0,k9,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-k9),l=s;if(c>0){let u=await e.read(n,0,k9,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 ijc(t){return Math.abs(tjc(t)).toString(36)}function _8e(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=WFe?e:`${e.slice(0,WFe)}-${ijc(t)}`}function nW(){return(0,Z_e.join)(vve(),"projects")}function ojc(t){return(0,Z_e.join)(nW(),_8e(t))}async function v8e(t){try{return(await(0,DN.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function PN(t){let e=ojc(t),r=[];try{await(0,DN.readdir)(e),r.push(e)}catch{}let n=_8e(t);if(n.length<=WFe)return r;let o=n.slice(0,WFe)+"-",s=nW();try{for(let c of await(0,DN.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,Z_e.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function Vxt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,Z_e.join)(c,r);try{let d=await(0,DN.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await v8e(e);for(let u of await PN(c)){let d=await n(u,c);if(d)return d}let l;try{l=await E8e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await PN(u)){let f=await n(d,u);if(f)return f}return}let o=nW(),s;try{s=await(0,DN.readdir)(o)}catch{return}for(let c of s){let l=await n((0,Z_e.join)(o,c),void 0);if(l)return l}}function ljc(){return cjc??=Buffer.from('"compact_boundary"')}function RZi(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 YIt(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function pjc(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(zFe);if(o===-1||o>=r)return 0;let s=o+1;if(YIt(n,KIt,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 gjc(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 Ajc(t){if(t.carryLen>0){let e=t.carryBuf;YIt(e,KIt,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]!==zFe&&kie(t.out,djc,0,1),kie(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function yjc(t,e){let r=ljc(),n=sjc,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,DN.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=hjc(o,f,r);mjc(o,f,s,h.lastSnapStart,h.lastSnapEnd),gjc(o,f,h.trailStart),o.bufFileOff+=h.trailStart}Ajc(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function Ejc(t,e){try{return e>ajc&&!KE(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await yjc(t,e)).postBoundaryBuf:await(0,_Zi.readFile)(t)}catch{return null}}function _jc(t){let e=[];try{let o=Kd(e,Zd`parseTranscriptEntries(${t.length} bytes)`,0),s=[],c=10,l=t.length,u=0;for(;u=d)continue;let h=t.toString("utf-8",f,d);try{let m=Mqc(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{Jd(e,r,n)}}function vjc(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(),bjc(e,d,f)}function X3r(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 Cjc(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 bjc(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=X3r(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=X3r(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(Cjc(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=X3r(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 Sjc(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function PZi(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 kZi(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 Tjc(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 DZi(r,e)}function DZi(t,e){let r=vjc(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>Sjc(s,n)).map(s=>PZi(s));return kZi(o,e)}async function Ijc(t,e){if(!yh(t))return[];let r=await Vxt(t,e?.dir);if(!r)return[];let n=await Ejc(r.filePath,r.fileSize);return n?DZi(_jc(n),e):[]}function Wxt(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=lP(o,"customTitle")||lP(n,"customTitle")||lP(o,"aiTitle")||lP(n,"aiTitle")||void 0,f=xZi(n)||void 0,h=Z3r(n,"timestamp"),m;if(h){let v=Date.parse(h);Number.isNaN(v)||(m=v)}let g=d||lP(o,"lastPrompt")||lP(o,"summary")||f;if(!g)return null;let A=lP(o,"gitBranch")||Z3r(n,"gitBranch")||void 0,y=Z3r(n,"cwd")||r||void 0,E=o.split(` -`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),_=E&&lP(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 DFe(t,e,r){let n;try{n=await(0,Sve.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=yh(o.slice(0,-6));if(!s)return null;let c=(0,Tve.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,Sve.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function NZi(t){let e=await wZi(t.filePath);if(!e)return null;let r=Wxt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function wjc(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function Rjc(t,e,r){t.sort(wjc);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 kjc(t,e,r){let n=await v8e(t),o;if(e)try{o=await E8e(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await PN(n))h.push(...await DFe(m,r,n));return h}let s=nW(),c=process.platform==="win32",l=o.map(h=>{let m=_8e(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,Sve.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await PN(n))h.push(...await DFe(m,r,n));return h}let d=[],f=new Set;for(let h of await PN(n)){let m=(0,Tve.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await DFe(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>=WFe&&m.startsWith(A+"-")){f.add(m),d.push(...await DFe((0,Tve.join)(s,h.name),r,g));break}}}return d}async function Djc(t){let e=nW(),r;try{r=await(0,Sve.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>DFe((0,Tve.join)(e,n.name),t)))).flat()}async function Njc(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 kjc(e,o??!0,c):await Djc(c);return c?Rjc(l,r,s):Pjc(l)}async function Mjc(t,e={}){let r=yh(t);if(!r)return;let n=await Vxt(r,e.dir);if(!n)return;let o=await wZi(n.filePath);if(o)return Wxt(r,o,n.projectPath)??void 0}async function Ojc(t,e,r={}){if(!yh(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=Nm({type:"custom-title",customTitle:e.trim(),sessionId:t})+` -`;await MZi(t,n,r)}async function Bjc(t,e,r={}){if(!yh(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=FFe(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=Nm({type:"tag",tag:e??"",sessionId:t})+` -`;await MZi(t,n,r)}async function Ljc(t,e={}){if(!yh(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await Fjc(e)){let n=(0,Die.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,DB.stat)(n))}catch(s){let c=II(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,DB.rm)(n,{force:!0}),await(0,DB.rm)((0,Die.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 Fjc(t){if(t.dir){let r=await v8e(t.dir),n=await PN(r),o;try{o=await E8e(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await PN(s));return n}let e=nW();try{return(await(0,DB.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,Die.join)(e,r.name))}catch{return[]}}async function MZi(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await v8e(r.dir);for(let u of await PN(c))if(await eFr((0,Die.join)(u,n),e))return;let l;try{l=await E8e(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await PN(u))if(await eFr((0,Die.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=nW(),s;try{s=await(0,DB.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await eFr((0,Die.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function eFr(t,e){let r;try{r=await(0,DB.open)(t,$Fr.constants.O_WRONLY|$Fr.constants.O_APPEND)}catch(n){let o=II(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 Ujc(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await HIt().readBytes((0,JIt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await v8e(e);for(let u of await PN(c)){let d=await n(u);if(d)return d}let l;try{l=await E8e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await PN(u)){let f=await n(d);if(f)return f}return null}let o=nW(),s;try{s=await HIt().list(o)}catch{return null}for(let c of s){let l=await n((0,JIt.join)(o,c));if(l)return l}return null}function qjc(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{OZi(LN(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function jjc(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||OZi(o,e,r,n);return{transcript:r,contentReplacements:n}}function OZi(t,e,r,n){Qjc.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 Hjc(t,e={}){if(!yh(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!yh(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await Ujc(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}=Gjc(r.buf,t,e);return await GFr((0,JIt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function Gjc(t,e,r){let n=qjc(t,e);return BZi(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,k9)),c=t.toString("utf-8",Math.max(0,o-k9));return lP(c,"customTitle")||lP(s,"customTitle")||lP(c,"aiTitle")||lP(s,"aiTitle")||xZi(s)})}function $jc(t,e,r){let n=jjc(t,e);return BZi(n,e,r,()=>Vjc(t))}function Vjc(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||njc(t)||void 0}function BZi(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,NFe.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,NFe.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,NFe.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,NFe.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function LZi(t,e){let r=await Vxt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,ZIt.join)(n,"subagents")}async function FZi(t){let e=[];async function r(n){let o;try{o=await(0,YFe.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,ZIt.join)(n,s.name)})}else s.isDirectory()&&await r((0,ZIt.join)(n,s.name))}return a(r,"J"),await r(t),e}function Wjc(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=LN(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function zjc(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 Yjc(t,e){if(!yh(t))return[];let r=await LZi(t,e?.dir);return r?(await FZi(r)).map(n=>n.agentId):[]}async function Kjc(t,e,r){if(!yh(t))return[];if(!e)return[];let n=await LZi(t,r?.dir);if(!n)return[];let o=(await FZi(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,YFe.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=LN(await(0,YFe.readFile)(l,"utf-8")).toolUseId}catch{}return UZi(s,r,c)}function UZi(t,e,r){if(t.length===0)return[];let n=Wjc(t),o=zjc(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>PZi(s,r));return kZi(o,e)}function jZi(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function HZi(t){return[...new Set(t)]}function Jjc(){return"prod"}function nHc(){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 oHc(){let t=(()=>{switch(Jjc()){case"local":return nHc();case"staging":return rHc??SYi;case"prod":return SYi}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!iHc.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 aHc(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"):vve(),o=r?"":`-${(0,QZi.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${oHc().OAUTH_FILE_SUFFIX}${t}${o}`}function lHc(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,qZi.userInfo)().username}catch{t="claude-code-user"}return cHc.test(t)?t:"claude-code-user"}function VFr(){return dHc}function cn(t,e){let r=VFr(),n=WFr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===KFe?void 0:KFe].filter(o=>!!o)});t.common.issues.push(n)}function Yo(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:a((s,c)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??c.defaultError}:typeof c.data>"u"?{message:l??n??c.defaultError}:s.code!=="invalid_type"?{message:c.defaultError}:{message:l??r??c.defaultError}},"errorMap"),description:o}}function VZi(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 wHc(t){return new RegExp(`^${VZi(t)}$`)}function RHc(t){let e=`${$Zi}T${VZi(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 PHc(t,e){return!!((e==="v4"||!e)&&vHc.test(t)||(e==="v6"||!e)&&bHc.test(t))}function kHc(t,e){if(!AHc.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 DHc(t,e){return!!((e==="v4"||!e)&&CHc.test(t)||(e==="v6"||!e)&&SHc.test(t))}function NHc(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 F_e(t){if(t instanceof wI){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=hP.create(F_e(n))}return new wI({...t._def,shape:a(()=>e,"shape")})}else return t instanceof eW?new eW({...t._def,type:F_e(t.element)}):t instanceof hP?hP.create(F_e(t.unwrap())):t instanceof B9?B9.create(F_e(t.unwrap())):t instanceof O9?O9.create(t.items.map(e=>F_e(e))):t}function YFr(t,e){let r=GV(t),n=GV(e);if(t===e)return{valid:!0,data:t};if(r===Rn.object&&n===Rn.object){let o=fc.objectKeys(e),s=fc.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=YFr(t[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(r===Rn.array&&n===Rn.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;sr?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}function Wv(t){return t&&Object.assign(rxt,t),rxt}function OHc(t){return t}function BHc(t){return t}function LHc(t){}function FHc(t){throw Error()}function UHc(t){}function u6r(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=>ss(r)).join(e)}function JZi(t,e){return typeof e=="bigint"?e.toString():e}function zxt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function Hie(t){return t==null}function Yxt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function ZZi(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 Gc(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 d6r(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function QHc(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function qHc(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 $Hc(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 ss(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function tXi(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function VHc(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return FN(t,{...t._zod.def,shape:r,checks:[]})}function WHc(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return FN(t,{...t._zod.def,shape:r,checks:[]})}function zHc(t,e){if(!c8e(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 d6r(this,"shape",n),n},checks:[]};return FN(t,r)}function YHc(t,e){return FN(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return d6r(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function KHc(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return FN(e,{...e._zod.def,shape:o,checks:[]})}function JHc(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return FN(e,{...e._zod.def,shape:o,checks:[]})}function G_e(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function OFe(t){return typeof t=="string"?t:t?.message}function MN(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=OFe(t.inst?._zod.def?.error?.(t))??OFe(e?.error?.(t))??OFe(r.customError?.(t))??OFe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function Kxt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Jxt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function iXi(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function ZHc(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function h6r(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 m6r(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 ${aXi(n.path)}`);return e.join(` -`)}function yXi(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function wXi(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 RXi(t){return new RegExp(`^${wXi(t)}$`)}function PXi(t){let e=wXi({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(`^${IXi}T(?:${n})$`)}function RYi(t,e,r){t.issues.length&&e.issues.push(...fP(r,t.issues))}function S6r(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function Ieo(t){if(!v6r.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return S6r(r)}function Reo(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 PYi(t,e,r){t.issues.length&&e.issues.push(...fP(r,t.issues)),e.value[r]=t.value}function rIt(t,e,r){t.issues.length&&e.issues.push(...fP(r,t.issues)),e.value[r]=t.value}function kYi(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(...fP(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function DYi(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=>MN(s,n,Wv())))}),e}function XFr(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(c8e(t)&&c8e(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=XFr(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;nMN(l,c,Wv()))})),e.issues.length&&(nxt.has(typeof n)?r.issues.push(...fP(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>MN(l,c,Wv()))})),r.value.set(t.value,e.value)}function OYi(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function BYi(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function LYi(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 FYi(t,e,r){return G_e(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function UYi(t){return t.value=Object.freeze(t.value),t}function QYi(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(iXi(o))}}function uGc(){return{localeError:lGc()}}function fGc(){return{localeError:dGc()}}function qYi(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 hGc(){return{localeError:pGc()}}function gGc(){return{localeError:mGc()}}function yGc(){return{localeError:AGc()}}function _Gc(){return{localeError:EGc()}}function cto(){return{localeError:CGc()}}function TGc(){return{localeError:SGc()}}function xGc(){return{localeError:IGc()}}function RGc(){return{localeError:wGc()}}function kGc(){return{localeError:PGc()}}function NGc(){return{localeError:DGc()}}function OGc(){return{localeError:MGc()}}function LGc(){return{localeError:BGc()}}function UGc(){return{localeError:FGc()}}function qGc(){return{localeError:QGc()}}function HGc(){return{localeError:jGc()}}function $Gc(){return{localeError:GGc()}}function WGc(){return{localeError:VGc()}}function YGc(){return{localeError:zGc()}}function JGc(){return{localeError:KGc()}}function XGc(){return{localeError:ZGc()}}function t$c(){return{localeError:e$c()}}function n$c(){return{localeError:r$c()}}function o$c(){return{localeError:i$c()}}function a$c(){return{localeError:s$c()}}function l$c(){return{localeError:c$c()}}function d$c(){return{localeError:u$c()}}function jYi(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 p$c(){return{localeError:f$c()}}function m$c(){return{localeError:h$c()}}function A$c(){return{localeError:g$c()}}function E$c(){return{localeError:y$c()}}function v$c(){return{localeError:_$c()}}function S$c(){return{localeError:b$c()}}function I$c(){return{localeError:T$c()}}function w$c(){return{localeError:x$c()}}function P$c(){return{localeError:R$c()}}function D$c(){return{localeError:k$c()}}function M$c(){return{localeError:N$c()}}function M6r(){return new l8e}function dto(t,e){return new t({type:"string",...xr(e)})}function fto(t,e){return new t({type:"string",coerce:!0,...xr(e)})}function O6r(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...xr(e)})}function cxt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...xr(e)})}function B6r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...xr(e)})}function L6r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xr(e)})}function F6r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xr(e)})}function U6r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xr(e)})}function Q6r(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...xr(e)})}function q6r(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...xr(e)})}function j6r(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...xr(e)})}function H6r(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...xr(e)})}function G6r(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...xr(e)})}function $6r(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...xr(e)})}function V6r(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...xr(e)})}function W6r(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...xr(e)})}function z6r(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...xr(e)})}function Y6r(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...xr(e)})}function K6r(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xr(e)})}function J6r(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xr(e)})}function Z6r(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...xr(e)})}function X6r(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...xr(e)})}function e9r(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...xr(e)})}function t9r(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...xr(e)})}function hto(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xr(e)})}function mto(t,e){return new t({type:"string",format:"date",check:"string_format",...xr(e)})}function gto(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...xr(e)})}function Ato(t,e){return new t({type:"string",format:"duration",check:"string_format",...xr(e)})}function yto(t,e){return new t({type:"number",checks:[],...xr(e)})}function Eto(t,e){return new t({type:"number",coerce:!0,checks:[],...xr(e)})}function _to(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...xr(e)})}function vto(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...xr(e)})}function Cto(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...xr(e)})}function bto(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...xr(e)})}function Sto(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...xr(e)})}function Tto(t,e){return new t({type:"boolean",...xr(e)})}function Ito(t,e){return new t({type:"boolean",coerce:!0,...xr(e)})}function xto(t,e){return new t({type:"bigint",...xr(e)})}function wto(t,e){return new t({type:"bigint",coerce:!0,...xr(e)})}function Rto(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...xr(e)})}function Pto(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...xr(e)})}function kto(t,e){return new t({type:"symbol",...xr(e)})}function Dto(t,e){return new t({type:"undefined",...xr(e)})}function Nto(t,e){return new t({type:"null",...xr(e)})}function Mto(t){return new t({type:"any"})}function lxt(t){return new t({type:"unknown"})}function Oto(t,e){return new t({type:"never",...xr(e)})}function Bto(t,e){return new t({type:"void",...xr(e)})}function Lto(t,e){return new t({type:"date",...xr(e)})}function Fto(t,e){return new t({type:"date",coerce:!0,...xr(e)})}function Uto(t,e){return new t({type:"nan",...xr(e)})}function Uie(t,e){return new C6r({check:"less_than",...xr(e),value:t,inclusive:!1})}function kN(t,e){return new C6r({check:"less_than",...xr(e),value:t,inclusive:!0})}function Qie(t,e){return new b6r({check:"greater_than",...xr(e),value:t,inclusive:!1})}function SI(t,e){return new b6r({check:"greater_than",...xr(e),value:t,inclusive:!0})}function Qto(t){return Qie(0,t)}function qto(t){return Uie(0,t)}function jto(t){return kN(0,t)}function Hto(t){return SI(0,t)}function u8e(t,e){return new qXi({check:"multiple_of",...xr(e),value:t})}function twt(t,e){return new GXi({check:"max_size",...xr(e),maximum:t})}function d8e(t,e){return new $Xi({check:"min_size",...xr(e),minimum:t})}function r9r(t,e){return new VXi({check:"size_equals",...xr(e),size:t})}function rwt(t,e){return new WXi({check:"max_length",...xr(e),maximum:t})}function pve(t,e){return new zXi({check:"min_length",...xr(e),minimum:t})}function nwt(t,e){return new YXi({check:"length_equals",...xr(e),length:t})}function n9r(t,e){return new KXi({check:"string_format",format:"regex",...xr(e),pattern:t})}function i9r(t){return new JXi({check:"string_format",format:"lowercase",...xr(t)})}function o9r(t){return new ZXi({check:"string_format",format:"uppercase",...xr(t)})}function s9r(t,e){return new XXi({check:"string_format",format:"includes",...xr(e),includes:t})}function a9r(t,e){return new eeo({check:"string_format",format:"starts_with",...xr(e),prefix:t})}function c9r(t,e){return new teo({check:"string_format",format:"ends_with",...xr(e),suffix:t})}function Gto(t,e,r){return new reo({check:"property",property:t,schema:e,...xr(r)})}function l9r(t,e){return new neo({check:"mime_type",mime:t,...xr(e)})}function $ie(t){return new ieo({check:"overwrite",tx:t})}function u9r(t){return $ie(e=>e.normalize(t))}function d9r(){return $ie(t=>t.trim())}function f9r(){return $ie(t=>t.toLowerCase())}function p9r(){return $ie(t=>t.toUpperCase())}function h9r(t,e,r){return new t({type:"array",element:e,...xr(r)})}function O$c(t,e,r){return new t({type:"union",options:e,...xr(r)})}function B$c(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...xr(n)})}function L$c(t,e,r){return new t({type:"intersection",left:e,right:r})}function $to(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 F$c(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...xr(n)})}function U$c(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...xr(n)})}function Q$c(t,e,r){return new t({type:"set",valueType:e,...xr(r)})}function q$c(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 j$c(t,e,r){return new t({type:"enum",entries:e,...xr(r)})}function H$c(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...xr(r)})}function Vto(t,e){return new t({type:"file",...xr(e)})}function G$c(t,e){return new t({type:"transform",transform:e})}function $$c(t,e){return new t({type:"optional",innerType:e})}function V$c(t,e){return new t({type:"nullable",innerType:e})}function W$c(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function z$c(t,e,r){return new t({type:"nonoptional",innerType:e,...xr(r)})}function Y$c(t,e){return new t({type:"success",innerType:e})}function K$c(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function J$c(t,e,r){return new t({type:"pipe",in:e,out:r})}function Z$c(t,e){return new t({type:"readonly",innerType:e})}function X$c(t,e,r){return new t({type:"template_literal",parts:e,...xr(r)})}function eVc(t,e){return new t({type:"lazy",getter:e})}function tVc(t,e){return new t({type:"promise",innerType:e})}function Wto(t,e,r){let n=xr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function zto(t,e,r){return new t({type:"custom",check:"custom",fn:e,...xr(r)})}function Yto(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??D6r,u=t.Boolean??I6r,d=t.String??S8e,f=new(t.Transform??k6r)({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 Kto(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 Jto(t){return new uxt({type:"function",input:Array.isArray(t?.input)?$to(ewt,t?.input):t?.input??h9r(w6r,lxt(axt)),output:t?.output??lxt(axt)})}function m9r(t,e){if(t instanceof l8e){let n=new f8e(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 f8e(e);return r.process(t),r.emit(t,e)}function D0(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 D0(n.element,r);case"object":{for(let o in n.shape)if(D0(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(D0(o,r))return!0;return!1}case"intersection":return D0(n.left,r)||D0(n.right,r);case"tuple":{for(let o of n.items)if(D0(o,r))return!0;return!!(n.rest&&D0(n.rest,r))}case"record":return D0(n.keyType,r)||D0(n.valueType,r);case"map":return D0(n.keyType,r)||D0(n.valueType,r);case"set":return D0(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return D0(n.innerType,r);case"lazy":return D0(n.getter(),r);case"default":return D0(n.innerType,r);case"prefault":return D0(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return D0(n.in,r)||D0(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function HYi(t,e){let r={type:"object",get shape(){return Gs.assignProp(this,"shape",{...t}),this.shape},...Gs.normalizeParams(e)};return new iVc(r)}function MB(t){return!!t._zod}function Q_e(t){let e=Object.values(t);if(e.length===0)return HYi({});let r=e.every(MB),n=e.every(o=>!MB(o));if(r)return HYi(t);if(n)return MHc(t);throw Error("Mixed Zod versions detected in object shape.")}function UFe(t,e){return MB(t)?Zxt(t,e):t.safeParse(e)}async function rFr(t,e){return MB(t)?await Xxt(t,e):await t.safeParseAsync(e)}function T8e(t){if(!t)return;let e;if(MB(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function bFe(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 Q_e(t)}}if(MB(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 nFr(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 oVc(t){return t.description}function sVc(t){if(MB(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function Zto(t){if(MB(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 Xto(t){return hto(A9r,t)}function ero(t){return mto(y9r,t)}function tro(t){return gto(E9r,t)}function rro(t){return Ato(_9r,t)}function It(t){return dto(iwt,t)}function cVc(t){return O6r(C9r,t)}function lVc(t){return cxt(dxt,t)}function uVc(t){return B6r(N9,t)}function dVc(t){return L6r(N9,t)}function fVc(t){return F6r(N9,t)}function pVc(t){return U6r(N9,t)}function hVc(t){return Q6r(b9r,t)}function mVc(t){return q6r(S9r,t)}function gVc(t){return j6r(T9r,t)}function AVc(t){return H6r(I9r,t)}function yVc(t){return G6r(x9r,t)}function EVc(t){return $6r(w9r,t)}function _Vc(t){return V6r(R9r,t)}function vVc(t){return W6r(P9r,t)}function CVc(t){return z6r(k9r,t)}function bVc(t){return Y6r(D9r,t)}function SVc(t){return K6r(N9r,t)}function TVc(t){return J6r(M9r,t)}function IVc(t){return Z6r(O9r,t)}function xVc(t){return X6r(B9r,t)}function wVc(t){return e9r(L9r,t)}function RVc(t){return t9r(F9r,t)}function PVc(t,e,r={}){return Kto(cro,t,e,r)}function kc(t){return yto(owt,t)}function e8r(t){return _to(Ive,t)}function kVc(t){return vto(Ive,t)}function DVc(t){return Cto(Ive,t)}function NVc(t){return bto(Ive,t)}function MVc(t){return Sto(Ive,t)}function N0(t){return Tto(swt,t)}function OVc(t){return xto(awt,t)}function BVc(t){return Rto(U9r,t)}function LVc(t){return Pto(U9r,t)}function FVc(t){return kto(lro,t)}function UVc(t){return Dto(uro,t)}function Q9r(t){return Nto(dro,t)}function QVc(){return Mto(fro)}function ef(){return lxt(pro)}function cwt(t){return Oto(hro,t)}function qVc(t){return Bto(mro,t)}function jVc(t){return Lto(q9r,t)}function Ea(t,e){return h9r(gro,t,e)}function HVc(t){let e=t._zod.def.shape;return ti(Object.keys(e))}function Cn(t,e){let r={type:"object",get shape(){return Gs.assignProp(this,"shape",{...t}),this.shape},...Gs.normalizeParams(e)};return new lwt(r)}function GVc(t,e){return new lwt({type:"object",get shape(){return Gs.assignProp(this,"shape",{...t}),this.shape},catchall:cwt(),...Gs.normalizeParams(e)})}function Gv(t,e){return new lwt({type:"object",get shape(){return Gs.assignProp(this,"shape",{...t}),this.shape},catchall:ef(),...Gs.normalizeParams(e)})}function eu(t,e){return new j9r({type:"union",options:t,...Gs.normalizeParams(e)})}function H9r(t,e,r){return new Aro({type:"union",options:e,discriminator:t,...Gs.normalizeParams(r)})}function uwt(t,e){return new yro({type:"intersection",left:t,right:e})}function $Vc(t,e,r){let n=e instanceof Co,o=n?r:e;return new Ero({type:"tuple",items:t,rest:n?e:null,...Gs.normalizeParams(o)})}function Xl(t,e,r){return new G9r({type:"record",keyType:t,valueType:e,...Gs.normalizeParams(r)})}function VVc(t,e,r){return new G9r({type:"record",keyType:eu([t,cwt()]),valueType:e,...Gs.normalizeParams(r)})}function WVc(t,e,r){return new _ro({type:"map",keyType:t,valueType:e,...Gs.normalizeParams(r)})}function zVc(t,e){return new vro({type:"set",valueType:t,...Gs.normalizeParams(e)})}function I1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new p8e({type:"enum",entries:r,...Gs.normalizeParams(e)})}function YVc(t,e){return new p8e({type:"enum",entries:t,...Gs.normalizeParams(e)})}function ti(t,e){return new Cro({type:"literal",values:Array.isArray(t)?t:[t],...Gs.normalizeParams(e)})}function KVc(t){return Vto(bro,t)}function V9r(t){return new $9r({type:"transform",transform:t})}function vd(t){return new W9r({type:"optional",innerType:t})}function fxt(t){return new Sro({type:"nullable",innerType:t})}function JVc(t){return vd(fxt(t))}function Iro(t,e){return new Tro({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function wro(t,e){return new xro({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Rro(t,e){return new z9r({type:"nonoptional",innerType:t,...Gs.normalizeParams(e)})}function ZVc(t){return new Pro({type:"success",innerType:t})}function Dro(t,e){return new kro({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function XVc(t){return Uto(Nro,t)}function pxt(t,e){return new Y9r({type:"pipe",in:t,out:e})}function Oro(t){return new Mro({type:"readonly",innerType:t})}function eWc(t,e){return new Bro({type:"template_literal",parts:t,...Gs.normalizeParams(e)})}function Fro(t){return new Lro({type:"lazy",getter:t})}function tWc(t){return new Uro({type:"promise",innerType:t})}function Qro(t,e){let r=new Eh({check:"custom",...Gs.normalizeParams(e)});return r._zod.check=t,r}function qro(t,e){return Wto(dwt,t??(()=>!0),e)}function jro(t,e={}){return zto(dwt,t,e)}function Hro(t,e){let r=Qro(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Gs.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(Gs.issue(s))}},t(n.value,n)),e);return r}function rWc(t,e={error:`Input not instance of ${t.name}`}){let r=new dwt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...Gs.normalizeParams(e)});return r._zod.bag.Class=t,r}function iWc(t){let e=Fro(()=>eu([It(t),kc(),N0(),Q9r(),Ea(e),Xl(It(),e)]));return e}function K9r(t,e){return pxt(V9r(t),e)}function sWc(t){Wv({customError:t})}function aWc(){return Wv().customError}function cWc(t){return fto(iwt,t)}function lWc(t){return Eto(owt,t)}function uWc(t){return Ito(swt,t)}function dWc(t){return wto(awt,t)}function fWc(t){return Fto(q9r,t)}function qzc(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function jzc(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function Tie(t){return t==="completed"||t==="failed"||t==="cancelled"}function cno(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function fl(t,e,r,n,o){t[e]=r,cno(t,e,n,o)}function T1(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?lno(e,t.currentPath):e.join("/")}}function Kzc(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==Cr.ZodAny&&(r.items=Pc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&fl(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&fl(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(fl(r,"minItems",t.exactLength.value,t.exactLength.message,e),fl(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function Jzc(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?fl(r,"minimum",n.value,n.message,e):fl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),fl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?fl(r,"maximum",n.value,n.message,e):fl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),fl(r,"maximum",n.value,n.message,e));break;case"multipleOf":fl(r,"multipleOf",n.value,n.message,e);break}return r}function Zzc(){return{type:"boolean"}}function uno(t,e){return Pc(t.type._def,e)}function dno(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>dno(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 eYc(t,e)}}function tYc(t,e){return{...Pc(t.innerType._def,e),default:t.defaultValue()}}function rYc(t,e){return e.effectStrategy==="input"?Pc(t.schema._def,e):T1(e)}function nYc(t){return{type:"string",enum:Array.from(t.values)}}function oYc(t,e){let r=[Pc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Pc(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(s=>{if(iYc(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 sYc(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 fno(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":fl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":fl(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":RN(r,"email",n.message,e);break;case"format:idn-email":RN(r,"idn-email",n.message,e);break;case"pattern:zod":Hv(r,wN.email,n.message,e);break}break;case"url":RN(r,"uri",n.message,e);break;case"uuid":RN(r,"uuid",n.message,e);break;case"regex":Hv(r,n.regex,n.message,e);break;case"cuid":Hv(r,wN.cuid,n.message,e);break;case"cuid2":Hv(r,wN.cuid2,n.message,e);break;case"startsWith":Hv(r,RegExp(`^${oFr(n.value,e)}`),n.message,e);break;case"endsWith":Hv(r,RegExp(`${oFr(n.value,e)}$`),n.message,e);break;case"datetime":RN(r,"date-time",n.message,e);break;case"date":RN(r,"date",n.message,e);break;case"time":RN(r,"time",n.message,e);break;case"duration":RN(r,"duration",n.message,e);break;case"length":fl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),fl(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Hv(r,RegExp(oFr(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&RN(r,"ipv4",n.message,e),n.version!=="v4"&&RN(r,"ipv6",n.message,e);break}case"base64url":Hv(r,wN.base64url,n.message,e);break;case"jwt":Hv(r,wN.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Hv(r,wN.ipv4Cidr,n.message,e),n.version!=="v4"&&Hv(r,wN.ipv6Cidr,n.message,e);break}case"emoji":Hv(r,wN.emoji(),n.message,e);break;case"ulid":{Hv(r,wN.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{RN(r,"binary",n.message,e);break}case"contentEncoding:base64":{fl(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Hv(r,wN.base64,n.message,e);break}}break}case"nanoid":Hv(r,wN.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function oFr(t,e){return e.patternStrategy==="escape"?cYc(t):t}function cYc(t){let e="";for(let r=0;ro.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):fl(t,"format",e,r,n)}function Hv(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:VYi(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):fl(t,"pattern",VYi(e,n),r,n)}function VYi(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(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({...n,[o]:Pc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??T1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Pc(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===Cr.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=fno(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}=uno(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function lYc(t,e){if(e.mapStrategy==="record")return pno(t,e);let r=Pc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||T1(e),n=Pc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||T1(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function uYc(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 dYc(t){return t.target==="openAi"?void 0:{not:T1({...t,currentPath:[...t.currentPath,"not"]})}}function fYc(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function pYc(t,e){if(e.target==="openApi3")return WYi(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Ext&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=Ext[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 WYi(t,e)}function hYc(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:Ext[t.innerType._def.typeName],nullable:!0}:{type:[Ext[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Pc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Pc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function mYc(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",cno(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?fl(r,"minimum",n.value,n.message,e):fl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),fl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?fl(r,"maximum",n.value,n.message,e):fl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),fl(r,"maximum",n.value,n.message,e));break;case"multipleOf":fl(r,"multipleOf",n.value,n.message,e);break}return r}function gYc(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=yYc(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Pc(u._def,{...e,currentPath:[...e.currentPath,"properties",l],propertyPath:[...e.currentPath,"properties",l]});f!==void 0&&(n.properties[l]=f,!d&&o.push(l))}o.length&&(n.required=o);let c=AYc(t,e);return c!==void 0&&(n.additionalProperties=c),n}function AYc(t,e){if(t.catchall._def.typeName!=="ZodNever")return Pc(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function yYc(t){try{return t.isOptional()}catch{return!0}}function vYc(t,e){return Pc(t.type._def,e)}function CYc(t,e){let r={type:"array",uniqueItems:!0,items:Pc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&fl(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&fl(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function bYc(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Pc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Pc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Pc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function SYc(t){return{not:T1(t)}}function TYc(t){return T1(t)}function Pc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==Wzc)return l}if(n&&!r){let l=wYc(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=xYc(t,t.typeName,e),c=typeof s=="function"?Pc(s(),e):s;if(c&&RYc(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function kYc(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function zYi(t,e){return MB(t)?m9r(t,{target:kYc(e?.target),io:e?.pipeStrategy??"input"}):PYc(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function YYi(t){let e=T8e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=Zto(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function KYi(t,e){let r=UFe(t,e);if(!r.success)throw r.error;return r.data}function JYi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function NYc(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];JYi(c)&&JYi(s)?r[o]={...c,...s}:r[o]=s}return r}function BYc(){let t=new MYc.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return OYc.default(t),t}function LYc(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 FYc(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 ZYi(t){return!!t&&typeof t=="object"&&hno in t}function UYc(t){return t[hno]?.complete}function qYc(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"),!QYc.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 jYc(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 eKi(t){let e=qYc(t);return jYc(t,e.warnings),e.isValid}function mno(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function gno(t){return"_def"in t||"_zod"in t||mno(t)}function m8r(t){return typeof t!="object"||t===null||gno(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(mno)}function tKi(t){if(t){if(m8r(t))return Q_e(t);if(!gno(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function GYc(t){let e=T8e(t);return e?Object.entries(e).map(([r,n])=>{let o=oVc(n),s=sVc(n);return{name:r,description:o,required:!s}}):[]}function jV(t){let e=T8e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=Zto(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function rKi(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function $Yc(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 VYc(t){let e=new h8r({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(!WYc(n))continue;let o=n.description;o&&!D9.has(n)&&D9.add(n,{description:o})}e.registerTool(r.name,{description:r.description,inputSchema:r.inputSchema,annotations:r.annotations,_meta:t.alwaysLoad?{"anthropic/alwaysLoad":!0,...r._meta}:r._meta},r.handler)}),{type:"sdk",name:t.name,instance:e}}function WYc(t){return typeof t=="object"&&t!==null&&"_zod"in t}function wr(t){let e;return()=>e??=t()}function YYc(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 uP("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 KYc(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:Nm(r)})}catch(s){throw new uP(`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 uP(`Failed to create session: ${n.status} ${n.statusText}${s?` \u2014 ${s}`:""}`,"session_create_failed")}let o=zYc().safeParse(await n.json());if(!o.success)throw new uP(`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 iKi(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function A8r(t,e,r){let n=JYc();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=xI(),c=Nm(o)+` -`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,yno.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function JYc(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function ZYc(t){let{buffer:e,bytesRead:r}=xI().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 XYc(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function eKc(t){let e=xI(),{resolvedPath:r,isSymlink:n}=uZi(e,t);n&&Jl(`Reading through symlink: ${t} -> ${r}`);let o=ZYc(r),s=e.readFileSync(r,{encoding:o}),c=XYc(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 yio(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}=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 `,` -`),encoding:o,lineEndings:c}}function mwt(t){return eKc(t).content}function Eno(t){return t.startsWith("\uFEFF")?t.slice(1):t}function iKc(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),_xt.default.platform==="darwin"?tKc(t):_xt.default.platform==="win32"?rKc(t):nKc(t)}function oKc(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||KE(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function sKc(){return oKc()==="essential-traffic"}function cKc(t){sFr.length>=aKc&&sFr.shift(),sFr.push(t)}function _no(t){let e=A8e(t);try{if(KE(process.env.CLAUDE_CODE_USE_BEDROCK)||KE(process.env.CLAUDE_CODE_USE_VERTEX)||KE(process.env.CLAUDE_CODE_USE_FOUNDRY)||KE(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||KE(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||sKc())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(cKc(r),uKi===null){lKc.push({type:"error",error:e});return}uKi.logError(e)}catch{}}function dKc(t,e,r=100){let n=new _8r({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 Sno(t,e){try{return{ok:!0,value:JSON.parse(Eno(t))}}catch(r){return e&&_no(r),{ok:!1}}}function SKc(){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:TFe(),shell:G.enum(bKc).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:TFe(),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:TFe(),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:TFe(),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:TFe(),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 UKc(t){return wno.has(t.toLowerCase())?!1:FKc.test(t)?!0:LKc.test(t)}function cJc(t){let e=sJc();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=aJc().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(Jl(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(Jl(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function Lno(){return EJc.filter(t=>ywt[t].buildGate())}function _Jc(t){let e={};for(let r of t)e={...e,...ywt[r].shape()};return e}function vJc(t){let e={};for(let r of t)e={...e,...ywt[r].permissionsShape?.()};return e}function CJc(t){let e=[];for(let r of t)e.push(...ywt[r].permissionModes?.()??[]);return e}function bJc(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 B_e(t){return Object.hasOwn(gKi,t)?gKi[t]:t}function SJc(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function TJc(t){let e=IJc(t,"(");if(e===-1)return{toolName:B_e(t)};let r=xJc(t,")");if(r===-1||r<=e)return{toolName:B_e(t)};if(r!==t.length-1)return{toolName:B_e(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:B_e(t)};if(o===""||o==="*")return{toolName:B_e(n)};let s=SJc(o);return{toolName:B_e(n),ruleContent:s}}function IJc(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function xJc(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 wJc(t){return Sxt.filePatternTools.includes(t)}function RJc(t){return Sxt.bashPrefixTools.includes(t)}function PJc(t){return Object.hasOwn(Sxt.customValidation,t)?Sxt.customValidation[t]:void 0}function Uno(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function cFr(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 "${gqc(String(n.toolName))}"`};let s=PJc(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(RJc(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(wJc(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 qno(t){return G.object({allow:G.array(lFr()).optional().describe("List of permission rules for allowed operations"),deny:G.array(lFr()).optional().describe("List of permission rules for denied operations"),ask:G.array(lFr()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum([...vUr,...CJc(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...vJc(t),additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function OJc(t){return G.object({$schema:G.literal(yJc).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:MJc().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...KE(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:DJc().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:qno(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(jno()).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(Hno()).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:Cxt().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=>AKi.includes(r)):e,G.union([G.boolean(),G.array(G.enum(AKi))])).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(),NJc()).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(bxt()).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(bxt()).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:mKc().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(_Kc),G.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:G.enum(AKc).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(gKc).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(yKc).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"),..._Jc(t)}).passthrough()}function FJc(t){let e=BJc.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=LJc[yqc(t.path,".")]),r}function yKi(t){return t.code==="invalid_type"}function EKi(t){return t.code==="invalid_value"}function UJc(t){return t.code==="unrecognized_keys"}function _Ki(t){return t.code==="too_small"}function V_e(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function vKi(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function N8e(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(EKi(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(yKi(r)){l=r.expected;let h=vKi(r.message);u=h??V_e(r.input),d=h??V_e(r.input)}else _Ki(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=FJc({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(EKi(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(yKi(r)){let h=vKi(r.message)??V_e(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(UJc(r)){let h=r.keys.join(", ");o=`Unrecognized ${Aqc(r.keys.length,"field")}: ${h}`}else _Ki(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 QJc(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=Qno(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 jJc(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=V_e(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(!qJc.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${Fxt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=V_e(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 GJc(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of HJc){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 ${V_e(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,Vno.execFile)(t,e,{encoding:"utf-8",timeout:WJc},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function KJc(){return(async()=>{if(process.platform==="darwin"){let t=zJc(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,Wno.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await IFe($Jc,[...VJc,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([IFe(t,["query",T8r,"/v",j_e]),IFe(t,["query",I8r,"/v",j_e])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if($no()){let[t,e]=await Promise.all([IFe(bKi,["query",T8r,"/v",j_e]),IFe(bKi,["query",I8r,"/v",j_e])]);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 JJc(){return YJc}function ZJc(){Ixt||(Ixt=(async()=>{let t=Date.now(),e=JJc()??KJc(),{mdm:r,hkcu:n,wslInherits:o}=nZc(await e);zno=r,Yno=n,Kno=o;let s=Date.now()-t;if(Jl(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){Jl(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{A8r("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function XJc(){Ixt||ZJc(),await Ixt}function eZc(){return zno??$V}function tZc(){return Yno??$V}function rZc(){return Kno}function uFr(t,e){let r=XV(gwt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=Pve(r,e),o=Rve().safeParse(r);if(!o.success){let s=N8e(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function SKi(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 nZc(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=uFr(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:$V,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=SKi(t.hklmStdout);c&&(r=uFr(c,`Registry: ${T8r}\\${j_e}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:$V,o=$no(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||oZc(),!s))return{mdm:n,hkcu:$V,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:$V,wslInherits:s}}if(iZc(s))return{mdm:n,hkcu:$V,wslInherits:s};if(t.hkcuStdout){let c=SKi(t.hkcuStdout);if(c){let l=uFr(c,`Registry: ${I8r}\\${j_e}`);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:$V,wslInherits:s}}function iZc(t){return t&&IKi(Txt)?!0:IKi(h8e())}function TKi(t){let e=XV(gwt(mwt(t),!1));if(!e||typeof e!="object")return!1;Pve(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function oZc(){function t(e){try{let r=gwt(mwt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,Nie.join)(Txt,"managed-settings.json")))return!0;try{let e=(0,Nie.join)(Txt,"managed-settings.d");for(let r of xI().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,Nie.join)(e,r.name)))return!0}catch{}return!1}function IKi(t){try{if(TKi((0,Nie.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,Nie.join)(t,"managed-settings.d"),r=xI().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(TKi((0,Nie.join)(e,n.name)))return!0}catch{}}catch{}return!1}function sZc(t,e,r){(r!==void 0&&!Uxt(t[e],r)||r===void 0&&!(e in t))&&Z8r(t,e,r)}function aZc(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 dZc(t){return bve(t)&&t6r(t)}function yZc(t){if(!bve(t)||g8e(t)!=pZc)return!1;var e=iZi(t);if(e===null)return!0;var r=gZc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Jno.call(r)==AZc}function _Zc(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function vZc(t){return PUc(t,tZi(t))}function bZc(t,e,r,n,o,s,c){var l=w8r(t,r),u=w8r(e,r),d=c.get(u);if(d){x8r(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=ZV(u),g=!m&&X8r(u),A=!m&&!g&&XJi(u);f=u,m||g||A?ZV(l)?f=l:fZc(l)?f=V7c(l):g?(h=!1,f=nZi(u,!0)):A?(h=!1,f=eQc(u,!0)):f=[]:EZc(u)||VFe(u)?(f=l,VFe(l)?f=CZc(l):(!M9(l)||q8r(l))&&(f=iQc(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),x8r(t,r,f)}function Zno(t,e,r,n,o){t!==e&&uZc(e,function(s,c){if(o||(o=new bUc),M9(s))SZc(t,e,c,r,Zno,n,o);else{var l=n?n(w8r(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),x8r(t,c,l)}},tZi)}function IZc(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 wZc(t,e,r){return e=xKi(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=xKi(n.length-e,0),c=Array(s);++o0){if(++e>=NZc)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function UZc(t,e){return eio(Xno(t,e,sZi),t+"")}function qZc(t,e,r){if(!M9(r))return!1;var n=typeof e;return(n=="number"?t6r(r)&&Hxt(e,r.length):n=="string"&&e in r)?Uxt(r[e],t):!1}function HZc(t){return QZc(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&&jZc(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?tio(l,e-1,r,n,o):z7c(o,l):n||(o[o.length]=l)}return o}function tXc(t){var e=t==null?0:t.length;return e?eXc(t,1):[]}function nXc(t){return eio(Xno(t,void 0,rXc),t+"")}function cXc(){return void 0??(0,rio.join)(vve(),sXc)}function lXc(){try{let t=mwt(cXc()),e=LN(Eno(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function uXc(){if(!void 0&&aXc!==!0)return null;if(fFr)return fFr;let t=lXc();return t?(fFr=t,s6r(),t):null}function bUr(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),AJc.filter(r=>e.has(r))}function dXc(){return(0,vy.join)(h8e(),"managed-settings.json")}function nio(t){if(Awt()==="wsl"&&t.wslInherits?.()){let e=pFr(Txt);if(e.settings)return e;let r=pFr(h8e());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return pFr(h8e())}function pFr(t){let e=[],r={},n=!1,{settings:o,errors:s}=xxt((0,vy.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=zV(r,o,YV),n=!0);let c=(0,vy.join)(t,"managed-settings.d");try{let d=xI().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}=xxt((0,vy.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=zV(r,h,YV),n=!0)}}catch(d){let f=II(d);f!=="ENOENT"&&f!=="ENOTDIR"&&Jl(`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 fXc(t,e){y8e(t)?Jl(`Broken symlink or missing file encountered for settings.json at path: ${e}`):Jl(`settings file read failed at ${e}: ${t}`,{level:"error"})}function xxt(t,e){let r=qQc(t);if(r)return{settings:r.settings?XV(r.settings):null,errors:r.errors};let n=pXc(t,e);return jQc(t,n),{settings:n.settings?XV(n.settings):null,errors:n.errors}}function iio(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 oio(t){let e=t?.remote?t.remote():uXc();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=XV(e),n=Pve(r,"remote managed settings"),o=Rve().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...N8e(o.error,"remote managed settings")]}}function sio(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=XV(e),n=Pve(r,"parent managed settings"),o=Rve().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...N8e(o.error,"parent managed settings")]}}function aio(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=XV(e),n=Pve(r,"SDK inline settings"),o=Rve().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...N8e(o.error,"SDK inline settings")]}}function pXc(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=uZi(xI(),t);r=mwt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=XV(gwt(r,!1)),o=Pve(n,t),s=Rve().safeParse(n);if(!s.success){let c=N8e(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return fXc(r,t),{settings:null,errors:[]}}}function RKi(t,e){switch(t){case"userSettings":return(0,vy.resolve)(vve());case"policySettings":case"projectSettings":case"localSettings":return(0,vy.resolve)(e.cwd);case"flagSettings":return e.flagPath?(0,vy.dirname)((0,vy.resolve)(e.flagPath)):(0,vy.resolve)(e.cwd)}}function hXc(t){return t.coworkPlugins||KE(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function wxt(t,e){switch(t){case"userSettings":return(0,vy.join)(RKi(t,e),hXc(e));case"projectSettings":case"localSettings":return(0,vy.join)(RKi(t,e),mXc(t));case"policySettings":return dXc();case"flagSettings":return e.flagPath}}function mXc(t){switch(t){case"projectSettings":return(0,vy.join)(".claude","settings.json");case"localSettings":return(0,vy.join)(".claude","settings.local.json")}}function cio(t,e){let r=FQc(t);if(r!==void 0)return r;let n=_Xc(t,e);return UQc(t,n),n}function gXc(t){return!t||t.parentSettingsBehavior==="merge"}function AXc(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=dFr(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=dFr(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=dFr(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 yXc(t){if(t.helper?.())return"helper";if(oio(t).settings)return"remote";if(iio(t).settings)return Awt()==="macos"?"plist":"hklm";if((t.file?.()??nio(t)).settings)return"file";if(sio(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function EXc(t){let e=[],{settings:r,errors:n}=oio(t);e.push(...n);let{settings:o,errors:s}=iio(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??nio(t);e.push(...l);let{settings:u,errors:d}=sio(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&&gXc(h)?AXc(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function lio(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=EXc(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:zV({},n??{},r??{},YV),errors:o}}function _Xc(t,e){if(t==="policySettings")return lio(e).settings;let r=wxt(t,e),{settings:n}=r?xxt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=aio(e);if(o)return zV(n||{},o,YV)}return n}function vXc(t,e){return HZi([...t,...e])}function YV(t,e){if(Array.isArray(t)&&Array.isArray(e))return vXc(t,e)}function CXc(t){if(hFr)return{settings:{},errors:[]};let e=Date.now();A8r("info","settings_load_started"),hFr=!0;try{let r=GQc(),n={};r&&(n=zV(n,r,YV));let o=[],s=new Set,c=new Set;for(let l of bUr(t)){if(l==="policySettings"){let{settings:d,errors:f}=lio(t);d&&(n=zV(n,d,YV));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=wxt(l,t);if(u){let d=(0,vy.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=xxt(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=zV(n,f,YV))}}if(l==="flagSettings"){let{settings:d,errors:f}=aio(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=zV(n,d,YV))}}return A8r("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{hFr=!1}}function bXc(t){let e=BQc();if(e!==null)return e;let r=CXc(t);return LQc(r),r}function SXc(t){let{settings:e}=bXc(t);return e||{}}function TXc(t){s6r();let e=[];for(let r of bUr(t)){let n=cio(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:SXc(t),sources:e}}function IXc(t,e){let r=bUr(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(cio(o,e)?.[t]!==void 0)return o}return null}function kXc(t){let e=t.effective.permissions?.defaultMode;if(!e||!RXc.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(PXc.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function DXc(t={}){await XJc();let e={cwd:(0,Ano.resolve)(t.cwd??xI().cwd()),allowedSources:(t.settingSources??wXc).map(r=>xXc[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:eZc,hkcu:tZc,wslInherits:rZc,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=TXc(e),o=yXc(e)??void 0,s=n.map(({source:l,settings:u})=>({source:PKi[l],settings:u,path:l==="policySettings"?void 0:wxt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=IXc(l,e);u&&(c[l]={source:PKi[u],path:u==="policySettings"?void 0:wxt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{s6r()}}async function NXc(t){return DXc(t)}async function MXc(t,e){try{await(0,JE.copyFile)(t,e)}catch(r){if(!y8e(r))throw r}}async function OXc(t,e){if(!t)return;let r=t;try{let n=LN(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=Nm(n))}catch{}await(0,JE.writeFile)(e,r,{mode:384})}function BXc(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=aHc(sHc);return new Promise(e=>{(0,XKi.execFile)("security",["find-generic-password","-a",lHc(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function uio(t,e,r,n,o=6e4){if(!yh(e))return;let s=yP(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,dc.join)((0,W_e.tmpdir)(),`claude-resume-${(0,Bxt.randomUUID)()}`);try{let u=(0,dc.join)(l,"projects",s);await(0,JE.mkdir)(u,{recursive:!0});let d=(0,dc.join)(u,`${e}.jsonl`);await GFr(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,dc.join)((0,W_e.homedir)(),".claude"),m;try{m=await(0,JE.readFile)((0,dc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!y8e(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await BXc()??m),await OXc(m,(0,dc.join)(l,".credentials.json")),await MXc((0,dc.join)(f??(0,W_e.homedir)(),".claude.json"),(0,dc.join)(l,".claude.json")),t.listSubkeys){let g=(0,dc.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,dc.resolve)(g,y+".jsonl");if(!y||(0,dc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!E.startsWith(g+dc.sep)){Jl(`[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 _)k8r(T)?v.push(T):b.push(T);if(b.length>0&&(await(0,JE.mkdir)((0,dc.dirname)(E),{recursive:!0}),await GFr(E,b)),v.length>0){let T=v.at(-1),w=(0,dc.resolve)(g,y+".meta.json");await(0,JE.mkdir)((0,dc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,JE.writeFile)(w,Nm(x),{mode:384})}}}return l}catch(u){throw await Rxt(l),u}}function R8r(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=gFr(),additionalDirectories:A=[],agent:y,agents:E,allowedTools:_=[],betas:v,canUseTool:b,continue:T,cwd:w,debug:R,debugFile:x,disallowedTools:P=[],tools:D,env:N,executable:B=lJi()?"bun":"node",executableArgs:L=[],extraArgs:j={},fallbackModel:M,enableFileCheckpointing:O,toolConfig:q,forkSession:Q,hooks:U,includeHookEvents:z,includePartialMessages:$,forwardSubagentText:W,onElicitation:J,persistSession:ne,sessionStore:H,sessionStoreFlush:re,thinking:ae,effort:Be,maxThinkingTokens:ve,maxTurns:Ue,maxBudgetUsd:Pe,taskBudget:Z,mcpServers:ee,model:K,outputFormat:he,permissionMode:X="default",allowDangerouslySkipPermissions:ue=!1,permissionPromptToolName:je,plugins:ie,getOAuthToken:le,getHostAuthToken:Ne,workload:we,resume:Le,resumeSessionAt:rt,sessionId:st,skills:_t,stderr:kt,strictMcpConfig:$t}=d;if(H&&ne===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(H&&T&&!Le&&!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&&Jl("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 Ht=d.pathToClaudeCodeExecutable;if(!Ht){let Ge=(0,rJi.fileURLToPath)(importMetaUrlShim),Y=(0,eJi.createRequire)(Ge),se=Hqc(me=>Y.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.`);Ht=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"),le&&(F.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ne&&(F.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),q?.askUserQuestion?.previewFormat&&(F.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=q.askUserQuestion.previewFormat);let be={};if(bYi.propagation.inject(bYi.context.active(),be),"traceparent"in be)for(let Ge of["TRACEPARENT","TRACESTATE"])Ge in(N??{})||delete F[Ge];for(let[Ge,Y]of Object.entries(be)){let se=Ge.toUpperCase();se in(N??{})||(F[se]=Y)}let Qe={},fe=new Map;if(ee)for(let[Ge,Y]of Object.entries(ee))Y.type==="sdk"&&Y.instance?fe.set(Ge,Y.instance):Qe[Ge]=Y;let Se;if(ae)switch(ae.type){case"adaptive":Se={type:"adaptive",display:ae.display};break;case"enabled":Se={type:"enabled",budgetTokens:ae.budgetTokens,display:ae.display};break;case"disabled":Se={type:"disabled"};break}else ve!==void 0&&(Se=ve===0?{type:"disabled"}:{type:"enabled",budgetTokens:ve});r&&(F.CLAUDE_CONFIG_DIR=r,process.platform==="win32"&&(F.CLAUDE_SECURESTORAGE_CONFIG_DIR=N?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??N?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??""));let Fe=new UFr({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:B,executableArgs:L,extraArgs:we?{...j,workload:we}:j,pathToClaudeCodeExecutable:Ht,env:F,forkSession:Q,stderr:kt,thinkingConfig:Se,effort:Be,maxTurns:Ue,maxBudgetUsd:Pe,taskBudget:Z,model:K,fallbackModel:M,jsonSchema:Ie,permissionMode:X,allowDangerouslySkipPermissions:ue,permissionPromptToolName:je,continueConversation:H?void 0:T,resume:Le,resumeSessionAt:rt,sessionId:st,settings:typeof s=="object"?Nm(s):s,managedSettings:c?Nm(c):void 0,settingSources:l,skills:_t,allowedTools:_,disallowedTools:P,tools:D,mcpServers:Qe,strictMcpConfig:$t,canUseTool:!!b,hooks:!!U,includeHookEvents:z,includePartialMessages:$,persistSession:ne,sessionMirror:!!H,plugins:ie,sandbox:u,spawnClaudeCodeProcess:d.spawnClaudeCodeProcess,deferSpawn:n}),te={systemPrompt:f,appendSystemPrompt:h,planModeInstructions:d.planModeInstructions,appendSubagentSystemPrompt:d.appendSubagentSystemPrompt,toolAliases:d.toolAliases,excludeDynamicSections:m,agents:E,title:d.title,skills:_t,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:W},Te=new qFr(Fe,e,b,U,g,fe,Ie,te,J,le,Ne);if(H){let Ge=a(()=>(0,dc.join)(F.CLAUDE_CONFIG_DIR??(0,dc.join)((0,W_e.homedir)(),".claude"),"projects"),"S6"),Y=re==="eager",se=new jFr(async(me,Ce)=>{let He=MKi(me,Ge());He?await H.append(He,Ce):Jl(`[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=MKi(me,Ge());He&&Te.reportMirrorError(He,Ce.message)},Y?0:c6r,Y?0:l6r);Te.setTranscriptMirrorBatcher(se)}return{queryInstance:Te,transport:Fe,abortController:g,processEnv:F}}function P8r(t,e,r,n){typeof r=="string"?e.write(Nm({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 Rxt(t){for(let e=0;;e++)try{return await(0,JE.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!LXc.has(II(r)??""))return;await iJi((e+1)*100)}}function FXc(t,e){t.waitForExit().catch(()=>{}).finally(()=>Rxt(e))}function UXc({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=R8r({...e},typeof t=="string",void 0,!0),d=(0,dc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await wie(f.listSessions(yP(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return uio(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(()=>FXc(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=A8e(g);c.spawnAbort(A),s.setError(A)}),P8r(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=R8r(e,typeof t=="string");return P8r(r,n,t,o),r}async function QXc({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,dc.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(yP(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await uio(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=R8r(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(()=>Rxt(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{P8r(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(()=>Rxt(r))}throw await c,l}}async function qXc(t,e){return e?.sessionStore?eel(e.sessionStore,t,e):Ijc(t,e)}async function jXc(t){return t?.sessionStore?ZXc(t.sessionStore,t):Njc(t)}async function HXc(t,e){return e?.sessionStore?tel(e.sessionStore,t,e):Mjc(t,e)}async function GXc(t,e,r){return r?.sessionStore?rel(r.sessionStore,t,e,r.dir):Ojc(t,e,r)}async function $Xc(t,e,r){return r?.sessionStore?nel(r.sessionStore,t,e,r.dir):Bjc(t,e,r)}async function VXc(t,e){if(!yh(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=yP(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return Ljc(t,e)}async function WXc(t,e){return e?.sessionStore?iel(e.sessionStore,t,e):Hjc(t,e)}async function zXc(t,e,r){if(!yh(t))throw Error(`Invalid sessionId: ${t}`);let n=await Vxt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=yP(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:c6r;if(await kKi(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,dc.join)(c,"subagents");for(let u of await YXc(l)){let d=(0,dc.relative)(c,u).split(dc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await kKi(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=LN(await(0,JE.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!y8e(m))throw m}}}async function kKi(t,e,r,n){let o=(0,tJi.createInterface)({input:(0,Lxt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push(LN(l)),c+=l.length,(s.length>=n||c>=l6r)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function YXc(t){let e=[];async function r(n){let o;try{o=await(0,JE.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,dc.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 KXc(t,e){return e?.sessionStore?oel(e.sessionStore,t,e.dir):Yjc(t,e)}async function JXc(t,e,r){return r?.sessionStore?sel(r.sessionStore,t,e,r):Kjc(t,e,r)}function dio(t){let e=(0,dc.resolve)(t??"."),r;try{r=(0,Lxt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function yP(t){return _8e(dio(t))}function fio(t){return t.map(e=>Nm(e)).join(` +`),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(` `)+` -`}function DKi(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function k8r(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function ZXc(t,e){let r=dio(e.dir),n=_8e(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 Jl("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=DKi(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await NKi(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=DKi(c,s,o);return NKi(t,l,e.dir,r)}async function NKi(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await hio(t,o.sessionId,r);if(!s)return null;let c=Wxt(o.sessionId,pio(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 pio(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,k9).toString("utf-8"),s=n>k9?r.subarray(n-k9).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function XXc(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` -`)+1);try{let n=LN(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 hio(t,e,r){let n=yP(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:fio(o)}async function eel(t,e,r){if(!yh(e))return[];let n=yP(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:Tjc(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function tel(t,e,r){if(!yh(e))return;let n=await hio(t,e,r.dir);if(!n)return;let o=pio(n,XXc(n));return Wxt(e,o)??void 0}async function rel(t,e,r,n){if(!yh(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=yP(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,Bxt.randomUUID)(),timestamp:new Date().toISOString()}])}async function nel(t,e,r,n){if(!yh(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=FFe(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=yP(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,Bxt.randomUUID)(),timestamp:new Date().toISOString()}])}async function iel(t,e,r){if(!yh(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!yh(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=yP(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}=$jc(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function oel(t,e,r){if(!yh(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=yP(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 sel(t,e,r,n){if(!yh(e))return[];if(!r)return[];let o=yP(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(k8r),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!k8r(f));return d.length===0?[]:UZi(Buffer.from(fio(d)),{limit:n.limit,offset:n.offset},u)}function MKi(t,e){let r=(0,dc.relative)(e,t),n=r.split(dc.sep);if(n[0]===".."||(0,dc.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 OKi,XKi,Bxt,Lxt,JE,eJi,W_e,dc,tJi,rJi,nJi,oJi,sJi,aJi,pJi,hJi,$Ji,PFr,VJi,Kg,WJi,PB,NFr,aZi,$It,XE,jie,vo,O0,lZi,kB,AZi,_Zi,HFr,vZi,DN,Z_e,CZi,bZi,SZi,TZi,Sve,Tve,$Fr,DB,Die,NFe,JIt,YFe,ZIt,QZi,qZi,Ano,Nie,yno,Xd,yUr,_xt,Tno,Ino,_Ur,v8r,Gno,Vno,Wno,vy,rio,w3c,R3c,mFr,P3c,k3c,N3c,M3c,D8r,jt,O3c,OB,L3c,F3c,U3c,Kd,Jd,Q3c,q3c,j3c,BKi,H3c,mve,G3c,N8r,$3c,gve,V3c,W3c,LKi,Pxt,z3c,FKi,Y3c,UKi,K3c,kxt,QKi,M8r,O8r,qKi,B8r,jKi,HKi,J3c,GKi,Z3c,X3c,eFc,tFc,rFc,nFc,iFc,oFc,sFc,aFc,cFc,lFc,uFc,dFc,fFc,pFc,hFc,mFc,uIt,wzi,Ps,pc,rW,Dxt,gFc,$Ki,VKi,dIt,AFc,BN,yFc,EFc,WKi,_Fc,Nxt,Mxt,L8r,Oxt,F8r,vFc,zKi,CFc,bFc,SFc,TFc,IFc,xFc,wFc,RFc,PFc,kFc,DFc,NFc,MFc,OFc,BFc,U8r,LFc,FFc,UFc,QFc,YKi,KKi,qFc,jFc,HFc,GFc,$Fc,JKi,VFc,WFc,zFc,YFc,KFc,JFc,ZFc,XFc,e8c,t8c,r8c,n8c,i8c,o8c,s8c,a8c,ZKi,c8c,l8c,u8c,d8c,Fxt,p8c,h8c,m8c,g8c,A8c,AFr,C1,C8c,uJi,b8c,S8c,Ave,T8c,JV,dJi,I8c,x8c,sFe,R8c,P8c,k8c,N8c,M8c,O8c,Rzi,g8e,M9,F8c,U8c,Q8c,q8c,q8r,H8c,L3r,Pzi,$8c,V8c,W8c,Y8c,K8c,J8c,Z8c,X8c,e6c,t6c,r6c,i6c,s6c,j8r,c6c,QFe,u6c,f6c,p6c,h6c,m6c,A6c,y6c,E6c,v6c,C6c,S6c,kzi,I6c,Uxt,Qxt,R6c,P6c,D6c,M6c,B6c,F6c,qxt,U6c,fJi,q6c,H6c,jxt,V6c,z6c,K6c,Z6c,H8r,X6c,Cy,vve,VVh,mJi,yFr,wi,$v,TI,z_e,fIt,pIt,hIt,mIt,gIt,AIt,yIt,EIt,_It,e9c,t9c,EFr,Dzi,n9c,gJi,i9c,VV,o9c,a9c,Mzi,Ozi,Bzi,$8r,d9c,p9c,h9c,EJi,vIt,m9c,g9c,W8r,A9c,Lzi,F3r,y9c,Zl,vFr,Kl,Fzi,Uzi,CIt,qzi,v9c,jzi,Iie,SJi,C9c,b9c,S9c,Y8r,T9c,IJi,CI,bI,Mie,aFe,Oie,CFr,wFe,bIt,qTt,SIt,bFr,Bie,ZE,PJi,kJi,K8r,Gzi,U9c,Q9c,SFr,DJi,q9c,j9c,Cd,NJi,mr,$zi,V9c,$n,TIt,BFe,IIt,xIt,wIt,RIt,jFe,PIt,kIt,Y_e,DIt,NIt,LJi,Y9c,L_e,K9c,J9c,QJi,sP,UV,P_e,cFe,jTt,lFe,uFe,HTt,dFe,T9,fFe,GTt,$Tt,Cie,VTt,WTt,pFe,U3r,Wzi,zTt,Q3r,q3r,j3r,zzi,Yzi,IFr,MIt,Z9c,X9c,hFe,k_e,bie,k0,v1,vI,P9,QV,mFe,Jzi,xFr,OIt,Xzi,tUc,Lie,BIt,LIt,K_e,FIt,HFe,UIt,GFe,b1,QIt,aP,qV,D_e,gFe,YTt,AFe,yFe,KTt,EFe,I9,_Fe,JTt,ZTt,Sie,XTt,eIt,vFe,H3r,rYi,G3r,$3r,V3r,W3r,nYi,iYi,wFr,qIt,$Fe,sYi,nUc,jIt,RFr,J8r,cIt,HJi,iUc,oUc,Rp,J_e,aUc,cUc,kFr,uUc,Pie,N_e,pUc,mUc,AUc,EUc,_Uc,CUc,bUc,SUc,GIt,Z8r,IUc,xUc,YJi,PUc,DUc,bve,MUc,aYi,KJi,BUc,LUc,FUc,VFe,UUc,ZV,RFe,qUc,JJi,cYi,jUc,lYi,HUc,GUc,X8r,$Uc,VUc,Hxt,zUc,e6r,KUc,JUc,ZUc,XUc,e7c,t7c,r7c,n7c,i7c,o7c,s7c,a7c,c7c,l7c,u7c,d7c,f7c,p7c,h7c,m7c,g7c,A7c,y7c,E7c,_d,v7c,b7c,PFe,ZJi,LFe,S7c,z3r,T7c,DFr,uYi,I7c,XJi,x7c,w7c,P7c,k7c,eZi,M7c,t6r,L7c,F7c,U7c,q7c,tZi,kFe,rZi,dYi,H7c,fYi,pYi,nZi,V7c,z7c,Y7c,iZi,K7c,hYi,Z7c,eQc,mYi,tQc,rQc,iQc,oQc,r6r,aQc,cQc,uQc,dQc,pQc,hQc,mQc,gQc,AQc,EQc,_Qc,gYi,AYi,vQc,bQc,Gxt,TQc,n6r,wQc,PQc,DQc,MQc,sZi,i6r,VIt,QQc,o6r,HQc,VQc,zQc,YQc,KQc,WVh,JQc,zVh,ZQc,YVh,XQc,KVh,eqc,JVh,MFr,nqc,oqc,fqc,pqc,ZVh,XVh,Eqc,EYi,_Yi,_qc,vqc,vYi,OFr,Sqc,Tqc,BFr,Iqc,dZi,fZi,wqc,Rqc,tIt,Y3r,CFe,K3r,LFr,gZi,eWh,Dqc,Zd,LN,Lqc,WIt,CYi,UFr,M_e,zIt,$qc,QFr,qFr,c6r,l6r,Wqc,jFr,bYi,J3r,Kqc,ejc,k9,rjc,WFe,sjc,ajc,cjc,KIt,ujc,zFe,djc,fjc,xjc,Qjc,Zjc,GZi,Xjc,eHc,tHc,rWh,SYi,rHc,iHc,sHc,cHc,fc,TYi,Rn,GV,hr,pP,uHc,KFe,dHc,WFr,Vv,to,MFe,S1,IYi,xYi,X_e,XIt,Jn,mP,wYi,ks,fHc,pHc,hHc,mHc,gHc,AHc,yHc,EHc,_Hc,tFr,vHc,CHc,bHc,SHc,THc,IHc,$Zi,xHc,eve,JFe,ZFe,XFe,e8e,t8e,tve,rve,r8e,KV,NB,n8e,eW,wI,nve,w9,zFr,ive,O9,KFr,i8e,o8e,JFr,ove,sve,ave,cve,Fie,NN,hP,B9,lve,uve,s8e,ext,txt,dve,nWh,Cr,iWh,oWh,sWh,aWh,cWh,lWh,uWh,dWh,fWh,pWh,hWh,mWh,gWh,AWh,MHc,yWh,EWh,_Wh,vWh,CWh,bWh,SWh,TWh,IWh,xWh,wWh,RWh,PWh,kWh,DWh,NWh,MWh,OWh,BWh,zZi,YZi,KZi,tW,rxt,Gs,f6r,XZi,GHc,nxt,eXi,rXi,nXi,ZFr,oXi,p6r,C8e,g6r,ixt,A6r,oxt,y6r,Zxt,E6r,Xxt,_6r,lXi,uXi,dXi,fXi,pXi,hXi,mXi,XHc,gXi,fve,eGc,tGc,rGc,AXi,nGc,iGc,oGc,sGc,aGc,EXi,_Xi,vXi,CXi,bXi,v6r,SXi,cGc,TXi,IXi,xXi,kXi,DXi,NXi,MXi,OXi,BXi,LXi,FXi,UXi,Eh,QXi,C6r,b6r,qXi,jXi,HXi,GXi,$Xi,VXi,WXi,zXi,YXi,b8e,KXi,JXi,ZXi,XXi,eeo,teo,reo,neo,ieo,sxt,oeo,Co,S8e,Nu,seo,aeo,ceo,leo,ueo,deo,feo,peo,heo,meo,geo,Aeo,yeo,Eeo,_eo,veo,Ceo,beo,Seo,Teo,xeo,weo,Peo,keo,T6r,Deo,I6r,x6r,Neo,Meo,Oeo,Beo,Leo,axt,Feo,Ueo,Qeo,w6r,R6r,P6r,qeo,jeo,ewt,Heo,Geo,$eo,Veo,Weo,zeo,k6r,Yeo,Keo,Jeo,Zeo,Xeo,eto,tto,rto,D6r,nto,ito,oto,sto,ato,N6r,lGc,dGc,pGc,mGc,AGc,EGc,vGc,CGc,bGc,SGc,IGc,wGc,PGc,DGc,MGc,BGc,FGc,QGc,jGc,GGc,VGc,zGc,KGc,ZGc,e$c,r$c,i$c,s$c,c$c,u$c,f$c,h$c,g$c,y$c,_$c,C$c,b$c,T$c,x$c,R$c,k$c,N$c,lto,uto,l8e,D9,pto,uxt,f8e,rVc,nVc,iVc,G,g9r,A9r,y9r,E9r,_9r,nro,aVc,I8e,iro,oro,sro,aro,Ds,v9r,iwt,bd,C9r,dxt,N9,b9r,S9r,T9r,I9r,x9r,w9r,R9r,P9r,k9r,D9r,N9r,M9r,O9r,B9r,L9r,F9r,cro,owt,Ive,swt,awt,U9r,lro,uro,dro,fro,pro,hro,mro,q9r,gro,lwt,j9r,Aro,yro,Ero,G9r,_ro,vro,p8e,Cro,bro,$9r,W9r,Sro,Tro,xro,z9r,Pro,kro,Nro,Y9r,Mro,Bro,Lro,Uro,dwt,nWc,oWc,Gro,pWc,$ro,Vro,hWc,xie,fwt,M0,Wro,zro,LWh,mWc,gWc,J9r,RI,x8e,AWc,by,gP,AP,Sy,pwt,Yro,GYi,Kro,yWc,Z9r,iIt,Li,X9r,EWc,FWh,UWh,eUr,_Wc,tUr,vWc,w8e,hve,Jro,CWc,bWc,SWc,TWc,IWc,xWc,Zro,wWc,RWc,Xro,rUr,PWc,kWc,nUr,DWc,R8e,P8e,NWc,k8e,hwt,MWc,hxt,iUr,oUr,sUr,QWh,aUr,cUr,lUr,OWc,eno,tno,uUr,rno,D8e,xve,nno,BWc,t8r,LWc,r8r,FWc,dUr,UWc,n8r,QWc,qWc,jWc,HWc,GWc,$Wc,VWc,WWc,zWc,YWc,i8r,KWc,JWc,o8r,fUr,pUr,hUr,ZWc,XWc,ezc,mUr,tzc,rzc,nzc,izc,ozc,ino,s8r,szc,gUr,qWh,azc,mxt,czc,jWh,gxt,lzc,ono,uzc,dzc,fzc,pzc,hzc,mzc,gzc,Axt,Azc,yzc,Ezc,AUr,sno,_zc,vzc,Czc,bzc,Szc,Tzc,Izc,xzc,wzc,Rzc,Pzc,kzc,Dzc,Nzc,Mzc,Ozc,Bzc,Lzc,yxt,Fzc,Uzc,Qzc,a8r,Hzc,Gzc,$zc,ano,Vzc,HWh,GWh,$Wh,VWh,WWh,zWh,di,c8r,Wzc,$Yi,zzc,Yzc,lno,Xzc,eYc,iYc,iFr,wN,aYc,Ext,WYi,EYc,_Yc,IYc,xYc,wYc,RYc,PYc,DYc,l8r,MYc,OYc,u8r,d8r,f8r,hno,XYi,QYc,p8r,h8r,HYc,SFe,nKi,zYc,uP,g8r,oKi,YWh,KWh,sKi,aKi,cKi,lKi,WV,EUr,q_e,tKc,rKc,nKc,JWh,aKc,sFr,lKc,uKi,ZWh,O_e,vno,y8r,Cno,vxt,dKi,uKc,HV,bno,$_e,E8r,_8r,fKc,fKi,gwt,Awt,ezh,tzh,rzh,h8e,nzh,pKc,hKc,mKc,gKc,AKc,yKc,EKc,_Kc,izh,vUr,vKc,CKc,ozh,szh,bKc,TFe,TKc,IKc,Cxt,azh,czh,wve,iW,xKc,wKc,xno,RKc,PKc,kKc,DKc,NKc,MKc,OKc,BKc,C8r,lzh,wno,LKc,FKc,ON,qie,pKi,b8r,S8r,Rno,CUr,QKc,uzh,qKc,jKc,HKc,GKc,$Kc,Pno,kno,VKc,hKi,WKc,zKc,Dno,YKc,KKc,mKi,JKc,ZKc,Nno,XKc,Mno,eJc,tJc,rJc,bxt,aFr,Ono,nJc,iJc,oJc,sJc,aJc,dzh,Bno,lJc,uJc,dJc,fJc,pJc,hJc,mJc,fzh,gJc,pzh,AJc,yJc,EJc,oIt,ywt,gKi,Fno,hzh,mzh,Sxt,lFr,DJc,gzh,NJc,jno,Hno,MJc,AKi,Rve,R9,BJc,LJc,Azh,qJc,HJc,CKi,T8r,I8r,j_e,$Jc,VJc,WJc,bKi,Txt,YJc,$V,zno,Yno,Kno,Ixt,x8r,cZc,lZc,uZc,fZc,pZc,hZc,mZc,Jno,gZc,AZc,EZc,w8r,CZc,SZc,TZc,xZc,xKi,Xno,PZc,kZc,DZc,NZc,MZc,OZc,LZc,FZc,eio,QZc,jZc,GZc,$Zc,zV,WZc,YZc,JZc,wKi,XZc,eXc,rXc,iXc,oXc,dFr,sXc,fFr,aXc,hFr,xXc,PKi,wXc,RXc,PXc,LXc,gio=_e(()=>{p();OKi=require("node:module"),XKi=require("child_process"),Bxt=require("crypto"),Lxt=require("fs"),JE=require("fs/promises"),eJi=require("module"),W_e=require("os"),dc=require("path"),tJi=require("readline"),rJi=require("url"),nJi=require("events"),oJi=require("child_process"),sJi=require("fs"),aJi=require("readline"),pJi=require("os"),hJi=require("path"),$Ji=require("crypto"),PFr=require("path"),VJi=require("async_hooks"),Kg=require("fs/promises"),WJi=require("crypto"),PB=require("fs/promises"),NFr=require("fs"),aZi=require("process"),$It=require("crypto"),XE=require("fs/promises"),jie=require("path"),vo=de(require("fs"),1),O0=require("fs/promises"),lZi=require("fs"),kB=require("path"),AZi=require("fs"),_Zi=require("fs/promises"),HFr=require("events"),vZi=require("fs"),DN=require("fs/promises"),Z_e=require("path"),CZi=require("child_process"),bZi=require("util"),SZi=require("child_process"),TZi=require("path"),Sve=require("fs/promises"),Tve=require("path"),$Fr=require("fs"),DB=require("fs/promises"),Die=require("path"),NFe=require("crypto"),JIt=require("path"),YFe=require("fs/promises"),ZIt=require("path"),QZi=require("crypto"),qZi=require("os"),Ano=require("path"),Nie=require("path"),yno=require("path"),Xd=de(require("node:path"),1),yUr=de(require("node:os"),1),_xt=de(require("node:process"),1),Tno=require("path"),Ino=require("fs/promises"),_Ur=require("os"),v8r=require("path"),Gno=require("os"),Vno=require("child_process"),Wno=require("fs"),vy=require("path"),rio=require("path"),w3c=Object.create,{getPrototypeOf:R3c,defineProperty:mFr,getOwnPropertyNames:P3c}=Object,k3c=Object.prototype.hasOwnProperty;a(D3c,"a_");D8r=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?N3c??=new WeakMap:M3c??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?w3c(R3c(t)):{};let c=e||!t||!t.__esModule?mFr(r,"default",{value:t,enumerable:!0}):r;for(let l of P3c(t))k3c.call(c,l)||mFr(c,l,{get:D3c.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),jt=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),O3c=a(t=>t,"$k");a(B3c,"Qk");OB=a((t,e)=>{for(var r in e)mFr(t,r,{get:e[r],enumerable:!0,configurable:!0,set:B3c.bind(e,r)})},"M4"),L3c=(0,OKi.createRequire)(importMetaUrlShim),F3c=Symbol.dispose||Symbol.for("Symbol.dispose"),U3c=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),Kd=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[U3c]),n===void 0&&(n=e[F3c]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),Jd=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$"),Q3c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),q3c=jt(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(Q3c(),t)}),j3c=jt(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(q3c(),t)}),BKi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),H3c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=BKi(),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)}),mve=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=j3c(),r=BKi(),n=H3c(),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}),G3c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=mve();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")}),N8r=jt(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={}))}),$3c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=N8r();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}),gve=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=G3c(),r=$3c(),n=N8r(),o=mve(),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}),V3c=jt(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}),W3c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),LKi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=gve(),r=V3c(),n=W3c(),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}),Pxt=jt(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}),z3c=jt(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}),Y3c=jt(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={}))}),UKi=jt(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)}}}),K3c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=Pxt();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}),kxt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=K3c(),r=mve(),n=gve(),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}),QKi=jt(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={}))}),M8r=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=QKi();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),O8r=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=M8r();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}),qKi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=Pxt(),r=O8r(),n=kxt(),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}),B8r=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=M8r(),r=O8r(),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}),jKi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=kxt(),r=qKi(),n=O8r(),o=B8r(),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")}),HKi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=jKi(),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}),J3c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=jKi();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),GKi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=HKi(),r=J3c(),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}),Z3c=jt(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={}))}),X3c=jt(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={}))}),eFc=jt(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={}))}),tFc=jt(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}),rFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=tFc(),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}),nFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=rFc();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),iFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=kxt();t.context=e.ContextAPI.getInstance()}),oFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=gve();t.diag=e.DiagAPI.instance()}),sFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=FKi();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),aFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=sFc(),r=mve(),n=gve(),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}),cFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=aFc();t.metrics=e.MetricsAPI.getInstance()}),lFc=jt(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}),uFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=kxt(),r=Pxt(),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}),dFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=mve(),r=lFc(),n=UKi(),o=uFc(),s=LKi(),c=gve(),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}),fFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=dFc();t.propagation=e.PropagationAPI.getInstance()}),pFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=mve(),r=GKi(),n=B8r(),o=qKi(),s=gve(),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}),hFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=pFc();t.trace=e.TraceAPI.getInstance()}),mFc=jt(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=LKi();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=Pxt();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=z3c();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=N8r();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=FKi();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=Y3c();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=UKi();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=HKi();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=GKi();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=Z3c();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=X3c();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=eFc();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=QKi();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=nFc();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=B8r();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=M8r();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 _=iFc();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return _.context},"get")});var v=oFc();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var b=cFc();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return b.metrics},"get")});var T=fFc();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=hFc();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}}),uIt=jt(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=uIt();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}),Ps=jt(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=uIt(),r=wzi(),n=uIt();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=wzi();Object.defineProperty(t,"Scope",{enumerable:!0,get:a(function(){return o.Scope},"get")}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:a(function(){return o.ValueScope},"get")}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:a(function(){return o.ValueScopeName},"get")}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:a(function(){return o.varKinds},"get")}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{static{a(this,"y1")}optimizeNodes(){return this}optimizeNames(H,re){return this}}class c extends s{static{a(this,"Lj")}constructor(H,re,ae){super(),this.varKind=H,this.name=re,this.rhs=ae}render({es5:H,_n:re}){let ae=H?r.varKinds.var:this.varKind,Be=this.rhs===void 0?"":` = ${this.rhs}`;return`${ae} ${this.name}${Be};`+re}optimizeNames(H,re){if(H[this.name.str])return this.rhs&&(this.rhs=M(this.rhs,H,re)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class l extends s{static{a(this,"NB")}constructor(H,re,ae){super(),this.lhs=H,this.rhs=re,this.sideEffects=ae}render({_n:H}){return`${this.lhs} = ${this.rhs};`+H}optimizeNames(H,re){if(!(this.lhs instanceof e.Name&&!H[this.lhs.str]&&!this.sideEffects))return this.rhs=M(this.rhs,H,re),this}get names(){let H=this.lhs instanceof e.Name?{}:{...this.lhs.names};return j(H,this.rhs)}}class u extends l{static{a(this,"jj")}constructor(H,re,ae,Be){super(H,ae,Be),this.op=re}render({_n:H}){return`${this.lhs} ${this.op}= ${this.rhs};`+H}}class d extends s{static{a(this,"Aj")}constructor(H){super(),this.label=H,this.names={}}render({_n:H}){return`${this.label}:`+H}}class f extends s{static{a(this,"Ij")}constructor(H){super(),this.label=H,this.names={}}render({_n:H}){return`break${this.label?` ${this.label}`:""};`+H}}class h extends s{static{a(this,"Rj")}constructor(H){super(),this.error=H}render({_n:H}){return`throw ${this.error};`+H}get names(){return this.error.names}}class m extends s{static{a(this,"Pj")}constructor(H){super(),this.code=H}render({_n:H}){return`${this.code};`+H}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(H,re){return this.code=M(this.code,H,re),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class g extends s{static{a(this,"LW")}constructor(H=[]){super(),this.nodes=H}render(H){return this.nodes.reduce((re,ae)=>re+ae.render(H),"")}optimizeNodes(){let{nodes:H}=this,re=H.length;for(;re--;){let ae=H[re].optimizeNodes();Array.isArray(ae)?H.splice(re,1,...ae):ae?H[re]=ae:H.splice(re,1)}return H.length>0?this:void 0}optimizeNames(H,re){let{nodes:ae}=this,Be=ae.length;for(;Be--;){let ve=ae[Be];ve.optimizeNames(H,re)||(O(H,ve.names),ae.splice(Be,1))}return ae.length>0?this:void 0}get names(){return this.nodes.reduce((H,re)=>L(H,re.names),{})}}class A extends g{static{a(this,"f1")}render(H){return"{"+H._n+super.render(H)+"}"+H._n}}class y extends g{static{a(this,"Ej")}}class E extends A{static{a(this,"RJ")}}E.kind="else";class _ extends A{static{a(this,"e4")}constructor(H,re){super(re),this.condition=H}render(H){let re=`if(${this.condition})`+super.render(H);return this.else&&(re+="else "+this.else.render(H)),re}optimizeNodes(){super.optimizeNodes();let H=this.condition;if(H===!0)return this.nodes;let re=this.else;if(re){let ae=re.optimizeNodes();re=this.else=Array.isArray(ae)?new E(ae):ae}if(re)return H===!1?re instanceof _?re:re.nodes:this.nodes.length?this:new _(q(H),re instanceof _?[re]:re.nodes);if(!(H===!1||!this.nodes.length))return this}optimizeNames(H,re){var ae;if(this.else=(ae=this.else)===null||ae===void 0?void 0:ae.optimizeNames(H,re),!!(super.optimizeNames(H,re)||this.else))return this.condition=M(this.condition,H,re),this}get names(){let H=super.names;return j(H,this.condition),this.else&&L(H,this.else.names),H}}_.kind="if";class v extends A{static{a(this,"q9")}}v.kind="for";class b extends v{static{a(this,"bj")}constructor(H){super(),this.iteration=H}render(H){return`for(${this.iteration})`+super.render(H)}optimizeNames(H,re){if(super.optimizeNames(H,re))return this.iteration=M(this.iteration,H,re),this}get names(){return L(super.names,this.iteration.names)}}class T extends v{static{a(this,"_j")}constructor(H,re,ae,Be){super(),this.varKind=H,this.name=re,this.from=ae,this.to=Be}render(H){let re=H.es5?r.varKinds.var:this.varKind,{name:ae,from:Be,to:ve}=this;return`for(${re} ${ae}=${Be}; ${ae}<${ve}; ${ae}++)`+super.render(H)}get names(){let H=j(super.names,this.from);return j(H,this.to)}}class w extends v{static{a(this,"BB")}constructor(H,re,ae,Be){super(),this.loop=H,this.varKind=re,this.name=ae,this.iterable=Be}render(H){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(H)}optimizeNames(H,re){if(super.optimizeNames(H,re))return this.iterable=M(this.iterable,H,re),this}get names(){return L(super.names,this.iterable.names)}}class R extends A{static{a(this,"wW")}constructor(H,re,ae){super(),this.name=H,this.args=re,this.async=ae}render(H){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(H)}}R.kind="func";class x extends g{static{a(this,"OW")}render(H){return"return "+super.render(H)}}x.kind="return";class P extends A{static{a(this,"kj")}render(H){let re="try"+super.render(H);return this.catch&&(re+=this.catch.render(H)),this.finally&&(re+=this.finally.render(H)),re}optimizeNodes(){var H,re;return super.optimizeNodes(),(H=this.catch)===null||H===void 0||H.optimizeNodes(),(re=this.finally)===null||re===void 0||re.optimizeNodes(),this}optimizeNames(H,re){var ae,Be;return super.optimizeNames(H,re),(ae=this.catch)===null||ae===void 0||ae.optimizeNames(H,re),(Be=this.finally)===null||Be===void 0||Be.optimizeNames(H,re),this}get names(){let H=super.names;return this.catch&&L(H,this.catch.names),this.finally&&L(H,this.finally.names),H}}class D extends A{static{a(this,"DW")}constructor(H){super(),this.error=H}render(H){return`catch(${this.error})`+super.render(H)}}D.kind="catch";class N extends A{static{a(this,"FW")}render(H){return"finally"+super.render(H)}}N.kind="finally";class B{static{a(this,"Sj")}constructor(H,re={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...re,_n:re.lines?` -`:""},this._extScope=H,this._scope=new r.Scope({parent:H}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(H){return this._scope.name(H)}scopeName(H){return this._extScope.name(H)}scopeValue(H,re){let ae=this._extScope.value(H,re);return(this._values[ae.prefix]||(this._values[ae.prefix]=new Set)).add(ae),ae}getScopeValue(H,re){return this._extScope.getValue(H,re)}scopeRefs(H){return this._extScope.scopeRefs(H,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(H,re,ae,Be){let ve=this._scope.toName(re);return ae!==void 0&&Be&&(this._constants[ve.str]=ae),this._leafNode(new c(H,ve,ae)),ve}const(H,re,ae){return this._def(r.varKinds.const,H,re,ae)}let(H,re,ae){return this._def(r.varKinds.let,H,re,ae)}var(H,re,ae){return this._def(r.varKinds.var,H,re,ae)}assign(H,re,ae){return this._leafNode(new l(H,re,ae))}add(H,re){return this._leafNode(new u(H,t.operators.ADD,re))}code(H){return typeof H=="function"?H():H!==e.nil&&this._leafNode(new m(H)),this}object(...H){let re=["{"];for(let[ae,Be]of H)re.length>1&&re.push(","),re.push(ae),(ae!==Be||this.opts.es5)&&(re.push(":"),(0,e.addCodeArg)(re,Be));return re.push("}"),new e._Code(re)}if(H,re,ae){if(this._blockNode(new _(H)),re&&ae)this.code(re).else().code(ae).endIf();else if(re)this.code(re).endIf();else if(ae)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(H){return this._elseNode(new _(H))}else(){return this._elseNode(new E)}endIf(){return this._endBlockNode(_,E)}_for(H,re){return this._blockNode(H),re&&this.code(re).endFor(),this}for(H,re){return this._for(new b(H),re)}forRange(H,re,ae,Be,ve=this.opts.es5?r.varKinds.var:r.varKinds.let){let Ue=this._scope.toName(H);return this._for(new T(ve,Ue,re,ae),()=>Be(Ue))}forOf(H,re,ae,Be=r.varKinds.const){let ve=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`,Pe=>{this.var(ve,e._`${Ue}[${Pe}]`),ae(ve)})}return this._for(new w("of",Be,ve,re),()=>ae(ve))}forIn(H,re,ae,Be=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(H,e._`Object.keys(${re})`,ae);let ve=this._scope.toName(H);return this._for(new w("in",Be,ve,re),()=>ae(ve))}endFor(){return this._endBlockNode(v)}label(H){return this._leafNode(new d(H))}break(H){return this._leafNode(new f(H))}return(H){let re=new x;if(this._blockNode(re),this.code(H),re.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(H,re,ae){if(!re&&!ae)throw Error('CodeGen: "try" without "catch" and "finally"');let Be=new P;if(this._blockNode(Be),this.code(H),re){let ve=this.name("e");this._currNode=Be.catch=new D(ve),re(ve)}return ae&&(this._currNode=Be.finally=new N,this.code(ae)),this._endBlockNode(D,N)}throw(H){return this._leafNode(new h(H))}block(H,re){return this._blockStarts.push(this._nodes.length),H&&this.code(H).endBlock(re),this}endBlock(H){let re=this._blockStarts.pop();if(re===void 0)throw Error("CodeGen: not in self-balancing block");let ae=this._nodes.length-re;if(ae<0||H!==void 0&&ae!==H)throw Error(`CodeGen: wrong number of nodes: ${ae} vs ${H} expected`);return this._nodes.length=re,this}func(H,re=e.nil,ae,Be){return this._blockNode(new R(H,re,ae)),Be&&this.code(Be).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize(H=1){for(;H-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(H){return this._currNode.nodes.push(H),this}_blockNode(H){this._currNode.nodes.push(H),this._nodes.push(H)}_endBlockNode(H,re){let ae=this._currNode;if(ae instanceof H||re&&ae instanceof re)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${re?`${H.kind}/${re.kind}`:H.kind}"`)}_elseNode(H){let re=this._currNode;if(!(re instanceof _))throw Error('CodeGen: "else" without "if"');return this._currNode=re.else=H,this}get _root(){return this._nodes[0]}get _currNode(){let H=this._nodes;return H[H.length-1]}set _currNode(H){let re=this._nodes;re[re.length-1]=H}}t.CodeGen=B;function L(ne,H){for(let re in H)ne[re]=(ne[re]||0)+(H[re]||0);return ne}a(L,"v0");function j(ne,H){return H instanceof e._CodeOrName?L(ne,H.names):ne}a(j,"ZW");function M(ne,H,re){if(ne instanceof e.Name)return ae(ne);if(!Be(ne))return ne;return new e._Code(ne._items.reduce((ve,Ue)=>(Ue instanceof e.Name&&(Ue=ae(Ue)),Ue instanceof e._Code?ve.push(...Ue._items):ve.push(Ue),ve),[]));function ae(ve){let Ue=re[ve.str];return Ue===void 0||H[ve.str]!==1?ve:(delete H[ve.str],Ue)}function Be(ve){return ve instanceof e._Code&&ve._items.some(Ue=>Ue instanceof e.Name&&H[Ue.str]===1&&re[Ue.str]!==void 0)}}a(M,"V9");function O(ne,H){for(let re in H)ne[re]=(ne[re]||0)-(H[re]||0)}a(O,"dp");function q(ne){return typeof ne=="boolean"||typeof ne=="number"||ne===null?!ne:e._`!${J(ne)}`}a(q,"vj"),t.not=q;var Q=W(t.operators.AND);function U(...ne){return ne.reduce(Q)}a(U,"np"),t.and=U;var z=W(t.operators.OR);function $(...ne){return ne.reduce(z)}a($,"op"),t.or=$;function W(ne){return(H,re)=>H===e.nil?re:re===e.nil?H:e._`${J(H)} ${ne} ${J(re)}`}a(W,"Cj");function J(ne){return ne instanceof e.Name?ne:e._`(${ne})`}a(J,"zB")}),pc=jt(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=Ps(),r=uIt();function n(R){let x={};for(let P of R)x[P]=!0;return x}a(n,"$d"),t.toHash=n;function o(R,x){return typeof x=="boolean"?x:Object.keys(x).length===0?!0:(s(R,x),!c(x,R.self.RULES.all))}a(o,"Qd"),t.alwaysValidSchema=o;function s(R,x=R.schema){let{opts:P,self:D}=R;if(!P.strictSchema||typeof x=="boolean")return;let N=D.RULES.keywords;for(let B in x)N[B]||w(R,`unknown keyword: "${B}"`)}a(s,"fj"),t.checkUnknownRules=s;function c(R,x){if(typeof R=="boolean")return!R;for(let P in R)if(x[P])return!0;return!1}a(c,"gj"),t.schemaHasRules=c;function l(R,x){if(typeof R=="boolean")return!R;for(let P in R)if(P!=="$ref"&&x.all[P])return!0;return!1}a(l,"Jd"),t.schemaHasRulesButRef=l;function u({topSchemaRef:R,schemaPath:x},P,D,N){if(!N){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return e._`${P}`}return e._`${R}${x}${(0,e.getProperty)(D)}`}a(u,"Xd"),t.schemaRefOrVal=u;function d(R){return m(decodeURIComponent(R))}a(d,"Yd"),t.unescapeFragment=d;function f(R){return encodeURIComponent(h(R))}a(f,"Wd"),t.escapeFragment=f;function h(R){return typeof R=="number"?`${R}`:R.replace(/~/g,"~0").replace(/\//g,"~1")}a(h,"OB"),t.escapeJsonPointer=h;function m(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}a(m,"hj"),t.unescapeJsonPointer=m;function g(R,x){if(Array.isArray(R))for(let P of R)x(P);else x(R)}a(g,"Gd"),t.eachItem=g;function A({mergeNames:R,mergeToName:x,mergeValues:P,resultToName:D}){return(N,B,L,j)=>{let M=L===void 0?B:L instanceof e.Name?(B instanceof e.Name?R(N,B,L):x(N,B,L),L):B instanceof e.Name?(x(N,L,B),B):P(B,L);return j===e.Name&&!(M instanceof e.Name)?D(N,M):M}}a(A,"xj"),t.mergeEvaluated={props:A({mergeNames:a((R,x,P)=>R.if(e._`${P} !== true && ${x} !== undefined`,()=>{R.if(e._`${x} === true`,()=>R.assign(P,!0),()=>R.assign(P,e._`${P} || {}`).code(e._`Object.assign(${P}, ${x})`))}),"mergeNames"),mergeToName:a((R,x,P)=>R.if(e._`${P} !== true`,()=>{x===!0?R.assign(P,!0):(R.assign(P,e._`${P} || {}`),E(R,P,x))}),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:{...R,...x},"mergeValues"),resultToName:y}),items:A({mergeNames:a((R,x,P)=>R.if(e._`${P} !== true && ${x} !== undefined`,()=>R.assign(P,e._`${x} === true ? true : ${P} > ${x} ? ${P} : ${x}`)),"mergeNames"),mergeToName:a((R,x,P)=>R.if(e._`${P} !== true`,()=>R.assign(P,x===!0?!0:e._`${P} > ${x} ? ${P} : ${x}`)),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:Math.max(R,x),"mergeValues"),resultToName:a((R,x)=>R.var("items",x),"resultToName")})};function y(R,x){if(x===!0)return R.var("props",!0);let P=R.var("props",e._`{}`);return x!==void 0&&E(R,P,x),P}a(y,"uj"),t.evaluatedPropsToName=y;function E(R,x,P){Object.keys(P).forEach(D=>R.assign(e._`${x}${(0,e.getProperty)(D)}`,!0))}a(E,"DB"),t.setEvaluated=E;var _={};function v(R,x){return R.scopeValue("func",{ref:x,code:_[x.code]||(_[x.code]=new r._Code(x.code))})}a(v,"Ud"),t.useFunc=v;var b;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(b||(t.Type=b={}));function T(R,x,P){if(R instanceof e.Name){let D=x===b.Num;return P?D?e._`"[" + ${R} + "]"`:e._`"['" + ${R} + "']"`:D?e._`"/" + ${R}`:e._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(R).toString():"/"+h(R)}a(T,"Hd"),t.getErrorPath=T;function w(R,x,P=R.opts.strictSchema){if(P){if(x=`strict mode: ${x}`,P===!0)throw Error(x);R.self.logger.warn(x)}}a(w,"mj"),t.checkStrictMode=w}),rW=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),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}),Dxt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Ps(),r=pc(),n=rW();t.keywordError={message:a(({keyword:E})=>e.str`must pass "${E}" keyword validation`,"message")},t.keyword$DataError={message:a(({keyword:E,schemaType:_})=>_?e.str`"${E}" keyword must be ${_} ($data)`:e.str`"${E}" keyword is invalid ($data)`,"message")};function o(E,_=t.keywordError,v,b){let{it:T}=E,{gen:w,compositeRule:R,allErrors:x}=T,P=h(E,_,v);b??(R||x)?u(w,P):d(T,e._`[${P}]`)}a(o,"bd"),t.reportError=o;function s(E,_=t.keywordError,v){let{it:b}=E,{gen:T,compositeRule:w,allErrors:R}=b,x=h(E,_,v);u(T,x),!(w||R)&&d(b,n.default.vErrors)}a(s,"_d"),t.reportExtraError=s;function c(E,_){E.assign(n.default.errors,_),E.if(e._`${n.default.vErrors} !== null`,()=>E.if(_,()=>E.assign(e._`${n.default.vErrors}.length`,_),()=>E.assign(n.default.vErrors,null)))}a(c,"kd"),t.resetErrorsCount=c;function l({gen:E,keyword:_,schemaValue:v,data:b,errsCount:T,it:w}){if(T===void 0)throw Error("ajv implementation error");let R=E.name("err");E.forRange("i",T,n.default.errors,x=>{E.const(R,e._`${n.default.vErrors}[${x}]`),E.if(e._`${R}.instancePath === undefined`,()=>E.assign(e._`${R}.instancePath`,(0,e.strConcat)(n.default.instancePath,w.errorPath))),E.assign(e._`${R}.schemaPath`,e.str`${w.errSchemaPath}/${_}`),w.opts.verbose&&(E.assign(e._`${R}.schema`,v),E.assign(e._`${R}.data`,b))})}a(l,"Sd"),t.extendErrors=l;function u(E,_){let v=E.const("err",_);E.if(e._`${n.default.vErrors} === null`,()=>E.assign(n.default.vErrors,e._`[${v}]`),e._`${n.default.vErrors}.push(${v})`),E.code(e._`${n.default.errors}++`)}a(u,"dj");function d(E,_){let{gen:v,validateName:b,schemaEnv:T}=E;T.$async?v.throw(e._`new ${E.ValidationError}(${_})`):(v.assign(e._`${b}.errors`,_),v.return(!1))}a(d,"ij");var f={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function h(E,_,v){let{createErrors:b}=E.it;return b===!1?e._`{}`:m(E,_,v)}a(h,"nj");function m(E,_,v={}){let{gen:b,it:T}=E,w=[g(T,v),A(E,v)];return y(E,_,w),b.object(...w)}a(m,"vd");function g({errorPath:E},{instancePath:_}){let v=_?e.str`${E}${(0,r.getErrorPath)(_,r.Type.Str)}`:E;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,v)]}a(g,"Cd");function A({keyword:E,it:{errSchemaPath:_}},{schemaPath:v,parentSchema:b}){let T=b?_:e.str`${_}/${E}`;return v&&(T=e.str`${T}${(0,r.getErrorPath)(v,r.Type.Str)}`),[f.schemaPath,T]}a(A,"Td");function y(E,{params:_,message:v},b){let{keyword:T,data:w,schemaValue:R,it:x}=E,{opts:P,propertyName:D,topSchemaRef:N,schemaPath:B}=x;b.push([f.keyword,T],[f.params,typeof _=="function"?_(E):_||e._`{}`]),P.messages&&b.push([f.message,typeof v=="function"?v(E):v]),P.verbose&&b.push([f.schema,R],[f.parentSchema,e._`${N}${B}`],[n.default.data,w]),D&&b.push([f.propertyName,D])}a(y,"xd")}),gFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=Dxt(),r=Ps(),n=rW(),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")}),$Ki=jt(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}),VKi=jt(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}),dIt=jt(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=$Ki(),r=VKi(),n=Dxt(),o=Ps(),s=pc(),c;(function(b){b[b.Correct=0]="Correct",b[b.Wrong=1]="Wrong"})(c||(t.DataType=c={}));function l(b){let T=u(b.type);if(T.includes("null")){if(b.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!T.length&&b.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');b.nullable===!0&&T.push("null")}return T}a(l,"Yi"),t.getSchemaTypes=l;function u(b){let T=Array.isArray(b)?b:b?[b]:[];if(T.every(e.isJSONType))return T;throw Error("type must be JSONType or JSONType[]: "+T.join(","))}a(u,"UA"),t.getJSONTypes=u;function d(b,T){let{gen:w,data:R,opts:x}=b,P=h(T,x.coerceTypes),D=T.length>0&&!(P.length===0&&T.length===1&&(0,r.schemaHasRulesForType)(b,T[0]));if(D){let N=y(T,R,x.strictNumbers,c.Wrong);w.if(N,()=>{P.length?m(b,T,P):_(b)})}return D}a(d,"Wi"),t.coerceAndCheckDataType=d;var f=new Set(["string","number","integer","boolean","null"]);function h(b,T){return T?b.filter(w=>f.has(w)||T==="array"&&w==="array"):[]}a(h,"Gi");function m(b,T,w){let{gen:R,data:x,opts:P}=b,D=R.let("dataType",o._`typeof ${x}`),N=R.let("coerced",o._`undefined`);P.coerceTypes==="array"&&R.if(o._`${D} == 'object' && Array.isArray(${x}) && ${x}.length == 1`,()=>R.assign(x,o._`${x}[0]`).assign(D,o._`typeof ${x}`).if(y(T,x,P.strictNumbers),()=>R.assign(N,x))),R.if(o._`${N} !== undefined`);for(let L of w)(f.has(L)||L==="array"&&P.coerceTypes==="array")&&B(L);R.else(),_(b),R.endIf(),R.if(o._`${N} !== undefined`,()=>{R.assign(x,N),g(b,N)});function B(L){switch(L){case"string":R.elseIf(o._`${D} == "number" || ${D} == "boolean"`).assign(N,o._`"" + ${x}`).elseIf(o._`${x} === null`).assign(N,o._`""`);return;case"number":R.elseIf(o._`${D} == "boolean" || ${x} === null +`}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 || (${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(B,"H")}a(m,"Ui");function g({gen:b,parentData:T,parentDataProperty:w},R){b.if(o._`${T} !== undefined`,()=>b.assign(o._`${T}[${w}]`,R))}a(g,"Hi");function A(b,T,w,R=c.Correct){let x=R===c.Correct?o.operators.EQ:o.operators.NEQ,P;switch(b){case"null":return o._`${T} ${x} null`;case"array":P=o._`Array.isArray(${T})`;break;case"object":P=o._`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":P=D(o._`!(${T} % 1) && !isNaN(${T})`);break;case"number":P=D();break;default:return o._`typeof ${T} ${x} ${b}`}return R===c.Correct?P:(0,o.not)(P);function D(N=o.nil){return(0,o.and)(o._`typeof ${T} == "number"`,N,w?o._`isFinite(${T})`:o.nil)}}a(A,"LB"),t.checkDataType=A;function y(b,T,w,R){if(b.length===1)return A(b[0],T,w,R);let x,P=(0,s.toHash)(b);if(P.array&&P.object){let D=o._`typeof ${T} != "object"`;x=P.null?D:o._`!${T} || ${D}`,delete P.null,delete P.array,delete P.object}else x=o.nil;P.number&&delete P.integer;for(let D in P)x=(0,o.and)(x,A(D,T,w,R));return x}a(y,"jB"),t.checkDataTypes=y;var E={message:a(({schema:b})=>`must be ${b}`,"message"),params:a(({schema:b,schemaValue:T})=>typeof b=="string"?o._`{type: ${b}}`:o._`{type: ${T}}`,"params")};function _(b){let T=v(b);(0,n.reportError)(T,E)}a(_,"AB"),t.reportTypeError=_;function v(b){let{gen:T,data:w,schema:R}=b,x=(0,s.schemaRefOrVal)(b,R,"type");return{gen:T,keyword:"type",data:w,schema:R.type,schemaCode:x,schemaValue:x,parentSchema:R,params:{},it:b}}a(v,"qi")}),AFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=Ps(),r=pc();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")}),BN=jt(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=Ps(),r=pc(),n=rW(),o=pc();function s(b,T){let{gen:w,data:R,it:x}=b;w.if(h(w,R,T,x.opts.ownProperties),()=>{b.setParams({missingProperty:e._`${T}`},!0),b.error()})}a(s,"Mi"),t.checkReportMissingProp=s;function c({gen:b,data:T,it:{opts:w}},R,x){return(0,e.or)(...R.map(P=>(0,e.and)(h(b,T,P,w.ownProperties),e._`${x} = ${P}`)))}a(c,"Li"),t.checkMissingProp=c;function l(b,T){b.setParams({missingProperty:T},!0),b.error()}a(l,"ji"),t.reportMissingProp=l;function u(b){return b.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}a(u,"wA"),t.hasPropFunc=u;function d(b,T,w){return e._`${u(b)}.call(${T}, ${w})`}a(d,"RB"),t.isOwnProperty=d;function f(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} !== undefined`;return R?e._`${x} && ${d(b,T,w)}`:x}a(f,"Ai"),t.propertyInData=f;function h(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} === undefined`;return R?(0,e.or)(x,(0,e.not)(d(b,T,w))):x}a(h,"PB"),t.noPropertyInData=h;function m(b){return b?Object.keys(b).filter(T=>T!=="__proto__"):[]}a(m,"OA"),t.allSchemaProperties=m;function g(b,T){return m(T).filter(w=>!(0,r.alwaysValidSchema)(b,T[w]))}a(g,"Ii"),t.schemaProperties=g;function A({schemaCode:b,data:T,it:{gen:w,topSchemaRef:R,schemaPath:x,errorPath:P},it:D},N,B,L){let j=L?e._`${b}, ${T}, ${R}${x}`:T,M=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,P)],[n.default.parentData,D.parentData],[n.default.parentDataProperty,D.parentDataProperty],[n.default.rootData,n.default.rootData]];D.opts.dynamicRef&&M.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);let O=e._`${j}, ${w.object(...M)}`;return B!==e.nil?e._`${N}.call(${B}, ${O})`:e._`${N}(${O})`}a(A,"Ri"),t.callValidateCode=A;var y=e._`new RegExp`;function E({gen:b,it:{opts:T}},w){let R=T.unicodeRegExp?"u":"",{regExp:x}=T.code,P=x(w,R);return b.scopeValue("pattern",{key:P.toString(),ref:P,code:e._`${x.code==="new RegExp"?y:(0,o.useFunc)(b,x)}(${w}, ${R})`})}a(E,"Ei"),t.usePattern=E;function _(b){let{gen:T,data:w,keyword:R,it:x}=b,P=T.name("valid");if(x.allErrors){let N=T.let("valid",!0);return D(()=>T.assign(N,!1)),N}return T.var(P,!0),D(()=>T.break()),P;function D(N){let B=T.const("len",e._`${w}.length`);T.forRange("i",0,B,L=>{b.subschema({keyword:R,dataProp:L,dataPropType:r.Type.Num},P),T.if((0,e.not)(P),N)})}}a(_,"bi"),t.validateArray=_;function v(b){let{gen:T,schema:w,keyword:R,it:x}=b;if(!Array.isArray(w))throw Error("ajv implementation error");if(w.some(N=>(0,r.alwaysValidSchema)(x,N))&&!x.opts.unevaluated)return;let P=T.let("valid",!1),D=T.name("_valid");T.block(()=>w.forEach((N,B)=>{let L=b.subschema({keyword:R,schemaProp:B,compositeRule:!0},D);T.assign(P,e._`${P} || ${D}`),!b.mergeValidEvaluated(L,D)&&T.if((0,e.not)(P))})),b.result(P,()=>b.reset(),()=>b.error(!0))}a(v,"_i"),t.validateUnion=v}),yFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=Ps(),r=rW(),n=BN(),o=Dxt();function s(g,A){let{gen:y,keyword:E,schema:_,parentSchema:v,it:b}=g,T=A.macro.call(b.self,_,v,b),w=f(y,E,T);b.opts.validateSchema!==!1&&b.self.validateSchema(T,!0);let R=y.name("valid");g.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${b.errSchemaPath}/${E}`,topSchemaRef:w,compositeRule:!0},R),g.pass(R,()=>g.error(!0))}a(s,"pi"),t.macroKeywordCode=s;function c(g,A){var y;let{gen:E,keyword:_,schema:v,parentSchema:b,$data:T,it:w}=g;d(w,A);let R=!T&&A.compile?A.compile.call(w.self,v,b,w):A.validate,x=f(E,_,R),P=E.let("valid");g.block$data(P,D),g.ok((y=A.valid)!==null&&y!==void 0?y:P);function D(){if(A.errors===!1)L(),A.modifying&&l(g),j(()=>g.error());else{let M=A.async?N():B();A.modifying&&l(g),j(()=>u(g,M))}}a(D,"z");function N(){let M=E.let("ruleErrs",null);return E.try(()=>L(e._`await `),O=>E.assign(P,!1).if(e._`${O} instanceof ${w.ValidationError}`,()=>E.assign(M,e._`${O}.errors`),()=>E.throw(O))),M}a(N,"N");function B(){let M=e._`${x}.errors`;return E.assign(M,null),L(e.nil),M}a(B,"w");function L(M=A.async?e._`await `:e.nil){let O=w.opts.passContext?r.default.this:r.default.self,q=!("compile"in A&&!T||A.schema===!1);E.assign(P,e._`${M}${(0,n.callValidateCode)(g,x,O,q)}`,A.modifying)}a(L,"O");function j(M){var O;E.if((0,e.not)((O=A.valid)!==null&&O!==void 0?O:P),M)}a(j,"D")}a(c,"di"),t.funcKeywordCode=c;function l(g){let{gen:A,data:y,it:E}=g;A.if(E.parentData,()=>A.assign(y,e._`${E.parentData}[${E.parentDataProperty}]`))}a(l,"ZA");function u(g,A){let{gen:y}=g;y.if(e._`Array.isArray(${A})`,()=>{y.assign(r.default.vErrors,e._`${r.default.vErrors} === null ? ${A} : ${r.default.vErrors}.concat(${A})`).assign(r.default.errors,e._`${r.default.vErrors}.length`),(0,o.extendErrors)(g)},()=>g.error())}a(u,"ii");function d({schemaEnv:g},A){if(A.async&&!g.$async)throw Error("async keyword in sync schema")}a(d,"ni");function f(g,A,y){if(y===void 0)throw Error(`keyword "${A}" failed to compile`);return g.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}a(f,"MA");function h(g,A,y=!1){return!A.length||A.some(E=>E==="array"?Array.isArray(g):E==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==E||y&&typeof g>"u")}a(h,"ri"),t.validSchemaType=h;function m({schema:g,opts:A,self:y,errSchemaPath:E},_,v){if(Array.isArray(_.keyword)?!_.keyword.includes(v):_.keyword!==v)throw Error("ajv implementation error");let b=_.dependencies;if(b?.some(T=>!Object.prototype.hasOwnProperty.call(g,T)))throw Error(`parent schema must have dependencies of ${v}: ${b.join(",")}`);if(_.validateSchema&&!_.validateSchema(g[v])){let T=`keyword "${v}" value is invalid at path "${E}": `+y.errorsText(_.validateSchema.errors);if(A.validateSchema==="log")y.logger.error(T);else throw Error(T)}}a(m,"oi"),t.validateKeywordUsage=m}),EFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=Ps(),r=pc();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}),WKi=jt((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},"$")}),_Fc=jt((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=pc(),r=WKi(),n=_Fc(),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(E,_=!0){return typeof E=="boolean"?!0:_===!0?!l(E):_?u(E)<=_:!1}a(s,"Kn"),t.inlineRef=s;var c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(E){for(let _ in E){if(c.has(_))return!0;let v=E[_];if(Array.isArray(v)&&v.some(l)||typeof v=="object"&&l(v))return!0}return!1}a(l,"bB");function u(E){let _=0;for(let v in E){if(v==="$ref")return 1/0;if(_++,!o.has(v)&&(typeof E[v]=="object"&&(0,e.eachItem)(E[v],b=>_+=u(b)),_===1/0))return 1/0}return _}a(u,"SA");function d(E,_="",v){v!==!1&&(_=m(_));let b=E.parse(_);return f(E,b)}a(d,"vA"),t.getFullPath=d;function f(E,_){return E.serialize(_).split("#")[0]+"#"}a(f,"CA"),t._getFullPath=f;var h=/#\/?$/;function m(E){return E?E.replace(h,""):""}a(m,"N9"),t.normalizeId=m;function g(E,_,v){return v=m(v),E.resolve(_,v)}a(g,"Bn"),t.resolveUrl=g;var A=/^[a-z_][-a-z0-9._]*$/i;function y(E,_){if(typeof E=="boolean")return{};let{schemaId:v,uriResolver:b}=this.opts,T=m(E[v]||_),w={"":T},R=d(b,T,!1),x={},P=new Set;return n(E,{allKeys:!0},(B,L,j,M)=>{if(M===void 0)return;let O=R+L,q=w[M];typeof B[v]=="string"&&(q=Q.call(this,B[v])),U.call(this,B.$anchor),U.call(this,B.$dynamicAnchor),w[L]=q;function Q(z){let $=this.opts.uriResolver.resolve;if(z=m(q?$(q,z):z),P.has(z))throw N(z);P.add(z);let W=this.refs[z];return typeof W=="string"&&(W=this.refs[W]),typeof W=="object"?D(B,W.schema,z):z!==m(O)&&(z[0]==="#"?(D(B,x[z],z),x[z]=B):this.refs[z]=O),z}a(Q,"M");function U(z){if(typeof z=="string"){if(!A.test(z))throw Error(`invalid anchor "${z}"`);Q.call(this,`#${z}`)}}a(U,"j")}),x;function D(B,L,j){if(L!==void 0&&!r(B,L))throw N(j)}function N(B){return Error(`reference "${B}" resolves to more than one schema`)}}a(y,"Nn"),t.getSchemaRefs=y}),Mxt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=gFc(),r=dIt(),n=VKi(),o=dIt(),s=AFc(),c=yFc(),l=EFc(),u=Ps(),d=rW(),f=Nxt(),h=pc(),m=Dxt();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:X,opts:ue},je){ue.code.es5?ee.func(K,u._`${d.default.data}, ${d.default.valCxt}`,X.$async,()=>{ee.code(u._`"use strict"; ${b(he,ue)}`),E(ee,ue),ee.code(je)}):ee.func(K,u._`${d.default.data}, ${y(ue)}`,X.$async,()=>ee.code(b(he,ue)).code(je))}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:X}=ee;A(ee,()=>{he.$comment&&K.$comment&&M(ee),B(ee),X.let(d.default.vErrors,null),X.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:X,opts:ue}=ee;ue.$comment&&he.$comment&&M(ee),L(ee),j(ee);let je=X.const("_errs",d.default.errors);D(ee,je),X.var(K,u._`${je} === ${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),X=(0,r.coerceAndCheckDataType)(ee,he);Q(ee,he,!X,K)}a(D,"dA");function N(ee){let{schema:K,errSchemaPath:he,opts:X,self:ue}=ee;K.$ref&&X.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(K,ue.RULES)&&ue.logger.warn(`$ref: keywords ignored in schema at path "${he}"`)}a(N,"_n");function B(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(B,"kn");function L(ee){let K=ee.schema[ee.opts.schemaId];K&&(ee.baseId=(0,f.resolveUrl)(ee.opts.uriResolver,ee.baseId,K))}a(L,"Sn");function j(ee){if(ee.schema.$async&&!ee.schemaEnv.$async)throw Error("async schema in sync schema")}a(j,"vn");function M({gen:ee,schemaEnv:K,schema:he,errSchemaPath:X,opts:ue}){let je=he.$comment;if(ue.$comment===!0)ee.code(u._`${d.default.self}.logger.log(${je})`);else if(typeof ue.$comment=="function"){let ie=u.str`${X}/$comment`,le=ee.scopeValue("root",{ref:K.root});ee.code(u._`${d.default.self}.opts.$comment(${je}, ${ie}, ${le}.schema)`)}}a(M,"iA");function O(ee){let{gen:K,schemaEnv:he,validateName:X,ValidationError:ue,opts:je}=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._`${X}.errors`,d.default.vErrors),je.unevaluated&&q(ee),K.return(u._`${d.default.errors} === 0`))}a(O,"Cn");function q({gen:ee,evaluated:K,props:he,items:X}){he instanceof u.Name&&ee.assign(u._`${K}.props`,he),X instanceof u.Name&&ee.assign(u._`${K}.items`,X)}a(q,"Tn");function Q(ee,K,he,X){let{gen:ue,schema:je,data:ie,allErrors:le,opts:Ne,self:we}=ee,{RULES:Le}=we;if(je.$ref&&(Ne.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(je,Le))){ue.block(()=>ve(ee,"$ref",Le.all.$ref.definition));return}Ne.jtd||z(ee,K),ue.block(()=>{for(let st of Le.rules)rt(st);rt(Le.post)});function rt(st){(0,n.shouldUseGroup)(je,st)&&(st.type?(ue.if((0,o.checkDataType)(st.type,ie,Ne.strictNumbers)),U(ee,st),K.length===1&&K[0]===st.type&&he&&(ue.else(),(0,o.reportTypeError)(ee)),ue.endIf()):U(ee,st),le||ue.if(u._`${d.default.errors} === ${X||0}`))}a(rt,"B")}a(Q,"gA");function U(ee,K){let{gen:he,schema:X,opts:{useDefaults:ue}}=ee;ue&&(0,s.assignDefaults)(ee,K.type),he.block(()=>{for(let je of K.rules)(0,n.shouldUseRule)(X,je)&&ve(ee,je.keyword,je.definition,K.type)})}a(U,"hA");function z(ee,K){ee.schemaEnv.meta||!ee.opts.strictTypes||($(ee,K),!ee.opts.allowUnionTypes&&W(ee,K),J(ee,ee.dataTypes))}a(z,"xn");function $(ee,K){if(K.length){if(!ee.dataTypes.length){ee.dataTypes=K;return}K.forEach(he=>{H(ee.dataTypes,he)||ae(ee,`type "${he}" not allowed by context "${ee.dataTypes.join(",")}"`)}),re(ee,K)}}a($,"yn");function W(ee,K){K.length>1&&!(K.length===2&&K.includes("null"))&&ae(ee,"use allowUnionTypes to allow union type keyword")}a(W,"fn");function J(ee,K){let he=ee.self.RULES.all;for(let X in he){let ue=he[X];if(typeof ue=="object"&&(0,n.shouldUseRule)(ee.schema,ue)){let{type:je}=ue.definition;je.length&&!je.some(ie=>ne(K,ie))&&ae(ee,`missing type "${je.join(",")}" for keyword "${X}"`)}}}a(J,"gn");function ne(ee,K){return ee.includes(K)||K==="number"&&ee.includes("integer")}a(ne,"hn");function H(ee,K){return ee.includes(K)||K==="integer"&&ee.includes("number")}a(H,"nA");function re(ee,K){let he=[];for(let X of ee.dataTypes)H(K,X)?he.push(X):K.includes("integer")&&X==="number"&&he.push("integer");ee.dataTypes=he}a(re,"un");function ae(ee,K){let he=ee.schemaEnv.baseId+ee.errSchemaPath;K+=` at "${he}" (strictTypes)`,(0,h.checkStrictMode)(ee,K,ee.opts.strictTypes)}a(ae,"SB");class Be{static{a(this,"vB")}constructor(K,he,X){if((0,c.validateKeywordUsage)(K,he,X),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=X,this.data=K.data,this.schema=K.schema[X],this.$data=he.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(K,this.schema,X,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",Z(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,he.schemaType,he.allowUndefined))throw Error(`${X} 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,X){this.failResult((0,u.not)(K),he,X)}failResult(K,he,X){this.gen.if(K),X?X():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,X){if(he){this.setParams(he),this._error(K,X),this.setParams({});return}this._error(K,X)}_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,X=u.nil){this.gen.block(()=>{this.check$data(K,X),he()})}check$data(K=u.nil,he=u.nil){if(!this.$data)return;let{gen:X,schemaCode:ue,schemaType:je,def:ie}=this;X.if((0,u.or)(u._`${ue} === undefined`,he)),K!==u.nil&&X.assign(K,!0),(je.length||ie.validateSchema)&&(X.elseIf(this.invalid$data()),this.$dataError(),K!==u.nil&&X.assign(K,!1)),X.else()}invalid$data(){let{gen:K,schemaCode:he,schemaType:X,def:ue,it:je}=this;return(0,u.or)(ie(),le());function ie(){if(X.length){if(!(he instanceof u.Name))throw Error("ajv implementation error");let Ne=Array.isArray(X)?X:[X];return u._`${(0,o.checkDataTypes)(Ne,he,je.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function le(){if(ue.validateSchema){let Ne=K.scopeValue("validate$data",{ref:ue.validateSchema});return u._`!${Ne}(${he})`}return u.nil}}subschema(K,he){let X=(0,l.getSubschema)(this.it,K);(0,l.extendSubschemaData)(X,this.it,K),(0,l.extendSubschemaMode)(X,K);let ue={...this.it,...X,items:void 0,props:void 0};return T(ue,he),ue}mergeEvaluated(K,he){let{it:X,gen:ue}=this;X.opts.unevaluated&&(X.props!==!0&&K.props!==void 0&&(X.props=h.mergeEvaluated.props(ue,K.props,X.props,he)),X.items!==!0&&K.items!==void 0&&(X.items=h.mergeEvaluated.items(ue,K.items,X.items,he)))}mergeValidEvaluated(K,he){let{it:X,gen:ue}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return ue.if(he,()=>this.mergeEvaluated(K,u.Name)),!0}}t.KeywordCxt=Be;function ve(ee,K,he,X){let ue=new Be(ee,he,K);"code"in he?he.code(ue,X):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(ve,"rA");var Ue=/^\/(?:[^~]|~0|~1)*$/,Pe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Z(ee,{dataLevel:K,dataNames:he,dataPathArr:X}){let ue,je;if(ee==="")return d.default.rootData;if(ee[0]==="/"){if(!Ue.test(ee))throw Error(`Invalid JSON-pointer: ${ee}`);ue=ee,je=d.default.rootData}else{let we=Pe.exec(ee);if(!we)throw Error(`Invalid JSON-pointer: ${ee}`);let Le=+we[1];if(ue=we[2],ue==="#"){if(Le>=K)throw Error(Ne("property/index",Le));return X[K-Le]}if(Le>K)throw Error(Ne("data",Le));if(je=he[K-Le],!ue)return je}let ie=je,le=ue.split("/");for(let we of le)we&&(je=u._`${je}${(0,u.getProperty)((0,h.unescapeJsonPointer)(we))}`,ie=u._`${ie} && ${je}`);return ie;function Ne(we,Le){return`Cannot access ${we} ${Le} levels up, current level is ${K}`}}a(Z,"oA"),t.getData=Z}),L8r=jt(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}),Oxt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Nxt();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}),F8r=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=Ps(),r=L8r(),n=rW(),o=Nxt(),s=pc(),c=Mxt();class l{static{a(this,"CJ")}constructor(v){var b;this.refs={},this.dynamicAnchors={};let T;typeof v.schema=="object"&&(T=v.schema),this.schema=v.schema,this.schemaId=v.schemaId,this.root=v.root||this,this.baseId=(b=v.baseId)!==null&&b!==void 0?b:(0,o.normalizeId)(T?.[v.schemaId||"$id"]),this.schemaPath=v.schemaPath,this.localRefs=v.localRefs,this.meta=v.meta,this.$async=T?.$async,this.refs={}}}t.SchemaEnv=l;function u(_){let v=h.call(this,_);if(v)return v;let b=(0,o.getFullPath)(this.opts.uriResolver,_.root.baseId),{es5:T,lines:w}=this.opts.code,{ownProperties:R}=this.opts,x=new e.CodeGen(this.scope,{es5:T,lines:w,ownProperties:R}),P;_.$async&&(P=x.scopeValue("Error",{ref:r.default,code:e._`require("ajv/dist/runtime/validation_error").default`}));let D=x.scopeName("validate");_.validateName=D;let N={gen:x,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:x.scopeValue("schema",this.opts.code.source===!0?{ref:_.schema,code:(0,e.stringify)(_.schema)}:{ref:_.schema}),validateName:D,ValidationError:P,schema:_.schema,schemaEnv:_,rootId:b,baseId:_.baseId||b,schemaPath:e.nil,errSchemaPath:_.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this},B;try{this._compilations.add(_),(0,c.validateFunctionCode)(N),x.optimize(this.opts.code.optimize);let L=x.toString();B=`${x.scopeRefs(n.default.scope)}return ${L}`,this.opts.code.process&&(B=this.opts.code.process(B,_));let j=Function(`${n.default.self}`,`${n.default.scope}`,B)(this,this.scope.get());if(this.scope.value(D,{ref:j}),j.errors=null,j.schema=_.schema,j.schemaEnv=_,_.$async&&(j.$async=!0),this.opts.code.source===!0&&(j.source={validateName:D,validateCode:L,scopeValues:x._values}),this.opts.unevaluated){let{props:M,items:O}=N;j.evaluated={props:M instanceof e.Name?void 0:M,items:O instanceof e.Name?void 0:O,dynamicProps:M instanceof e.Name,dynamicItems:O instanceof e.Name},j.source&&(j.source.evaluated=(0,e.stringify)(j.evaluated))}return _.validate=j,_}catch(L){throw delete _.validate,delete _.validateName,B&&this.logger.error("Error compiling schema, function code:",B),L}finally{this._compilations.delete(_)}}a(u,"xB"),t.compileSchema=u;function d(_,v,b){var T;b=(0,o.resolveUrl)(this.opts.uriResolver,v,b);let w=_.refs[b];if(w)return w;let R=g.call(this,_,b);if(R===void 0){let x=(T=_.localRefs)===null||T===void 0?void 0:T[b],{schemaId:P}=this.opts;x&&(R=new l({schema:x,schemaId:P,root:_,baseId:v}))}if(R!==void 0)return _.refs[b]=f.call(this,R)}a(d,"tn"),t.resolveRef=d;function f(_){return(0,o.inlineRef)(_.schema,this.opts.inlineRefs)?_.schema:_.validate?_:u.call(this,_)}a(f,"an");function h(_){for(let v of this._compilations)if(m(v,_))return v}a(h,"XI"),t.getCompilingSchema=h;function m(_,v){return _.schema===v.schema&&_.root===v.root&&_.baseId===v.baseId}a(m,"sn");function g(_,v){let b;for(;typeof(b=this.refs[v])=="string";)v=b;return b||this.schemas[v]||A.call(this,_,v)}a(g,"en");function A(_,v){let b=this.opts.uriResolver.parse(v),T=(0,o._getFullPath)(this.opts.uriResolver,b),w=(0,o.getFullPath)(this.opts.uriResolver,_.baseId,void 0);if(Object.keys(_.schema).length>0&&T===w)return E.call(this,b,_);let R=(0,o.normalizeId)(T),x=this.refs[R]||this.schemas[R];if(typeof x=="string"){let P=A.call(this,_,x);return typeof P?.schema!="object"?void 0:E.call(this,b,P)}if(typeof x?.schema=="object"){if(x.validate||u.call(this,x),R===(0,o.normalizeId)(v)){let{schema:P}=x,{schemaId:D}=this.opts,N=P[D];return N&&(w=(0,o.resolveUrl)(this.opts.uriResolver,w,N)),new l({schema:P,schemaId:D,root:_,baseId:w})}return E.call(this,b,x)}}a(A,"EW"),t.resolveSchema=A;var y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function E(_,{baseId:v,schema:b,root:T}){var w;if(((w=_.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let P of _.fragment.slice(1).split("/")){if(typeof b=="boolean")return;let D=b[(0,s.unescapeFragment)(P)];if(D===void 0)return;b=D;let N=typeof b=="object"&&b[this.opts.schemaId];!y.has(P)&&N&&(v=(0,o.resolveUrl)(this.opts.uriResolver,v,N))}let R;if(typeof b!="boolean"&&b.$ref&&!(0,s.schemaHasRulesButRef)(b,this.RULES)){let P=(0,o.resolveUrl)(this.opts.uriResolver,v,b.$ref);R=A.call(this,T,P)}let{schemaId:x}=this.opts;if(R=R||new l({schema:b,schemaId:x,root:T,baseId:v}),R.schema!==R.root.schema)return R}a(E,"TB")}),vFc=jt((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}}),zKi=jt((t,e)=>{var r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),n=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),o=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),c=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function l(x){let P="",D=0,N=0;for(N=0;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";P+=x[N];break}for(N+=1;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";P+=x[N]}return P}a(l,"fB");var u=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function d(x){return x.length=0,!0}a(d,"UI");function f(x,P,D){if(x.length){let N=l(x);if(N!=="")P.push(N);else return D.error=!0,!1;x.length=0}return!0}a(f,"Kr");function h(x){let P=0,D={error:!1,address:"",zone:""},N=[],B=[],L=!1,j=!1,M=f;for(let O=0;O7){D.error=!0;break}O>0&&x[O-1]===":"&&(L=!0),N.push(":");continue}else if(q==="%"){if(!M(B,N,D))break;M=d}else{B.push(q);continue}}return B.length&&(M===d?D.zone=B.join(""):j?N.push(B.join("")):N.push(l(B))),D.address=N.join(""),D}a(h,"qr");function m(x){if(g(x,":")<2)return{host:x,isIPV6:!1};let P=h(x);if(P.error)return{host:x,isIPV6:!1};{let{address:D,address:N}=P;return P.zone&&(D+="%"+P.zone,N+="%25"+P.zone),{host:D,isIPV6:!0,escapedHost:N}}}a(m,"qI");function g(x,P){let D=0;for(let N=0;Ny[N])}a(v,"VI");function b(x,P=!1){if(x.indexOf("%")===-1)return x;let D="";for(let N=0;N{var{isUUID:r}=zKi(),n=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,o=["http","https","ws","wss","urn","urn:uuid"];function s(x){return o.indexOf(x)!==-1}a(s,"Ar");function c(x){return x.secure===!0?!0:x.secure===!1?!1:x.scheme?x.scheme.length===3&&(x.scheme[0]==="w"||x.scheme[0]==="W")&&(x.scheme[1]==="s"||x.scheme[1]==="S")&&(x.scheme[2]==="s"||x.scheme[2]==="S"):!1}a(c,"hB");function l(x){return x.host||(x.error=x.error||"HTTP URIs must have a host."),x}a(l,"zI");function u(x){let P=String(x.scheme).toLowerCase()==="https";return(x.port===(P?443:80)||x.port==="")&&(x.port=void 0),x.path||(x.path="/"),x}a(u,"NI");function d(x){return x.secure=c(x),x.resourceName=(x.path||"/")+(x.query?"?"+x.query:""),x.path=void 0,x.query=void 0,x}a(d,"Ir");function f(x){if((x.port===(c(x)?443:80)||x.port==="")&&(x.port=void 0),typeof x.secure=="boolean"&&(x.scheme=x.secure?"wss":"ws",x.secure=void 0),x.resourceName){let[P,D]=x.resourceName.split("?");x.path=P&&P!=="/"?P:void 0,x.query=D,x.resourceName=void 0}return x.fragment=void 0,x}a(f,"Rr");function h(x,P){if(!x.path)return x.error="URN can not be parsed",x;let D=x.path.match(n);if(D){let N=P.scheme||x.scheme||"urn";x.nid=D[1].toLowerCase(),x.nss=D[2];let B=`${N}:${P.nid||x.nid}`,L=R(B);x.path=void 0,L&&(x=L.parse(x,P))}else x.error=x.error||"URN can not be parsed.";return x}a(h,"Pr");function m(x,P){if(x.nid===void 0)throw Error("URN without nid cannot be serialized");let D=P.scheme||x.scheme||"urn",N=x.nid.toLowerCase(),B=`${D}:${P.nid||N}`,L=R(B);L&&(x=L.serialize(x,P));let j=x,M=x.nss;return j.path=`${N||P.nid}:${M}`,P.skipEscape=!0,j}a(m,"Er");function g(x,P){let D=x;return D.uuid=D.nss,D.nss=void 0,!P.tolerant&&(!D.uuid||!r(D.uuid))&&(D.error=D.error||"UUID is not valid."),D}a(g,"br");function A(x){let P=x;return P.nss=(x.uuid||"").toLowerCase(),P}a(A,"_r");var y={scheme:"http",domainHost:!0,parse:l,serialize:u},E={scheme:"https",domainHost:y.domainHost,parse:l,serialize:u},_={scheme:"ws",domainHost:!0,parse:d,serialize:f},v={scheme:"wss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},b={scheme:"urn",parse:h,serialize:m,skipNormalize:!0},T={scheme:"urn:uuid",parse:g,serialize:A,skipNormalize:!0},w={http:y,https:E,ws:_,wss:v,urn:b,"urn:uuid":T};Object.setPrototypeOf(w,null);function R(x){return x&&(w[x]||w[x.toLowerCase()])||void 0}a(R,"uB"),e.exports={wsIsSecure:c,SCHEMES:w,isValidSchemeName:s,getSchemeHandler:R}}),bFc=jt((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=zKi(),{SCHEMES:h,getSchemeHandler:m}=CFc();function g(N,B){return typeof N=="string"?N=R(N,B):typeof N=="object"&&(N=w(_(N,B),B)),N}a(g,"cr");function A(N,B,L){let j=L?Object.assign({scheme:"null"},L):{scheme:"null"},M=y(w(N,j),w(B,j),j,!0);return j.skipEscape=!0,_(M,j)}a(A,"pr");function y(N,B,L,j){let M={};return j||(N=w(_(N,L),L),B=w(_(B,L),L)),L=L||{},!L.tolerant&&B.scheme?(M.scheme=B.scheme,M.userinfo=B.userinfo,M.host=B.host,M.port=B.port,M.path=n(B.path||""),M.query=B.query):(B.userinfo!==void 0||B.host!==void 0||B.port!==void 0?(M.userinfo=B.userinfo,M.host=B.host,M.port=B.port,M.path=n(B.path||""),M.query=B.query):(B.path?(B.path[0]==="/"?M.path=n(B.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?M.path="/"+B.path:N.path?M.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+B.path:M.path=B.path,M.path=n(M.path)),M.query=B.query):(M.path=N.path,B.query!==void 0?M.query=B.query:M.query=N.query),M.userinfo=N.userinfo,M.host=N.host,M.port=N.port),M.scheme=N.scheme),M.fragment=B.fragment,M}a(y,"MI");function E(N,B,L){let j=P(N,L),M=P(B,L);return j!==void 0&&M!==void 0&&j.toLowerCase()===M.toLowerCase()}a(E,"dr");function _(N,B){let L={host:N.host,scheme:N.scheme,userinfo:N.userinfo,port:N.port,path:N.path,query:N.query,nid:N.nid,nss:N.nss,uuid:N.uuid,fragment:N.fragment,reference:N.reference,resourceName:N.resourceName,secure:N.secure,error:""},j=Object.assign({},B),M=[],O=m(j.scheme||L.scheme);O&&O.serialize&&O.serialize(L,j),L.path!==void 0&&(j.skipEscape?L.path=s(L.path):(L.path=l(L.path),L.scheme!==void 0&&(L.path=L.path.split("%3A").join(":")))),j.reference!=="suffix"&&L.scheme&&M.push(L.scheme,":");let q=o(L);if(q!==void 0&&(j.reference!=="suffix"&&M.push("//"),M.push(q),L.path&&L.path[0]!=="/"&&M.push("/")),L.path!==void 0){let Q=L.path;!j.absolutePath&&(!O||!O.absolutePath)&&(Q=n(Q)),q===void 0&&Q[0]==="/"&&Q[1]==="/"&&(Q="/%2F"+Q.slice(2)),M.push(Q)}return L.query!==void 0&&M.push("?",L.query),L.fragment!==void 0&&M.push("#",L.fragment),M.join("")}a(_,"y0");var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(N,B){if(B[2]!==void 0&&N.path&&N.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof N.port=="number"&&(N.port<0||N.port>65535))return"URI port is malformed."}a(b,"nr");function T(N,B){let L=Object.assign({},B),j={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},M=!1,O=!1;L.reference==="suffix"&&(L.scheme?N=L.scheme+":"+N:N="//"+N);let q=N.match(v);if(q){j.scheme=q[1],j.userinfo=q[3],j.host=q[4],j.port=parseInt(q[5],10),j.path=q[6]||"",j.query=q[7],j.fragment=q[8],isNaN(j.port)&&(j.port=q[5]);let Q=b(j,q);if(Q!==void 0&&(j.error=j.error||Q,M=!0),j.host)if(d(j.host)===!1){let z=r(j.host);j.host=z.host.toLowerCase(),O=z.isIPV6}else O=!0;j.scheme===void 0&&j.userinfo===void 0&&j.host===void 0&&j.port===void 0&&j.query===void 0&&!j.path?j.reference="same-document":j.scheme===void 0?j.reference="relative":j.fragment===void 0?j.reference="absolute":j.reference="uri",L.reference&&L.reference!=="suffix"&&L.reference!==j.reference&&(j.error=j.error||"URI is not a "+L.reference+" reference.");let U=m(L.scheme||j.scheme);if(!L.unicodeSupport&&(!U||!U.unicodeSupport)&&j.host&&(L.domainHost||U&&U.domainHost)&&O===!1&&f(j.host))try{j.host=URL.domainToASCII(j.host.toLowerCase())}catch(z){j.error=j.error||"Host's domain name can not be converted to ASCII: "+z}if((!U||U&&!U.skipNormalize)&&(N.indexOf("%")!==-1&&(j.scheme!==void 0&&(j.scheme=unescape(j.scheme)),j.host!==void 0&&(j.host=u(unescape(j.host),O))),j.path&&(j.path=c(j.path)),j.fragment))try{j.fragment=encodeURI(decodeURIComponent(j.fragment))}catch{j.error=j.error||"URI malformed"}U&&U.parse&&U.parse(j,L)}else j.error=j.error||"URI can not be parsed.";return{parsed:j,malformedAuthorityOrPort:M}}a(T,"LI");function w(N,B){return T(N,B).parsed}a(w,"w9");function R(N,B){return x(N,B).normalized}a(R,"rr");function x(N,B){let{parsed:L,malformedAuthorityOrPort:j}=T(N,B);return{normalized:j?N:_(L,B),malformedAuthorityOrPort:j}}a(x,"jI");function P(N,B){if(typeof N=="string"){let{normalized:L,malformedAuthorityOrPort:j}=x(N,B);return j?void 0:L}if(typeof N=="object")return _(N,B)}a(P,"FI");var D={SCHEMES:h,normalize:g,resolve:A,resolveComponent:y,equal:E,serialize:_,parse:w};e.exports=D,e.exports.default=D,e.exports.fastUri=D}),SFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=bFc();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),TFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=Mxt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=Ps();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=L8r(),o=Oxt(),s=$Ki(),c=F8r(),l=Ps(),u=Nxt(),d=dIt(),f=pc(),h=vFc(),m=SFc(),g=a(($,W)=>new RegExp($,W),"vI");g.code="new RegExp";var A=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),E={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function b($){var W,J,ne,H,re,ae,Be,ve,Ue,Pe,Z,ee,K,he,X,ue,je,ie,le,Ne,we,Le,rt,st,_t;let kt=$.strict,$t=(W=$.code)===null||W===void 0?void 0:W.optimize,Ht=$t===!0||$t===void 0?1:$t||0,Ie=(ne=(J=$.code)===null||J===void 0?void 0:J.regExp)!==null&&ne!==void 0?ne:g,F=(H=$.uriResolver)!==null&&H!==void 0?H:m.default;return{strictSchema:(ae=(re=$.strictSchema)!==null&&re!==void 0?re:kt)!==null&&ae!==void 0?ae:!0,strictNumbers:(ve=(Be=$.strictNumbers)!==null&&Be!==void 0?Be:kt)!==null&&ve!==void 0?ve:!0,strictTypes:(Pe=(Ue=$.strictTypes)!==null&&Ue!==void 0?Ue:kt)!==null&&Pe!==void 0?Pe:"log",strictTuples:(ee=(Z=$.strictTuples)!==null&&Z!==void 0?Z:kt)!==null&&ee!==void 0?ee:"log",strictRequired:(he=(K=$.strictRequired)!==null&&K!==void 0?K:kt)!==null&&he!==void 0?he:!1,code:$.code?{...$.code,optimize:Ht,regExp:Ie}:{optimize:Ht,regExp:Ie},loopRequired:(X=$.loopRequired)!==null&&X!==void 0?X:v,loopEnum:(ue=$.loopEnum)!==null&&ue!==void 0?ue:v,meta:(je=$.meta)!==null&&je!==void 0?je:!0,messages:(ie=$.messages)!==null&&ie!==void 0?ie:!0,inlineRefs:(le=$.inlineRefs)!==null&&le!==void 0?le:!0,schemaId:(Ne=$.schemaId)!==null&&Ne!==void 0?Ne:"$id",addUsedSchema:(we=$.addUsedSchema)!==null&&we!==void 0?we:!0,validateSchema:(Le=$.validateSchema)!==null&&Le!==void 0?Le:!0,validateFormats:(rt=$.validateFormats)!==null&&rt!==void 0?rt:!0,unicodeRegExp:(st=$.unicodeRegExp)!==null&&st!==void 0?st:!0,int32range:(_t=$.int32range)!==null&&_t!==void 0?_t:!0,uriResolver:F}}a(b,"Wo");class T{static{a(this,"CW")}constructor(W={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,W=this.opts={...W,...b(W)};let{es5:J,lines:ne}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:J,lines:ne}),this.logger=L(W.logger);let H=W.validateFormats;W.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,E,W,"NOT SUPPORTED"),w.call(this,_,W,"DEPRECATED","warn"),this._metaOpts=N.call(this),W.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),W.keywords&&D.call(this,W.keywords),typeof W.meta=="object"&&this.addMetaSchema(W.meta),x.call(this),W.validateFormats=H}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:W,meta:J,schemaId:ne}=this.opts,H=h;ne==="id"&&(H={...h},H.id=H.$id,delete H.$id),J&&W&&this.addMetaSchema(H,H[ne],!1)}defaultMeta(){let{meta:W,schemaId:J}=this.opts;return this.opts.defaultMeta=typeof W=="object"?W[J]||W:void 0}validate(W,J){let ne;if(typeof W=="string"){if(ne=this.getSchema(W),!ne)throw Error(`no schema with key or ref "${W}"`)}else ne=this.compile(W);let H=ne(J);return"$async"in ne||(this.errors=ne.errors),H}compile(W,J){let ne=this._addSchema(W,J);return ne.validate||this._compileSchemaEnv(ne)}compileAsync(W,J){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:ne}=this.opts;return H.call(this,W,J);async function H(Pe,Z){await re.call(this,Pe.$schema);let ee=this._addSchema(Pe,Z);return ee.validate||ae.call(this,ee)}async function re(Pe){Pe&&!this.getSchema(Pe)&&await H.call(this,{$ref:Pe},!0)}async function ae(Pe){try{return this._compileSchemaEnv(Pe)}catch(Z){if(!(Z instanceof o.default))throw Z;return Be.call(this,Z),await ve.call(this,Z.missingSchema),ae.call(this,Pe)}}function Be({missingSchema:Pe,missingRef:Z}){if(this.refs[Pe])throw Error(`AnySchema ${Pe} is loaded but ${Z} cannot be resolved`)}async function ve(Pe){let Z=await Ue.call(this,Pe);this.refs[Pe]||await re.call(this,Z.$schema),this.refs[Pe]||this.addSchema(Z,Pe,J)}async function Ue(Pe){let Z=this._loading[Pe];if(Z)return Z;try{return await(this._loading[Pe]=ne(Pe))}finally{delete this._loading[Pe]}}}addSchema(W,J,ne,H=this.opts.validateSchema){if(Array.isArray(W)){for(let ae of W)this.addSchema(ae,void 0,ne,H);return this}let re;if(typeof W=="object"){let{schemaId:ae}=this.opts;if(re=W[ae],re!==void 0&&typeof re!="string")throw Error(`schema ${ae} must be string`)}return J=(0,u.normalizeId)(J||re),this._checkUnique(J),this.schemas[J]=this._addSchema(W,ne,J,H,!0),this}addMetaSchema(W,J,ne=this.opts.validateSchema){return this.addSchema(W,J,!0,ne),this}validateSchema(W,J){if(typeof W=="boolean")return!0;let ne;if(ne=W.$schema,ne!==void 0&&typeof ne!="string")throw Error("$schema must be a string");if(ne=ne||this.opts.defaultMeta||this.defaultMeta(),!ne)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let H=this.validate(ne,W);if(!H&&J){let re="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(re);else throw Error(re)}return H}getSchema(W){let J;for(;typeof(J=R.call(this,W))=="string";)W=J;if(J===void 0){let{schemaId:ne}=this.opts,H=new c.SchemaEnv({schema:{},schemaId:ne});if(J=c.resolveSchema.call(this,H,W),!J)return;this.refs[W]=J}return J.validate||this._compileSchemaEnv(J)}removeSchema(W){if(W instanceof RegExp)return this._removeAllSchemas(this.schemas,W),this._removeAllSchemas(this.refs,W),this;switch(typeof W){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let J=R.call(this,W);return typeof J=="object"&&this._cache.delete(J.schema),delete this.schemas[W],delete this.refs[W],this}case"object":{let J=W;this._cache.delete(J);let ne=W[this.opts.schemaId];return ne&&(ne=(0,u.normalizeId)(ne),delete this.schemas[ne],delete this.refs[ne]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(W){for(let J of W)this.addKeyword(J);return this}addKeyword(W,J){let ne;if(typeof W=="string")ne=W,typeof J=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),J.keyword=ne);else if(typeof W=="object"&&J===void 0){if(J=W,ne=J.keyword,Array.isArray(ne)&&!ne.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(M.call(this,ne,J),!J)return(0,f.eachItem)(ne,re=>O.call(this,re)),this;Q.call(this,J);let H={...J,type:(0,d.getJSONTypes)(J.type),schemaType:(0,d.getJSONTypes)(J.schemaType)};return(0,f.eachItem)(ne,H.type.length===0?re=>O.call(this,re,H):re=>H.type.forEach(ae=>O.call(this,re,H,ae))),this}getKeyword(W){let J=this.RULES.all[W];return typeof J=="object"?J.definition:!!J}removeKeyword(W){let{RULES:J}=this;delete J.keywords[W],delete J.all[W];for(let ne of J.rules){let H=ne.rules.findIndex(re=>re.keyword===W);H>=0&&ne.rules.splice(H,1)}return this}addFormat(W,J){return typeof J=="string"&&(J=new RegExp(J)),this.formats[W]=J,this}errorsText(W=this.errors,{separator:J=", ",dataVar:ne="data"}={}){return!W||W.length===0?"No errors":W.map(H=>`${ne}${H.instancePath} ${H.message}`).reduce((H,re)=>H+J+re)}$dataMetaSchema(W,J){let ne=this.RULES.all;W=JSON.parse(JSON.stringify(W));for(let H of J){let re=H.split("/").slice(1),ae=W;for(let Be of re)ae=ae[Be];for(let Be in ne){let ve=ne[Be];if(typeof ve!="object")continue;let{$data:Ue}=ve.definition,Pe=ae[Be];Ue&&Pe&&(ae[Be]=z(Pe))}}return W}_removeAllSchemas(W,J){for(let ne in W){let H=W[ne];(!J||J.test(ne))&&(typeof H=="string"?delete W[ne]:H&&!H.meta&&(this._cache.delete(H.schema),delete W[ne]))}}_addSchema(W,J,ne,H=this.opts.validateSchema,re=this.opts.addUsedSchema){let ae,{schemaId:Be}=this.opts;if(typeof W=="object")ae=W[Be];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof W!="boolean")throw Error("schema must be object or boolean")}let ve=this._cache.get(W);if(ve!==void 0)return ve;ne=(0,u.normalizeId)(ae||ne);let Ue=u.getSchemaRefs.call(this,W,ne);return ve=new c.SchemaEnv({schema:W,schemaId:Be,meta:J,baseId:ne,localRefs:Ue}),this._cache.set(ve.schema,ve),re&&!ne.startsWith("#")&&(ne&&this._checkUnique(ne),this.refs[ne]=ve),H&&this.validateSchema(W,!0),ve}_checkUnique(W){if(this.schemas[W]||this.refs[W])throw Error(`schema with key or id "${W}" already exists`)}_compileSchemaEnv(W){if(W.meta?this._compileMetaSchema(W):c.compileSchema.call(this,W),!W.validate)throw Error("ajv implementation error");return W.validate}_compileMetaSchema(W){let J=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,W)}finally{this.opts=J}}}T.ValidationError=n.default,T.MissingRefError=o.default,t.default=T;function w($,W,J,ne="error"){for(let H in $){let re=H;re in W&&this.logger[ne](`${J}: option ${H}. ${$[re]}`)}}a(w,"_I");function R($){return $=(0,u.normalizeId)($),this.schemas[$]||this.refs[$]}a(R,"kI");function x(){let $=this.opts.schemas;if($)if(Array.isArray($))this.addSchema($);else for(let W in $)this.addSchema($[W],W)}a(x,"Go");function P(){for(let $ in this.opts.formats){let W=this.opts.formats[$];W&&this.addFormat($,W)}}a(P,"Uo");function D($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let W in $){let J=$[W];J.keyword||(J.keyword=W),this.addKeyword(J)}}a(D,"Ho");function N(){let $={...this.opts};for(let W of A)delete $[W];return $}a(N,"Ko");var B={log(){},warn(){},error(){}};function L($){if($===!1)return B;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}a(L,"Vo");var j=/^[a-z_$][a-z0-9_$:-]*$/i;function M($,W){let{RULES:J}=this;if((0,f.eachItem)($,ne=>{if(J.keywords[ne])throw Error(`Keyword ${ne} is already defined`);if(!j.test(ne))throw Error(`Keyword ${ne} has invalid name`)}),!!W&&W.$data&&!("code"in W||"validate"in W))throw Error('$data keyword must have "code" or "validate" function')}a(M,"zo");function O($,W,J){var ne;let H=W?.post;if(J&&H)throw Error('keyword with "post" flag cannot have "type"');let{RULES:re}=this,ae=H?re.post:re.rules.find(({type:ve})=>ve===J);if(ae||(ae={type:J,rules:[]},re.rules.push(ae)),re.keywords[$]=!0,!W)return;let Be={keyword:$,definition:{...W,type:(0,d.getJSONTypes)(W.type),schemaType:(0,d.getJSONTypes)(W.schemaType)}};W.before?q.call(this,ae,Be,W.before):ae.rules.push(Be),re.all[$]=Be,(ne=W.implements)===null||ne===void 0||ne.forEach(ve=>this.addKeyword(ve))}a(O,"lB");function q($,W,J){let ne=$.rules.findIndex(H=>H.keyword===J);ne>=0?$.rules.splice(ne,0,W):($.rules.push(W),this.logger.warn(`rule ${J} is not defined`))}a(q,"No");function Q($){let{metaSchema:W}=$;W!==void 0&&($.$data&&this.opts.$data&&(W=z(W)),$.validateSchema=this.compile(W,!0))}a(Q,"wo");var U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function z($){return{anyOf:[$,U]}}a(z,"CI")}),IFc=jt(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}),xFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=Oxt(),r=BN(),n=Ps(),o=rW(),s=F8r(),c=pc(),l={keyword:"$ref",schemaType:"string",code(f){let{gen:h,schema:m,it:g}=f,{baseId:A,schemaEnv:y,validateName:E,opts:_,self:v}=g,{root:b}=y;if((m==="#"||m==="#/")&&A===b.baseId)return w();let T=s.resolveRef.call(v,b,A,m);if(T===void 0)throw new e.default(g.opts.uriResolver,A,m);if(T instanceof s.SchemaEnv)return R(T);return x(T);function w(){if(y===b)return d(f,E,y,y.$async);let P=h.scopeValue("root",{ref:b});return d(f,n._`${P}.validate`,b,b.$async)}function R(P){let D=u(f,P);d(f,D,P,P.$async)}function x(P){let D=h.scopeValue("schema",_.code.source===!0?{ref:P,code:(0,n.stringify)(P)}:{ref:P}),N=h.name("valid"),B=f.subschema({schema:P,dataTypes:[],schemaPath:n.nil,topSchemaRef:D,errSchemaPath:m},N);f.mergeEvaluated(B),f.ok(N)}}};function u(f,h){let{gen:m}=f;return h.validate?m.scopeValue("validate",{ref:h.validate}):n._`${m.scopeValue("wrapper",{ref:h})}.validate`}a(u,"hI"),t.getValidate=u;function d(f,h,m,g){let{gen:A,it:y}=f,{allErrors:E,schemaEnv:_,opts:v}=y,b=v.passContext?o.default.this:n.nil;g?T():w();function T(){if(!_.$async)throw Error("async schema referenced by sync schema");let P=A.let("valid");A.try(()=>{A.code(n._`await ${(0,r.callValidateCode)(f,h,b)}`),x(h),!E&&A.assign(P,!0)},D=>{A.if(n._`!(${D} instanceof ${y.ValidationError})`,()=>A.throw(D)),R(D),!E&&A.assign(P,!1)}),f.ok(P)}a(T,"V");function w(){f.result((0,r.callValidateCode)(f,h,b),()=>x(h),()=>R(h))}a(w,"B");function R(P){let D=n._`${P}.errors`;A.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${D} : ${o.default.vErrors}.concat(${D})`),A.assign(o.default.errors,n._`${o.default.vErrors}.length`)}a(R,"z");function x(P){var D;if(!y.opts.unevaluated)return;let N=(D=m?.validate)===null||D===void 0?void 0:D.evaluated;if(y.props!==!0)if(N&&!N.dynamicProps)N.props!==void 0&&(y.props=c.mergeEvaluated.props(A,N.props,y.props));else{let B=A.var("props",n._`${P}.evaluated.props`);y.props=c.mergeEvaluated.props(A,B,y.props,n.Name)}if(y.items!==!0)if(N&&!N.dynamicItems)N.items!==void 0&&(y.items=c.mergeEvaluated.items(A,N.items,y.items));else{let B=A.var("items",n._`${P}.evaluated.items`);y.items=c.mergeEvaluated.items(A,B,y.items,n.Name)}}a(x,"N")}a(d,"xW"),t.callRef=d,t.default=l}),wFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=IFc(),r=xFc(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),RFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),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}),PFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),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}),kFc=jt(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=Ps(),r=pc(),n=kFc(),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}),NFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=BN(),r=pc(),n=Ps(),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}),MFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),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}),OFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=BN(),r=Ps(),n=pc(),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}),BFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),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}),U8r=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=WKi();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),LFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=dIt(),r=Ps(),n=pc(),o=U8r(),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}),FFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),r=pc(),n=U8r(),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}),UFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),r=pc(),n=U8r(),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}),QFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=RFc(),r=PFc(),n=DFc(),o=NFc(),s=MFc(),c=OFc(),l=BFc(),u=LFc(),d=FFc(),f=UFc(),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}),YKi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=Ps(),r=pc(),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}),KKi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=Ps(),r=pc(),n=BN(),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}),qFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=KKi(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),jFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),r=pc(),n=BN(),o=YKi(),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}),HFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),r=pc(),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}),GFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=Ps(),r=pc(),n=BN();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")}),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}, 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}),$Fc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),r=pc(),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}),JKi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=BN(),r=Ps(),n=rW(),o=pc(),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}),VFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Mxt(),r=BN(),n=pc(),o=JKi(),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}),WFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=BN(),r=Ps(),n=pc(),o=pc(),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}),zFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pc(),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}),YFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=BN(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),KFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),r=pc(),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}),JFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pc(),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}),ZFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),r=pc(),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}),XFc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pc(),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}),e8c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=YKi(),r=qFc(),n=KKi(),o=jFc(),s=HFc(),c=GFc(),l=$Fc(),u=JKi(),d=VFc(),f=WFc(),h=zFc(),m=YFc(),g=KFc(),A=JFc(),y=ZFc(),E=XFc();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=_}),t8c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),r={message:a(({schemaCode:o})=>e.str`must match format "${o}"`,"message"),params:a(({schemaCode:o})=>e._`{format: ${o}}`,"params")},n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:r,code(o,s){let{gen:c,data:l,$data:u,schema:d,schemaCode:f,it:h}=o,{opts:m,errSchemaPath:g,schemaEnv:A,self:y}=h;if(!m.validateFormats)return;u?E():_();function E(){let v=c.scopeValue("formats",{ref:y.formats,code:m.code.formats}),b=c.const("fDef",e._`${v}[${f}]`),T=c.let("fType"),w=c.let("format");c.if(e._`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>c.assign(T,e._`${b}.type || "string"`).assign(w,e._`${b}.validate`),()=>c.assign(T,e._`"string"`).assign(w,b)),o.fail$data((0,e.or)(R(),x()));function R(){return m.strictSchema===!1?e.nil:e._`${f} && !${w}`}a(R,"j");function x(){let P=A.$async?e._`(${b}.async ? await ${w}(${l}) : ${w}(${l}))`:e._`${w}(${l})`,D=e._`(typeof ${w} == "function" ? ${P} : ${w}.test(${l}))`;return e._`${w} && ${w} !== true && ${T} === ${s} && !${D}`}a(x,"A")}a(E,"z");function _(){let v=y.formats[d];if(!v){R();return}if(v===!0)return;let[b,T,w]=x(v);b===s&&o.pass(P());function R(){if(m.strictSchema===!1){y.logger.warn(D());return}throw Error(D());function D(){return`unknown format "${d}" ignored in schema at path "${g}"`}}a(R,"j");function x(D){let N=D instanceof RegExp?(0,e.regexpCode)(D):m.code.formats?e._`${m.code.formats}${(0,e.getProperty)(d)}`:void 0,B=c.scopeValue("formats",{key:d,ref:D,code:N});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,e._`${B}.validate`]:["string",D,B]}a(x,"A");function P(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!A.$async)throw Error("async format in sync schema");return e._`await ${w}(${l})`}return typeof T=="function"?e._`${w}(${l})`:e._`${w}.test(${l})`}a(P,"S")}a(_,"N")}};t.default=n}),r8c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=t8c(),r=[e.default];t.default=r}),n8c=jt(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"]}),i8c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=wFc(),r=QFc(),n=e8c(),o=r8c(),s=n8c(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),o8c=jt(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={}))}),s8c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ps(),r=o8c(),n=F8r(),o=Oxt(),s=pc(),c={message:a(({params:{discrError:u,tagName:d}})=>u===r.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,"message"),params:a(({params:{discrError:u,tag:d,tagName:f}})=>e._`{error: ${u}, tag: ${f}, tagValue: ${d}}`,"params")},l={keyword:"discriminator",type:"object",schemaType:"object",error:c,code(u){let{gen:d,data:f,schema:h,parentSchema:m,it:g}=u,{oneOf:A}=m;if(!g.opts.discriminator)throw Error("discriminator: requires discriminator option");let y=h.propertyName;if(typeof y!="string")throw Error("discriminator: requires propertyName");if(h.mapping)throw Error("discriminator: mapping is not supported");if(!A)throw Error("discriminator: requires oneOf keyword");let E=d.let("valid",!1),_=d.const("tag",e._`${f}${(0,e.getProperty)(y)}`);d.if(e._`typeof ${_} == "string"`,()=>v(),()=>u.error(!1,{discrError:r.DiscrError.Tag,tag:_,tagName:y})),u.ok(E);function v(){let w=T();d.if(!1);for(let R in w)d.elseIf(e._`${_} === ${R}`),d.assign(E,b(w[R]));d.else(),u.error(!1,{discrError:r.DiscrError.Mapping,tag:_,tagName:y}),d.endIf()}a(v,"V");function b(w){let R=d.name("valid"),x=u.subschema({keyword:"oneOf",schemaProp:w},R);return u.mergeEvaluated(x,e.Name),R}a(b,"B");function T(){var w;let R={},x=D(m),P=!0;for(let L=0;L{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),ZKi=jt((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=TFc(),n=i8c(),o=s8c(),s=a8c(),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=Mxt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=Ps();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=L8r();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=Oxt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),c8c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(B,L){return{validate:B,compare:L}}a(e,"b4"),t.fullFormats={date:e(s,c),time:e(u(!0),d),"date-time":e(m(!0),g),"iso-time":e(u(),f),"iso-date-time":e(m(),A),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:N,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:b,int32:{type:"number",validate:R},int64:{type:"number",validate:x},float:{type:"number",validate:P},double:{type:"number",validate:P},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,c),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,A),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(B){return B%4===0&&(B%100!==0||B%400===0)}a(r,"Is");var n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(B){let L=n.exec(B);if(!L)return!1;let j=+L[1],M=+L[2],O=+L[3];return M>=1&&M<=12&&O>=1&&O<=(M===2&&r(j)?29:o[M])}a(s,"xP");function c(B,L){if(B&&L)return B>L?1:B23||$>59||B&&!Q)return!1;if(M<=23&&O<=59&&q<60)return!0;let W=O-$*U,J=M-z*U-(W<0?1:0);return(J===23||J===-1)&&(W===59||W===-1)&&q<61}}a(u,"Jz");function d(B,L){if(!(B&&L))return;let j=new Date("2020-01-01T"+B).valueOf(),M=new Date("2020-01-01T"+L).valueOf();if(j&&M)return j-M}a(d,"Wz");function f(B,L){if(!(B&&L))return;let j=l.exec(B),M=l.exec(L);if(j&&M)return B=j[1]+j[2]+j[3],L=M[1]+M[2]+M[3],B>L?1:B=T}a(R,"Cs");function x(B){return Number.isInteger(B)}a(x,"Ts");function P(){return!0}a(P,"TP");var D=/[^\\]\\Z/;function N(B){if(D.test(B))return!1;try{return new RegExp(B),!0}catch{return!1}}a(N,"ys")}),l8c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=ZKi(),r=Ps(),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}),u8c=jt((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=c8c(),n=l8c(),o=Ps(),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}),d8c=50;a(gFr,"g9");a(iJi,"K5");a(f8c,"Uk");a(wie,"v4");Fxt=["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"],p8c=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],h8c="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",m8c=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,g8c=/(.*?)<\/command-name>/;a(Q8r,"h9");A8c={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(cJi,"q5");a(y8c,"JN");a(FV,"G1");a(E8c,"zk");a(_8c,"Nk");a(v8c,"wk");AFr=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=cJi(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()}},C1=class extends Error{static{a(this,"W6")}};a(lJi,"V5");a(KE,"R$");a(m8e,"U1");C8c=typeof global=="object"&&global&&global.Object===Object&&global,uJi=C8c,b8c=typeof self=="object"&&self&&self.Object===Object&&self,S8c=uJi||b8c||Function("return this")(),Ave=S8c,T8c=Ave.Symbol,JV=T8c,dJi=Object.prototype,I8c=dJi.hasOwnProperty,x8c=dJi.toString,sFe=JV?JV.toStringTag:void 0;a(w8c,"Ak");R8c=w8c,P8c=Object.prototype,k8c=P8c.toString;a(D8c,"Pk");N8c=D8c,M8c="[object Null]",O8c="[object Undefined]",Rzi=JV?JV.toStringTag:void 0;a(B8c,"_k");g8e=B8c;a(L8c,"kk");M9=L8c,F8c="[object AsyncFunction]",U8c="[object Function]",Q8c="[object GeneratorFunction]",q8c="[object Proxy]";a(j8c,"xk");q8r=j8c,H8c=Ave["__core-js_shared__"],L3r=H8c,Pzi=(function(){var t=/[^.]+$/.exec(L3r&&L3r.keys&&L3r.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(G8c,"fk");$8c=G8c,V8c=Function.prototype,W8c=V8c.toString;a(z8c,"uk");Y8c=z8c,K8c=/[\\^$.*+?()[\]{}|]/g,J8c=/^\[object .+?Constructor\]$/,Z8c=Function.prototype,X8c=Object.prototype,e6c=Z8c.toString,t6c=X8c.hasOwnProperty,r6c=RegExp("^"+e6c.call(t6c).replace(K8c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(n6c,"rk");i6c=n6c;a(o6c,"ok");s6c=o6c;a(a6c,"tk");j8r=a6c,c6c=j8r(Object,"create"),QFe=c6c;a(l6c,"sk");u6c=l6c;a(d6c,"ek");f6c=d6c,p6c="__lodash_hash_undefined__",h6c=Object.prototype,m6c=h6c.hasOwnProperty;a(g6c,"XS");A6c=g6c,y6c=Object.prototype,E6c=y6c.hasOwnProperty;a(_6c,"GS");v6c=_6c,C6c="__lodash_hash_undefined__";a(b6c,"HS");S6c=b6c;a(yve,"a0");yve.prototype.clear=u6c;yve.prototype.delete=f6c;yve.prototype.get=A6c;yve.prototype.has=v6c;yve.prototype.set=S6c;kzi=yve;a(T6c,"KS");I6c=T6c;a(x6c,"qS");Uxt=x6c;a(w6c,"VS");Qxt=w6c,R6c=Array.prototype,P6c=R6c.splice;a(k6c,"NS");D6c=k6c;a(N6c,"wS");M6c=N6c;a(O6c,"OS");B6c=O6c;a(L6c,"DS");F6c=L6c;a(Eve,"s0");Eve.prototype.clear=I6c;Eve.prototype.delete=D6c;Eve.prototype.get=M6c;Eve.prototype.has=B6c;Eve.prototype.set=F6c;qxt=Eve,U6c=j8r(Ave,"Map"),fJi=U6c;a(Q6c,"ZS");q6c=Q6c;a(j6c,"MS");H6c=j6c;a(G6c,"LS");jxt=G6c;a($6c,"jS");V6c=$6c;a(W6c,"AS");z6c=W6c;a(Y6c,"IS");K6c=Y6c;a(J6c,"RS");Z6c=J6c;a(_ve,"e0");_ve.prototype.clear=q6c;_ve.prototype.delete=V6c;_ve.prototype.get=z6c;_ve.prototype.has=K6c;_ve.prototype.set=Z6c;H8r=_ve,X6c="Expected a function";a(G8r,"MG");G8r.Cache=H8r;Cy=G8r,vve=Cy(()=>(process.env.CLAUDE_CONFIG_DIR??(0,hJi.join)((0,pJi.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),VVh=Cy(()=>KE(process.env.CLAUDE_CODE_SUPERVISED));a(mn,"y");a(gt,"Z");mJi=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return mJi=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(qFe,"T4");yFr=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"),wi=class extends Error{static{a(this,"g")}},$v=class t extends wi{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 z_e({message:n,cause:yFr(r)});let s=r,c=s?.error?.type;return e===400?new pIt(e,s,n,o,c):e===401?new hIt(e,s,n,o,c):e===403?new mIt(e,s,n,o,c):e===404?new gIt(e,s,n,o,c):e===409?new AIt(e,s,n,o,c):e===422?new yIt(e,s,n,o,c):e===429?new EIt(e,s,n,o,c):e>=500?new _It(e,s,n,o,c):new t(e,s,n,o,c)}},TI=class extends $v{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},z_e=class extends $v{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},fIt=class extends z_e{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},pIt=class extends $v{static{a(this,"p9")}},hIt=class extends $v{static{a(this,"d9")}},mIt=class extends $v{static{a(this,"i9")}},gIt=class extends $v{static{a(this,"n9")}},AIt=class extends $v{static{a(this,"r9")}},yIt=class extends $v{static{a(this,"o9")}},EIt=class extends $v{static{a(this,"t9")}},_It=class extends $v{static{a(this,"a9")}},e9c=/^[a-z][a-z0-9+.-]*:/i,t9c=a(t=>e9c.test(t),"bN"),EFr=a(t=>(EFr=Array.isArray,EFr(t)),"jG"),Dzi=EFr;a(_Fr,"w5");a(Nzi,"IG");a(r9c,"_N");n9c=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new wi(`${t} must be an integer`);if(e<0)throw new wi(`${t} must be a positive integer`);return e},"kN"),gJi=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),i9c=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),VV="0.94.0",o9c=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(s9c,"SS");a9c=a(()=>{let t=s9c();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":VV,"X-Stainless-OS":Ozi(Deno.build.os),"X-Stainless-Arch":Mzi(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":VV,"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":VV,"X-Stainless-OS":Ozi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Mzi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=c9c();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":VV,"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":VV,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(c9c,"CS");Mzi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),Ozi=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"),$8r=a(()=>Bzi??(Bzi=a9c()),"s9");a(l9c,"yN");a(AJi,"RG");a(yJi,"D5");a(V8r,"e9");a(u9c,"fN");d9c=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(f9c,"hN");p9c="urn:ietf:params:oauth:grant-type:jwt-bearer",h9c="refresh_token",EJi="/v1/oauth/token",vIt="oauth-2025-04-20",m9c="oidc-federation-2026-04-01",g9c=120,W8r=30,A9c=5,Lzi=1048576;a(_Ji,"Z5");a(vJi,"M5");F3r=2e3,y9c=new Set(["error","error_description","error_uri"]);a(dP,"Z6");a(CJi,"L5");a(bJi,"j5");a(E9c,"fS");Zl=class extends wi{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(Rie,"Y4");vFr=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-Rie();return n>g9c?r.token:n>W8r?(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||Rie()-this.lastAdvisoryError{this.lastAdvisoryError=Rie(),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}},Kl=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(_9c,"rN");a(z8r,"Q8");a(Qzi,"bG");CIt={off:0,error:200,warn:300,info:400,debug:500},qzi=a((t,e,r)=>{if(t){if(r9c(CIt,t))return t;Yg(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(CIt))}`)}},"_G");a(xFe,"$Q");a(QTt,"A5");v9c={error:xFe,warn:xFe,info:xFe,debug:xFe},jzi=new WeakMap;a(Yg,"m$");Iie=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"),SJi="1.0",C9c=/^[A-Za-z0-9_.-]+$/;a(TJi,"tN");b9c=a(async t=>{var e,r;let n=await Y8r();if(n===null)return null;let o=t??await IJi();if(o===null)return null;TJi(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=Kl("ANTHROPIC_ORGANIZATION_ID"),h=Kl("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=Kl("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:Kl("ANTHROPIC_WORKSPACE_ID"),base_url:Kl("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:Kl("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:Kl("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=Kl("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=Kl("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=Kl("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=Kl("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=Kl("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=Kl("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=Kl("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),S9c=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await Y8r();if(!r)return null;let n=e??await IJi();return n?(TJi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),Y8r=a(async()=>{if(!T9c())return null;let t=await import("node:path"),e=Kl("ANTHROPIC_CONFIG_DIR");if(e)return e;if($8r()["X-Stainless-OS"]==="Windows"){let o=Kl("APPDATA");if(o)return t.join(o,"Anthropic");let s=Kl("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=Kl("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=Kl("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),T9c=a(()=>{let t=$8r()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),IJi=a(async()=>{let t=await Y8r();if(!t)return null;let e=Kl("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(Hzi,"SG");a(I9c,"$w");a(x9c,"Qw");a(w9c,"Jw");a(xJi,"vG");a(R9c,"Xw");a(P9c,"mS");a(k9c,"lS");a(D9c,"cS");Mie=class{static{a(this,"B1")}constructor(){CI.set(this,void 0),bI.set(this,void 0),mn(this,CI,new Uint8Array,"f"),mn(this,bI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?z8r(e):e;mn(this,CI,_9c([gt(this,CI,"f"),r]),"f");let n=[],o;for(;(o=N9c(gt(this,CI,"f"),gt(this,bI,"f")))!=null;){if(o.carriage&>(this,bI,"f")==null){mn(this,bI,o.index,"f");continue}if(gt(this,bI,"f")!=null&&(o.index!==gt(this,bI,"f")+1||o.carriage)){n.push(Qzi(gt(this,CI,"f").subarray(0,gt(this,bI,"f")-1))),mn(this,CI,gt(this,CI,"f").subarray(gt(this,bI,"f")),"f"),mn(this,bI,null,"f");continue}let s=gt(this,bI,"f")!==null?o.preceding-1:o.preceding,c=Qzi(gt(this,CI,"f").subarray(0,s));n.push(c),mn(this,CI,gt(this,CI,"f").subarray(o.index),"f"),mn(this,bI,null,"f")}return n}flush(){return gt(this,CI,"f").length?this.decode(` -`):[]}};CI=new WeakMap,bI=new WeakMap;Mie.NEWLINE_CHARS=new Set([` -`,"\r"]);Mie.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(N9c,"pS");a(M9c,"Yw");Oie=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,aFe.set(this,void 0),this.controller=r,mn(this,aFe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?Yg(n):console;async function*c(){if(o)throw new wi("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of O9c(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=gJi(u.data)??u.data,f=d?.error?.type;throw new $v(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(qFe(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 Mie,u=V8r(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 wi("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(qFe(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(aFe=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,aFe,"f")),new t(()=>o(r),this.controller,gt(this,aFe,"f"))]}toReadableStream(){let e=this,r;return AJi({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=z8r(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(O9c,"dS");a(B9c,"iS");CFr=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]=L9c(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(L9c,"nS");a(wJi,"P5");a(RJi,"CG");bIt=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=wJi){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,wFe.set(this,void 0),mn(this,wFe,e,"f")}_thenUnwrap(e){return new t(gt(this,wFe,"f"),this.responsePromise,async(r,n)=>RJi(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,wFe,"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)}};wFe=new WeakMap;SIt=class{static{a(this,"TG")}constructor(e,r,n,o){qTt.set(this,void 0),mn(this,qTt,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 wi("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await gt(this,qTt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(qTt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},bFr=class extends bIt{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await wJi(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},Bie=class extends SIt{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:{..._Fr(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{..._Fr(this.options.query),after_id:e}}:null}},ZE=class extends SIt{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:{..._Fr(this.options.query),page:e}}:null}},PJi=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(H_e,"J0");a(sIt,"XQ");kJi=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),K8r=a(async(t,e,r=!0)=>({...t,body:await U9c(t.body,e,r)}),"J8"),Gzi=new WeakMap;a(F9c,"oS");U9c=a(async(t,e,r=!0)=>{if(!await F9c(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])=>SFr(n,o,s,r))),n},"tS"),Q9c=a(t=>t instanceof Blob&&"name"in t,"aS"),SFr=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,H_e([await r.blob()],sIt(r,n),o))}else if(kJi(r))t.append(e,H_e([await new Response(yJi(r)).blob()],sIt(r,n)));else if(Q9c(r))t.append(e,H_e([r],sIt(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>SFr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>SFr(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"),DJi=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"),q9c=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&DJi(t),"sS"),j9c=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(H9c,"_5");a(TFr,"gG");a(G9c,"$v");Cd=class{static{a(this,"t")}constructor(e){this._client=e}},NJi=Symbol.for("brand.privateNullableHeaders");a($9c,"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 $9c(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{[NJi]:!0,values:e,nulls:r}},"R");a(MJi,"qw");$zi=Object.freeze(Object.create(null)),V9c=a((t=MJi)=>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??$zi)??$zi)?.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 wi(`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}),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: ${o.map(h=>h.error).join(` `)} ${s} -${f}`)}return s},"Xv"),$n=V9c(MJi),TIt=class extends Cd{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",ZE,{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])})}},BFe=Symbol("anthropic.sdk.stainlessHelper");a(aIt,"k5");a(OJi,"hG");a(BJi,"S5");a(W9c,"Vw");IIt=class extends Cd{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",Bie,{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",K8r({body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},W9c(o.file),r?.headers])},this._client))}},xIt=class extends Cd{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",Bie,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},wIt=class extends Cd{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",ZE,{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])})}},RIt=class extends Cd{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/agents/${e}/versions?beta=true`,ZE,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},jFe=class extends Cd{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new RIt(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",ZE,{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])})}};jFe.Versions=RIt;PIt=class extends Cd{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`,ZE,{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])})}},kIt=class extends Cd{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`,ZE,{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])})}},Y_e=class extends Cd{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new PIt(this._client),this.memoryVersions=new kIt(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",ZE,{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])})}};Y_e.Memories=PIt;Y_e.MemoryVersions=kIt;DIt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new Mie;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 wi("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 wi("Attempted to iterate over a response with no body");return new t(V8r(e.body),r)}},NIt=class extends Cd{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",Bie,{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 wi(`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)=>DIt.fromResponse(l.response,l.controller))}},LJi={"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(FJi,"Bw");a(Vzi,"uG");a(UJi,"mG");a(z9c,"Nv");Y9c=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),L_e(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),L_e(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),L_e(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),L_e(t);break;case"delimiter":return t=t.slice(0,t.length-1),L_e(t)}return t},"W8"),K9c=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"),J9c=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),QJi=a(t=>JSON.parse(J9c(K9c(L_e(Y9c(t))))),"C5"),Yzi="__json_buf";a(Kzi,"Ow");IFr=class t{static{a(this,"ZQ")}constructor(e,r){sP.add(this),this.messages=[],this.receivedMessages=[],UV.set(this,void 0),P_e.set(this,null),this.controller=new AbortController,cFe.set(this,void 0),jTt.set(this,()=>{}),lFe.set(this,()=>{}),uFe.set(this,void 0),HTt.set(this,()=>{}),dFe.set(this,()=>{}),T9.set(this,{}),fFe.set(this,!1),GTt.set(this,!1),$Tt.set(this,!1),Cie.set(this,!1),VTt.set(this,void 0),WTt.set(this,void 0),pFe.set(this,void 0),zTt.set(this,n=>{if(mn(this,GTt,!0,"f"),qFe(n)&&(n=new TI),n instanceof TI)return mn(this,$Tt,!0,"f"),this._emit("abort",n);if(n instanceof wi)return this._emit("error",n);if(n instanceof Error){let o=new wi(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new wi(String(n)))}),mn(this,cFe,new Promise((n,o)=>{mn(this,jTt,n,"f"),mn(this,lFe,o,"f")}),"f"),mn(this,uFe,new Promise((n,o)=>{mn(this,HTt,n,"f"),mn(this,dFe,o,"f")}),"f"),gt(this,cFe,"f").catch(()=>{}),gt(this,uFe,"f").catch(()=>{}),mn(this,P_e,e,"f"),mn(this,pFe,r?.logger??console,"f")}get response(){return gt(this,VTt,"f")}get request_id(){return gt(this,WTt,"f")}async withResponse(){mn(this,Cie,!0,"f");let e=await gt(this,cFe,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return mn(s,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")},gt(this,zTt,"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,sP,"m",Q3r).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,sP,"m",q3r).call(this,u);if(l.controller.signal?.aborted)throw new TI;gt(this,sP,"m",j3r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(mn(this,VTt,e,"f"),mn(this,WTt,e?.headers.get("request-id"),"f"),gt(this,jTt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,fFe,"f")}get errored(){return gt(this,GTt,"f")}get aborted(){return gt(this,$Tt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,T9,"f")[e]||(gt(this,T9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,T9,"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,T9,"f")[e]||(gt(this,T9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{mn(this,Cie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){mn(this,Cie,!0,"f"),await gt(this,uFe,"f")}get currentMessage(){return gt(this,UV,"f")}async finalMessage(){return await this.done(),gt(this,sP,"m",U3r).call(this)}async finalText(){return await this.done(),gt(this,sP,"m",Wzi).call(this)}_emit(e,...r){if(gt(this,fFe,"f"))return;e==="end"&&(mn(this,fFe,!0,"f"),gt(this,HTt,"f").call(this));let n=gt(this,T9,"f")[e];if(n&&(gt(this,T9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Cie,"f")&&!n?.length&&Promise.reject(o),gt(this,lFe,"f").call(this,o),gt(this,dFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Cie,"f")&&!n?.length&&Promise.reject(o),gt(this,lFe,"f").call(this,o),gt(this,dFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,sP,"m",U3r).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,sP,"m",Q3r).call(this),this._connected(null);let s=Oie.fromReadableStream(e,this.controller);for await(let c of s)gt(this,sP,"m",q3r).call(this,c);if(s.controller.signal?.aborted)throw new TI;gt(this,sP,"m",j3r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(UV=new WeakMap,P_e=new WeakMap,cFe=new WeakMap,jTt=new WeakMap,lFe=new WeakMap,uFe=new WeakMap,HTt=new WeakMap,dFe=new WeakMap,T9=new WeakMap,fFe=new WeakMap,GTt=new WeakMap,$Tt=new WeakMap,Cie=new WeakMap,VTt=new WeakMap,WTt=new WeakMap,pFe=new WeakMap,zTt=new WeakMap,sP=new WeakSet,U3r=a(function(){if(this.receivedMessages.length===0)throw new wi("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),Wzi=a(function(){if(this.receivedMessages.length===0)throw new wi("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 wi("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),Q3r=a(function(){this.ended||mn(this,UV,void 0,"f")},"cG"),q3r=a(function(e){if(this.ended)return;let r=gt(this,sP,"m",zzi).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":{Kzi(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(Vzi(r,gt(this,P_e,"f"),{logger:gt(this,pFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{mn(this,UV,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),j3r=a(function(){if(this.ended)throw new wi("stream has ended, this shouldn't happen");let e=gt(this,UV,"f");if(!e)throw new wi("request ended without sending any chunks");return mn(this,UV,void 0,"f"),Vzi(e,gt(this,P_e,"f"),{logger:gt(this,pFe,"f")})},"dG"),zzi=a(function(e){let r=gt(this,UV,"f");if(e.type==="message_start"){if(r)throw new wi(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new wi(`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&&Kzi(n)){let o=n[Yzi]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,Yzi,{value:o,enumerable:!1,writable:!0}),o)try{s.input=QJi(o)}catch(c){let l=new wi(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);gt(this,zTt,"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 Oie(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},MIt=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}},Z9c=1e5,X9c=`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=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: 1. Task Overview The user's core request and success criteria Any clarifications or constraints they specified @@ -1566,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(Zzi,"Lw");OIt=class{static{a(this,"jQ")}constructor(e,r,n){hFe.add(this),this.client=e,k_e.set(this,!1),bie.set(this,!1),k0.set(this,void 0),v1.set(this,void 0),vI.set(this,void 0),P9.set(this,void 0),QV.set(this,void 0),mFe.set(this,0),mn(this,k0,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...OJi(r.tools,r.messages)].join(", ");mn(this,v1,{...n,headers:mr([{"x-stainless-helper":o},n?.headers])},"f"),mn(this,QV,Zzi(),"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*[(k_e=new WeakMap,bie=new WeakMap,k0=new WeakMap,v1=new WeakMap,vI=new WeakMap,P9=new WeakMap,QV=new WeakMap,mFe=new WeakMap,hFe=new WeakSet,Jzi=a(async function(){let e=gt(this,k0,"f").params.compactionControl;if(!e||!e.enabled)return!1;let r=0;if(gt(this,vI,"f")!==void 0)try{let u=await gt(this,vI,"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??Z9c;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,k0,"f").params.max_tokens},{signal:gt(this,v1,"f").signal,headers:mr([gt(this,v1,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new wi("Expected text response for compaction");return gt(this,k0,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(gt(this,k_e,"f"))throw new wi("Cannot iterate over a consumed stream");mn(this,k_e,!0,"f"),mn(this,bie,!0,"f"),mn(this,P9,void 0,"f");try{for(;;){let r;try{if(gt(this,k0,"f").params.max_iterations&>(this,mFe,"f")>=gt(this,k0,"f").params.max_iterations)break;mn(this,bie,!1,"f"),mn(this,P9,void 0,"f"),mn(this,mFe,(e=gt(this,mFe,"f"),e++,e),"f"),mn(this,vI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=gt(this,k0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},gt(this,v1,"f")),mn(this,vI,r.finalMessage(),"f"),gt(this,vI,"f").catch(()=>{}),yield r):(mn(this,vI,this.client.beta.messages.create({...s,stream:!1},gt(this,v1,"f")),"f"),yield gt(this,vI,"f")),!await gt(this,hFe,"m",Jzi).call(this)){if(!gt(this,bie,"f")){let{role:l,content:u}=await gt(this,vI,"f");gt(this,k0,"f").params.messages.push({role:l,content:u})}let c=await gt(this,hFe,"m",xFr).call(this,gt(this,k0,"f").params.messages.at(-1));if(c)gt(this,k0,"f").params.messages.push(c);else if(!gt(this,bie,"f"))break}}finally{r&&r.abort()}}if(!gt(this,vI,"f"))throw new wi("ToolRunner concluded without a message from the server");gt(this,QV,"f").resolve(await gt(this,vI,"f"))}catch(r){throw mn(this,k_e,!1,"f"),gt(this,QV,"f").promise.catch(()=>{}),gt(this,QV,"f").reject(r),mn(this,QV,Zzi(),"f"),r}}setMessagesParams(e){typeof e=="function"?gt(this,k0,"f").params=e(gt(this,k0,"f").params):gt(this,k0,"f").params=e,mn(this,bie,!0,"f"),mn(this,P9,void 0,"f")}setRequestOptions(e){typeof e=="function"?mn(this,v1,e(gt(this,v1,"f")),"f"):mn(this,v1,{...gt(this,v1,"f"),...e},"f")}async generateToolResponse(e=gt(this,v1,"f").signal){let r=await gt(this,vI,"f")??this.params.messages.at(-1);return r?gt(this,hFe,"m",xFr).call(this,r,e):null}done(){return gt(this,QV,"f").promise}async runUntilDone(){if(!gt(this,k_e,"f"))for await(let e of this);return this.done()}get params(){return gt(this,k0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};xFr=a(async function(t,e=gt(this,v1,"f").signal){return gt(this,P9,"f")!==void 0?gt(this,P9,"f"):(mn(this,P9,eUc(gt(this,k0,"f").params,t,{...gt(this,v1,"f"),signal:e}),"f"),gt(this,P9,"f"))},"iG");a(eUc,"Fv");Xzi={"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"},tUc=["claude-mythos-preview","claude-opus-4-6"],Lie=class extends Cd{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new NIt(this._client)}create(e,r){let n=eYi(e),{betas:o,...s}=n;s.model in Xzi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${Xzi[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),tUc.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=LJi[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=BJi(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=>UJi(n,e,{logger:this._client.logger??console}))}stream(e,r){return IFr.createMessage(this,e,r)}countTokens(e,r){let n=eYi(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 OIt(this._client,e,r)}};a(eYi,"Aw");Lie.Batches=NIt;Lie.BetaToolRunner=OIt;Lie.ToolError=MIt;BIt=class extends Cd{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/events?beta=true`,ZE,{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})}},LIt=class extends Cd{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`,ZE,{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])})}},K_e=class extends Cd{static{a(this,"G0")}constructor(){super(...arguments),this.events=new BIt(this._client),this.resources=new LIt(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",ZE,{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])})}};K_e.Events=BIt;K_e.Resources=LIt;FIt=class extends Cd{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post($n`/v1/skills/${e}/versions?beta=true`,K8r({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`,ZE,{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])})}},HFe=class extends Cd{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new FIt(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",K8r({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",ZE,{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])})}};HFe.Versions=FIt;UIt=class extends Cd{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`,ZE,{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])})}},GFe=class extends Cd{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new UIt(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",ZE,{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])})}};GFe.Credentials=UIt;b1=class extends Cd{static{a(this,"G6")}constructor(){super(...arguments),this.models=new xIt(this._client),this.messages=new Lie(this._client),this.agents=new jFe(this._client),this.environments=new TIt(this._client),this.sessions=new K_e(this._client),this.vaults=new GFe(this._client),this.memoryStores=new Y_e(this._client),this.files=new IIt(this._client),this.skills=new HFe(this._client),this.userProfiles=new wIt(this._client)}};b1.Models=xIt;b1.Messages=Lie;b1.Agents=jFe;b1.Environments=TIt;b1.Sessions=K_e;b1.Vaults=GFe;b1.MemoryStores=Y_e;b1.Files=IIt;b1.Skills=HFe;b1.UserProfiles=wIt;QIt=class extends Cd{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(qJi,"Iw");a(tYi,"nG");a(jJi,"rG");a(rUc,"bv");iYi="__json_buf";a(oYi,"bw");wFr=class t{static{a(this,"CQ")}constructor(e,r){aP.add(this),this.messages=[],this.receivedMessages=[],qV.set(this,void 0),D_e.set(this,null),this.controller=new AbortController,gFe.set(this,void 0),YTt.set(this,()=>{}),AFe.set(this,()=>{}),yFe.set(this,void 0),KTt.set(this,()=>{}),EFe.set(this,()=>{}),I9.set(this,{}),_Fe.set(this,!1),JTt.set(this,!1),ZTt.set(this,!1),Sie.set(this,!1),XTt.set(this,void 0),eIt.set(this,void 0),vFe.set(this,void 0),G3r.set(this,n=>{if(mn(this,JTt,!0,"f"),qFe(n)&&(n=new TI),n instanceof TI)return mn(this,ZTt,!0,"f"),this._emit("abort",n);if(n instanceof wi)return this._emit("error",n);if(n instanceof Error){let o=new wi(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new wi(String(n)))}),mn(this,gFe,new Promise((n,o)=>{mn(this,YTt,n,"f"),mn(this,AFe,o,"f")}),"f"),mn(this,yFe,new Promise((n,o)=>{mn(this,KTt,n,"f"),mn(this,EFe,o,"f")}),"f"),gt(this,gFe,"f").catch(()=>{}),gt(this,yFe,"f").catch(()=>{}),mn(this,D_e,e,"f"),mn(this,vFe,r?.logger??console,"f")}get response(){return gt(this,XTt,"f")}get request_id(){return gt(this,eIt,"f")}async withResponse(){mn(this,Sie,!0,"f");let e=await gt(this,gFe,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return mn(s,D_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,G3r,"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,aP,"m",$3r).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,aP,"m",V3r).call(this,u);if(l.controller.signal?.aborted)throw new TI;gt(this,aP,"m",W3r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(mn(this,XTt,e,"f"),mn(this,eIt,e?.headers.get("request-id"),"f"),gt(this,YTt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,_Fe,"f")}get errored(){return gt(this,JTt,"f")}get aborted(){return gt(this,ZTt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,I9,"f")[e]||(gt(this,I9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(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(gt(this,I9,"f")[e]||(gt(this,I9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{mn(this,Sie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){mn(this,Sie,!0,"f"),await gt(this,yFe,"f")}get currentMessage(){return gt(this,qV,"f")}async finalMessage(){return await this.done(),gt(this,aP,"m",H3r).call(this)}async finalText(){return await this.done(),gt(this,aP,"m",rYi).call(this)}_emit(e,...r){if(gt(this,_Fe,"f"))return;e==="end"&&(mn(this,_Fe,!0,"f"),gt(this,KTt,"f").call(this));let n=gt(this,I9,"f")[e];if(n&&(gt(this,I9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Sie,"f")&&!n?.length&&Promise.reject(o),gt(this,AFe,"f").call(this,o),gt(this,EFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Sie,"f")&&!n?.length&&Promise.reject(o),gt(this,AFe,"f").call(this,o),gt(this,EFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,aP,"m",H3r).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,aP,"m",$3r).call(this),this._connected(null);let s=Oie.fromReadableStream(e,this.controller);for await(let c of s)gt(this,aP,"m",V3r).call(this,c);if(s.controller.signal?.aborted)throw new TI;gt(this,aP,"m",W3r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(qV=new WeakMap,D_e=new WeakMap,gFe=new WeakMap,YTt=new WeakMap,AFe=new WeakMap,yFe=new WeakMap,KTt=new WeakMap,EFe=new WeakMap,I9=new WeakMap,_Fe=new WeakMap,JTt=new WeakMap,ZTt=new WeakMap,Sie=new WeakMap,XTt=new WeakMap,eIt=new WeakMap,vFe=new WeakMap,G3r=new WeakMap,aP=new WeakSet,H3r=a(function(){if(this.receivedMessages.length===0)throw new wi("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),rYi=a(function(){if(this.receivedMessages.length===0)throw new wi("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 wi("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),$3r=a(function(){this.ended||mn(this,qV,void 0,"f")},"aG"),V3r=a(function(e){if(this.ended)return;let r=gt(this,aP,"m",nYi).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":{oYi(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(tYi(r,gt(this,D_e,"f"),{logger:gt(this,vFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{mn(this,qV,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),W3r=a(function(){if(this.ended)throw new wi("stream has ended, this shouldn't happen");let e=gt(this,qV,"f");if(!e)throw new wi("request ended without sending any chunks");return mn(this,qV,void 0,"f"),tYi(e,gt(this,D_e,"f"),{logger:gt(this,vFe,"f")})},"eG"),nYi=a(function(e){let r=gt(this,qV,"f");if(e.type==="message_start"){if(r)throw new wi(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new wi(`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&&oYi(n)){let o=n[iYi]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,iYi,{value:o,enumerable:!1,writable:!0}),o&&(s.input=QJi(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 Oie(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},qIt=class extends Cd{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",Bie,{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 wi(`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)=>DIt.fromResponse(s.response,s.controller))}},$Fe=class extends Cd{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new qIt(this._client)}create(e,r){e.model in sYi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${sYi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),nUc.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=LJi[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=BJi(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=>jJi(n,e,{logger:this._client.logger??console}))}stream(e,r){return wFr.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},sYi={"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"},nUc=["claude-mythos-preview","claude-opus-4-6"];$Fe.Batches=qIt;jIt=class extends Cd{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",Bie,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},iUc="\\n\\nHuman:",oUc="\\n\\nAssistant:",Rp=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=Kl("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(RFr.add(this),this._requestAuthFlags=new WeakMap,cIt.set(this,void 0),r===void 0&&(r=o.profile!=null?null:Kl("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:Kl("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&&o9c())throw new wi(`It looks like you're running in a browser-like environment. +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. 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??J8r.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=qzi(s.logLevel,"ClientOptions.logLevel",this)??qzi(Kl("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??l9c(),mn(this,cIt,d9c,"f");let l=Kl("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=xJi(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=>{Yg(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{Yg(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new vFr(e,r=>{Yg(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 R9c(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 wi(`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 f9c(e)}getUserAgent(){return`${this.constructor.name}/JS ${VV}`}defaultIdempotencyKey(){return`stainless-node-retry-${mJi()}`}makeStatusError(e,r,n,o){return $v.generate(e,r,n,o)}buildURL(e,r,n){let o=!gt(this,RFr,"m",HJi).call(this)&&n||this.baseURL,s=t9c(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!Nzi(c)||!Nzi(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 wi("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(vIt)||o.append("anthropic-beta",vIt),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 bIt(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(Yg(this).debug(`[${d}] sending request`,Iie({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new TI;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(yFr),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new TI;let v=qFe(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return Yg(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),Yg(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,Iie({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw Yg(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),Yg(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,Iie({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new fIt:new z_e({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 u9c(g.body),Yg(this).info(`${E} - ${R}`),Yg(this).debug(`[${d}] response error (${R})`,Iie({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";Yg(this).info(`${E} - ${v}`);let b=await g.text().catch(R=>yFr(R).message),T=gJi(b),w=T?void 0:b;throw Yg(this).debug(`[${d}] response error (${v})`,Iie({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 Yg(this).info(E),Yg(this).debug(`[${d}] response start`,Iie({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 bFr(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 i9c(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 wi("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&&n9c("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))}:{},...$8r(),...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:yJi(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,cIt,"f").call(this,{body:e,headers:n})}};J8r=Rp,cIt=new WeakMap,RFr=new WeakSet,HJi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");Rp.Anthropic=J8r;Rp.HUMAN_PROMPT=iUc;Rp.AI_PROMPT=oUc;Rp.DEFAULT_TIMEOUT=6e5;Rp.AnthropicError=wi;Rp.APIError=$v;Rp.APIConnectionError=z_e;Rp.APIConnectionTimeoutError=fIt;Rp.APIUserAbortError=TI;Rp.NotFoundError=gIt;Rp.ConflictError=AIt;Rp.RateLimitError=EIt;Rp.BadRequestError=pIt;Rp.AuthenticationError=hIt;Rp.InternalServerError=_It;Rp.PermissionDeniedError=mIt;Rp.UnprocessableEntityError=yIt;Rp.toFile=H9c;J_e=class extends Rp{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new QIt(this),this.messages=new $Fe(this),this.models=new jIt(this),this.beta=new b1(this)}};J_e.Completions=QIt;J_e.Messages=$Fe;J_e.Models=jIt;J_e.Beta=b1;a(A8e,"j4");a(lIt,"N8");a(II,"o$");a(y8e,"D1");a(GJi,"JU");a(sUc,"Tw");aUc=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),cUc=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a(lUc,"xw");kFr=class{static{a(this,"gw")}read(e){return(0,Kg.readFile)(e,"utf8")}readBytes(e){return(0,Kg.readFile)(e)}write(e,r,n){return(0,Kg.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,Kg.mkdir)(e,{recursive:!0})}catch(r){if(II(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return lUc(e,r,n)}delete(e){return(0,Kg.unlink)(e)}list(e){return(0,Kg.readdir)(e)}append(e,r,n){return(0,Kg.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,Kg.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,Kg.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,Kg.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,Kg.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},uUc=new VJi.AsyncLocalStorage;a(HIt,"w8");N_e=null;a(zJi,"uw");a(dUc,"mw");a(cP,"L6");a(fUc,"dv");pUc=fUc;a(hUc,"iv");mUc=hUc;a(gUc,"nv");AUc=gUc;a(yUc,"rv");EUc=yUc,_Uc=200;a(vUc,"tv");CUc=vUc;a(Cve,"D8");Cve.prototype.clear=pUc;Cve.prototype.delete=mUc;Cve.prototype.get=AUc;Cve.prototype.has=EUc;Cve.prototype.set=CUc;bUc=Cve,SUc=(function(){try{var t=j8r(Object,"defineProperty");return t({},"",{}),t}catch{}})(),GIt=SUc;a(TUc,"sv");Z8r=TUc,IUc=Object.prototype,xUc=IUc.hasOwnProperty;a(wUc,"QC");YJi=wUc;a(RUc,"JC");PUc=RUc;a(kUc,"XC");DUc=kUc;a(NUc,"YC");bve=NUc,MUc="[object Arguments]";a(OUc,"GC");aYi=OUc,KJi=Object.prototype,BUc=KJi.hasOwnProperty,LUc=KJi.propertyIsEnumerable,FUc=aYi((function(){return arguments})())?aYi:function(t){return bve(t)&&BUc.call(t,"callee")&&!LUc.call(t,"callee")},VFe=FUc,UUc=Array.isArray,ZV=UUc,RFe={};OB(RFe,{default:a(()=>X8r,"default")});a(QUc,"VC");qUc=QUc,JJi=typeof RFe=="object"&&RFe&&!RFe.nodeType&&RFe,cYi=JJi&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,jUc=cYi&&cYi.exports===JJi,lYi=jUc?Ave.Buffer:void 0,HUc=lYi?lYi.isBuffer:void 0,GUc=HUc||qUc,X8r=GUc,$Uc=9007199254740991,VUc=/^(?:0|[1-9]\d*)$/;a(WUc,"DC");Hxt=WUc,zUc=9007199254740991;a(YUc,"ZC");e6r=YUc,KUc="[object Arguments]",JUc="[object Array]",ZUc="[object Boolean]",XUc="[object Date]",e7c="[object Error]",t7c="[object Function]",r7c="[object Map]",n7c="[object Number]",i7c="[object Object]",o7c="[object RegExp]",s7c="[object Set]",a7c="[object String]",c7c="[object WeakMap]",l7c="[object ArrayBuffer]",u7c="[object DataView]",d7c="[object Float32Array]",f7c="[object Float64Array]",p7c="[object Int8Array]",h7c="[object Int16Array]",m7c="[object Int32Array]",g7c="[object Uint8Array]",A7c="[object Uint8ClampedArray]",y7c="[object Uint16Array]",E7c="[object Uint32Array]",_d={};_d[d7c]=_d[f7c]=_d[p7c]=_d[h7c]=_d[m7c]=_d[g7c]=_d[A7c]=_d[y7c]=_d[E7c]=!0;_d[KUc]=_d[JUc]=_d[l7c]=_d[ZUc]=_d[u7c]=_d[XUc]=_d[e7c]=_d[t7c]=_d[r7c]=_d[n7c]=_d[i7c]=_d[o7c]=_d[s7c]=_d[a7c]=_d[c7c]=!1;a(_7c,"pC");v7c=_7c;a(C7c,"dC");b7c=C7c,PFe={};OB(PFe,{default:a(()=>DFr,"default")});ZJi=typeof PFe=="object"&&PFe&&!PFe.nodeType&&PFe,LFe=ZJi&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,S7c=LFe&&LFe.exports===ZJi,z3r=S7c&&uJi.process,T7c=(function(){try{var t=LFe&&LFe.require&&LFe.require("util").types;return t||z3r&&z3r.binding&&z3r.binding("util")}catch{}})(),DFr=T7c,uYi=DFr&&DFr.isTypedArray,I7c=uYi?b7c(uYi):v7c,XJi=I7c,x7c=Object.prototype,w7c=x7c.hasOwnProperty;a(R7c,"aC");P7c=R7c,k7c=Object.prototype;a(D7c,"eC");eZi=D7c;a(N7c,"$T");M7c=N7c;a(O7c,"QT");t6r=O7c;a(B7c,"JT");L7c=B7c,F7c=Object.prototype,U7c=F7c.hasOwnProperty;a(Q7c,"WT");q7c=Q7c;a(j7c,"GT");tZi=j7c,kFe={};OB(kFe,{default:a(()=>nZi,"default")});rZi=typeof kFe=="object"&&kFe&&!kFe.nodeType&&kFe,dYi=rZi&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,H7c=dYi&&dYi.exports===rZi,fYi=H7c?Ave.Buffer:void 0,pYi=fYi?fYi.allocUnsafe:void 0;a(G7c,"HT");nZi=G7c;a($7c,"KT");V7c=$7c;a(W7c,"qT");z7c=W7c,Y7c=M7c(Object.getPrototypeOf,Object),iZi=Y7c,K7c=Ave.Uint8Array,hYi=K7c;a(J7c,"zT");Z7c=J7c;a(X7c,"NT");eQc=X7c,mYi=Object.create,tQc=(function(){function t(){}return a(t,"$"),function(e){if(!M9(e))return{};if(mYi)return mYi(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),rQc=tQc;a(nQc,"OT");iQc=nQc,oQc="[object Symbol]";a(sQc,"FT");r6r=sQc,aQc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cQc=/^\w*$/;a(lQc,"LT");uQc=lQc,dQc=500;a(fQc,"AT");pQc=fQc,hQc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mQc=/\\(\\)?/g,gQc=pQc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(hQc,function(r,n,o,s){e.push(o?s.replace(mQc,"$1"):n||r)}),e}),AQc=gQc;a(yQc,"ET");EQc=yQc,_Qc=1/0,gYi=JV?JV.prototype:void 0,AYi=gYi?gYi.toString:void 0;a(oZi,"PO");vQc=oZi;a(CQc,"_T");bQc=CQc;a(SQc,"kT");Gxt=SQc,TQc=1/0;a(IQc,"vT");n6r=IQc;a(xQc,"CT");wQc=xQc;a(RQc,"TT");PQc=RQc;a(kQc,"xT");DQc=kQc;a(NQc,"yT");MQc=NQc;a(OQc,"fT");sZi=OQc,i6r=null;a(BQc,"CO");a(LQc,"TO");VIt=new Map;a(FQc,"xO");a(UQc,"yO");o6r=new Map;a(qQc,"fO");a(jQc,"gO");a(s6r,"V0");a(GQc,"hO");a($Qc,"uO");VQc={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(WQc,"lT");zQc=WQc(),YQc=a(()=>{},"pT");a(cZi,"VU");KQc=m8e(),WVh=KQc.subscribe,JQc=m8e(),zVh=JQc.subscribe,ZQc=m8e(),YVh=ZQc.subscribe,XQc=m8e(),KVh=XQc.subscribe,eqc=m8e(),JVh=eqc.subscribe;a(tqc,"lO");a(rqc,"tT");MFr=class{static{a(this,"cO")}#e=new Set;register(e){let r=rqc(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}},nqc=new MFr;a(iqc,"pO");oqc=Cy(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(sqc,"sT");a(aqc,"eT");a(cqc,"iO");a(lqc,"tO");a(uqc,"Qx");a(yYi,"oO");a(dqc,"aO");a(uZi,"HX");fqc={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=Kd(e,Zd`fs.existsSync(${t})`,0);return vo.existsSync(t)}catch(o){var r=o,n=1}finally{Jd(e,r,n)}},async stat(t){return(0,O0.stat)(t)},async readdir(t){return(0,O0.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,O0.unlink)(t)},async rmdir(t){return(0,O0.rmdir)(t)},async rm(t,e){return(0,O0.rm)(t,e)},async mkdir(t,e){try{await(0,O0.mkdir)(t,{recursive:!0,...e})}catch(r){if(II(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,O0.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,O0.rename)(t,e)},statSync(t){let e=[];try{let o=Kd(e,Zd`fs.statSync(${t})`,0);return vo.statSync(t)}catch(o){var r=o,n=1}finally{Jd(e,r,n)}},lstatSync(t){let e=[];try{let o=Kd(e,Zd`fs.lstatSync(${t})`,0);return vo.lstatSync(t)}catch(o){var r=o,n=1}finally{Jd(e,r,n)}},readFileSync(t,e){let r=[];try{let s=Kd(r,Zd`fs.readFileSync(${t})`,0);return vo.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{Jd(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=Kd(e,Zd`fs.readFileBytesSync(${t})`,0);return vo.readFileSync(t)}catch(o){var r=o,n=1}finally{Jd(e,r,n)}},readSync(t,e){let r=[];try{let s=Kd(r,Zd`fs.readSync(${t}, ${e.length} bytes)`,0),c;try{c=vo.openSync(t,"r");let l=Buffer.alloc(e.length),u=vo.readSync(c,l,0,e.length,0);return{buffer:l,bytesRead:u}}finally{c&&vo.closeSync(c)}}catch(s){var n=s,o=1}finally{Jd(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=Kd(n,Zd`fs.appendFileSync(${t}, ${e.length} chars)`,0);if(r?.mode!==void 0)try{let l=vo.openSync(t,"ax",r.mode);try{vo.appendFileSync(l,e)}finally{vo.closeSync(l)}return}catch(l){if(II(l)!=="EEXIST")throw l}vo.appendFileSync(t,e)}catch(c){var o=c,s=1}finally{Jd(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=Kd(r,Zd`fs.copyFileSync(${t} → ${e})`,0);vo.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{Jd(r,n,o)}},unlinkSync(t){let e=[];try{let o=Kd(e,Zd`fs.unlinkSync(${t})`,0);vo.unlinkSync(t)}catch(o){var r=o,n=1}finally{Jd(e,r,n)}},renameSync(t,e){let r=[];try{let s=Kd(r,Zd`fs.renameSync(${t} → ${e})`,0);vo.renameSync(t,e)}catch(s){var n=s,o=1}finally{Jd(r,n,o)}},linkSync(t,e){let r=[];try{let s=Kd(r,Zd`fs.linkSync(${t} → ${e})`,0);vo.linkSync(t,e)}catch(s){var n=s,o=1}finally{Jd(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=Kd(n,Zd`fs.symlinkSync(${t} → ${e})`,0);vo.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{Jd(n,o,s)}},readlinkSync(t){let e=[];try{let o=Kd(e,Zd`fs.readlinkSync(${t})`,0);return vo.readlinkSync(t)}catch(o){var r=o,n=1}finally{Jd(e,r,n)}},realpathSync(t){let e=[];try{let o=Kd(e,Zd`fs.realpathSync(${t})`,0);return vo.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{Jd(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=Kd(r,Zd`fs.mkdirSync(${t})`,0),c={recursive:!0};e?.mode!==void 0&&(c.mode=e.mode);try{vo.mkdirSync(t,c)}catch(l){if(II(l)!=="EEXIST")throw l}}catch(s){var n=s,o=1}finally{Jd(r,n,o)}},readdirSync(t){let e=[];try{let o=Kd(e,Zd`fs.readdirSync(${t})`,0);return vo.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{Jd(e,r,n)}},readdirStringSync(t){let e=[];try{let o=Kd(e,Zd`fs.readdirStringSync(${t})`,0);return vo.readdirSync(t)}catch(o){var r=o,n=1}finally{Jd(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=Kd(e,Zd`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{Jd(e,r,n)}},rmdirSync(t){let e=[];try{let o=Kd(e,Zd`fs.rmdirSync(${t})`,0);vo.rmdirSync(t)}catch(o){var r=o,n=1}finally{Jd(e,r,n)}},rmSync(t,e){let r=[];try{let s=Kd(r,Zd`fs.rmSync(${t})`,0);vo.rmSync(t,e)}catch(s){var n=s,o=1}finally{Jd(r,n,o)}},createWriteStream(t){return vo.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,O0.readFile)(t);let r=await(0,O0.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(${_qc}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"}],vYi=null;a(Cqc,"Ox");a(bqc,"W2");OFr={verbose:0,debug:1,info:2,warn:3,error:4},Sqc=Cy(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(OFr,t)?t:"debug"}),Tqc=!1;a($xt,"qX");BFr=Cy(()=>{let t=$xt();return Tqc||KE(process.env.DEBUG)||KE(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||dZi()||t.some(e=>e.startsWith("--debug="))||fZi()!==null}),Iqc=Cy(()=>{let t=$xt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return oqc(e)}),dZi=Cy(()=>{let t=$xt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),fZi=Cy(()=>{let t=$xt();for(let e=0;e{try{let t=mZi(),e=(0,jie.dirname)(t),r=(0,jie.join)(e,"latest");await(0,XE.unlink)(r).catch(()=>{}),await(0,XE.symlink)(t,r)}catch{}}),eWh=(()=>{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})(),Dqc={[Symbol.dispose](){}};a(Nqc,"_x");Zd=Nqc;a(Nm,"B$");LN=a((t,e)=>{let r=[];try{let s=Kd(r,Zd`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{Jd(r,n,o)}},"d$");a(Mqc,"w2");a(XV,"A4");a(Oqc,"kx");a(Bqc,"O2");Lqc=2e3,WIt=new Set,CYi=!1;a(Fqc,"xx");a(Uqc,"yx");UFr=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=gFr();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||gFr(),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(A8e(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 lJi()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=KE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,oJi.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(KE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();cP(f),this.options.stderr&&this.options.stderr(f)}),{stdin:u.stdin,stdout:u.stdout,get killed(){return u.killed},get exitCode(){return u.exitCode},kill:u.kill.bind(u),on:u.on.bind(u),once:u.once.bind(u),off:u.off.bind(u)}}initialize(){try{let{additionalDirectories:e=[],agent:r,betas:n,cwd:o,executable:s=this.getDefaultExecutable(),executableArgs:c=[],extraArgs:l={},pathToClaudeCodeExecutable:u,env:d={...process.env},thinkingConfig:f,maxTurns:h,maxBudgetUsd:m,taskBudget:g,model:A,fallbackModel:y,jsonSchema:E,permissionMode:_,allowDangerouslySkipPermissions:v,permissionPromptToolName:b,continueConversation:T,resume:w,settingSources:R,skills:x,disallowedTools:P=[],tools:D,mcpServers:N,strictMcpConfig:B,canUseTool:L,includePartialMessages:j,plugins:M,sandbox:O}=this.options,{allowedTools:q=[]}=this.options;if(x!==void 0){let H=x==="all"?["Skill"]:x.map(ae=>`Skill(${ae})`),re=new Set(q);q=[...q,...H.filter(ae=>!re.has(ae))]}let Q=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(f){switch(f.type){case"enabled":f.budgetTokens===void 0?Q.push("--thinking","adaptive"):Q.push("--max-thinking-tokens",f.budgetTokens.toString());break;case"disabled":Q.push("--thinking","disabled");break;case"adaptive":Q.push("--thinking","adaptive");break}f.type!=="disabled"&&f.display&&Q.push("--thinking-display",f.display)}if(this.options.effort&&Q.push("--effort",this.options.effort),h&&Q.push("--max-turns",h.toString()),m!==void 0&&Q.push("--max-budget-usd",m.toString()),g&&Q.push("--task-budget",g.total.toString()),A&&Q.push("--model",A),r&&Q.push("--agent",r),n&&n.length>0&&Q.push("--betas",n.join(",")),E&&Q.push("--json-schema",Nm(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=dUc();H&&Q.push("--debug-file",H)}if(L){if(b)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");Q.push("--permission-prompt-tool","stdio")}else b&&Q.push("--permission-prompt-tool",b);if(T&&Q.push("--continue"),w&&Q.push("--resume",w),this.options.assistant&&Q.push("--assistant"),this.options.channels&&this.options.channels.length>0&&Q.push("--channels",...this.options.channels),q.length>0&&Q.push("--allowedTools",q.join(",")),P.length>0&&Q.push("--disallowedTools",P.join(",")),D!==void 0&&(Array.isArray(D)?D.length===0?Q.push("--tools",""):Q.push("--tools",D.join(",")):Q.push("--tools","default")),N&&Object.keys(N).length>0&&Q.push("--mcp-config",Nm({mcpServers:N})),R!==void 0&&Q.push(`--setting-sources=${R.join(",")}`),B&&Q.push("--strict-mcp-config"),_&&Q.push("--permission-mode",_),v&&Q.push("--allow-dangerously-skip-permissions"),y){if(A&&y===A)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");Q.push("--fallback-model",y)}this.options.includeHookEvents&&Q.push("--include-hook-events"),j&&Q.push("--include-partial-messages"),this.options.sessionMirror&&Q.push("--session-mirror");for(let H of e)Q.push("--add-dir",H);if(M&&M.length>0)for(let H of M)if(H.type==="local")Q.push("--plugin-dir",H.path);else throw Error(`Unsupported plugin type: ${H.type}`);this.options.forkSession&&Q.push("--fork-session"),this.options.resumeSessionAt&&Q.push("--resume-session-at",this.options.resumeSessionAt),this.options.sessionId&&Q.push("--session-id",this.options.sessionId),this.options.persistSession===!1&&Q.push("--no-session-persistence"),this.options.managedSettings&&Q.push("--managed-settings",this.options.managedSettings);let U={...l??{}};this.options.settings&&(U.settings=this.options.settings);let z=Bqc(U,O);for(let[H,re]of Object.entries(z))re===null?Q.push(`--${H}`):Q.push(`--${H}`,re);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,KE(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let $=Qqc(u),W=$?u:s,J=$?[...c,...Q]:[...c,u,...Q],ne={command:W,args:J,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(cP(`Spawning Claude Code (custom): ${W} ${J.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(ne)):(cP(`Spawning Claude Code: ${W} ${J.join(" ")}`),this.process=this.spawnLocalProcess(ne)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,Uqc(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 C1("Claude Code process aborted by user");else if(sUc(H)){let re=qqc(u,$);this.exitError=ReferenceError(re),cP(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${H.message}`),cP(this.exitError.message)}),this.process.on("exit",(H,re)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new C1("Claude Code process aborted by user");else{let ae=this.getProcessExitError(H,re);ae&&(this.exitError=ae,cP(ae.message))}}),this.ready=!this.abortController.signal.aborted}catch(e){throw this.ready=!1,e}}getProcessExitError(e,r){if(e!==0&&e!==null)return Error(`Claude Code process exited with code ${e}`);if(r)return Error(`Claude Code process terminated by signal ${r}`)}write(e){if(this.abortController.signal.aborted)throw new C1("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){cP("[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}`);cP(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||cP("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${lIt(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new C1("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()},Lqc,r,e).unref(),r.once("exit",()=>WIt.delete(r))):r&&(WIt.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,aJi.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=LN(n)}catch{cP(`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 C1("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(Qqc,"fx");a(qqc,"gx");M_e="@anthropic-ai/claude-agent-sdk";a(jqc,"ux");a(Hqc,"F2");zIt=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(Gqc,"mx");$qc=Gqc();a(a6r,"BX");a(yZi,"AU");a(EZi,"IU");a(Vqc,"Z2");a(x9,"I4");QFr=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?.())}},qFr=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new zIt;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,$It.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&&(Jl("[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 C1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);Jl(`[Query.readMessages] Replacing exit error with result text. Original: ${lIt(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(Nm(o)+` -`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:lIt(n)}};try{await Promise.resolve(this.transport.write(Nm(o)+` -`))}catch(s){Jl(`[Query.handleControlRequest] Error-response write failed: ${lIt(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 x9("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 x9("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 x9("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 x9("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return x9("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(Nm(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 x9("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return x9("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 x9("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return x9("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){Jl("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,Jl(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(Nm(n)+` -`))}Jl(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(Jl("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),Jl("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof C1))throw r}}waitForFirstResult(){return this.firstResultReceived?(Jl("[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 QFr(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),Jl(`[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,$It.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write(Nm(n)+` -`)).catch(o=>{Jl(`[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}})}},c6r=500,l6r=1048576,Wqc=[200,800],jFr=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=c6r,s=l6r,c=Wqc){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=Nm(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=A8e(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await iJi(f)}if(l){Jl(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){Jl(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},bYi=D8r(mFc(),1);a(zqc,"Ug");a(FFe,"O0");a(Yqc,"qg");J3r=new Map,Kqc=5e3;a(Jqc,"Bg");a(Zqc,"zg");a(Xqc,"OZ");ejc=(0,bZi.promisify)(CZi.execFile);a(E8e,"m4");a(tjc,"jH");k9=65536,rjc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(yh,"L$");a(IZi,"ZZ");a(Z3r,"IX");a(lP,"A6");a(GFr,"rQ");a(xZi,"RX");a(njc,"MZ");a(wZi,"PX");WFe=200;a(ijc,"Lg");a(_8e,"F0");a(nW,"U4");a(ojc,"jg");a(v8e,"M1");a(PN,"j6");a(Vxt,"L1");sjc=1048576,ajc=5242880;a(ljc,"Rg");a(RZi,"jZ");a(kie,"D0");a(YIt,"jX");KIt=Buffer.from('{"type":"attribution-snapshot"'),ujc=Buffer.from('{"type":"system"'),zFe=10,djc=Buffer.from([zFe]),fjc=256;a(pjc,"_g");a(hjc,"kg");a(mjc,"Sg");a(gjc,"vg");a(Ajc,"Cg");a(yjc,"AZ");a(Ejc,"xg");a(_jc,"yg");a(vjc,"fg");a(X3r,"IH");a(Cjc,"gg");a(bjc,"hg");a(Sjc,"ug");a(PZi,"RH");a(kZi,"PH");a(Tjc,"IZ");a(DZi,"RZ");a(Ijc,"PZ");a(Wxt,"k8");a(DFe,"oQ");a(NZi,"EZ");xjc=32;a(wjc,"pg");a(Rjc,"dg");a(Pjc,"ig");a(kjc,"ng");a(Djc,"rg");a(Njc,"bZ");a(Mjc,"_Z");a(Ojc,"CZ");a(Bjc,"TZ");a(Ljc,"xZ");a(Fjc,"ag");a(MZi,"yZ");a(eFr,"_H");a(Ujc,"sg");Qjc=new Set(["user","assistant","attachment","system","progress"]);a(qjc,"$h");a(jjc,"Qh");a(OZi,"fZ");a(Hjc,"gZ");a(Gjc,"Jh");a($jc,"hZ");a(Vjc,"Xh");a(BZi,"uZ");a(LZi,"lZ");a(FZi,"cZ");a(Wjc,"Wh");a(zjc,"Gh");a(Yjc,"pZ");a(Kjc,"dZ");a(UZi,"vH");a(jZi,"CH");a(HZi,"bX");a(Jjc,"Uh");Zjc="user:inference",GZi="user:profile",Xjc="org:create_api_key",eHc=[Xjc,GZi],tHc=[GZi,Zjc,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],rWh=HZi([...eHc,...tHc]),SYi={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}"},rHc=void 0;a(nHc,"zh");iHc=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(oHc,"rZ");sHc="-credentials";a(aHc,"tZ");cHc=/^[a-zA-Z0-9._-]+$/;a(lHc,"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})(fc||(fc={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(TYi||(TYi={}));Rn=fc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),GV=a(t=>{switch(typeof t){case"undefined":return Rn.undefined;case"string":return Rn.string;case"number":return Number.isNaN(t)?Rn.nan:Rn.number;case"boolean":return Rn.boolean;case"function":return Rn.function;case"bigint":return Rn.bigint;case"symbol":return Rn.symbol;case"object":return Array.isArray(t)?Rn.array:t===null?Rn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Rn.promise:typeof Map<"u"&&t instanceof Map?Rn.map:typeof Set<"u"&&t instanceof Set?Rn.set:typeof Date<"u"&&t instanceof Date?Rn.date:Rn.object;default:return Rn.unknown}},"l4"),hr=fc.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"]),pP=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()}};pP.create=t=>new pP(t);uHc=a((t,e)=>{let r;switch(t.code){case hr.invalid_type:t.received===Rn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case hr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,fc.jsonStringifyReplacer)}`;break;case hr.unrecognized_keys:r=`Unrecognized key(s) in object: ${fc.joinValues(t.keys,", ")}`;break;case hr.invalid_union:r="Invalid input";break;case hr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${fc.joinValues(t.options)}`;break;case hr.invalid_enum_value:r=`Invalid enum value. Expected ${fc.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}"`:fc.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,fc.assertNever(t)}return{message:r}},"Fh"),KFe=uHc,dHc=KFe;a(VFr,"tQ");WFr=a(t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],c={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let l="",u=n.filter(d=>!!d).slice().reverse();for(let d of u)l=d(c,{data:e,defaultError:l}).message;return{...o,path:s,message:l}},"_X");a(cn,"f");Vv=class t{static{a(this,"U6")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return to;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let s=await o.key,c=await o.value;n.push({key:s,value:c})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:c}=o;if(s.status==="aborted"||c.status==="aborted")return to;s.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(n[s.value]=c.value)}return{status:e.value,value:n}}},to=Object.freeze({status:"aborted"}),MFe=a(t=>({status:"dirty",value:t}),"v8"),S1=a(t=>({status:"valid",value:t}),"z6"),IYi=a(t=>t.status==="aborted","TH"),xYi=a(t=>t.status==="dirty","xH"),X_e=a(t=>t.status==="valid","Z0"),XIt=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})(Jn||(Jn={}));mP=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}},wYi=a((t,e)=>{if(X_e(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 pP(t.common.issues);return this._error=r,this._error}}},"eZ");a(Yo,"e");ks=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return GV(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:GV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Vv,ctx:{common:e.parent.common,data:e.data,parsedType:GV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(XIt(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:GV(e)},o=this._parseSync({data:e,path:n.path,parent:n});return wYi(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:GV(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return X_e(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=>X_e(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:GV(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(XIt(o)?o:Promise.resolve(o));return wYi(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 NN({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 hP.create(this,this._def)}nullable(){return B9.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return eW.create(this)}promise(){return Fie.create(this,this._def)}or(e){return nve.create([this,e],this._def)}and(e){return ive.create(this,e,this._def)}transform(e){return new NN({...Yo(this._def),schema:this,typeName:Cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new lve({...Yo(this._def),innerType:this,defaultValue:r,typeName:Cr.ZodDefault})}brand(){return new ext({typeName:Cr.ZodBranded,type:this,...Yo(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new uve({...Yo(this._def),innerType:this,catchValue:r,typeName:Cr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return txt.create(this,e)}readonly(){return dve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},fHc=/^c[^\s-]{8,}$/i,pHc=/^[0-9a-z]+$/,hHc=/^[0-9A-HJKMNP-TV-Z]{26}$/i,mHc=/^[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,gHc=/^[a-z0-9_-]{21}$/i,AHc=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,yHc=/^[-+]?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)?)??$/,EHc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_Hc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",vHc=/^(?:(?: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])$/,CHc=/^(?:(?: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])$/,bHc=/^(([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]))$/,SHc=/^(([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])$/,THc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,IHc=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$Zi="((\\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])))",xHc=new RegExp(`^${$Zi}$`);a(VZi,"QM");a(wHc,"yh");a(RHc,"fh");a(PHc,"gh");a(kHc,"hh");a(DHc,"uh");eve=class t extends ks{static{a(this,"p4")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Rn.string){let o=this._getOrReturnCtx(e);return cn(o,{code:hr.invalid_type,expected:Rn.string,received:o.parsedType}),to}let r=new Vv,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),cn(n,{code:hr.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,c=e.data.lengthe.test(o),{validation:r,code:hr.invalid_string,...Jn.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Jn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Jn.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Jn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Jn.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Jn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Jn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Jn.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Jn.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Jn.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Jn.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Jn.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Jn.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Jn.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,...Jn.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,...Jn.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Jn.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Jn.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Jn.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Jn.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Jn.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Jn.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Jn.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Jn.errToObj(r)})}nonempty(e){return this.min(1,Jn.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 eve({checks:[],typeName:Cr.ZodString,coerce:t?.coerce??!1,...Yo(t)});a(NHc,"mh");JFe=class t extends ks{static{a(this,"T8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Rn.number){let o=this._getOrReturnCtx(e);return cn(o,{code:hr.invalid_type,expected:Rn.number,received:o.parsedType}),to}let r,n=new Vv;for(let o of this._def.checks)o.kind==="int"?fc.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),cn(r,{code:hr.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),cn(r,{code:hr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?NHc(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),cn(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),cn(r,{code:hr.not_finite,message:o.message}),n.dirty()):fc.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Jn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Jn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Jn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Jn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Jn.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Jn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Jn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Jn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Jn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Jn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Jn.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Jn.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Jn.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Jn.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"&&fc.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 JFe({checks:[],typeName:Cr.ZodNumber,coerce:t?.coerce||!1,...Yo(t)});ZFe=class t extends ks{static{a(this,"x8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Rn.bigint)return this._getInvalidInput(e);let r,n=new Vv;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),cn(r,{code:hr.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),cn(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):fc.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:Rn.bigint,received:r.parsedType}),to}gte(e,r){return this.setLimit("min",e,!0,Jn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Jn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Jn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Jn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Jn.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:Jn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Jn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Jn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Jn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Jn.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 ZFe({checks:[],typeName:Cr.ZodBigInt,coerce:t?.coerce??!1,...Yo(t)});XFe=class extends ks{static{a(this,"kX")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Rn.boolean){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:Rn.boolean,received:r.parsedType}),to}return S1(e.data)}};XFe.create=t=>new XFe({typeName:Cr.ZodBoolean,coerce:t?.coerce||!1,...Yo(t)});e8e=class t extends ks{static{a(this,"eQ")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Rn.date){let o=this._getOrReturnCtx(e);return cn(o,{code:hr.invalid_type,expected:Rn.date,received:o.parsedType}),to}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return cn(o,{code:hr.invalid_date}),to}let r=new Vv,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),cn(n,{code:hr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):fc.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:Jn.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Jn.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 e8e({checks:[],coerce:t?.coerce||!1,typeName:Cr.ZodDate,...Yo(t)});t8e=class extends ks{static{a(this,"SX")}_parse(e){if(this._getType(e)!==Rn.symbol){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:Rn.symbol,received:r.parsedType}),to}return S1(e.data)}};t8e.create=t=>new t8e({typeName:Cr.ZodSymbol,...Yo(t)});tve=class extends ks{static{a(this,"$7")}_parse(e){if(this._getType(e)!==Rn.undefined){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:Rn.undefined,received:r.parsedType}),to}return S1(e.data)}};tve.create=t=>new tve({typeName:Cr.ZodUndefined,...Yo(t)});rve=class extends ks{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==Rn.null){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:Rn.null,received:r.parsedType}),to}return S1(e.data)}};rve.create=t=>new rve({typeName:Cr.ZodNull,...Yo(t)});r8e=class extends ks{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return S1(e.data)}};r8e.create=t=>new r8e({typeName:Cr.ZodAny,...Yo(t)});KV=class extends ks{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return S1(e.data)}};KV.create=t=>new KV({typeName:Cr.ZodUnknown,...Yo(t)});NB=class extends ks{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:Rn.never,received:r.parsedType}),to}};NB.create=t=>new NB({typeName:Cr.ZodNever,...Yo(t)});n8e=class extends ks{static{a(this,"CX")}_parse(e){if(this._getType(e)!==Rn.undefined){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:Rn.void,received:r.parsedType}),to}return S1(e.data)}};n8e.create=t=>new n8e({typeName:Cr.ZodVoid,...Yo(t)});eW=class t extends ks{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==Rn.array)return cn(r,{code:hr.invalid_type,expected:Rn.array,received:r.parsedType}),to;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(cn(r,{code:hr.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>o.type._parseAsync(new mP(r,c,r.path,l)))).then(c=>Vv.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new mP(r,c,r.path,l)));return Vv.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Jn.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Jn.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Jn.toString(r)}})}nonempty(e){return this.min(1,e)}};eW.create=(t,e)=>new eW({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Cr.ZodArray,...Yo(e)});a(F_e,"C8");wI=class t extends ks{static{a(this,"g$")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=fc.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==Rn.object){let u=this._getOrReturnCtx(e);return cn(u,{code:hr.invalid_type,expected:Rn.object,received:u.parsedType}),to}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof NB&&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 mP(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof NB){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")c.length>0&&(cn(n,{code:hr.unrecognized_keys,keys:c}),r.dirty());else if(u!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of c){let f=n.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new mP(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=>Vv.mergeObjectSync(r,u)):Vv.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Jn.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:Jn.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 fc.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 fc.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return F_e(this)}partial(e){let r={};for(let n of fc.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 fc.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof hP;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return WZi(fc.objectKeys(this.shape))}};wI.create=(t,e)=>new wI({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:NB.create(),typeName:Cr.ZodObject,...Yo(e)});wI.strictCreate=(t,e)=>new wI({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:NB.create(),typeName:Cr.ZodObject,...Yo(e)});wI.lazycreate=(t,e)=>new wI({shape:t,unknownKeys:"strip",catchall:NB.create(),typeName:Cr.ZodObject,...Yo(e)});nve=class extends ks{static{a(this,"J7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new pP(l.ctx.common.issues));return cn(r,{code:hr.invalid_union,unionErrors:c}),to}if(a(o,"Y"),r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(o);{let s,c=[];for(let u of n){let d={...r,common:{...r.common,issues:[]},parent:null},f=u._parseSync({data:r.data,path:r.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(u=>new pP(u));return cn(r,{code:hr.invalid_union,unionErrors:l}),to}}get options(){return this._def.options}};nve.create=(t,e)=>new nve({options:t,typeName:Cr.ZodUnion,...Yo(e)});w9=a(t=>t instanceof ove?w9(t.schema):t instanceof NN?w9(t.innerType()):t instanceof sve?[t.value]:t instanceof ave?t.options:t instanceof cve?fc.objectValues(t.enum):t instanceof lve?w9(t._def.innerType):t instanceof tve?[void 0]:t instanceof rve?[null]:t instanceof hP?[void 0,...w9(t.unwrap())]:t instanceof B9?[null,...w9(t.unwrap())]:t instanceof ext||t instanceof dve?w9(t.unwrap()):t instanceof uve?w9(t._def.innerType):[],"c4"),zFr=class t extends ks{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Rn.object)return cn(r,{code:hr.invalid_type,expected:Rn.object,received:r.parsedType}),to;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(cn(r,{code:hr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),to)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let c=w9(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,...Yo(n)})}};a(YFr,"fH");ive=class extends ks{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(IYi(s)||IYi(c))return to;let l=YFr(s.value,c.value);return l.valid?((xYi(s)||xYi(c))&&r.dirty(),{status:r.value,value:l.data}):(cn(n,{code:hr.invalid_intersection_types}),to)},"Y");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>o(s,c)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ive.create=(t,e,r)=>new ive({left:t,right:e,typeName:Cr.ZodIntersection,...Yo(r)});O9=class t extends ks{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.array)return cn(n,{code:hr.invalid_type,expected:Rn.array,received:n.parsedType}),to;if(n.data.lengththis._def.items.length&&(cn(n,{code:hr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new mP(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Vv.mergeArray(r,s)):Vv.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};O9.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new O9({items:t,typeName:Cr.ZodTuple,rest:null,...Yo(e)})};KFr=class t extends ks{static{a(this,"TX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.object)return cn(n,{code:hr.invalid_type,expected:Rn.object,received:n.parsedType}),to;let o=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)o.push({key:s._parse(new mP(n,l,n.path,l)),value:c._parse(new mP(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?Vv.mergeObjectAsync(r,o):Vv.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ks?new t({keyType:e,valueType:r,typeName:Cr.ZodRecord,...Yo(n)}):new t({keyType:eve.create(),valueType:e,typeName:Cr.ZodRecord,...Yo(r)})}},i8e=class extends ks{static{a(this,"xX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.map)return cn(n,{code:hr.invalid_type,expected:Rn.map,received:n.parsedType}),to;let o=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,u],d)=>({key:o._parse(new mP(n,l,n.path,[d,"key"])),value:s._parse(new mP(n,u,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of c){let d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return to;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let u of c){let{key:d,value:f}=u;if(d.status==="aborted"||f.status==="aborted")return to;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}}}};i8e.create=(t,e,r)=>new i8e({valueType:e,keyType:t,typeName:Cr.ZodMap,...Yo(r)});o8e=class t extends ks{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.set)return cn(n,{code:hr.invalid_type,expected:Rn.set,received:n.parsedType}),to;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(cn(n,{code:hr.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function c(u){let d=new Set;for(let f of u){if(f.status==="aborted")return to;f.status==="dirty"&&r.dirty(),d.add(f.value)}return{status:r.value,value:d}}a(c,"W");let l=[...n.data.values()].map((u,d)=>s._parse(new mP(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:Jn.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Jn.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};o8e.create=(t,e)=>new o8e({valueType:t,minSize:null,maxSize:null,typeName:Cr.ZodSet,...Yo(e)});JFr=class t extends ks{static{a(this,"sQ")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Rn.function)return cn(r,{code:hr.invalid_type,expected:Rn.function,received:r.parsedType}),to;function n(l,u){return WFr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,VFr(),KFe].filter(d=>!!d),issueData:{code:hr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return WFr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,VFr(),KFe].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 Fie){let l=this;return S1(async function(...u){let d=new pP([]),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 S1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new pP([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new pP([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:O9.create(e).rest(KV.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||O9.create([]).rest(KV.create()),returns:r||KV.create(),typeName:Cr.ZodFunction,...Yo(n)})}},ove=class extends ks{static{a(this,"Y7")}get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ove.create=(t,e)=>new ove({getter:t,typeName:Cr.ZodLazy,...Yo(e)});sve=class extends ks{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return cn(r,{received:r.data,code:hr.invalid_literal,expected:this._def.value}),to}return{status:"valid",value:e.data}}get value(){return this._def.value}};sve.create=(t,e)=>new sve({value:t,typeName:Cr.ZodLiteral,...Yo(e)});a(WZi,"JM");ave=class t extends ks{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return cn(r,{expected:fc.joinValues(n),received:r.parsedType,code:hr.invalid_type}),to}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return cn(r,{received:r.data,code:hr.invalid_enum_value,options:n}),to}return S1(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})}};ave.create=WZi;cve=class extends ks{static{a(this,"G7")}_parse(e){let r=fc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Rn.string&&n.parsedType!==Rn.number){let o=fc.objectValues(r);return cn(n,{expected:fc.joinValues(o),received:n.parsedType,code:hr.invalid_type}),to}if(this._cache||(this._cache=new Set(fc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=fc.objectValues(r);return cn(n,{received:n.data,code:hr.invalid_enum_value,options:o}),to}return S1(e.data)}get enum(){return this._def.values}};cve.create=(t,e)=>new cve({values:t,typeName:Cr.ZodNativeEnum,...Yo(e)});Fie=class extends ks{static{a(this,"f8")}unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Rn.promise&&r.common.async===!1)return cn(r,{code:hr.invalid_type,expected:Rn.promise,received:r.parsedType}),to;let n=r.parsedType===Rn.promise?r.data:Promise.resolve(r.data);return S1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Fie.create=(t,e)=>new Fie({type:t,typeName:Cr.ZodPromise,...Yo(e)});NN=class extends ks{static{a(this,"P4")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Cr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:a(c=>{cn(n,c),c.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let c=o.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async l=>{if(r.value==="aborted")return to;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?to:u.status==="dirty"||r.value==="dirty"?MFe(u.value):u});{if(r.value==="aborted")return to;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?to:l.status==="dirty"||r.value==="dirty"?MFe(l.value):l}}if(o.type==="refinement"){let c=a(l=>{let u=o.refinement(l,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"W");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?to:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?to:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(o.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!X_e(c))return to;let l=o.transform(c.value,s);if(l instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>X_e(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):to);fc.assertNever(o)}};NN.create=(t,e,r)=>new NN({schema:t,typeName:Cr.ZodEffects,effect:e,...Yo(r)});NN.createWithPreprocess=(t,e,r)=>new NN({schema:e,effect:{type:"preprocess",transform:t},typeName:Cr.ZodEffects,...Yo(r)});hP=class extends ks{static{a(this,"o6")}_parse(e){return this._getType(e)===Rn.undefined?S1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};hP.create=(t,e)=>new hP({innerType:t,typeName:Cr.ZodOptional,...Yo(e)});B9=class extends ks{static{a(this,"A1")}_parse(e){return this._getType(e)===Rn.null?S1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};B9.create=(t,e)=>new B9({innerType:t,typeName:Cr.ZodNullable,...Yo(e)});lve=class extends ks{static{a(this,"U7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===Rn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};lve.create=(t,e)=>new lve({innerType:t,typeName:Cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Yo(e)});uve=class extends ks{static{a(this,"H7")}_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return XIt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new pP(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new pP(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};uve.create=(t,e)=>new uve({innerType:t,typeName:Cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Yo(e)});s8e=class extends ks{static{a(this,"yX")}_parse(e){if(this._getType(e)!==Rn.nan){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:Rn.nan,received:r.parsedType}),to}return{status:"valid",value:e.data}}};s8e.create=t=>new s8e({typeName:Cr.ZodNaN,...Yo(t)});ext=class extends ks{static{a(this,"hH")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},txt=class t extends ks{static{a(this,"fX")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?to:o.status==="dirty"?(r.dirty(),MFe(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?to:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:Cr.ZodPipeline})}},dve=class extends ks{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(X_e(o)&&(o.value=Object.freeze(o.value)),o),"J");return XIt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};dve.create=(t,e)=>new dve({innerType:t,typeName:Cr.ZodReadonly,...Yo(e)});nWh={object:wI.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={}));iWh=eve.create,oWh=JFe.create,sWh=s8e.create,aWh=ZFe.create,cWh=XFe.create,lWh=e8e.create,uWh=t8e.create,dWh=tve.create,fWh=rve.create,pWh=r8e.create,hWh=KV.create,mWh=NB.create,gWh=n8e.create,AWh=eW.create,MHc=wI.create,yWh=wI.strictCreate,EWh=nve.create,_Wh=zFr.create,vWh=ive.create,CWh=O9.create,bWh=KFr.create,SWh=i8e.create,TWh=o8e.create,IWh=JFr.create,xWh=ove.create,wWh=sve.create,RWh=ave.create,PWh=cve.create,kWh=Fie.create,DWh=NN.create,NWh=hP.create,MWh=B9.create,OWh=NN.createWithPreprocess,BWh=txt.create,zZi={};OB(zZi,{version:a(()=>oeo,"version"),util:a(()=>Gs,"util"),treeifyError:a(()=>sXi,"treeifyError"),toJSONSchema:a(()=>m9r,"toJSONSchema"),toDotPath:a(()=>aXi,"toDotPath"),safeParseAsync:a(()=>Xxt,"safeParseAsync"),safeParse:a(()=>Zxt,"safeParse"),registry:a(()=>M6r,"registry"),regexes:a(()=>_6r,"regexes"),prettifyError:a(()=>cXi,"prettifyError"),parseAsync:a(()=>oxt,"parseAsync"),parse:a(()=>ixt,"parse"),locales:a(()=>N6r,"locales"),isValidJWT:a(()=>Reo,"isValidJWT"),isValidBase64URL:a(()=>Ieo,"isValidBase64URL"),isValidBase64:a(()=>S6r,"isValidBase64"),globalRegistry:a(()=>D9,"globalRegistry"),globalConfig:a(()=>rxt,"globalConfig"),function:a(()=>Jto,"function"),formatError:a(()=>m6r,"formatError"),flattenError:a(()=>h6r,"flattenError"),config:a(()=>Wv,"config"),clone:a(()=>FN,"clone"),_xid:a(()=>V6r,"_xid"),_void:a(()=>Bto,"_void"),_uuidv7:a(()=>U6r,"_uuidv7"),_uuidv6:a(()=>F6r,"_uuidv6"),_uuidv4:a(()=>L6r,"_uuidv4"),_uuid:a(()=>B6r,"_uuid"),_url:a(()=>Q6r,"_url"),_uppercase:a(()=>o9r,"_uppercase"),_unknown:a(()=>lxt,"_unknown"),_union:a(()=>O$c,"_union"),_undefined:a(()=>Dto,"_undefined"),_ulid:a(()=>$6r,"_ulid"),_uint64:a(()=>Pto,"_uint64"),_uint32:a(()=>Sto,"_uint32"),_tuple:a(()=>$to,"_tuple"),_trim:a(()=>d9r,"_trim"),_transform:a(()=>G$c,"_transform"),_toUpperCase:a(()=>p9r,"_toUpperCase"),_toLowerCase:a(()=>f9r,"_toLowerCase"),_templateLiteral:a(()=>X$c,"_templateLiteral"),_symbol:a(()=>kto,"_symbol"),_success:a(()=>Y$c,"_success"),_stringbool:a(()=>Yto,"_stringbool"),_stringFormat:a(()=>Kto,"_stringFormat"),_string:a(()=>dto,"_string"),_startsWith:a(()=>a9r,"_startsWith"),_size:a(()=>r9r,"_size"),_set:a(()=>Q$c,"_set"),_safeParseAsync:a(()=>E6r,"_safeParseAsync"),_safeParse:a(()=>y6r,"_safeParse"),_regex:a(()=>n9r,"_regex"),_refine:a(()=>zto,"_refine"),_record:a(()=>F$c,"_record"),_readonly:a(()=>Z$c,"_readonly"),_property:a(()=>Gto,"_property"),_promise:a(()=>tVc,"_promise"),_positive:a(()=>Qto,"_positive"),_pipe:a(()=>J$c,"_pipe"),_parseAsync:a(()=>A6r,"_parseAsync"),_parse:a(()=>g6r,"_parse"),_overwrite:a(()=>$ie,"_overwrite"),_optional:a(()=>$$c,"_optional"),_number:a(()=>yto,"_number"),_nullable:a(()=>V$c,"_nullable"),_null:a(()=>Nto,"_null"),_normalize:a(()=>u9r,"_normalize"),_nonpositive:a(()=>jto,"_nonpositive"),_nonoptional:a(()=>z$c,"_nonoptional"),_nonnegative:a(()=>Hto,"_nonnegative"),_never:a(()=>Oto,"_never"),_negative:a(()=>qto,"_negative"),_nativeEnum:a(()=>j$c,"_nativeEnum"),_nanoid:a(()=>j6r,"_nanoid"),_nan:a(()=>Uto,"_nan"),_multipleOf:a(()=>u8e,"_multipleOf"),_minSize:a(()=>d8e,"_minSize"),_minLength:a(()=>pve,"_minLength"),_min:a(()=>SI,"_min"),_mime:a(()=>l9r,"_mime"),_maxSize:a(()=>twt,"_maxSize"),_maxLength:a(()=>rwt,"_maxLength"),_max:a(()=>kN,"_max"),_map:a(()=>U$c,"_map"),_lte:a(()=>kN,"_lte"),_lt:a(()=>Uie,"_lt"),_lowercase:a(()=>i9r,"_lowercase"),_literal:a(()=>H$c,"_literal"),_length:a(()=>nwt,"_length"),_lazy:a(()=>eVc,"_lazy"),_ksuid:a(()=>W6r,"_ksuid"),_jwt:a(()=>t9r,"_jwt"),_isoTime:a(()=>gto,"_isoTime"),_isoDuration:a(()=>Ato,"_isoDuration"),_isoDateTime:a(()=>hto,"_isoDateTime"),_isoDate:a(()=>mto,"_isoDate"),_ipv6:a(()=>Y6r,"_ipv6"),_ipv4:a(()=>z6r,"_ipv4"),_intersection:a(()=>L$c,"_intersection"),_int64:a(()=>Rto,"_int64"),_int32:a(()=>bto,"_int32"),_int:a(()=>_to,"_int"),_includes:a(()=>s9r,"_includes"),_guid:a(()=>cxt,"_guid"),_gte:a(()=>SI,"_gte"),_gt:a(()=>Qie,"_gt"),_float64:a(()=>Cto,"_float64"),_float32:a(()=>vto,"_float32"),_file:a(()=>Vto,"_file"),_enum:a(()=>q$c,"_enum"),_endsWith:a(()=>c9r,"_endsWith"),_emoji:a(()=>q6r,"_emoji"),_email:a(()=>O6r,"_email"),_e164:a(()=>e9r,"_e164"),_discriminatedUnion:a(()=>B$c,"_discriminatedUnion"),_default:a(()=>W$c,"_default"),_date:a(()=>Lto,"_date"),_custom:a(()=>Wto,"_custom"),_cuid2:a(()=>G6r,"_cuid2"),_cuid:a(()=>H6r,"_cuid"),_coercedString:a(()=>fto,"_coercedString"),_coercedNumber:a(()=>Eto,"_coercedNumber"),_coercedDate:a(()=>Fto,"_coercedDate"),_coercedBoolean:a(()=>Ito,"_coercedBoolean"),_coercedBigint:a(()=>wto,"_coercedBigint"),_cidrv6:a(()=>J6r,"_cidrv6"),_cidrv4:a(()=>K6r,"_cidrv4"),_catch:a(()=>K$c,"_catch"),_boolean:a(()=>Tto,"_boolean"),_bigint:a(()=>xto,"_bigint"),_base64url:a(()=>X6r,"_base64url"),_base64:a(()=>Z6r,"_base64"),_array:a(()=>h9r,"_array"),_any:a(()=>Mto,"_any"),TimePrecision:a(()=>pto,"TimePrecision"),NEVER:a(()=>YZi,"NEVER"),JSONSchemaGenerator:a(()=>f8e,"JSONSchemaGenerator"),JSONSchema:a(()=>rVc,"JSONSchema"),Doc:a(()=>sxt,"Doc"),$output:a(()=>lto,"$output"),$input:a(()=>uto,"$input"),$constructor:a(()=>ft,"$constructor"),$brand:a(()=>KZi,"$brand"),$ZodXID:a(()=>meo,"$ZodXID"),$ZodVoid:a(()=>Ueo,"$ZodVoid"),$ZodUnknown:a(()=>axt,"$ZodUnknown"),$ZodUnion:a(()=>P6r,"$ZodUnion"),$ZodUndefined:a(()=>Oeo,"$ZodUndefined"),$ZodUUID:a(()=>aeo,"$ZodUUID"),$ZodURL:a(()=>leo,"$ZodURL"),$ZodULID:a(()=>heo,"$ZodULID"),$ZodType:a(()=>Co,"$ZodType"),$ZodTuple:a(()=>ewt,"$ZodTuple"),$ZodTransform:a(()=>k6r,"$ZodTransform"),$ZodTemplateLiteral:a(()=>ito,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>Meo,"$ZodSymbol"),$ZodSuccess:a(()=>eto,"$ZodSuccess"),$ZodStringFormat:a(()=>Nu,"$ZodStringFormat"),$ZodString:a(()=>S8e,"$ZodString"),$ZodSet:a(()=>$eo,"$ZodSet"),$ZodRegistry:a(()=>l8e,"$ZodRegistry"),$ZodRecord:a(()=>Heo,"$ZodRecord"),$ZodRealError:a(()=>C8e,"$ZodRealError"),$ZodReadonly:a(()=>nto,"$ZodReadonly"),$ZodPromise:a(()=>oto,"$ZodPromise"),$ZodPrefault:a(()=>Zeo,"$ZodPrefault"),$ZodPipe:a(()=>D6r,"$ZodPipe"),$ZodOptional:a(()=>Yeo,"$ZodOptional"),$ZodObject:a(()=>R6r,"$ZodObject"),$ZodNumberFormat:a(()=>Deo,"$ZodNumberFormat"),$ZodNumber:a(()=>T6r,"$ZodNumber"),$ZodNullable:a(()=>Keo,"$ZodNullable"),$ZodNull:a(()=>Beo,"$ZodNull"),$ZodNonOptional:a(()=>Xeo,"$ZodNonOptional"),$ZodNever:a(()=>Feo,"$ZodNever"),$ZodNanoID:a(()=>deo,"$ZodNanoID"),$ZodNaN:a(()=>rto,"$ZodNaN"),$ZodMap:a(()=>Geo,"$ZodMap"),$ZodLiteral:a(()=>Weo,"$ZodLiteral"),$ZodLazy:a(()=>sto,"$ZodLazy"),$ZodKSUID:a(()=>geo,"$ZodKSUID"),$ZodJWT:a(()=>Peo,"$ZodJWT"),$ZodIntersection:a(()=>jeo,"$ZodIntersection"),$ZodISOTime:a(()=>Eeo,"$ZodISOTime"),$ZodISODuration:a(()=>_eo,"$ZodISODuration"),$ZodISODateTime:a(()=>Aeo,"$ZodISODateTime"),$ZodISODate:a(()=>yeo,"$ZodISODate"),$ZodIPv6:a(()=>Ceo,"$ZodIPv6"),$ZodIPv4:a(()=>veo,"$ZodIPv4"),$ZodGUID:a(()=>seo,"$ZodGUID"),$ZodFunction:a(()=>uxt,"$ZodFunction"),$ZodFile:a(()=>zeo,"$ZodFile"),$ZodError:a(()=>p6r,"$ZodError"),$ZodEnum:a(()=>Veo,"$ZodEnum"),$ZodEmoji:a(()=>ueo,"$ZodEmoji"),$ZodEmail:a(()=>ceo,"$ZodEmail"),$ZodE164:a(()=>weo,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>qeo,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>Jeo,"$ZodDefault"),$ZodDate:a(()=>Qeo,"$ZodDate"),$ZodCustomStringFormat:a(()=>keo,"$ZodCustomStringFormat"),$ZodCustom:a(()=>ato,"$ZodCustom"),$ZodCheckUpperCase:a(()=>ZXi,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>b8e,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>eeo,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>VXi,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>KXi,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>reo,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>ieo,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>jXi,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>qXi,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>$Xi,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>zXi,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>neo,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>GXi,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>WXi,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>JXi,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>C6r,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>YXi,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>XXi,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>b6r,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>teo,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>HXi,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>Eh,"$ZodCheck"),$ZodCatch:a(()=>tto,"$ZodCatch"),$ZodCUID2:a(()=>peo,"$ZodCUID2"),$ZodCUID:a(()=>feo,"$ZodCUID"),$ZodCIDRv6:a(()=>Seo,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>beo,"$ZodCIDRv4"),$ZodBoolean:a(()=>I6r,"$ZodBoolean"),$ZodBigIntFormat:a(()=>Neo,"$ZodBigIntFormat"),$ZodBigInt:a(()=>x6r,"$ZodBigInt"),$ZodBase64URL:a(()=>xeo,"$ZodBase64URL"),$ZodBase64:a(()=>Teo,"$ZodBase64"),$ZodAsyncError:a(()=>tW,"$ZodAsyncError"),$ZodArray:a(()=>w6r,"$ZodArray"),$ZodAny:a(()=>Leo,"$ZodAny")});YZi=Object.freeze({status:"aborted"});a(ft,"F");KZi=Symbol("zod_brand"),tW=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},rxt={};a(Wv,"c$");Gs={};OB(Gs,{unwrapMessage:a(()=>OFe,"unwrapMessage"),stringifyPrimitive:a(()=>ss,"stringifyPrimitive"),required:a(()=>JHc,"required"),randomString:a(()=>jHc,"randomString"),propertyKeyTypes:a(()=>nxt,"propertyKeyTypes"),promiseAllObject:a(()=>qHc,"promiseAllObject"),primitiveTypes:a(()=>eXi,"primitiveTypes"),prefixIssues:a(()=>fP,"prefixIssues"),pick:a(()=>VHc,"pick"),partial:a(()=>KHc,"partial"),optionalKeys:a(()=>tXi,"optionalKeys"),omit:a(()=>WHc,"omit"),numKeys:a(()=>HHc,"numKeys"),nullish:a(()=>Hie,"nullish"),normalizeParams:a(()=>xr,"normalizeParams"),merge:a(()=>YHc,"merge"),jsonStringifyReplacer:a(()=>JZi,"jsonStringifyReplacer"),joinValues:a(()=>Vr,"joinValues"),issue:a(()=>iXi,"issue"),isPlainObject:a(()=>c8e,"isPlainObject"),isObject:a(()=>a8e,"isObject"),getSizableOrigin:a(()=>Kxt,"getSizableOrigin"),getParsedType:a(()=>GHc,"getParsedType"),getLengthableOrigin:a(()=>Jxt,"getLengthableOrigin"),getEnumValues:a(()=>u6r,"getEnumValues"),getElementAtPath:a(()=>QHc,"getElementAtPath"),floatSafeRemainder:a(()=>ZZi,"floatSafeRemainder"),finalizeIssue:a(()=>MN,"finalizeIssue"),extend:a(()=>zHc,"extend"),escapeRegex:a(()=>Gie,"escapeRegex"),esc:a(()=>U_e,"esc"),defineLazy:a(()=>Gc,"defineLazy"),createTransparentProxy:a(()=>$Hc,"createTransparentProxy"),clone:a(()=>FN,"clone"),cleanRegex:a(()=>Yxt,"cleanRegex"),cleanEnum:a(()=>ZHc,"cleanEnum"),captureStackTrace:a(()=>f6r,"captureStackTrace"),cached:a(()=>zxt,"cached"),assignProp:a(()=>d6r,"assignProp"),assertNotEqual:a(()=>BHc,"assertNotEqual"),assertNever:a(()=>FHc,"assertNever"),assertIs:a(()=>LHc,"assertIs"),assertEqual:a(()=>OHc,"assertEqual"),assert:a(()=>UHc,"assert"),allowsEval:a(()=>XZi,"allowsEval"),aborted:a(()=>G_e,"aborted"),NUMBER_FORMAT_RANGES:a(()=>rXi,"NUMBER_FORMAT_RANGES"),Class:a(()=>ZFr,"Class"),BIGINT_FORMAT_RANGES:a(()=>nXi,"BIGINT_FORMAT_RANGES")});a(OHc,"lh");a(BHc,"ch");a(LHc,"ph");a(FHc,"dh");a(UHc,"ih");a(u6r,"B7");a(Vr,"P");a(JZi,"mH");a(zxt,"z7");a(Hie,"I1");a(Yxt,"N7");a(ZZi,"lH");a(Gc,"N$");a(d6r,"cH");a(QHc,"nh");a(qHc,"rh");a(jHc,"oh");a(U_e,"j0");f6r=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(a8e,"g8");XZi=zxt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(c8e,"h8");a(HHc,"th");GHc=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"),nxt=new Set(["string","number","symbol"]),eXi=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(Gie,"r4");a(FN,"H6");a(xr,"k");a($Hc,"sh");a(ss,"x");a(tXi,"iH");rXi={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]},nXi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(VHc,"eh");a(WHc,"$u");a(zHc,"Qu");a(YHc,"Ju");a(KHc,"Xu");a(JHc,"Yu");a(G_e,"A0");a(fP,"I6");a(OFe,"V7");a(MN,"g6");a(Kxt,"O7");a(Jxt,"D7");a(iXi,"oH");a(ZHc,"Wu");ZFr=class{static{a(this,"YM")}constructor(...e){}},oXi=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,JZi,2)},enumerable:!0})},"WM"),p6r=ft("$ZodError",oXi),C8e=ft("$ZodError",oXi,{Parent:Error});a(h6r,"m8");a(m6r,"l8");a(sXi,"mX");a(aXi,"GM");a(cXi,"lX");g6r=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 tW;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>MN(u,s,Wv())));throw f6r(l,o?.callee),l}return c.value},"cX"),ixt=g6r(C8e),A6r=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=>MN(u,s,Wv())));throw f6r(l,o?.callee),l}return c.value},"pX"),oxt=A6r(C8e),y6r=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 tW;return s.issues.length?{success:!1,error:new(t??p6r)(s.issues.map(c=>MN(c,o,Wv())))}:{success:!0,data:s.value}},"dX"),Zxt=y6r(C8e),E6r=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=>MN(c,o,Wv())))}:{success:!0,data:s.value}},"iX"),Xxt=E6r(C8e),_6r={};OB(_6r,{xid:a(()=>fXi,"xid"),uuid7:a(()=>rGc,"uuid7"),uuid6:a(()=>tGc,"uuid6"),uuid4:a(()=>eGc,"uuid4"),uuid:a(()=>fve,"uuid"),uppercase:a(()=>UXi,"uppercase"),unicodeEmail:a(()=>oGc,"unicodeEmail"),undefined:a(()=>LXi,"undefined"),ulid:a(()=>dXi,"ulid"),time:a(()=>RXi,"time"),string:a(()=>kXi,"string"),rfc5322Email:a(()=>iGc,"rfc5322Email"),number:a(()=>MXi,"number"),null:a(()=>BXi,"null"),nanoid:a(()=>hXi,"nanoid"),lowercase:a(()=>FXi,"lowercase"),ksuid:a(()=>pXi,"ksuid"),ipv6:a(()=>_Xi,"ipv6"),ipv4:a(()=>EXi,"ipv4"),integer:a(()=>NXi,"integer"),html5Email:a(()=>nGc,"html5Email"),hostname:a(()=>SXi,"hostname"),guid:a(()=>gXi,"guid"),extendedDuration:a(()=>XHc,"extendedDuration"),emoji:a(()=>yXi,"emoji"),email:a(()=>AXi,"email"),e164:a(()=>TXi,"e164"),duration:a(()=>mXi,"duration"),domain:a(()=>cGc,"domain"),datetime:a(()=>PXi,"datetime"),date:a(()=>xXi,"date"),cuid2:a(()=>uXi,"cuid2"),cuid:a(()=>lXi,"cuid"),cidrv6:a(()=>CXi,"cidrv6"),cidrv4:a(()=>vXi,"cidrv4"),browserEmail:a(()=>sGc,"browserEmail"),boolean:a(()=>OXi,"boolean"),bigint:a(()=>DXi,"bigint"),base64url:a(()=>v6r,"base64url"),base64:a(()=>bXi,"base64"),_emoji:a(()=>aGc,"_emoji")});lXi=/^[cC][^\s-]{8,}$/,uXi=/^[0-9a-z]+$/,dXi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,fXi=/^[0-9a-vA-V]{20}$/,pXi=/^[A-Za-z0-9]{27}$/,hXi=/^[a-zA-Z0-9_-]{21}$/,mXi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,XHc=/^[-+]?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)?)??$/,gXi=/^([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})$/,fve=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"),eGc=fve(4),tGc=fve(6),rGc=fve(7),AXi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,nGc=/^[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])?)*$/,iGc=/^(([^<>()\[\]\\.,;:\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,}))$/,oGc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,sGc=/^[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])?)*$/,aGc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(yXi,"WK");EXi=/^(?:(?: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])$/,_Xi=/^(([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})$/,vXi=/^((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])$/,CXi=/^(([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])$/,bXi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,v6r=/^[A-Za-z0-9_-]*$/,SXi=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,cGc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,TXi=/^\+(?:[0-9]){6,14}[0-9]$/,IXi="(?:(?:\\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])))",xXi=new RegExp(`^${IXi}$`);a(wXi,"HM");a(RXi,"NK");a(PXi,"wK");kXi=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),DXi=/^\d+n?$/,NXi=/^\d+$/,MXi=/^-?\d+(?:\.\d+)?/i,OXi=/true|false/i,BXi=/null/i,LXi=/undefined/i,FXi=/^[^A-Z]*$/,UXi=/^[^a-z]*$/,Eh=ft("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),QXi={number:"number",bigint:"bigint",object:"date"},C6r=ft("$ZodCheckLessThan",(t,e)=>{Eh.init(t,e);let r=QXi[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{Eh.init(t,e);let r=QXi[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})}}),qXi=ft("$ZodCheckMultipleOf",(t,e)=>{Eh.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):ZZi(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})}}),jXi=ft("$ZodCheckNumberFormat",(t,e)=>{Eh.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=rXi[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=NXi)}),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})}}),HXi=ft("$ZodCheckBigIntFormat",(t,e)=>{Eh.init(t,e);let[r,n]=nXi[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})}}),GXi=ft("$ZodCheckMaxSize",(t,e)=>{Eh.init(t,e),t._zod.when=r=>{let n=r.value;return!Hie(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:Kxt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),$Xi=ft("$ZodCheckMinSize",(t,e)=>{Eh.init(t,e),t._zod.when=r=>{let n=r.value;return!Hie(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:Kxt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),VXi=ft("$ZodCheckSizeEquals",(t,e)=>{Eh.init(t,e),t._zod.when=r=>{let n=r.value;return!Hie(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:Kxt(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})}}),WXi=ft("$ZodCheckMaxLength",(t,e)=>{Eh.init(t,e),t._zod.when=r=>{let n=r.value;return!Hie(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=Jxt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),zXi=ft("$ZodCheckMinLength",(t,e)=>{Eh.init(t,e),t._zod.when=r=>{let n=r.value;return!Hie(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=Jxt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),YXi=ft("$ZodCheckLengthEquals",(t,e)=>{Eh.init(t,e),t._zod.when=r=>{let n=r.value;return!Hie(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=Jxt(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})}}),b8e=ft("$ZodCheckStringFormat",(t,e)=>{var r,n;Eh.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=()=>{})}),KXi=ft("$ZodCheckRegex",(t,e)=>{b8e.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})}}),JXi=ft("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=FXi),b8e.init(t,e)}),ZXi=ft("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=UXi),b8e.init(t,e)}),XXi=ft("$ZodCheckIncludes",(t,e)=>{Eh.init(t,e);let r=Gie(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})}}),eeo=ft("$ZodCheckStartsWith",(t,e)=>{Eh.init(t,e);let r=new RegExp(`^${Gie(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})}}),teo=ft("$ZodCheckEndsWith",(t,e)=>{Eh.init(t,e);let r=new RegExp(`.*${Gie(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(RYi,"KM");reo=ft("$ZodCheckProperty",(t,e)=>{Eh.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=>RYi(o,r,e.property));RYi(n,r,e.property)}}),neo=ft("$ZodCheckMimeType",(t,e)=>{Eh.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})}}),ieo=ft("$ZodCheckOverwrite",(t,e)=>{Eh.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),sxt=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??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(` `).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(` -`))}},oeo={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=oeo;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=G_e(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 tW;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=G_e(s,h)))});else{if(s.issues.length===h)continue;u||(u=G_e(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 tW;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=Zxt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Xxt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),S8e=ft("$ZodString",(t,e)=>{Co.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??kXi(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}}),Nu=ft("$ZodStringFormat",(t,e)=>{b8e.init(t,e),S8e.init(t,e)}),seo=ft("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=gXi),Nu.init(t,e)}),aeo=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=fve(r))}else e.pattern??(e.pattern=fve());Nu.init(t,e)}),ceo=ft("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=AXi),Nu.init(t,e)}),leo=ft("$ZodURL",(t,e)=>{Nu.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:SXi.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})}}}),ueo=ft("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=yXi()),Nu.init(t,e)}),deo=ft("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=hXi),Nu.init(t,e)}),feo=ft("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=lXi),Nu.init(t,e)}),peo=ft("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=uXi),Nu.init(t,e)}),heo=ft("$ZodULID",(t,e)=>{e.pattern??(e.pattern=dXi),Nu.init(t,e)}),meo=ft("$ZodXID",(t,e)=>{e.pattern??(e.pattern=fXi),Nu.init(t,e)}),geo=ft("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=pXi),Nu.init(t,e)}),Aeo=ft("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=PXi(e)),Nu.init(t,e)}),yeo=ft("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=xXi),Nu.init(t,e)}),Eeo=ft("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=RXi(e)),Nu.init(t,e)}),_eo=ft("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=mXi),Nu.init(t,e)}),veo=ft("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=EXi),Nu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Ceo=ft("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=_Xi),Nu.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})}}}),beo=ft("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=vXi),Nu.init(t,e)}),Seo=ft("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=CXi),Nu.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(S6r,"oK");Teo=ft("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=bXi),Nu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{S6r(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(Ieo,"AM");xeo=ft("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=v6r),Nu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{Ieo(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),weo=ft("$ZodE164",(t,e)=>{e.pattern??(e.pattern=TXi),Nu.init(t,e)});a(Reo,"IM");Peo=ft("$ZodJWT",(t,e)=>{Nu.init(t,e),t._zod.check=r=>{Reo(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),keo=ft("$ZodCustomStringFormat",(t,e)=>{Nu.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})}}),T6r=ft("$ZodNumber",(t,e)=>{Co.init(t,e),t._zod.pattern=t._zod.bag.pattern??MXi,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}}),Deo=ft("$ZodNumber",(t,e)=>{jXi.init(t,e),T6r.init(t,e)}),I6r=ft("$ZodBoolean",(t,e)=>{Co.init(t,e),t._zod.pattern=OXi,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}}),x6r=ft("$ZodBigInt",(t,e)=>{Co.init(t,e),t._zod.pattern=DXi,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}}),Neo=ft("$ZodBigInt",(t,e)=>{HXi.init(t,e),x6r.init(t,e)}),Meo=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}}),Oeo=ft("$ZodUndefined",(t,e)=>{Co.init(t,e),t._zod.pattern=LXi,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}}),Beo=ft("$ZodNull",(t,e)=>{Co.init(t,e),t._zod.pattern=BXi,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}}),Leo=ft("$ZodAny",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),axt=ft("$ZodUnknown",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),Feo=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)}),Ueo=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}}),Qeo=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(PYi,"BM");w6r=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;cPYi(d,r,c))):PYi(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(rIt,"aX");a(kYi,"zM");R6r=ft("$ZodObject",(t,e)=>{Co.init(t,e);let r=zxt(()=>{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=tXi(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});Gc(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 sxt(["shape","payload","ctx"]),m=r.value,g=a(_=>{let v=U_e(_);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=U_e(_);h.write(` +`))}},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(` if (${v}.issues.length) { if (input[${b}] === undefined) { if (${b} in input) { @@ -1605,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 ? [${U_e(_)}, ...iss.path] : [${U_e(_)}] - })));`),h.write(`newResult[${U_e(_)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(_,v)=>E(f,_,v)},"Y"),o,s=a8e,c=!rxt.jitless,l=c&&XZi.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?kYi(x,f,b,m):rIt(x,f,b))):R?kYi(w,f,b,m):rIt(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=>rIt(T,f,v))):rIt(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(DYi,"NM");P6r=ft("$ZodUnion",(t,e)=>{Co.init(t,e),Gc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Gc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Gc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),Gc(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=>Yxt(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=>DYi(c,r,t,n)):DYi(s,r,t,n)}}),qeo=ft("$ZodDiscriminatedUnion",(t,e)=>{P6r.init(t,e);let r=t._zod.parse;Gc(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=zxt(()=>{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(!a8e(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)}}),jeo=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])=>NYi(r,l,u)):NYi(r,s,c)}});a(XFr,"pK");a(NYi,"wM");ewt=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=>nIt(h,o,u))):nIt(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=>nIt(m,o,u))):nIt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(nIt,"sX");Heo=ft("$ZodRecord",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!c8e(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(...fP(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...fP(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=>MN(d,n,Wv())),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(...fP(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...fP(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),Geo=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])=>{MYi(f,h,r,c,o,t,n)})):MYi(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(MYi,"OM");$eo=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=>OYi(u,r))):OYi(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(OYi,"DM");Veo=ft("$ZodEnum",(t,e)=>{Co.init(t,e);let r=u6r(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>nxt.has(typeof n)).map(n=>typeof n=="string"?Gie(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}}),Weo=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"?Gie(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}}),zeo=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}}),k6r=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 tW;return r.value=o,r}}),Yeo=ft("$ZodOptional",(t,e)=>{Co.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Gc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Gc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Yxt(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)}),Keo=ft("$ZodNullable",(t,e)=>{Co.init(t,e),Gc(t._zod,"optin",()=>e.innerType._zod.optin),Gc(t._zod,"optout",()=>e.innerType._zod.optout),Gc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Yxt(r.source)}|null)$`):void 0}),Gc(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)}),Jeo=ft("$ZodDefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",Gc(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=>BYi(s,e)):BYi(o,e)}});a(BYi,"FM");Zeo=ft("$ZodPrefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",Gc(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))}),Xeo=ft("$ZodNonOptional",(t,e)=>{Co.init(t,e),Gc(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=>LYi(s,t)):LYi(o,t)}});a(LYi,"ZM");eto=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)}}),tto=ft("$ZodCatch",(t,e)=>{Co.init(t,e),t._zod.optin="optional",Gc(t._zod,"optout",()=>e.innerType._zod.optout),Gc(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=>MN(c,n,Wv()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>MN(s,n,Wv()))},input:r.value}),r.issues=[]),r)}}),rto=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)}),D6r=ft("$ZodPipe",(t,e)=>{Co.init(t,e),Gc(t._zod,"values",()=>e.in._zod.values),Gc(t._zod,"optin",()=>e.in._zod.optin),Gc(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=>FYi(s,e,n)):FYi(o,e,n)}});a(FYi,"MM");nto=ft("$ZodReadonly",(t,e)=>{Co.init(t,e),Gc(t._zod,"propValues",()=>e.innerType._zod.propValues),Gc(t._zod,"values",()=>e.innerType._zod.values),Gc(t._zod,"optin",()=>e.innerType._zod.optin),Gc(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(UYi):UYi(o)}});a(UYi,"LM");ito=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||eXi.has(typeof n))r.push(Gie(`${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)}),oto=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))}),sto=ft("$ZodLazy",(t,e)=>{Co.init(t,e),Gc(t._zod,"innerType",()=>e.getter()),Gc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Gc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Gc(t._zod,"optin",()=>t._zod.innerType._zod.optin),Gc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),ato=ft("$ZodCustom",(t,e)=>{Eh.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=>QYi(s,r,n,t));QYi(o,r,n,t)}});a(QYi,"jM");N6r={};OB(N6r,{zhTW:a(()=>M$c,"zhTW"),zhCN:a(()=>D$c,"zhCN"),vi:a(()=>P$c,"vi"),ur:a(()=>w$c,"ur"),ua:a(()=>I$c,"ua"),tr:a(()=>S$c,"tr"),th:a(()=>v$c,"th"),ta:a(()=>E$c,"ta"),sv:a(()=>A$c,"sv"),sl:a(()=>m$c,"sl"),ru:a(()=>p$c,"ru"),pt:a(()=>d$c,"pt"),ps:a(()=>a$c,"ps"),pl:a(()=>l$c,"pl"),ota:a(()=>o$c,"ota"),no:a(()=>n$c,"no"),nl:a(()=>t$c,"nl"),ms:a(()=>XGc,"ms"),mk:a(()=>JGc,"mk"),ko:a(()=>YGc,"ko"),kh:a(()=>WGc,"kh"),ja:a(()=>$Gc,"ja"),it:a(()=>HGc,"it"),id:a(()=>qGc,"id"),hu:a(()=>UGc,"hu"),he:a(()=>LGc,"he"),frCA:a(()=>OGc,"frCA"),fr:a(()=>NGc,"fr"),fi:a(()=>kGc,"fi"),fa:a(()=>RGc,"fa"),es:a(()=>xGc,"es"),eo:a(()=>TGc,"eo"),en:a(()=>cto,"en"),de:a(()=>_Gc,"de"),cs:a(()=>yGc,"cs"),ca:a(()=>gGc,"ca"),be:a(()=>hGc,"be"),az:a(()=>fGc,"az"),ar:a(()=>uGc,"ar")});lGc=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 ${ss(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(uGc,"tK");dGc=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 ${ss(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(fGc,"aK");a(qYi,"PM");pGc=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 ${ss(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=qYi(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=qYi(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(hGc,"sK");mGc=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 ${ss(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(gGc,"eK");AGc=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 ${ss(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(yGc,"$q");EGc=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 ${ss(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(_Gc,"Qq");vGc=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"),CGc=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 ${vGc(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${ss(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(cto,"A7");bGc=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"),SGc=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 ${bGc(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${ss(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(TGc,"Jq");IGc=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 ${ss(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(xGc,"Xq");wGc=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 ${ss(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(RGc,"Yq");PGc=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 ${ss(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(kGc,"Wq");DGc=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 : ${ss(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(NGc,"Gq");MGc=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 ${ss(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(OGc,"Uq");BGc=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 ${ss(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(LGc,"Hq");FGc=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 ${ss(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(UGc,"Kq");QGc=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 ${ss(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(qGc,"qq");jGc=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 ${ss(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(HGc,"Vq");GGc=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: ${ss(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($Gc,"Bq");VGc=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 ${ss(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(WGc,"zq");zGc=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 ${ss(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(YGc,"Nq");KGc=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 ${ss(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(JGc,"wq");ZGc=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 ${ss(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(XGc,"Oq");e$c=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 ${ss(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(t$c,"Dq");r$c=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 ${ss(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(n$c,"Fq");i$c=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 ${ss(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(o$c,"Zq");s$c=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 ${ss(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(a$c,"Mq");c$c=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 ${ss(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(l$c,"Lq");u$c=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 ${ss(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(d$c,"jq");a(jYi,"EM");f$c=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 ${ss(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=jYi(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=jYi(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(p$c,"Aq");h$c=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 ${ss(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(m$c,"Iq");g$c=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 ${ss(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(A$c,"Rq");y$c=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 ${ss(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(E$c,"Pq");_$c=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 ${ss(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(v$c,"Eq");C$c=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"),b$c=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 ${C$c(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${ss(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(S$c,"bq");T$c=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 ${ss(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(I$c,"_q");x$c=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: ${ss(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(w$c,"kq");R$c=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 ${ss(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(P$c,"Sq");k$c=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 ${ss(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(D$c,"vq");N$c=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 ${ss(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(M$c,"Cq");lto=Symbol("ZodOutput"),uto=Symbol("ZodInput"),l8e=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(M6r,"R7");D9=M6r();a(dto,"aY");a(fto,"Tq");a(O6r,"P7");a(cxt,"o8");a(B6r,"E7");a(L6r,"b7");a(F6r,"_7");a(U6r,"k7");a(Q6r,"S7");a(q6r,"v7");a(j6r,"C7");a(H6r,"T7");a(G6r,"x7");a($6r,"y7");a(V6r,"f7");a(W6r,"g7");a(z6r,"h7");a(Y6r,"u7");a(K6r,"m7");a(J6r,"l7");a(Z6r,"c7");a(X6r,"p7");a(e9r,"d7");a(t9r,"i7");pto={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(hto,"xq");a(mto,"yq");a(gto,"fq");a(Ato,"gq");a(yto,"eY");a(Eto,"hq");a(_to,"$3");a(vto,"Q3");a(Cto,"J3");a(bto,"X3");a(Sto,"Y3");a(Tto,"W3");a(Ito,"uq");a(xto,"G3");a(wto,"mq");a(Rto,"U3");a(Pto,"H3");a(kto,"K3");a(Dto,"q3");a(Nto,"V3");a(Mto,"B3");a(lxt,"b0");a(Oto,"z3");a(Bto,"N3");a(Lto,"w3");a(Fto,"lq");a(Uto,"O3");a(Uie,"o4");a(kN,"t6");a(Qie,"t4");a(SI,"P6");a(Qto,"cq");a(qto,"pq");a(jto,"dq");a(Hto,"iq");a(u8e,"_0");a(twt,"t8");a(d8e,"k0");a(r9r,"n7");a(rwt,"a8");a(pve,"k1");a(nwt,"s8");a(n9r,"r7");a(i9r,"o7");a(o9r,"t7");a(s9r,"a7");a(a9r,"s7");a(c9r,"e7");a(Gto,"nq");a(l9r,"$J");a($ie,"a4");a(u9r,"QJ");a(d9r,"JJ");a(f9r,"XJ");a(p9r,"YJ");a(h9r,"WJ");a(O$c,"Wm");a(B$c,"Gm");a(L$c,"Um");a($to,"rq");a(F$c,"Hm");a(U$c,"Km");a(Q$c,"qm");a(q$c,"Vm");a(j$c,"Bm");a(H$c,"zm");a(Vto,"D3");a(G$c,"Nm");a($$c,"wm");a(V$c,"Om");a(W$c,"Dm");a(z$c,"Fm");a(Y$c,"Zm");a(K$c,"Mm");a(J$c,"Lm");a(Z$c,"jm");a(X$c,"Am");a(eVc,"Im");a(tVc,"Rm");a(Wto,"F3");a(zto,"Z3");a(Yto,"M3");a(Kto,"L3");uxt=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?ixt(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?ixt(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 oxt(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?oxt(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 ewt({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(Jto,"j3");f8e=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??D9,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;let l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,l);let u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path},h=e._zod.parent;if(h)l.ref=h,this.process(h,f),this.seen.get(h).isParent=!0;else{let m=l.schema;switch(o.type){case"string":{let g=m;g.type="string";let{minimum:A,maximum:y,format:E,patterns:_,contentEncoding:v}=e._zod.bag;if(typeof A=="number"&&(g.minLength=A),typeof y=="number"&&(g.maxLength=y),E&&(g.format=s[E]??E,g.format===""&&delete g.format),v&&(g.contentEncoding=v),_&&_.size>0){let b=[..._];b.length===1?g.pattern=b[0].source:b.length>1&&(l.schema.allOf=[...b.map(T=>({...this.target==="draft-7"?{type:"string"}:{},pattern:T.source}))])}break}case"number":{let g=m,{minimum:A,maximum:y,format:E,multipleOf:_,exclusiveMaximum:v,exclusiveMinimum:b}=e._zod.bag;typeof E=="string"&&E.includes("int")?g.type="integer":g.type="number",typeof b=="number"&&(g.exclusiveMinimum=b),typeof A=="number"&&(g.minimum=A,typeof b=="number"&&(b>=A?delete g.minimum:delete g.exclusiveMinimum)),typeof v=="number"&&(g.exclusiveMaximum=v),typeof y=="number"&&(g.maximum=y,typeof v=="number"&&(v<=y?delete g.maximum:delete g.exclusiveMaximum)),typeof _=="number"&&(g.multipleOf=_);break}case"boolean":{let g=m;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{m.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let g=m,{minimum:A,maximum:y}=e._zod.bag;typeof A=="number"&&(g.minItems=A),typeof y=="number"&&(g.maxItems=y),g.type="array",g.items=this.process(o.element,{...f,path:[...f.path,"items"]});break}case"object":{let g=m;g.type="object",g.properties={};let A=o.shape;for(let _ in A)g.properties[_]=this.process(A[_],{...f,path:[...f.path,"properties",_]});let y=new Set(Object.keys(A)),E=new Set([...y].filter(_=>{let v=o.shape[_]._zod;return this.io==="input"?v.optin===void 0:v.optout===void 0}));E.size>0&&(g.required=Array.from(E)),o.catchall?._zod.def.type==="never"?g.additionalProperties=!1:o.catchall?o.catchall&&(g.additionalProperties=this.process(o.catchall,{...f,path:[...f.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{let g=m;g.anyOf=o.options.map((A,y)=>this.process(A,{...f,path:[...f.path,"anyOf",y]}));break}case"intersection":{let g=m,A=this.process(o.left,{...f,path:[...f.path,"allOf",0]}),y=this.process(o.right,{...f,path:[...f.path,"allOf",1]}),E=a(v=>"allOf"in v&&Object.keys(v).length===1,"D"),_=[...E(A)?A.allOf:[A],...E(y)?y.allOf:[y]];g.allOf=_;break}case"tuple":{let g=m;g.type="array";let A=o.items.map((_,v)=>this.process(_,{...f,path:[...f.path,"prefixItems",v]}));if(this.target==="draft-2020-12"?g.prefixItems=A:g.items=A,o.rest){let _=this.process(o.rest,{...f,path:[...f.path,"items"]});this.target==="draft-2020-12"?g.items=_:g.additionalItems=_}o.rest&&(g.items=this.process(o.rest,{...f,path:[...f.path,"items"]}));let{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(g.minItems=y),typeof E=="number"&&(g.maxItems=E);break}case"record":{let g=m;g.type="object",g.propertyNames=this.process(o.keyType,{...f,path:[...f.path,"propertyNames"]}),g.additionalProperties=this.process(o.valueType,{...f,path:[...f.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let g=m,A=u6r(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"&&D0(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 ? [${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("/")}/ -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(m9r,"e8");a(D0,"t$");rVc={},nVc=ft("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");Co.init(t,e),t.def=e,t.parse=(r,n)=>ixt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Zxt(t,r,n),t.parseAsync=async(r,n)=>oxt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Xxt(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>FN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),iVc=ft("ZodMiniObject",(t,e)=>{R6r.init(t,e),nVc.init(t,e),Gs.defineLazy(t,"shape",()=>e.shape)});a(HYi,"tq");a(MB,"a6");a(Q_e,"S0");a(UFe,"S1");a(rFr,"I3");a(T8e,"v1");a(bFe,"$9");a(nFr,"R3");a(oVc,"_M");a(sVc,"kM");a(Zto,"P3");G={};OB(G,{xid:a(()=>_Vc,"xid"),void:a(()=>qVc,"void"),uuidv7:a(()=>pVc,"uuidv7"),uuidv6:a(()=>fVc,"uuidv6"),uuidv4:a(()=>dVc,"uuidv4"),uuid:a(()=>uVc,"uuid"),url:a(()=>hVc,"url"),uppercase:a(()=>o9r,"uppercase"),unknown:a(()=>ef,"unknown"),union:a(()=>eu,"union"),undefined:a(()=>UVc,"undefined"),ulid:a(()=>EVc,"ulid"),uint64:a(()=>LVc,"uint64"),uint32:a(()=>MVc,"uint32"),tuple:a(()=>$Vc,"tuple"),trim:a(()=>d9r,"trim"),treeifyError:a(()=>sXi,"treeifyError"),transform:a(()=>V9r,"transform"),toUpperCase:a(()=>p9r,"toUpperCase"),toLowerCase:a(()=>f9r,"toLowerCase"),toJSONSchema:a(()=>m9r,"toJSONSchema"),templateLiteral:a(()=>eWc,"templateLiteral"),symbol:a(()=>FVc,"symbol"),superRefine:a(()=>Hro,"superRefine"),success:a(()=>ZVc,"success"),stringbool:a(()=>nWc,"stringbool"),stringFormat:a(()=>PVc,"stringFormat"),string:a(()=>It,"string"),strictObject:a(()=>GVc,"strictObject"),startsWith:a(()=>a9r,"startsWith"),size:a(()=>r9r,"size"),setErrorMap:a(()=>sWc,"setErrorMap"),set:a(()=>zVc,"set"),safeParseAsync:a(()=>aro,"safeParseAsync"),safeParse:a(()=>sro,"safeParse"),registry:a(()=>M6r,"registry"),regexes:a(()=>_6r,"regexes"),regex:a(()=>n9r,"regex"),refine:a(()=>jro,"refine"),record:a(()=>Xl,"record"),readonly:a(()=>Oro,"readonly"),property:a(()=>Gto,"property"),promise:a(()=>tWc,"promise"),prettifyError:a(()=>cXi,"prettifyError"),preprocess:a(()=>K9r,"preprocess"),prefault:a(()=>wro,"prefault"),positive:a(()=>Qto,"positive"),pipe:a(()=>pxt,"pipe"),partialRecord:a(()=>VVc,"partialRecord"),parseAsync:a(()=>oro,"parseAsync"),parse:a(()=>iro,"parse"),overwrite:a(()=>$ie,"overwrite"),optional:a(()=>vd,"optional"),object:a(()=>Cn,"object"),number:a(()=>kc,"number"),nullish:a(()=>JVc,"nullish"),nullable:a(()=>fxt,"nullable"),null:a(()=>Q9r,"null"),normalize:a(()=>u9r,"normalize"),nonpositive:a(()=>jto,"nonpositive"),nonoptional:a(()=>Rro,"nonoptional"),nonnegative:a(()=>Hto,"nonnegative"),never:a(()=>cwt,"never"),negative:a(()=>qto,"negative"),nativeEnum:a(()=>YVc,"nativeEnum"),nanoid:a(()=>gVc,"nanoid"),nan:a(()=>XVc,"nan"),multipleOf:a(()=>u8e,"multipleOf"),minSize:a(()=>d8e,"minSize"),minLength:a(()=>pve,"minLength"),mime:a(()=>l9r,"mime"),maxSize:a(()=>twt,"maxSize"),maxLength:a(()=>rwt,"maxLength"),map:a(()=>WVc,"map"),lte:a(()=>kN,"lte"),lt:a(()=>Uie,"lt"),lowercase:a(()=>i9r,"lowercase"),looseObject:a(()=>Gv,"looseObject"),locales:a(()=>N6r,"locales"),literal:a(()=>ti,"literal"),length:a(()=>nwt,"length"),lazy:a(()=>Fro,"lazy"),ksuid:a(()=>vVc,"ksuid"),keyof:a(()=>HVc,"keyof"),jwt:a(()=>RVc,"jwt"),json:a(()=>iWc,"json"),iso:a(()=>g9r,"iso"),ipv6:a(()=>bVc,"ipv6"),ipv4:a(()=>CVc,"ipv4"),intersection:a(()=>uwt,"intersection"),int64:a(()=>BVc,"int64"),int32:a(()=>NVc,"int32"),int:a(()=>e8r,"int"),instanceof:a(()=>rWc,"instanceof"),includes:a(()=>s9r,"includes"),guid:a(()=>lVc,"guid"),gte:a(()=>SI,"gte"),gt:a(()=>Qie,"gt"),globalRegistry:a(()=>D9,"globalRegistry"),getErrorMap:a(()=>aWc,"getErrorMap"),function:a(()=>Jto,"function"),formatError:a(()=>m6r,"formatError"),float64:a(()=>DVc,"float64"),float32:a(()=>kVc,"float32"),flattenError:a(()=>h6r,"flattenError"),file:a(()=>KVc,"file"),enum:a(()=>I1,"enum"),endsWith:a(()=>c9r,"endsWith"),emoji:a(()=>mVc,"emoji"),email:a(()=>cVc,"email"),e164:a(()=>wVc,"e164"),discriminatedUnion:a(()=>H9r,"discriminatedUnion"),date:a(()=>jVc,"date"),custom:a(()=>qro,"custom"),cuid2:a(()=>yVc,"cuid2"),cuid:a(()=>AVc,"cuid"),core:a(()=>zZi,"core"),config:a(()=>Wv,"config"),coerce:a(()=>Gro,"coerce"),clone:a(()=>FN,"clone"),cidrv6:a(()=>TVc,"cidrv6"),cidrv4:a(()=>SVc,"cidrv4"),check:a(()=>Qro,"check"),catch:a(()=>Dro,"catch"),boolean:a(()=>N0,"boolean"),bigint:a(()=>OVc,"bigint"),base64url:a(()=>xVc,"base64url"),base64:a(()=>IVc,"base64"),array:a(()=>Ea,"array"),any:a(()=>QVc,"any"),_default:a(()=>Iro,"_default"),_ZodString:a(()=>v9r,"_ZodString"),ZodXID:a(()=>R9r,"ZodXID"),ZodVoid:a(()=>mro,"ZodVoid"),ZodUnknown:a(()=>pro,"ZodUnknown"),ZodUnion:a(()=>j9r,"ZodUnion"),ZodUndefined:a(()=>uro,"ZodUndefined"),ZodUUID:a(()=>N9,"ZodUUID"),ZodURL:a(()=>b9r,"ZodURL"),ZodULID:a(()=>w9r,"ZodULID"),ZodType:a(()=>Ds,"ZodType"),ZodTuple:a(()=>Ero,"ZodTuple"),ZodTransform:a(()=>$9r,"ZodTransform"),ZodTemplateLiteral:a(()=>Bro,"ZodTemplateLiteral"),ZodSymbol:a(()=>lro,"ZodSymbol"),ZodSuccess:a(()=>Pro,"ZodSuccess"),ZodStringFormat:a(()=>bd,"ZodStringFormat"),ZodString:a(()=>iwt,"ZodString"),ZodSet:a(()=>vro,"ZodSet"),ZodRecord:a(()=>G9r,"ZodRecord"),ZodRealError:a(()=>I8e,"ZodRealError"),ZodReadonly:a(()=>Mro,"ZodReadonly"),ZodPromise:a(()=>Uro,"ZodPromise"),ZodPrefault:a(()=>xro,"ZodPrefault"),ZodPipe:a(()=>Y9r,"ZodPipe"),ZodOptional:a(()=>W9r,"ZodOptional"),ZodObject:a(()=>lwt,"ZodObject"),ZodNumberFormat:a(()=>Ive,"ZodNumberFormat"),ZodNumber:a(()=>owt,"ZodNumber"),ZodNullable:a(()=>Sro,"ZodNullable"),ZodNull:a(()=>dro,"ZodNull"),ZodNonOptional:a(()=>z9r,"ZodNonOptional"),ZodNever:a(()=>hro,"ZodNever"),ZodNanoID:a(()=>T9r,"ZodNanoID"),ZodNaN:a(()=>Nro,"ZodNaN"),ZodMap:a(()=>_ro,"ZodMap"),ZodLiteral:a(()=>Cro,"ZodLiteral"),ZodLazy:a(()=>Lro,"ZodLazy"),ZodKSUID:a(()=>P9r,"ZodKSUID"),ZodJWT:a(()=>F9r,"ZodJWT"),ZodIssueCode:a(()=>oWc,"ZodIssueCode"),ZodIntersection:a(()=>yro,"ZodIntersection"),ZodISOTime:a(()=>E9r,"ZodISOTime"),ZodISODuration:a(()=>_9r,"ZodISODuration"),ZodISODateTime:a(()=>A9r,"ZodISODateTime"),ZodISODate:a(()=>y9r,"ZodISODate"),ZodIPv6:a(()=>D9r,"ZodIPv6"),ZodIPv4:a(()=>k9r,"ZodIPv4"),ZodGUID:a(()=>dxt,"ZodGUID"),ZodFile:a(()=>bro,"ZodFile"),ZodError:a(()=>aVc,"ZodError"),ZodEnum:a(()=>p8e,"ZodEnum"),ZodEmoji:a(()=>S9r,"ZodEmoji"),ZodEmail:a(()=>C9r,"ZodEmail"),ZodE164:a(()=>L9r,"ZodE164"),ZodDiscriminatedUnion:a(()=>Aro,"ZodDiscriminatedUnion"),ZodDefault:a(()=>Tro,"ZodDefault"),ZodDate:a(()=>q9r,"ZodDate"),ZodCustomStringFormat:a(()=>cro,"ZodCustomStringFormat"),ZodCustom:a(()=>dwt,"ZodCustom"),ZodCatch:a(()=>kro,"ZodCatch"),ZodCUID2:a(()=>x9r,"ZodCUID2"),ZodCUID:a(()=>I9r,"ZodCUID"),ZodCIDRv6:a(()=>M9r,"ZodCIDRv6"),ZodCIDRv4:a(()=>N9r,"ZodCIDRv4"),ZodBoolean:a(()=>swt,"ZodBoolean"),ZodBigIntFormat:a(()=>U9r,"ZodBigIntFormat"),ZodBigInt:a(()=>awt,"ZodBigInt"),ZodBase64URL:a(()=>B9r,"ZodBase64URL"),ZodBase64:a(()=>O9r,"ZodBase64"),ZodArray:a(()=>gro,"ZodArray"),ZodAny:a(()=>fro,"ZodAny"),TimePrecision:a(()=>pto,"TimePrecision"),NEVER:a(()=>YZi,"NEVER"),$output:a(()=>lto,"$output"),$input:a(()=>uto,"$input"),$brand:a(()=>KZi,"$brand")});g9r={};OB(g9r,{time:a(()=>tro,"time"),duration:a(()=>rro,"duration"),datetime:a(()=>Xto,"datetime"),date:a(()=>ero,"date"),ZodISOTime:a(()=>E9r,"ZodISOTime"),ZodISODuration:a(()=>_9r,"ZodISODuration"),ZodISODateTime:a(()=>A9r,"ZodISODateTime"),ZodISODate:a(()=>y9r,"ZodISODate")});A9r=ft("ZodISODateTime",(t,e)=>{Aeo.init(t,e),bd.init(t,e)});a(Xto,"aq");y9r=ft("ZodISODate",(t,e)=>{yeo.init(t,e),bd.init(t,e)});a(ero,"sq");E9r=ft("ZodISOTime",(t,e)=>{Eeo.init(t,e),bd.init(t,e)});a(tro,"eq");_9r=ft("ZodISODuration",(t,e)=>{_eo.init(t,e),bd.init(t,e)});a(rro,"$V");nro=a((t,e)=>{p6r.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>m6r(t,r),"value")},flatten:{value:a(r=>h6r(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"),aVc=ft("ZodError",nro),I8e=ft("ZodError",nro,{Parent:Error}),iro=g6r(I8e),oro=A6r(I8e),sro=y6r(I8e),aro=E6r(I8e),Ds=ft("ZodType",(t,e)=>(Co.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>FN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>iro(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>sro(t,r,n),t.parseAsync=async(r,n)=>oro(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>aro(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(jro(r,n)),t.superRefine=r=>t.check(Hro(r)),t.overwrite=r=>t.check($ie(r)),t.optional=()=>vd(t),t.nullable=()=>fxt(t),t.nullish=()=>vd(fxt(t)),t.nonoptional=r=>Rro(t,r),t.array=()=>Ea(t),t.or=r=>eu([t,r]),t.and=r=>uwt(t,r),t.transform=r=>pxt(t,V9r(r)),t.default=r=>Iro(t,r),t.prefault=r=>wro(t,r),t.catch=r=>Dro(t,r),t.pipe=r=>pxt(t,r),t.readonly=()=>Oro(t),t.describe=r=>{let n=t.clone();return D9.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return D9.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return D9.get(t);let n=t.clone();return D9.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),v9r=ft("_ZodString",(t,e)=>{S8e.init(t,e),Ds.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(n9r(...n)),t.includes=(...n)=>t.check(s9r(...n)),t.startsWith=(...n)=>t.check(a9r(...n)),t.endsWith=(...n)=>t.check(c9r(...n)),t.min=(...n)=>t.check(pve(...n)),t.max=(...n)=>t.check(rwt(...n)),t.length=(...n)=>t.check(nwt(...n)),t.nonempty=(...n)=>t.check(pve(1,...n)),t.lowercase=n=>t.check(i9r(n)),t.uppercase=n=>t.check(o9r(n)),t.trim=()=>t.check(d9r()),t.normalize=(...n)=>t.check(u9r(...n)),t.toLowerCase=()=>t.check(f9r()),t.toUpperCase=()=>t.check(p9r())}),iwt=ft("ZodString",(t,e)=>{S8e.init(t,e),v9r.init(t,e),t.email=r=>t.check(O6r(C9r,r)),t.url=r=>t.check(Q6r(b9r,r)),t.jwt=r=>t.check(t9r(F9r,r)),t.emoji=r=>t.check(q6r(S9r,r)),t.guid=r=>t.check(cxt(dxt,r)),t.uuid=r=>t.check(B6r(N9,r)),t.uuidv4=r=>t.check(L6r(N9,r)),t.uuidv6=r=>t.check(F6r(N9,r)),t.uuidv7=r=>t.check(U6r(N9,r)),t.nanoid=r=>t.check(j6r(T9r,r)),t.guid=r=>t.check(cxt(dxt,r)),t.cuid=r=>t.check(H6r(I9r,r)),t.cuid2=r=>t.check(G6r(x9r,r)),t.ulid=r=>t.check($6r(w9r,r)),t.base64=r=>t.check(Z6r(O9r,r)),t.base64url=r=>t.check(X6r(B9r,r)),t.xid=r=>t.check(V6r(R9r,r)),t.ksuid=r=>t.check(W6r(P9r,r)),t.ipv4=r=>t.check(z6r(k9r,r)),t.ipv6=r=>t.check(Y6r(D9r,r)),t.cidrv4=r=>t.check(K6r(N9r,r)),t.cidrv6=r=>t.check(J6r(M9r,r)),t.e164=r=>t.check(e9r(L9r,r)),t.datetime=r=>t.check(Xto(r)),t.date=r=>t.check(ero(r)),t.time=r=>t.check(tro(r)),t.duration=r=>t.check(rro(r))});a(It,"L");bd=ft("ZodStringFormat",(t,e)=>{Nu.init(t,e),v9r.init(t,e)}),C9r=ft("ZodEmail",(t,e)=>{ceo.init(t,e),bd.init(t,e)});a(cVc,"Cm");dxt=ft("ZodGUID",(t,e)=>{seo.init(t,e),bd.init(t,e)});a(lVc,"Tm");N9=ft("ZodUUID",(t,e)=>{aeo.init(t,e),bd.init(t,e)});a(uVc,"xm");a(dVc,"ym");a(fVc,"fm");a(pVc,"gm");b9r=ft("ZodURL",(t,e)=>{leo.init(t,e),bd.init(t,e)});a(hVc,"hm");S9r=ft("ZodEmoji",(t,e)=>{ueo.init(t,e),bd.init(t,e)});a(mVc,"um");T9r=ft("ZodNanoID",(t,e)=>{deo.init(t,e),bd.init(t,e)});a(gVc,"mm");I9r=ft("ZodCUID",(t,e)=>{feo.init(t,e),bd.init(t,e)});a(AVc,"lm");x9r=ft("ZodCUID2",(t,e)=>{peo.init(t,e),bd.init(t,e)});a(yVc,"cm");w9r=ft("ZodULID",(t,e)=>{heo.init(t,e),bd.init(t,e)});a(EVc,"pm");R9r=ft("ZodXID",(t,e)=>{meo.init(t,e),bd.init(t,e)});a(_Vc,"dm");P9r=ft("ZodKSUID",(t,e)=>{geo.init(t,e),bd.init(t,e)});a(vVc,"im");k9r=ft("ZodIPv4",(t,e)=>{veo.init(t,e),bd.init(t,e)});a(CVc,"nm");D9r=ft("ZodIPv6",(t,e)=>{Ceo.init(t,e),bd.init(t,e)});a(bVc,"rm");N9r=ft("ZodCIDRv4",(t,e)=>{beo.init(t,e),bd.init(t,e)});a(SVc,"om");M9r=ft("ZodCIDRv6",(t,e)=>{Seo.init(t,e),bd.init(t,e)});a(TVc,"tm");O9r=ft("ZodBase64",(t,e)=>{Teo.init(t,e),bd.init(t,e)});a(IVc,"am");B9r=ft("ZodBase64URL",(t,e)=>{xeo.init(t,e),bd.init(t,e)});a(xVc,"sm");L9r=ft("ZodE164",(t,e)=>{weo.init(t,e),bd.init(t,e)});a(wVc,"em");F9r=ft("ZodJWT",(t,e)=>{Peo.init(t,e),bd.init(t,e)});a(RVc,"$l");cro=ft("ZodCustomStringFormat",(t,e)=>{keo.init(t,e),bd.init(t,e)});a(PVc,"Ql");owt=ft("ZodNumber",(t,e)=>{T6r.init(t,e),Ds.init(t,e),t.gt=(n,o)=>t.check(Qie(n,o)),t.gte=(n,o)=>t.check(SI(n,o)),t.min=(n,o)=>t.check(SI(n,o)),t.lt=(n,o)=>t.check(Uie(n,o)),t.lte=(n,o)=>t.check(kN(n,o)),t.max=(n,o)=>t.check(kN(n,o)),t.int=n=>t.check(e8r(n)),t.safe=n=>t.check(e8r(n)),t.positive=n=>t.check(Qie(0,n)),t.nonnegative=n=>t.check(SI(0,n)),t.negative=n=>t.check(Uie(0,n)),t.nonpositive=n=>t.check(kN(0,n)),t.multipleOf=(n,o)=>t.check(u8e(n,o)),t.step=(n,o)=>t.check(u8e(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(kc,"z$");Ive=ft("ZodNumberFormat",(t,e)=>{Deo.init(t,e),owt.init(t,e)});a(e8r,"WV");a(kVc,"Jl");a(DVc,"Xl");a(NVc,"Yl");a(MVc,"Wl");swt=ft("ZodBoolean",(t,e)=>{I6r.init(t,e),Ds.init(t,e)});a(N0,"i$");awt=ft("ZodBigInt",(t,e)=>{x6r.init(t,e),Ds.init(t,e),t.gte=(n,o)=>t.check(SI(n,o)),t.min=(n,o)=>t.check(SI(n,o)),t.gt=(n,o)=>t.check(Qie(n,o)),t.gte=(n,o)=>t.check(SI(n,o)),t.min=(n,o)=>t.check(SI(n,o)),t.lt=(n,o)=>t.check(Uie(n,o)),t.lte=(n,o)=>t.check(kN(n,o)),t.max=(n,o)=>t.check(kN(n,o)),t.positive=n=>t.check(Qie(BigInt(0),n)),t.negative=n=>t.check(Uie(BigInt(0),n)),t.nonpositive=n=>t.check(kN(BigInt(0),n)),t.nonnegative=n=>t.check(SI(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(u8e(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(OVc,"Gl");U9r=ft("ZodBigIntFormat",(t,e)=>{Neo.init(t,e),awt.init(t,e)});a(BVc,"Ul");a(LVc,"Hl");lro=ft("ZodSymbol",(t,e)=>{Meo.init(t,e),Ds.init(t,e)});a(FVc,"Kl");uro=ft("ZodUndefined",(t,e)=>{Oeo.init(t,e),Ds.init(t,e)});a(UVc,"ql");dro=ft("ZodNull",(t,e)=>{Beo.init(t,e),Ds.init(t,e)});a(Q9r,"T3");fro=ft("ZodAny",(t,e)=>{Leo.init(t,e),Ds.init(t,e)});a(QVc,"Vl");pro=ft("ZodUnknown",(t,e)=>{axt.init(t,e),Ds.init(t,e)});a(ef,"S$");hro=ft("ZodNever",(t,e)=>{Feo.init(t,e),Ds.init(t,e)});a(cwt,"x3");mro=ft("ZodVoid",(t,e)=>{Ueo.init(t,e),Ds.init(t,e)});a(qVc,"Bl");q9r=ft("ZodDate",(t,e)=>{Qeo.init(t,e),Ds.init(t,e),t.min=(n,o)=>t.check(SI(n,o)),t.max=(n,o)=>t.check(kN(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(jVc,"zl");gro=ft("ZodArray",(t,e)=>{w6r.init(t,e),Ds.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(pve(r,n)),t.nonempty=r=>t.check(pve(1,r)),t.max=(r,n)=>t.check(rwt(r,n)),t.length=(r,n)=>t.check(nwt(r,n)),t.unwrap=()=>t.element});a(Ea,"W$");a(HVc,"Nl");lwt=ft("ZodObject",(t,e)=>{R6r.init(t,e),Ds.init(t,e),Gs.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>I1(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:ef()}),t.loose=()=>t.clone({...t._zod.def,catchall:ef()}),t.strict=()=>t.clone({...t._zod.def,catchall:cwt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Gs.extend(t,r),t.merge=r=>Gs.merge(t,r),t.pick=r=>Gs.pick(t,r),t.omit=r=>Gs.omit(t,r),t.partial=(...r)=>Gs.partial(W9r,t,r[0]),t.required=(...r)=>Gs.required(z9r,t,r[0])});a(Cn,"h");a(GVc,"wl");a(Gv,"K6");j9r=ft("ZodUnion",(t,e)=>{P6r.init(t,e),Ds.init(t,e),t.options=e.options});a(eu,"A$");Aro=ft("ZodDiscriminatedUnion",(t,e)=>{j9r.init(t,e),qeo.init(t,e)});a(H9r,"g3");yro=ft("ZodIntersection",(t,e)=>{jeo.init(t,e),Ds.init(t,e)});a(uwt,"VJ");Ero=ft("ZodTuple",(t,e)=>{ewt.init(t,e),Ds.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a($Vc,"Ol");G9r=ft("ZodRecord",(t,e)=>{Heo.init(t,e),Ds.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(Xl,"I$");a(VVc,"Dl");_ro=ft("ZodMap",(t,e)=>{Geo.init(t,e),Ds.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(WVc,"Fl");vro=ft("ZodSet",(t,e)=>{$eo.init(t,e),Ds.init(t,e),t.min=(...r)=>t.check(d8e(...r)),t.nonempty=r=>t.check(d8e(1,r)),t.max=(...r)=>t.check(twt(...r)),t.size=(...r)=>t.check(r9r(...r))});a(zVc,"Zl");p8e=ft("ZodEnum",(t,e)=>{Veo.init(t,e),Ds.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 p8e({...e,checks:[],...Gs.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 p8e({...e,checks:[],...Gs.normalizeParams(o),entries:s})}});a(I1,"N6");a(YVc,"Ml");Cro=ft("ZodLiteral",(t,e)=>{Weo.init(t,e),Ds.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");bro=ft("ZodFile",(t,e)=>{zeo.init(t,e),Ds.init(t,e),t.min=(r,n)=>t.check(d8e(r,n)),t.max=(r,n)=>t.check(twt(r,n)),t.mime=(r,n)=>t.check(l9r(Array.isArray(r)?r:[r],n))});a(KVc,"Ll");$9r=ft("ZodTransform",(t,e)=>{k6r.init(t,e),Ds.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Gs.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(Gs.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(V9r,"bV");W9r=ft("ZodOptional",(t,e)=>{Yeo.init(t,e),Ds.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(vd,"_$");Sro=ft("ZodNullable",(t,e)=>{Keo.init(t,e),Ds.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(fxt,"v3");a(JVc,"jl");Tro=ft("ZodDefault",(t,e)=>{Jeo.init(t,e),Ds.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(Iro,"aM");xro=ft("ZodPrefault",(t,e)=>{Zeo.init(t,e),Ds.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(wro,"eM");z9r=ft("ZodNonOptional",(t,e)=>{Xeo.init(t,e),Ds.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Rro,"$L");Pro=ft("ZodSuccess",(t,e)=>{eto.init(t,e),Ds.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(ZVc,"Al");kro=ft("ZodCatch",(t,e)=>{tto.init(t,e),Ds.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(Dro,"XL");Nro=ft("ZodNaN",(t,e)=>{rto.init(t,e),Ds.init(t,e)});a(XVc,"Il");Y9r=ft("ZodPipe",(t,e)=>{D6r.init(t,e),Ds.init(t,e),t.in=e.in,t.out=e.out});a(pxt,"C3");Mro=ft("ZodReadonly",(t,e)=>{nto.init(t,e),Ds.init(t,e)});a(Oro,"GL");Bro=ft("ZodTemplateLiteral",(t,e)=>{ito.init(t,e),Ds.init(t,e)});a(eWc,"Rl");Lro=ft("ZodLazy",(t,e)=>{sto.init(t,e),Ds.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(Fro,"KL");Uro=ft("ZodPromise",(t,e)=>{oto.init(t,e),Ds.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(tWc,"Pl");dwt=ft("ZodCustom",(t,e)=>{ato.init(t,e),Ds.init(t,e)});a(Qro,"VL");a(qro,"vV");a(jro,"BL");a(Hro,"zL");a(rWc,"El");nWc=a((...t)=>Yto({Pipe:Y9r,Boolean:swt,String:iwt,Transform:$9r},...t),"bl");a(iWc,"_l");a(K9r,"u3");oWc={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(sWc,"Sl");a(aWc,"vl");Gro={};OB(Gro,{string:a(()=>cWc,"string"),number:a(()=>lWc,"number"),date:a(()=>fWc,"date"),boolean:a(()=>uWc,"boolean"),bigint:a(()=>dWc,"bigint")});a(cWc,"Cl");a(lWc,"Tl");a(uWc,"xl");a(dWc,"yl");a(fWc,"fl");Wv(cto());pWc=G,$ro=pWc,Vro="2025-11-25",hWc=[Vro,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],xie="io.modelcontextprotocol/related-task",fwt="2.0",M0=qro(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Wro=eu([It(),kc().int()]),zro=It(),LWh=Gv({ttl:kc().optional(),pollInterval:kc().optional()}),mWc=Cn({ttl:kc().optional()}),gWc=Cn({taskId:It()}),J9r=Gv({progressToken:Wro.optional(),[xie]:gWc.optional()}),RI=Cn({_meta:J9r.optional()}),x8e=RI.extend({task:mWc.optional()}),AWc=a(t=>x8e.safeParse(t).success,"FL"),by=Cn({method:It(),params:RI.loose().optional()}),gP=Cn({_meta:J9r.optional()}),AP=Cn({method:It(),params:gP.loose().optional()}),Sy=Gv({_meta:J9r.optional()}),pwt=eu([It(),kc().int()]),Yro=Cn({jsonrpc:ti(fwt),id:pwt,...by.shape}).strict(),GYi=a(t=>Yro.safeParse(t).success,"fV"),Kro=Cn({jsonrpc:ti(fwt),...AP.shape}).strict(),yWc=a(t=>Kro.safeParse(t).success,"LL"),Z9r=Cn({jsonrpc:ti(fwt),id:pwt,result:Sy}).strict(),iIt=a(t=>Z9r.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"})(Li||(Li={}));X9r=Cn({jsonrpc:ti(fwt),id:pwt.optional(),error:Cn({code:kc().int(),message:It(),data:ef().optional()})}).strict(),EWc=a(t=>X9r.safeParse(t).success,"jL"),FWh=eu([Yro,Kro,Z9r,X9r]),UWh=eu([Z9r,X9r]),eUr=Sy.strict(),_Wc=gP.extend({requestId:pwt.optional(),reason:It().optional()}),tUr=AP.extend({method:ti("notifications/cancelled"),params:_Wc}),vWc=Cn({src:It(),mimeType:It().optional(),sizes:Ea(It()).optional(),theme:I1(["light","dark"]).optional()}),w8e=Cn({icons:Ea(vWc).optional()}),hve=Cn({name:It(),title:It().optional()}),Jro=hve.extend({...hve.shape,...w8e.shape,version:It(),websiteUrl:It().optional(),description:It().optional()}),CWc=uwt(Cn({applyDefaults:N0().optional()}),Xl(It(),ef())),bWc=K9r(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,uwt(Cn({form:CWc.optional(),url:M0.optional()}),Xl(It(),ef()).optional())),SWc=Gv({list:M0.optional(),cancel:M0.optional(),requests:Gv({sampling:Gv({createMessage:M0.optional()}).optional(),elicitation:Gv({create:M0.optional()}).optional()}).optional()}),TWc=Gv({list:M0.optional(),cancel:M0.optional(),requests:Gv({tools:Gv({call:M0.optional()}).optional()}).optional()}),IWc=Cn({experimental:Xl(It(),M0).optional(),sampling:Cn({context:M0.optional(),tools:M0.optional()}).optional(),elicitation:bWc.optional(),roots:Cn({listChanged:N0().optional()}).optional(),tasks:SWc.optional(),extensions:Xl(It(),M0).optional()}),xWc=RI.extend({protocolVersion:It(),capabilities:IWc,clientInfo:Jro}),Zro=by.extend({method:ti("initialize"),params:xWc}),wWc=Cn({experimental:Xl(It(),M0).optional(),logging:M0.optional(),completions:M0.optional(),prompts:Cn({listChanged:N0().optional()}).optional(),resources:Cn({subscribe:N0().optional(),listChanged:N0().optional()}).optional(),tools:Cn({listChanged:N0().optional()}).optional(),tasks:TWc.optional(),extensions:Xl(It(),M0).optional()}),RWc=Sy.extend({protocolVersion:It(),capabilities:wWc,serverInfo:Jro,instructions:It().optional()}),Xro=AP.extend({method:ti("notifications/initialized"),params:gP.optional()}),rUr=by.extend({method:ti("ping"),params:RI.optional()}),PWc=Cn({progress:kc(),total:vd(kc()),message:vd(It())}),kWc=Cn({...gP.shape,...PWc.shape,progressToken:Wro}),nUr=AP.extend({method:ti("notifications/progress"),params:kWc}),DWc=RI.extend({cursor:zro.optional()}),R8e=by.extend({params:DWc.optional()}),P8e=Sy.extend({nextCursor:zro.optional()}),NWc=I1(["working","input_required","completed","failed","cancelled"]),k8e=Cn({taskId:It(),status:NWc,ttl:eu([kc(),Q9r()]),createdAt:It(),lastUpdatedAt:It(),pollInterval:vd(kc()),statusMessage:vd(It())}),hwt=Sy.extend({task:k8e}),MWc=gP.merge(k8e),hxt=AP.extend({method:ti("notifications/tasks/status"),params:MWc}),iUr=by.extend({method:ti("tasks/get"),params:RI.extend({taskId:It()})}),oUr=Sy.merge(k8e),sUr=by.extend({method:ti("tasks/result"),params:RI.extend({taskId:It()})}),QWh=Sy.loose(),aUr=R8e.extend({method:ti("tasks/list")}),cUr=P8e.extend({tasks:Ea(k8e)}),lUr=by.extend({method:ti("tasks/cancel"),params:RI.extend({taskId:It()})}),OWc=Sy.merge(k8e),eno=Cn({uri:It(),mimeType:vd(It()),_meta:Xl(It(),ef()).optional()}),tno=eno.extend({text:It()}),uUr=It().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),rno=eno.extend({blob:uUr}),D8e=I1(["user","assistant"]),xve=Cn({audience:Ea(D8e).optional(),priority:kc().min(0).max(1).optional(),lastModified:g9r.datetime({offset:!0}).optional()}),nno=Cn({...hve.shape,...w8e.shape,uri:It(),description:vd(It()),mimeType:vd(It()),size:vd(kc()),annotations:xve.optional(),_meta:vd(Gv({}))}),BWc=Cn({...hve.shape,...w8e.shape,uriTemplate:It(),description:vd(It()),mimeType:vd(It()),annotations:xve.optional(),_meta:vd(Gv({}))}),t8r=R8e.extend({method:ti("resources/list")}),LWc=P8e.extend({resources:Ea(nno)}),r8r=R8e.extend({method:ti("resources/templates/list")}),FWc=P8e.extend({resourceTemplates:Ea(BWc)}),dUr=RI.extend({uri:It()}),UWc=dUr,n8r=by.extend({method:ti("resources/read"),params:UWc}),QWc=Sy.extend({contents:Ea(eu([tno,rno]))}),qWc=AP.extend({method:ti("notifications/resources/list_changed"),params:gP.optional()}),jWc=dUr,HWc=by.extend({method:ti("resources/subscribe"),params:jWc}),GWc=dUr,$Wc=by.extend({method:ti("resources/unsubscribe"),params:GWc}),VWc=gP.extend({uri:It()}),WWc=AP.extend({method:ti("notifications/resources/updated"),params:VWc}),zWc=Cn({name:It(),description:vd(It()),required:vd(N0())}),YWc=Cn({...hve.shape,...w8e.shape,description:vd(It()),arguments:vd(Ea(zWc)),_meta:vd(Gv({}))}),i8r=R8e.extend({method:ti("prompts/list")}),KWc=P8e.extend({prompts:Ea(YWc)}),JWc=RI.extend({name:It(),arguments:Xl(It(),It()).optional()}),o8r=by.extend({method:ti("prompts/get"),params:JWc}),fUr=Cn({type:ti("text"),text:It(),annotations:xve.optional(),_meta:Xl(It(),ef()).optional()}),pUr=Cn({type:ti("image"),data:uUr,mimeType:It(),annotations:xve.optional(),_meta:Xl(It(),ef()).optional()}),hUr=Cn({type:ti("audio"),data:uUr,mimeType:It(),annotations:xve.optional(),_meta:Xl(It(),ef()).optional()}),ZWc=Cn({type:ti("tool_use"),name:It(),id:It(),input:Xl(It(),ef()),_meta:Xl(It(),ef()).optional()}),XWc=Cn({type:ti("resource"),resource:eu([tno,rno]),annotations:xve.optional(),_meta:Xl(It(),ef()).optional()}),ezc=nno.extend({type:ti("resource_link")}),mUr=eu([fUr,pUr,hUr,ezc,XWc]),tzc=Cn({role:D8e,content:mUr}),rzc=Sy.extend({description:It().optional(),messages:Ea(tzc)}),nzc=AP.extend({method:ti("notifications/prompts/list_changed"),params:gP.optional()}),izc=Cn({title:It().optional(),readOnlyHint:N0().optional(),destructiveHint:N0().optional(),idempotentHint:N0().optional(),openWorldHint:N0().optional()}),ozc=Cn({taskSupport:I1(["required","optional","forbidden"]).optional()}),ino=Cn({...hve.shape,...w8e.shape,description:It().optional(),inputSchema:Cn({type:ti("object"),properties:Xl(It(),M0).optional(),required:Ea(It()).optional()}).catchall(ef()),outputSchema:Cn({type:ti("object"),properties:Xl(It(),M0).optional(),required:Ea(It()).optional()}).catchall(ef()).optional(),annotations:izc.optional(),execution:ozc.optional(),_meta:Xl(It(),ef()).optional()}),s8r=R8e.extend({method:ti("tools/list")}),szc=P8e.extend({tools:Ea(ino)}),gUr=Sy.extend({content:Ea(mUr).default([]),structuredContent:Xl(It(),ef()).optional(),isError:N0().optional()}),qWh=gUr.or(Sy.extend({toolResult:ef()})),azc=x8e.extend({name:It(),arguments:Xl(It(),ef()).optional()}),mxt=by.extend({method:ti("tools/call"),params:azc}),czc=AP.extend({method:ti("notifications/tools/list_changed"),params:gP.optional()}),jWh=Cn({autoRefresh:N0().default(!0),debounceMs:kc().int().nonnegative().default(300)}),gxt=I1(["debug","info","notice","warning","error","critical","alert","emergency"]),lzc=RI.extend({level:gxt}),ono=by.extend({method:ti("logging/setLevel"),params:lzc}),uzc=gP.extend({level:gxt,logger:It().optional(),data:ef()}),dzc=AP.extend({method:ti("notifications/message"),params:uzc}),fzc=Cn({name:It().optional()}),pzc=Cn({hints:Ea(fzc).optional(),costPriority:kc().min(0).max(1).optional(),speedPriority:kc().min(0).max(1).optional(),intelligencePriority:kc().min(0).max(1).optional()}),hzc=Cn({mode:I1(["auto","required","none"]).optional()}),mzc=Cn({type:ti("tool_result"),toolUseId:It().describe("The unique identifier for the corresponding tool call."),content:Ea(mUr).default([]),structuredContent:Cn({}).loose().optional(),isError:N0().optional(),_meta:Xl(It(),ef()).optional()}),gzc=H9r("type",[fUr,pUr,hUr]),Axt=H9r("type",[fUr,pUr,hUr,ZWc,mzc]),Azc=Cn({role:D8e,content:eu([Axt,Ea(Axt)]),_meta:Xl(It(),ef()).optional()}),yzc=x8e.extend({messages:Ea(Azc),modelPreferences:pzc.optional(),systemPrompt:It().optional(),includeContext:I1(["none","thisServer","allServers"]).optional(),temperature:kc().optional(),maxTokens:kc().int(),stopSequences:Ea(It()).optional(),metadata:M0.optional(),tools:Ea(ino).optional(),toolChoice:hzc.optional()}),Ezc=by.extend({method:ti("sampling/createMessage"),params:yzc}),AUr=Sy.extend({model:It(),stopReason:vd(I1(["endTurn","stopSequence","maxTokens"]).or(It())),role:D8e,content:gzc}),sno=Sy.extend({model:It(),stopReason:vd(I1(["endTurn","stopSequence","maxTokens","toolUse"]).or(It())),role:D8e,content:eu([Axt,Ea(Axt)])}),_zc=Cn({type:ti("boolean"),title:It().optional(),description:It().optional(),default:N0().optional()}),vzc=Cn({type:ti("string"),title:It().optional(),description:It().optional(),minLength:kc().optional(),maxLength:kc().optional(),format:I1(["email","uri","date","date-time"]).optional(),default:It().optional()}),Czc=Cn({type:I1(["number","integer"]),title:It().optional(),description:It().optional(),minimum:kc().optional(),maximum:kc().optional(),default:kc().optional()}),bzc=Cn({type:ti("string"),title:It().optional(),description:It().optional(),enum:Ea(It()),default:It().optional()}),Szc=Cn({type:ti("string"),title:It().optional(),description:It().optional(),oneOf:Ea(Cn({const:It(),title:It()})),default:It().optional()}),Tzc=Cn({type:ti("string"),title:It().optional(),description:It().optional(),enum:Ea(It()),enumNames:Ea(It()).optional(),default:It().optional()}),Izc=eu([bzc,Szc]),xzc=Cn({type:ti("array"),title:It().optional(),description:It().optional(),minItems:kc().optional(),maxItems:kc().optional(),items:Cn({type:ti("string"),enum:Ea(It())}),default:Ea(It()).optional()}),wzc=Cn({type:ti("array"),title:It().optional(),description:It().optional(),minItems:kc().optional(),maxItems:kc().optional(),items:Cn({anyOf:Ea(Cn({const:It(),title:It()}))}),default:Ea(It()).optional()}),Rzc=eu([xzc,wzc]),Pzc=eu([Tzc,Izc,Rzc]),kzc=eu([Pzc,_zc,vzc,Czc]),Dzc=x8e.extend({mode:ti("form").optional(),message:It(),requestedSchema:Cn({type:ti("object"),properties:Xl(It(),kzc),required:Ea(It()).optional()})}),Nzc=x8e.extend({mode:ti("url"),message:It(),elicitationId:It(),url:It().url()}),Mzc=eu([Dzc,Nzc]),Ozc=by.extend({method:ti("elicitation/create"),params:Mzc}),Bzc=gP.extend({elicitationId:It()}),Lzc=AP.extend({method:ti("notifications/elicitation/complete"),params:Bzc}),yxt=Sy.extend({action:I1(["accept","decline","cancel"]),content:K9r(t=>t===null?void 0:t,Xl(It(),eu([It(),kc(),N0(),Ea(It())])).optional())}),Fzc=Cn({type:ti("ref/resource"),uri:It()}),Uzc=Cn({type:ti("ref/prompt"),name:It()}),Qzc=RI.extend({ref:eu([Uzc,Fzc]),argument:Cn({name:It(),value:It()}),context:Cn({arguments:Xl(It(),It()).optional()}).optional()}),a8r=by.extend({method:ti("completion/complete"),params:Qzc});a(qzc,"kL");a(jzc,"SL");Hzc=Sy.extend({completion:Gv({values:Ea(It()).max(100),total:vd(kc().int()),hasMore:vd(N0())})}),Gzc=Cn({uri:It().startsWith("file://"),name:It().optional(),_meta:Xl(It(),ef()).optional()}),$zc=by.extend({method:ti("roots/list"),params:RI.optional()}),ano=Sy.extend({roots:Ea(Gzc)}),Vzc=AP.extend({method:ti("notifications/roots/list_changed"),params:gP.optional()}),HWh=eu([rUr,Zro,a8r,ono,o8r,i8r,t8r,r8r,n8r,HWc,$Wc,mxt,s8r,iUr,sUr,aUr,lUr]),GWh=eu([tUr,nUr,Xro,Vzc,hxt]),$Wh=eu([eUr,AUr,sno,yxt,ano,oUr,cUr,hwt]),VWh=eu([rUr,Ezc,Ozc,$zc,iUr,sUr,aUr,lUr]),WWh=eu([tUr,nUr,dzc,WWc,qWc,czc,nzc,hxt,Lzc]),zWh=eu([eUr,RWc,Hzc,rzc,KWc,LWc,FWc,QWc,gUr,szc,oUr,cUr,hwt]),di=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===Li.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new c8r(o.elicitations,r)}return new t(e,r,n)}},c8r=class extends di{static{a(this,"vL")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Li.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};a(Tie,"T1");Wzc=Symbol("Let zodToJsonSchema decide on which parser to use"),$Yi={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"},zzc=a(t=>typeof t=="string"?{...$Yi,name:t}:{...$Yi,...t},"xL"),Yzc=a(t=>{let e=zzc(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(cno,"aV");a(fl,"H$");lno=a((t,e)=>{let r=0;for(;rPc(t.innerType._def,e),"uL");a(dno,"sV");eYc=a((t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":fl(r,"minimum",n.value,n.message,e);break;case"max":fl(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(tYc,"mL");a(rYc,"lL");a(nYc,"cL");iYc=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(oYc,"pL");a(sYc,"dL");iFr=void 0,wN={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(()=>(iFr===void 0&&(iFr=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),iFr),"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(fno,"qW");a(oFr,"$B");aYc=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(cYc,"Np");a(RN,"V4");a(Hv,"w6");a(VYi,"iL");a(pno,"VW");a(lYc,"nL");a(uYc,"rL");a(dYc,"oL");a(fYc,"tL");Ext={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(pYc,"sL");WYi=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Pc(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0},"aL");a(hYc,"eL");a(mYc,"$j");a(gYc,"Qj");a(AYc,"wp");a(yYc,"Op");EYc=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Pc(t.innerType._def,e);let r=Pc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:T1(e)},r]}:T1(e)},"Jj"),_Yc=a((t,e)=>{if(e.pipeStrategy==="input")return Pc(t.in._def,e);if(e.pipeStrategy==="output")return Pc(t.out._def,e);let r=Pc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Pc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a(vYc,"Yj");a(CYc,"Wj");a(bYc,"Gj");a(SYc,"Uj");a(TYc,"Hj");IYc=a((t,e)=>Pc(t.innerType._def,e),"Kj"),xYc=a((t,e,r)=>{switch(e){case Cr.ZodString:return fno(t,r);case Cr.ZodNumber:return mYc(t,r);case Cr.ZodObject:return gYc(t,r);case Cr.ZodBigInt:return Jzc(t,r);case Cr.ZodBoolean:return Zzc();case Cr.ZodDate:return dno(t,r);case Cr.ZodUndefined:return SYc(r);case Cr.ZodNull:return fYc(r);case Cr.ZodArray:return Kzc(t,r);case Cr.ZodUnion:case Cr.ZodDiscriminatedUnion:return pYc(t,r);case Cr.ZodIntersection:return oYc(t,r);case Cr.ZodTuple:return bYc(t,r);case Cr.ZodRecord:return pno(t,r);case Cr.ZodLiteral:return sYc(t,r);case Cr.ZodEnum:return nYc(t);case Cr.ZodNativeEnum:return uYc(t);case Cr.ZodNullable:return hYc(t,r);case Cr.ZodOptional:return EYc(t,r);case Cr.ZodMap:return lYc(t,r);case Cr.ZodSet:return CYc(t,r);case Cr.ZodLazy:return()=>t.getter()._def;case Cr.ZodPromise:return vYc(t,r);case Cr.ZodNaN:case Cr.ZodNever:return dYc(r);case Cr.ZodEffects:return rYc(t,r);case Cr.ZodAny:return T1(r);case Cr.ZodUnknown:return TYc(r);case Cr.ZodDefault:return tYc(t,r);case Cr.ZodBranded:return uno(t,r);case Cr.ZodReadonly:return IYc(t,r);case Cr.ZodCatch:return Xzc(t,r);case Cr.ZodPipeline:return _Yc(t,r);case Cr.ZodFunction:case Cr.ZodVoid:case Cr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Pc,"r");wYc=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:lno(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`),T1(e)):e.$refStrategy==="seen"?T1(e):void 0}},"Dp"),RYc=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),PYc=a((t,e)=>{let r=Yzc(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Pc(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0)??T1(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=Pc(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??T1(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(kYc,"Zp");a(zYi,"JB");a(YYi,"XB");a(KYi,"YB");DYc=6e4,l8r=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(tUr,r=>{this._oncancel(r)}),this.setNotificationHandler(nUr,r=>{this._onprogress(r)}),this.setRequestHandler(rUr,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(iUr,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new di(Li.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(sUr,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 di(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 di(Li.InvalidParams,`Task not found: ${s}`);if(!Tie(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Tie(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[xie]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(aUr,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 di(Li.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(lUr,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new di(Li.InvalidParams,`Task not found: ${r.params.taskId}`);if(Tie(o.status))throw new di(Li.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 di(Li.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof di?o:new di(Li.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),di.fromError(Li.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),iIt(s)||EWc(s)?this._onresponse(s):GYi(s)?this._onrequest(s,c):yWc(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=di.fromError(Li.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?.[xie]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Li.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=AWc(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 di(Li.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:Li.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),iIt(e))n(e);else{let c=new di(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(iIt(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),iIt(e))o(e);else{let c=di.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 di?c:new di(Li.InternalError,String(c))}}return}let s;try{let c=await this.request(e,hwt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new di(Li.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Tie(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new di(Li.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new di(Li.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 di?c:new di(Li.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||{},[xie]: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 di?v:new di(Li.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=UFe(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??DYc,E=a(()=>A(di.fromError(Li.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},oUr,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},cUr,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},OWc,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||{},[xie]: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||{},[xie]: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||{},[xie]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=YYi(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=KYi(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=YYi(e);this._notificationHandlers.set(n,o=>{let s=KYi(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"&&GYi(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new di(Li.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 di(Li.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new di(Li.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 di(Li.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=hxt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Tie(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 di(Li.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Tie(l.status))throw new di(Li.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=hxt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Tie(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a(JYi,"Vj");a(NYc,"Bj");MYc=D8r(ZKi(),1),OYc=D8r(u8c(),1);a(BYc,"ps");u8r=class{static{a(this,"qz")}constructor(e){this._ajv=e??BYc()}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)}}},d8r=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},AUr,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},yxt,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(LYc,"tP");a(FYc,"aP");f8r=class extends l8r{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(gxt.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(Xro,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(ono,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=gxt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new d8r(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=NYc(this._capabilities,e)}setRequestHandler(e,r){let n=T8e(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(MB(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=UFe(mxt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new di(Li.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=UFe(hwt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new di(Li.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=UFe(gUr,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new di(Li.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){FYc(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&LYc(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:hWc.includes(r)?r:Vro,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"},eUr)}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},sno,r):this.request({method:"sampling/createMessage",params:e},AUr,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},yxt,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},yxt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new di(Li.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof di?s:new di(Li.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},ano,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"})}},hno=Symbol.for("mcp.completable");a(ZYi,"zz");a(UYc,"$E");(function(t){t.Completable="McpCompletable"})(XYi||(XYi={}));QYc=/^[A-Za-z0-9._-]{1,128}$/;a(qYc,"is");a(jYc,"ns");a(eKi,"Nz");p8r=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)}},h8r=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 f8r(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new p8r(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(jV(s8r)),this.server.assertCanSetRequestHandler(jV(mxt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(s8r,()=>({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=bFe(r.inputSchema);return o?zYi(o,{strictUnions:!0,pipeStrategy:"input"}):HYc})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=bFe(r.outputSchema);o&&(n.outputSchema=zYi(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(mxt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new di(Li.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new di(Li.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 di(Li.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new di(Li.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 di&&n.code===Li.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=bFe(e.inputSchema)??e.inputSchema,s=await rFr(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=nFr(c);throw new di(Li.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 di(Li.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=bFe(e.outputSchema),s=await rFr(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=nFr(c);throw new di(Li.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 di(Li.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(jV(a8r)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(a8r,async e=>{switch(e.params.ref.type){case"ref/prompt":return qzc(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return jzc(e),this.handleResourceCompletion(e,e.params.ref);default:throw new di(Li.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new di(Li.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new di(Li.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return SFe;let o=T8e(n.argsSchema)?.[e.params.argument.name];if(!ZYi(o))return SFe;let s=UYc(o);if(!s)return SFe;let c=await s(e.params.argument.value,e.params.context);return rKi(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 SFe;throw new di(Li.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return SFe;let s=await o(e.params.argument.value,e.params.context);return rKi(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(jV(t8r)),this.server.assertCanSetRequestHandler(jV(r8r)),this.server.assertCanSetRequestHandler(jV(n8r)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(t8r,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(r8r,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(n8r,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new di(Li.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 di(Li.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(jV(i8r)),this.server.assertCanSetRequestHandler(jV(o8r)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(i8r,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?GYc(r.argsSchema):void 0}))})),this.server.setRequestHandler(o8r,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new di(Li.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new di(Li.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=bFe(n.argsSchema),s=await rFr(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=nFr(u);throw new di(Li.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:Q_e(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=Q_e(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 hP?l._def?.innerType:l;return ZYi(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){eKi(e);let f={title:r,description:n,inputSchema:tKi(o),outputSchema:tKi(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"&&eKi(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=Q_e(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=Q_e(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(m8r(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!m8r(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()}},HYc={type:"object",properties:{}};a(mno,"XE");a(gno,"YE");a(m8r,"Oz");a(tKi,"QE");a(GYc,"os");a(jV,"l1");a(rKi,"JE");SFe={completion:{values:[],hasMore:!1}};a($Yc,"ts");a(VYc,"as");a(WYc,"ss");a(wr,"b");nKi=15e3,zYc=wr(()=>G.object({session_id:G.string(),ws_url:G.string(),work_dir:G.string().optional(),session_key:G.string().optional()})),uP=class extends Error{static{a(this,"F4")}code;constructor(e,r){super(e),this.name="DirectConnectError",this.code=r}},g8r=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new zIt;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 C1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new C1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await KYc(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=A8e(s);if(!(c instanceof C1)){let l=c instanceof uP&&c.code?c.code:"session_create_failed";this.emitTelemetry("bad",l)}this.failInit(c);return}if(this.closed){this.options.deleteSessionOnClose&&this.sessionId&&iKi(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 uP(`WebSocket connection timeout after ${nKi}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},nKi,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,cP(`[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(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(` `)===-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=LN(f)}catch(m){cP(`DirectConnect: dropped malformed JSON line (${f.length} bytes): ${m}`);continue}this.messages.enqueue(h)}}),n.addEventListener("error",()=>{clearTimeout(o);let s=new uP("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 uP(`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"?yZi("transport_direct_connect"):e==="bad"?EZi("transport_direct_connect",r??"unknown"):Vqc("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 C1("Operation aborted");if(this.readyState||await this.readyPromise,!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new uP("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&&iKi(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(YYc,"$e");a(KYc,"Qe");a(iKi,"GE");a(A8r,"nJ");a(JYc,"Xe");a(ZYc,"Ye");a(XYc,"We");a(eKc,"Ge");a(mwt,"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"})(oKi||(oKi={}));YWh=Array(20).fill(0).map((t,e)=>" ".repeat(e)),KWh={" ":{"\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=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)=>` `+" ".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}})(sKi||(sKi={}));(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"})(aKi||(aKi={}));(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"})(cKi||(cKi={}));(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"})(lKi||(lKi={}));a(Eno,"rW");WV=yUr.default.homedir(),EUr=yUr.default.tmpdir(),{env:q_e}=_xt.default,tKc=a(t=>{let e=Xd.default.join(WV,"Library");return{data:Xd.default.join(e,"Application Support",t),config:Xd.default.join(e,"Preferences",t),cache:Xd.default.join(e,"Caches",t),log:Xd.default.join(e,"Logs",t),temp:Xd.default.join(EUr,t)}},"Oe"),rKc=a(t=>{let e=q_e.APPDATA||Xd.default.join(WV,"AppData","Roaming"),r=q_e.LOCALAPPDATA||Xd.default.join(WV,"AppData","Local");return{data:Xd.default.join(r,t,"Data"),config:Xd.default.join(e,t,"Config"),cache:Xd.default.join(r,t,"Cache"),log:Xd.default.join(r,t,"Log"),temp:Xd.default.join(EUr,t)}},"De"),nKc=a(t=>{let e=Xd.default.basename(WV);return{data:Xd.default.join(q_e.XDG_DATA_HOME||Xd.default.join(WV,".local","share"),t),config:Xd.default.join(q_e.XDG_CONFIG_HOME||Xd.default.join(WV,".config"),t),cache:Xd.default.join(q_e.XDG_CACHE_HOME||Xd.default.join(WV,".cache"),t),log:Xd.default.join(q_e.XDG_STATE_HOME||Xd.default.join(WV,".local","state"),t),temp:Xd.default.join(EUr,e,t)}},"Fe");a(iKc,"Mz");JWh=iKc("claude-cli");a(oKc,"Ze");a(sKc,"wE");aKc=100,sFr=[];a(cKc,"Le");lKc=[],uKi=null,ZWh=Cy(()=>process.argv.includes("--hard-fail"));a(_no,"oW");O_e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,vno=new Set,y8r=typeof process=="object"&&process?process:{},Cno=a((t,e,r,n)=>{typeof y8r.emitWarning=="function"?y8r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),vxt=globalThis.AbortController,dKi=globalThis.AbortSignal;if(typeof vxt>"u"){dKi=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},vxt=class{static{a(this,"tW")}constructor(){e()}signal=new dKi;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=y8r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,Cno("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")}uKc=a(t=>!vno.has(t),"Ae"),HV=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),bno=a(t=>HV(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?$_e:null:null,"ME"),$_e=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},E8r=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=bno(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]}},_8r=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&&!HV(r))throw TypeError("max option must be a nonnegative integer");let x=r?bno(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=E8r.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&&!HV(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!HV(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=HV(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!HV(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError("At least one of max, maxSize, or ttl is required");!this.ttlAutopurge&&!this.#e&&!this.#t&&uKc("LRU_CACHE_UNBOUNDED")&&(vno.add("LRU_CACHE_UNBOUNDED"),Cno("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",t))}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#P(){let e=new $_e(this.#e),r=new $_e(this.#e);this.#E=e,this.#T=r,this.#B=(s,c,l=O_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?O_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=O_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");#B=a(()=>{},"#y");#_=a(()=>!1,"#N");#D(){let e=new $_e(this.#e);this.#a=0,this.#b=e,this.#k=r=>{this.#a-=e[r],e[r]=0},this.#L=(r,n,o,s)=>{if(this.#f(n))return 0;if(!HV(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!HV(o))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#k=a(e=>{},"#b");#N=a((e,r,n)=>{},"#v");#L=a((e,r,n,o)=>{if(n||o)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#f");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#_(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(O_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=O_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=O_e.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#L(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#v.length!==0?this.#v.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#C&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#C&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#k(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#E&&this.#P(),this.#E&&(d||this.#B(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(Error("evicted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#k(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#v.push(r)),this.#s===1?(this.#A=this.#h=0,this.#v.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#_(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#_(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new vxt,{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 vxt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let D=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",D&&(_.returnedStale=!0)),D?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),P=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",P&&R&&(_.returnedStale=!0)),P?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#_(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#k(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#v.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(Error("deleted"));else{let o=this.#u[r];this.#C&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#E&&this.#T&&(this.#E.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#v.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};a(dKc,"LE");fKc=8192;a(Sno,"AE");fKi=dKc(Sno,t=>t,50),gwt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>fKc?Sno(t,e):fKi(t,e);return r.ok?r.value:null},{cache:fKi.cache}),Awt=Cy(()=>{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=xI().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){Jl(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return _no(t),"unknown"}}),ezh=Cy(()=>{if(process.platform==="linux")try{let t=xI().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){Jl(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),tzh=Cy(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,_Ur.release)()};try{let e=await(0,Ino.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}),rzh=Cy(()=>{if(process.platform!=="darwin")return;let t=(0,_Ur.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),h8e=Cy(function(){switch(Awt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),nzh=Cy(function(){return(0,Tno.join)(h8e(),"managed-settings.d")}),pKc=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()),hKc=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()),mKc=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:pKc(),filesystem:hKc(),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,v8r.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,v8r.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()),gKc=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],AKc=["normal","vim"],yKc=["auto","tmux","in-process"],EKc=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],_Kc=["auto",...EKc],izh=Awt()==="macos"?"\u23FA":"\u25CF",vUr=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],vKc=[...vUr,"bubble"],CKc=vKc,ozh=wr(()=>$ro.enum(CKc)),szh=wr(()=>$ro.enum(vUr)),bKc=["bash","powershell"],TFe=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(SKc,"Se");TKc=wr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=SKc();return G.discriminatedUnion("type",[t,e,r,n,o])}),IKc=wr(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(TKc()).describe("List of hooks to execute when the matcher matches")})),Cxt=wr(()=>G.partialRecord(G.enum(Fxt),G.array(IKc()))),azh=wr(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),czh=wr(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),wve=wr(()=>G.literal("comms").optional().catch(void 0)),iW=wr(()=>G.number().int().positive()),xKc=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:iW().optional(),alwaysLoad:G.boolean().optional(),role:wve()})),wKc=wr(()=>G.boolean()),xno=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:wKc().optional()})),RKc=wr(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:xno().optional(),timeout:iW().optional(),alwaysLoad:G.boolean().optional(),role:wve()})),PKc=wr(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional(),timeout:iW().optional(),alwaysLoad:G.boolean().optional(),role:wve()})),kKc=wr(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional(),timeout:iW().optional(),alwaysLoad:G.boolean().optional(),role:wve()})),DKc=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:xno().optional(),timeout:iW().optional(),alwaysLoad:G.boolean().optional(),role:wve()})),NKc=wr(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),timeout:iW().optional(),alwaysLoad:G.boolean().optional(),role:wve()})),MKc=wr(()=>G.object({type:G.literal("sdk"),name:G.string(),timeout:iW().optional(),alwaysLoad:G.boolean().optional()})),OKc=wr(()=>G.enum(["allow","ask","blocked"])),BKc=wr(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string(),timeout:iW().optional(),alwaysLoad:G.boolean().optional(),toolPermissions:G.record(G.string(),OKc()).optional()})),C8r=wr(()=>G.union([xKc(),RKc(),PKc(),kKc(),DKc(),NKc(),MKc(),BKc()])),lzh=wr(()=>G.object({mcpServers:G.record(G.string(),C8r())})),wno=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"]),LKc=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,FKc=/[^\u0020-\u007E]/;a(UKc,"pe");ON=wr(()=>G.string().startsWith("./")),qie=wr(()=>ON().endsWith(".json")),pKi=wr(()=>G.union([ON().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")])),b8r=wr(()=>ON().endsWith(".md")),S8r=wr(()=>G.union([b8r(),ON()])),Rno=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=>!UKc(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/'})),CUr=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")})),QKc=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:CUr().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(uJc()).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.`)})),uzh=wr(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>Cxt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),qKc=wr(()=>G.object({hooks:G.union([qie().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(()=>Cxt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([qie().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(()=>Cxt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),jKc=wr(()=>G.object({source:S8r().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'})),HKc=wr(()=>G.object({commands:G.union([S8r().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(S8r().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(),jKc()).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")')])})),GKc=wr(()=>G.object({agents:G.union([b8r().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(b8r().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.")])})),$Kc=wr(()=>G.object({skills:G.union([ON().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),G.array(ON().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.")])})),Pno=wr(()=>G.object({outputStyles:G.union([ON().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(ON().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.")])})),kno=wr(()=>G.object({themes:G.union([ON().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(ON().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.")])})),VKc=wr(()=>G.object({})),hKi=wr(()=>G.string().min(1)),WKc=wr(()=>G.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),zKc=wr(()=>G.object({mcpServers:G.union([qie().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),pKi().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),C8r()).describe("MCP server configurations keyed by server name"),G.array(G.union([qie().describe("Path to MCP servers configuration file"),pKi().describe("Path or URL to MCPB file"),G.record(G.string(),C8r()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),Dno=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()),YKc=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"),Dno()).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.")})),KKc=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(),Dno()).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.")})),mKi=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(hKi()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(WKc(),hKi()).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")})),JKc=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).')})),ZKc=wr(()=>G.array(JKc()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),Nno=wr(()=>G.object({monitors:G.union([qie().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),ZKc()]).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.")})),XKc=wr(()=>G.object({lspServers:G.union([qie().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),mKi()).describe("LSP server configurations keyed by server name"),G.array(G.union([qie().describe("Path to LSP configuration file"),G.record(G.string(),mKi()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),Mno=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")),eJc=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.")})),tJc=wr(()=>G.object({experimental:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,G.object({...kno().partial().shape,...Nno().partial().shape,...Pno().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."))})),rJc=wr(()=>G.object({...QKc().shape,...qKc().partial().shape,...HKc().partial().shape,...GKc().partial().shape,...$Kc().partial().shape,...Pno().partial().shape,...kno().partial().shape,...VKc().shape,...KKc().partial().shape,...zKc().partial().shape,...XKc().partial().shape,...Nno().partial().shape,...eJc().partial().shape,...YKc().partial().shape,...tJc().partial().shape})),bxt=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:Mno().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:Rno().refine(t=>!wno.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(nJc()).describe("Plugin entries declared inline in settings.json"),owner:CUr().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).")])),aFr=wr(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),Ono=wr(()=>G.union([ON().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:Mno().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:aFr().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:aFr().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:aFr().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.')])),nJc=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:Ono().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)."})),iJc=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.`)})),oJc=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:iJc().optional().describe("Matchers that determine when the plugin is relevant.")})),sJc=wr(()=>rJc().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:Ono().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,oJc().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.`)})),aJc=wr(()=>G.object({name:G.string().min(1).refine(t=>!t.includes(" "))}));a(cJc,"z$$");dzh=wr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Rno(),version:G.string().optional().describe("Marketplace manifest version"),description:G.string().optional().describe("Human-readable description of this marketplace"),owner:CUr().describe("Marketplace maintainer or curator information"),plugins:G.array(G.unknown()).transform(cJc).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.")})),Bno=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")),lJc=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,uJc=wr(()=>G.union([G.string().regex(lJc,"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)])),dJc=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).")})),fJc=wr(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(Bno(),dJc()).describe("Map of plugin IDs to their installation metadata")})),pJc=wr(()=>G.enum(["managed","user","project","local"])),hJc=wr(()=>G.object({scope:pJc().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.")})),mJc=wr(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(Bno(),G.array(hJc())).describe("Map of plugin IDs to arrays of installation entries")})),fzh=wr(()=>G.union([fJc(),mJc()])),gJc=wr(()=>G.object({source:bxt().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")})),pzh=wr(()=>G.record(G.string(),gJc())),AJc=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],yJc="https://json.schemastore.org/claude-code-settings.json",EJc=["autoMode","deepLink","voice","assistant","briefView"],oIt={},ywt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>oIt,"shape"),permissionsShape:a(()=>oIt,"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(()=>oIt,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>oIt,"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(Lno,"Ez");a(_Jc,"tE");a(vJc,"aE");a(CJc,"sE");a(bJc,"eE");gKi={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(B_e,"E9");Fno="workspace",hzh=`mcp__${Fno}__bash`,mzh=`mcp__${Fno}__web_fetch`;a(SJc,"A$$");a(TJc,"Jb");a(IJc,"I$$");a(xJc,"R$$");Sxt={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(wJc,"Xb");a(RJc,"Yb");a(PJc,"Wb");a(Uno,"Gb");a(cFr,"bz");a(kJc,"P$$");a(Qno,"_z");lFr=wr(()=>G.string().superRefine((t,e)=>{let r=Qno(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}})}})),DJc=wr(()=>G.record(G.string(),G.coerce.string()));a(qno,"Hb");gzh=wr(()=>qno(Lno())),NJc=wr(()=>G.object({source:bxt().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")})),jno=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=>jZi([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"'})),Hno=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=>jZi([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"'})),MJc=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()})),AKi=["skills","agents","hooks","mcp"];a(OJc,"Kb");Rve=wr(()=>OJc(Lno())),R9="https://code.claude.com/docs/en",BJc=[{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:`${R9}/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:`${R9}/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:`${R9}/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:`${R9}/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:`${R9}/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:`${R9}/iam#working-directories`}}],LJc={permissions:`${R9}/iam#configuring-permissions`,env:`${R9}/settings#environment-variables`,hooks:`${R9}/hooks`};a(FJc,"qb");Azh=wr(()=>Rve().strict());a(yKi,"Vb");a(EKi,"Bb");a(UJc,"v$$");a(_Ki,"zb");a(V_e,"b9");a(vKi,"Nb");a(N8e,"d0");a(QJc,"C$$");qJc=new Set(Fxt);a(jJc,"x$$");HJc=[{key:"allowedMcpServers",schema:jno},{key:"deniedMcpServers",schema:Hno}];a(GJc,"f$$");a(Pve,"i1");CKi="com.anthropic.claudecode",T8r="HKLM\\SOFTWARE\\Policies\\ClaudeCode",I8r="HKCU\\SOFTWARE\\Policies\\ClaudeCode",j_e="Settings",$Jc="/usr/bin/plutil",VJc=["-convert","json","-o","-","--"],WJc=5e3,bKi="/mnt/c/Windows/System32/reg.exe",Txt="/mnt/c/Program Files/ClaudeCode";a($no,"XG");a(zJc,"Zb");YJc=null;a(IFe,"$5");a(KJc,"Mb");a(JJc,"Lb");$V=Object.freeze({settings:{},errors:[]}),zno=null,Yno=null,Kno=!1,Ixt=null;a(ZJc,"l$$");a(XJc,"bb");a(eZc,"_b");a(tZc,"kb");a(rZc,"Sb");a(uFr,"Cz");a(SKi,"jb");a(nZc,"c$$");a(iZc,"p$$");a(TKi,"Ab");a(oZc,"d$$");a(IKi,"Ib");a(sZc,"i$$");x8r=sZc;a(aZc,"n$$");cZc=aZc,lZc=cZc(),uZc=lZc;a(dZc,"o$$");fZc=dZc,pZc="[object Object]",hZc=Function.prototype,mZc=Object.prototype,Jno=hZc.toString,gZc=mZc.hasOwnProperty,AZc=Jno.call(Object);a(yZc,"Q6$");EZc=yZc;a(_Zc,"J6$");w8r=_Zc;a(vZc,"X6$");CZc=vZc;a(bZc,"Y6$");SZc=bZc;a(Zno,"hb");TZc=Zno;a(IZc,"W6$");xZc=IZc,xKi=Math.max;a(wZc,"G6$");Xno=wZc;a(RZc,"U6$");PZc=RZc,kZc=GIt?function(t,e){return GIt(t,"toString",{configurable:!0,enumerable:!1,value:PZc(e),writable:!0})}:sZi,DZc=kZc,NZc=800,MZc=16,OZc=Date.now;a(BZc,"B6$");LZc=BZc,FZc=LZc(DZc),eio=FZc;a(UZc,"N6$");QZc=UZc;a(qZc,"w6$");jZc=qZc;a(HZc,"O6$");GZc=HZc,$Zc=GZc(function(t,e,r,n){TZc(t,e,r,n)}),zV=$Zc;a(VZc,"F6$");WZc=VZc;a(zZc,"Z6$");YZc=zZc;a(KZc,"M6$");JZc=KZc,wKi=JV?JV.isConcatSpreadable:void 0;a(ZZc,"L6$");XZc=ZZc;a(tio,"$_");eXc=tio;a(tXc,"j6$");rXc=tXc;a(nXc,"A6$");iXc=nXc,oXc=iXc(function(t,e){return t==null?{}:JZc(t,e)}),dFr=oXc,sXc="remote-settings.json",fFr=null;a(cXc,"b6$");a(lXc,"_6$");a(uXc,"W_");a(bUr,"fz");a(dXc,"S6$");a(nio,"U_");a(pFr,"xz");a(fXc,"v6$");a(xxt,"HG");a(iio,"H_");a(oio,"K_");a(sio,"q_");a(aio,"V_");a(pXc,"C6$");a(RKi,"G_");a(hXc,"T6$");a(wxt,"Y5");a(mXc,"x6$");a(cio,"B_");a(gXc,"y6$");a(AXc,"f6$");a(yXc,"z_");a(EXc,"g6$");a(lio,"N_");a(_Xc,"h6$");a(vXc,"u6$");a(YV,"o1");hFr=!1;a(CXc,"m6$");a(bXc,"l6$");a(SXc,"c6$");a(TXc,"w_");a(IXc,"O_");xXc={user:"userSettings",project:"projectSettings",local:"localSettings"},PKi={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},wXc=["user","project","local"],RXc=new Set(["bypassPermissions","auto","acceptEdits"]),PXc=new Set(["project"]);a(kXc,"o6$");a(DXc,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(NXc,"LA$");a(MXc,"G4$");a(OXc,"U4$");a(BXc,"H4$");a(uio,"b_");a(R8r,"uz");a(P8r,"mz");LXc=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(Rxt,"KG");a(FXc,"q4$");a(UXc,"jA$");a(QXc,"AA$");a(qXc,"IA$");a(jXc,"RA$");a(HXc,"PA$");a(GXc,"EA$");a($Xc,"bA$");a(VXc,"_A$");a(WXc,"kA$");a(zXc,"SA$");a(kKi,"M_");a(YXc,"V4$");a(KXc,"vA$");a(JXc,"CA$");a(dio,"__");a(yP,"J4");a(fio,"k_");a(DKi,"L_");a(k8r,"lz");a(ZXc,"B4$");a(NKi,"j_");a(pio,"S_");a(XXc,"z4$");a(hio,"v_");a(eel,"N4$");a(tel,"w4$");a(rel,"O4$");a(nel,"D4$");a(iel,"F4$");a(oel,"Z4$");a(sel,"M4$");a(MKi,"A_")});var koo=I((KUr,Poo)=>{p();KUr.createWatcher=P6e()("vscode-policy-watcher");if(require.main===Poo){let t=process.platform;KUr.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var pso=I(i7r=>{p();var fso="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");i7r.encode=function(t){if(0<=t&&t{p();var hso=pso(),o7r=5,mso=1<>1;return e?-r:r}a($tl,"fromVLQSigned");s7r.encode=a(function(e){var r="",n,o=Gtl(e);do n=o&gso,o>>>=o7r,o>0&&(n|=Aso),r+=hso.encode(n);while(o>0);return r},"base64VLQ_encode");s7r.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=hso.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&Aso),u&=gso,s=s+(u<{p();function Vtl(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(Vtl,"getArg");n_.getArg=Vtl;var yso=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Wtl=/^data:.+\,.+$/;function l6e(t){var e=t.match(yso);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(l6e,"urlParse");n_.urlParse=l6e;function Vve(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(Vve,"urlGenerate");n_.urlGenerate=Vve;function c7r(t){var e=t,r=l6e(t);if(r){if(!r.path)return t;e=r.path}for(var n=n_.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,Vve(r)):e}a(c7r,"normalize");n_.normalize=c7r;function Eso(t,e){t===""&&(t="."),e===""&&(e=".");var r=l6e(e),n=l6e(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Vve(r);if(r||e.match(Wtl))return e;if(n&&!n.host&&!n.path)return n.host=e,Vve(n);var o=e.charAt(0)==="/"?e:c7r(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,Vve(n)):o}a(Eso,"join");n_.join=Eso;n_.isAbsolute=function(t){return t.charAt(0)==="/"||yso.test(t)};function ztl(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(ztl,"relative");n_.relative=ztl;var _so=(function(){var t=Object.create(null);return!("__proto__"in t)})();function vso(t){return t}a(vso,"identity");function Ytl(t){return Cso(t)?"$"+t:t}a(Ytl,"toSetString");n_.toSetString=_so?vso:Ytl;function Ktl(t){return Cso(t)?t.slice(1):t}a(Ktl,"fromSetString");n_.fromSetString=_so?vso:Ktl;function Cso(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(Cso,"isProtoString");function Jtl(t,e,r){var n=Wve(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:Wve(t.name,e.name)}a(Jtl,"compareByOriginalPositions");n_.compareByOriginalPositions=Jtl;function Ztl(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=Wve(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:Wve(t.name,e.name)}a(Ztl,"compareByGeneratedPositionsDeflated");n_.compareByGeneratedPositionsDeflated=Ztl;function Wve(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(Wve,"strcmp");function Xtl(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=Wve(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:Wve(t.name,e.name)}a(Xtl,"compareByGeneratedPositionsInflated");n_.compareByGeneratedPositionsInflated=Xtl;function erl(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(erl,"parseSourceMapInput");n_.parseSourceMapInput=erl;function trl(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=l6e(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=Eso(Vve(n),e)}return c7r(e)}a(trl,"computeSourceURL");n_.computeSourceURL=trl});var d7r=I(bso=>{p();var l7r=zve(),u7r=Object.prototype.hasOwnProperty,Kie=typeof Map<"u";function Q9(){this._array=[],this._set=Kie?new Map:Object.create(null)}a(Q9,"ArraySet");Q9.fromArray=a(function(e,r){for(var n=new Q9,o=0,s=e.length;o=0)return r}else{var n=l7r.toSetString(e);if(u7r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");Q9.prototype.at=a(function(e){if(e>=0&&e{p();var Sso=zve();function rrl(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Sso.compareByGeneratedPositionsInflated(t,e)<=0}a(rrl,"generatedPositionAfter");function HRt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(HRt,"MappingList");HRt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");HRt.prototype.add=a(function(e){rrl(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");HRt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Sso.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");Tso.MappingList=HRt});var f7r=I(xso=>{p();var u6e=a7r(),Mm=zve(),GRt=d7r().ArraySet,nrl=Iso().MappingList;function CP(t){t||(t={}),this._file=Mm.getArg(t,"file",null),this._sourceRoot=Mm.getArg(t,"sourceRoot",null),this._skipValidation=Mm.getArg(t,"skipValidation",!1),this._sources=new GRt,this._names=new GRt,this._mappings=new nrl,this._sourcesContents=null}a(CP,"SourceMapGenerator");CP.prototype._version=3;CP.fromSourceMap=a(function(e){var r=e.sourceRoot,n=new CP({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=Mm.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=Mm.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");CP.prototype.addMapping=a(function(e){var r=Mm.getArg(e,"generated"),n=Mm.getArg(e,"original",null),o=Mm.getArg(e,"source",null),s=Mm.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");CP.prototype.setSourceContent=a(function(e,r){var n=e;this._sourceRoot!=null&&(n=Mm.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Mm.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Mm.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");CP.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=Mm.relative(s,o));var c=new GRt,l=new GRt;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=Mm.join(n,u.source)),s!=null&&(u.source=Mm.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=Mm.join(n,u)),s!=null&&(u=Mm.relative(s,u)),this.setSourceContent(u,d))},this)},"SourceMapGenerator_applySourceMap");CP.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");CP.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(!Mm.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=u6e.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=u6e.encode(h-c),c=h,u+=u6e.encode(d.originalLine-1-o),o=d.originalLine-1,u+=u6e.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=u6e.encode(f-s),s=f)),l+=u}return l},"SourceMapGenerator_serializeMappings");CP.prototype._generateSourcesContent=a(function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Mm.relative(r,n));var o=Mm.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)},"SourceMapGenerator_generateSourcesContent");CP.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");CP.prototype.toString=a(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");xso.SourceMapGenerator=CP});var wso=I(Jie=>{p();Jie.GREATEST_LOWER_BOUND=1;Jie.LEAST_UPPER_BOUND=2;function p7r(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?p7r(c,e,r,n,o,s):s==Jie.LEAST_UPPER_BOUND?e1?p7r(t,c,r,n,o,s):s==Jie.LEAST_UPPER_BOUND?c:t<0?-1:t}a(p7r,"recursiveSearch");Jie.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=p7r(-1,r.length,e,r,n,o||Jie.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 Pso=I(Rso=>{p();function h7r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a(h7r,"swap");function irl(t,e){return Math.round(t+Math.random()*(e-t))}a(irl,"randomIntInRange");function m7r(t,e,r,n){if(r{p();var qn=zve(),g7r=wso(),Yve=d7r().ArraySet,orl=a7r(),d6e=Pso().quickSort;function Sd(t,e){var r=t;return typeof t=="string"&&(r=qn.parseSourceMapInput(t)),r.sections!=null?new GN(r,e):new Ty(r,e)}a(Sd,"SourceMapConsumer");Sd.fromSourceMap=function(t,e){return Ty.fromSourceMap(t,e)};Sd.prototype._version=3;Sd.prototype.__generatedMappings=null;Object.defineProperty(Sd.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Sd.prototype.__originalMappings=null;Object.defineProperty(Sd.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Sd.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Sd.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Sd.GENERATED_ORDER=1;Sd.ORIGINAL_ORDER=2;Sd.GREATEST_LOWER_BOUND=1;Sd.LEAST_UPPER_BOUND=2;Sd.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||Sd.GENERATED_ORDER,c;switch(s){case Sd.GENERATED_ORDER:c=this._generatedMappings;break;case Sd.ORIGINAL_ORDER:c=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;c.map(function(u){var d=u.source===null?null:this._sources.at(u.source);return d=qn.computeSourceURL(l,d,this._sourceMapURL),{source:d,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(e,o)},"SourceMapConsumer_eachMapping");Sd.prototype.allGeneratedPositionsFor=a(function(e){var r=qn.getArg(e,"line"),n={source:qn.getArg(e,"source"),originalLine:r,originalColumn:qn.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",qn.compareByOriginalPositions,g7r.LEAST_UPPER_BOUND);if(s>=0){var c=this._originalMappings[s];if(e.column===void 0)for(var l=c.originalLine;c&&c.originalLine===l;)o.push({line:qn.getArg(c,"generatedLine",null),column:qn.getArg(c,"generatedColumn",null),lastColumn:qn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:qn.getArg(c,"generatedLine",null),column:qn.getArg(c,"generatedColumn",null),lastColumn:qn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");$Rt.SourceMapConsumer=Sd;function Ty(t,e){var r=t;typeof t=="string"&&(r=qn.parseSourceMapInput(t));var n=qn.getArg(r,"version"),o=qn.getArg(r,"sources"),s=qn.getArg(r,"names",[]),c=qn.getArg(r,"sourceRoot",null),l=qn.getArg(r,"sourcesContent",null),u=qn.getArg(r,"mappings"),d=qn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=qn.normalize(c)),o=o.map(String).map(qn.normalize).map(function(f){return c&&qn.isAbsolute(c)&&qn.isAbsolute(f)?qn.relative(c,f):f}),this._names=Yve.fromArray(s.map(String),!0),this._sources=Yve.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return qn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(Ty,"BasicSourceMapConsumer");Ty.prototype=Object.create(Sd.prototype);Ty.prototype.consumer=Sd;Ty.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=qn.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r1&&(y.source=l+_[1],l+=_[1],y.originalLine=s+_[2],s=y.originalLine,y.originalLine+=1,y.originalColumn=c+_[3],c=y.originalColumn,_.length>4&&(y.name=u+_[4],u+=_[4])),A.push(y),typeof y.originalLine=="number"&&g.push(y)}d6e(A,qn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,d6e(g,qn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");Ty.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 g7r.search(e,r,s,c)},"SourceMapConsumer_findMapping");Ty.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=qn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=qn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=qn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:qn.getArg(o,"originalLine",null),column:qn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");Ty.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");Ty.prototype.sourceContentFor=a(function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=qn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=qn.urlParse(this.sourceRoot))){var c=o.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(c))return this.sourcesContent[this._sources.indexOf(c)];if((!s.path||s.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(r)return null;throw new Error('"'+o+'" is not in the SourceMap.')},"SourceMapConsumer_sourceContentFor");Ty.prototype.generatedPositionFor=a(function(e){var r=qn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:qn.getArg(e,"line"),originalColumn:qn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",qn.compareByOriginalPositions,qn.getArg(e,"bias",Sd.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:qn.getArg(s,"generatedLine",null),column:qn.getArg(s,"generatedColumn",null),lastColumn:qn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");$Rt.BasicSourceMapConsumer=Ty;function GN(t,e){var r=t;typeof t=="string"&&(r=qn.parseSourceMapInput(t));var n=qn.getArg(r,"version"),o=qn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Yve,this._names=new Yve;var s={line:-1,column:0};this._sections=o.map(function(c){if(c.url)throw new Error("Support for url field in sections not implemented.");var l=qn.getArg(c,"offset"),u=qn.getArg(l,"line"),d=qn.getArg(l,"column");if(u{p();var srl=f7r().SourceMapGenerator,VRt=zve(),arl=/(\r?\n)/,crl=10,Kve="$$$isSourceNode$$$";function DI(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[Kve]=!0,n!=null&&this.add(n)}a(DI,"SourceNode");DI.fromStringWithSourceMap=a(function(e,r,n){var o=new DI,s=e.split(arl),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[Kve]||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");DI.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();WRt.SourceMapGenerator=f7r().SourceMapGenerator;WRt.SourceMapConsumer=Dso().SourceMapConsumer;WRt.SourceNode=Mso().SourceNode});var Lso=I((vfm,Bso)=>{p();var lrl=Object.prototype.toString,A7r=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function url(t){return lrl.call(t).slice(8,-1)==="ArrayBuffer"}a(url,"isArrayBuffer");function drl(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 A7r?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(drl,"fromArrayBuffer");function frl(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return A7r?Buffer.from(t,e):new Buffer(t,e)}a(frl,"fromString");function prl(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return url(t)?drl(t,e,r):typeof t=="string"?frl(t,e):A7r?Buffer.from(t):new Buffer(t)}a(prl,"bufferFrom");Bso.exports=prl});var $so=I((Xie,v7r)=>{p();var hrl=Oso().SourceMapConsumer,y7r=require("path"),UB;try{UB=require("fs"),(!UB.existsSync||!UB.readFileSync)&&(UB=null)}catch{}var mrl=Lso();function Fso(t,e){return t.require(e)}a(Fso,"dynamicRequire");var Uso=!1,Qso=!1,E7r=!1,f6e="auto",Zie={},p6e={},grl=/^data:application\/json[^,]+base64,/,dW=[],fW=[];function C7r(){return f6e==="browser"?!0:f6e==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(C7r,"isInBrowser");function Arl(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a(Arl,"hasGlobalProcessEventEmitter");function yrl(){return typeof process=="object"&&process!==null?process.version:""}a(yrl,"globalProcessVersion");function Erl(){if(typeof process=="object"&&process!==null)return process.stderr}a(Erl,"globalProcessStderr");function _rl(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(_rl,"globalProcessExit");function zRt(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(Crl,"CallSiteToString");function qso(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=Crl,e}a(qso,"cloneCallSite");function Hso(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(yrl())?0:62;n===1&&o>c&&!C7r()&&!t.isEval()&&(o-=c);var l=T7r({source:r,line:n,column:o});e.curPosition=l,t=qso(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=jso(d),t=qso(t),t.getEvalOrigin=function(){return d}),t}a(Hso,"wrapCallSite");function brl(t,e){E7r&&(Zie={},p6e={});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 `+Hso(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(brl,"prepareStackTrace");function Gso(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=Zie[r];if(!s&&UB&&UB.existsSync(r))try{s=UB.readFileSync(r,"utf8")}catch{s=""}if(s){var c=s.split(/(?:\r\n|\r|\n)/)[n-1];if(c)return r+":"+n+` +`+" ".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+` `+c+` -`+new Array(o).join(" ")+"^"}}return null}a(Gso,"getErrorSource");function Srl(t){var e=Gso(t),r=Erl();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),_rl(1)}a(Srl,"printErrorAndExit");function Trl(){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 Srl(arguments[1])}return t.apply(this,arguments)}}a(Trl,"shimEmitUncaughtException");var Irl=dW.slice(0),xrl=fW.slice(0);Xie.wrapCallSite=Hso;Xie.getErrorSource=Gso;Xie.mapSourcePosition=T7r;Xie.retrieveSourceMap=S7r;Xie.install=function(t){if(t=t||{},t.environment&&(f6e=t.environment,["node","browser","auto"].indexOf(f6e)===-1))throw new Error("environment "+f6e+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(dW.length=0),dW.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(fW.length=0),fW.unshift(t.retrieveSourceMap)),t.hookRequire&&!C7r()){var e=Fso(v7r,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return Zie[c]=s,p6e[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(E7r||(E7r="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),Uso||(Uso=!0,Error.prepareStackTrace=brl),!Qso){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=Fso(v7r,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Arl()&&(Qso=!0,Trl())}};Xie.resetRetrieveHandlers=function(){dW.length=0,fW.length=0,dW=Irl.slice(0),fW=xrl.slice(0),S7r=zRt(fW),b7r=zRt(dW)}});var Vso=I(()=>{p();$so().install()});var Prl={};Ri(Prl,{getTokenizer:()=>Ts,getTokenizerAsync:()=>X7,main:()=>zso});module.exports=_a(Prl);p();p();p();var P7r="auth.db",eao=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],tao=` +`+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=` CREATE TABLE IF NOT EXISTS oauth_tokens ( token_id INTEGER PRIMARY KEY AUTOINCREMENT, auth_authority TEXT NOT NULL, @@ -1633,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) ) -`,rao=` +`,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 ) -`,nao=` +`,cco=` CREATE TABLE IF NOT EXISTS editor_signout ( editor_id TEXT PRIMARY KEY, signed_out_at INTEGER NOT NULL ) -`,iao=` +`,lco=` CREATE TABLE IF NOT EXISTS metadata ( key TEXT PRIMARY KEY, value TEXT NOT NULL ) -`,oao=[tao,rao,nao,iao];function JRt(t){for(let e of eao)t.exec(e);return sao(t),t}a(JRt,"applyPragmas");function sao(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(sao,"ensureWalMode");function ZRt(t){for(let e of oao)t.exec(e);return t}a(ZRt,"applySchema");function q9(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(q9,"runInWriteTx");p();p();p();var XRt="github.copilot",k7r="github-enterprise";p();var Ns=a((t,e)=>({editorId:t,displayName:e}),"id"),aao=Ns("unknown","Unknown"),D7r=Ns("eclipse","Eclipse"),N7r=Ns("xcode","Xcode"),j9=Ns("vim","Vim/Neovim"),M7r=Ns("helix","Helix"),cao={"copilot-eclipse":D7r,Copilot4Eclipse:D7r,"copilot-xcode":N7r,"Copilot for Xcode":N7r,"copilot-vs":Ns("visual-studio","Visual Studio"),"copilot.vim":j9,"copilot.lua":j9,"Github Copilot LSP for Neovim":j9,"coc-github-copilot":j9,"nvim-lspconfig":j9,"copilot-lsp-client-neovim":j9,"neovim-copilot-lsp":j9,"sidekick.nvim":j9,"helix-copilot":M7r,"copilot-helix":M7r,"copilot-sublime":Ns("sublime-text","Sublime Text"),"zed-copilot":Ns("zed","Zed"),RStudio:Ns("rstudio","RStudio"),"obsidian-copilot":Ns("obsidian","Obsidian"),marimo:Ns("marimo","marimo"),"Qt Creator Copilot plugin":Ns("qt-creator","Qt Creator"),"godot-copilot":Ns("godot","Godot"),"kakoune-lsp":Ns("kakoune","Kakoune"),"typora-copilot":Ns("typora","Typora"),"Copilot for Nova":Ns("nova","Nova")},lao={IU:Ns("intellij","IntelliJ IDEA"),IC:Ns("intellij","IntelliJ IDEA"),IE:Ns("intellij","IntelliJ IDEA"),PY:Ns("pycharm","PyCharm"),PC:Ns("pycharm","PyCharm"),PE:Ns("pycharm","PyCharm"),WS:Ns("webstorm","WebStorm"),PS:Ns("phpstorm","PhpStorm"),RD:Ns("rider","Rider"),RM:Ns("rubymine","RubyMine"),CL:Ns("clion","CLion"),GO:Ns("goland","GoLand"),RR:Ns("rustrover","RustRover"),DB:Ns("datagrip","DataGrip"),DS:Ns("dataspell","DataSpell"),AI:Ns("android-studio","Android Studio"),QA:Ns("aqua","Aqua"),MPS:Ns("mps","MPS"),JBC:Ns("jetbrains-client","JetBrains Client"),GW:Ns("jetbrains-gateway","JetBrains Gateway")},O7r="JetBrains-",uao=Ns("jetbrains","JetBrains IDE");function B7r(t){let e=t.plugin.name?.trim();if(!e)return aao;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(O7r)){let n=lao[r.slice(O7r.length)];if(n)return n}return uao}return cao[e]??Ns(e,e)}a(B7r,"resolveEditorIdentity");p();p();p();p();var h6e=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 ePt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(ePt,"findKnownOrg");function L7r(t){let e=t.organization_list??[];return ePt(e)??""}a(L7r,"getUserKind");p();var Ff=class{static{a(this,"LogTarget")}},QB=class{static{a(this,"TelemetryLogSender")}},pe=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(Ff).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(QB).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 pe("default");p();p();p();p();async function Vlo(){let{getDeviceId:t}=await Promise.resolve().then(()=>de(mjr()));return t()}a(Vlo,"loadDeviceId");var MI=class{constructor(e=Vlo){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 TP=class{static{a(this,"InlineCompletionsUnification")}},Wlo={codeUnification:!1,modelUnification:!1,expAssignments:[]},ooe=class extends TP{constructor(){super(...arguments);this.inlineCompletionsUnificationState=Wlo;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};var Jv=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return N6e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(TP).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 l_="X-Copilot-RelatedPluginVersion-",soe=($=>($.Market="X-MSEdge-Market",$.CorpNet="X-FD-Corpnet",$.Build="X-VSCode-Build",$.ApplicationVersion="X-VSCode-AppVersion",$.TargetPopulation="X-VSCode-TargetPopulation",$.ClientId="X-MSEdge-ClientId",$.DevDeviceId="X-VSCode-DevDeviceId",$.ExtensionName="X-VSCode-ExtensionName",$.ExtensionVersion="X-VSCode-ExtensionVersion",$.ExtensionRelease="X-VSCode-ExtensionRelease",$.CompletionsInChatExtensionVersion="X-VSCode-CompletionsInChatExtensionVersion",$.Language="X-VSCode-Language",$.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",$.CopilotEngine="X-Copilot-Engine",$.CopilotOverrideEngine="X-Copilot-OverrideEngine",$.CopilotRepository="X-Copilot-Repository",$.CopilotFileType="X-Copilot-FileType",$.CopilotUserKind="X-Copilot-UserKind",$.CopilotDogfood="X-Copilot-Dogfood",$.CopilotOrgs="X-Copilot-Orgs",$.CopilotTrackingId="X-Copilot-CopilotTrackingId",$.CopilotClientVersion="X-Copilot-ClientVersion",$.CopilotSku="X-GitHub-Copilot-SKU",$.CopilotRelatedPluginVersionCppTools=l_+"msvscodecpptools",$.CopilotRelatedPluginVersionCMakeTools=l_+"msvscodecmaketools",$.CopilotRelatedPluginVersionMakefileTools=l_+"msvscodemakefiletools",$.CopilotRelatedPluginVersionCSharpDevKit=l_+"msdotnettoolscsdevkit",$.CopilotRelatedPluginVersionPython=l_+"mspythonpython",$.CopilotRelatedPluginVersionPylance=l_+"mspythonvscodepylance",$.CopilotRelatedPluginVersionJavaPack=l_+"vscjavavscodejavapack",$.CopilotRelatedPluginVersionJavaManager=l_+"vscjavavscodejavadependency",$.CopilotRelatedPluginVersionTypescript=l_+"vscodetypescriptlanguagefeatures",$.CopilotRelatedPluginVersionTypescriptNext=l_+"msvscodevscodetypescriptnext",$.CopilotRelatedPluginVersionCSharp=l_+"msdotnettoolscsharp",$.CopilotRelatedPluginVersionGithubCopilotChat=l_+"githubcopilotchat",$.CopilotRelatedPluginVersionGithubCopilot=l_+"githubcopilot",$))(soe||{});var zlo={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},VB=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=zlo[r];o!==void 0&&(e.properties[o]=n)}}stringify(){let e=Object.keys(this.filters);return e.sort(),e.map(r=>`${r}:${this.filters[r]}`).join(";")}toHeaders(){return{...this.filters}}withChange(e,r){return new t({...this.filters,[e]:r})}};p();p();p();function Es(t,e){let r=U0(t,e,"event.CopilotToken");return t.get(Ut).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(Es,"onCopilotToken");function TPt(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(TPt,"propertiesFromCopilotToken");var Pp=class{constructor(e){this.#e={};this.optedIn=!1;Es(e,r=>this.updateFromToken(r))}static{a(this,"TelemetryUserConfig")}#e;getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=TPt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1")}};var y9e=de(J9()),E9e=de(require("os"));var Ylo=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function Klo(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(Ylo),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(Klo,"buildExceptionDetail");function wPt(t,e){let r=t.get(Ir),n=r.getEditorInfo(),o=t.get(Pp),s={"#editor":n.devName??n.name,"#editor_version":x1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":x1(r.getEditorPluginInfo()),"#session_id":t.get(La).sessionId,"#machine_id":t.get(La).machineId,"#architecture":E9e.arch(),"#os_platform":E9e.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(wPt,"buildContext");function bHr(t,e,r){let n=t.get(as),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:wPt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=Klo(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,y9e.SHA256)(y9e.enc.Utf16.parse(f.join(` -`))).toString()),c}a(bHr,"buildPayload");p();var _9e=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 THr=de(J9());var En=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)}},IP=class extends En{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"}},v9e=class extends En{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 IHr=7*86400*1e3,VN=class{constructor(e=5){this.perWeek=e;this.cache=new En(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-IHr);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(xHr(t.replace(/\\/g,"/")),"gi"):new RegExp(xHr(t),"gi"));function Zlo(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(Xlo,"removePropertiesWithPossibleUserInfo");function euo(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(euo,"redactPaths");function RHr(t,e=Jlo){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=Xlo(s);if(c!==s){r[n]=c;continue}s=Zlo(s,e);for(let l of e)s=s.replace(l,"");s=euo(s),r[n]=s}return r}a(RHr,"sanitizeTelemetryProperties");function Z9(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(Z9,"filterTelemetryProperties");p();var OI=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:kHr(r,n),verboseLogging:ruo(r,n),testMode:e,simulation:tuo(n)})}};function w1(t){return t.get(OI).flags.testMode}a(w1,"isRunningInTest");function fCe(t){return w1(t)}a(fCe,"shouldFailForDebugPurposes");function pCe(t){return t.get(OI).flags.debug}a(pCe,"isDebugEnabled");function PHr(t){return t.get(OI).flags.verboseLogging}a(PHr,"isVerboseLoggingEnabled");function kHr(t,e){return t.includes("--debug")||PPt(e,"DEBUG")}a(kHr,"determineDebugFlag");function tuo(t){return PPt(t,"SIMULATION")}a(tuo,"determineSimulationFlag");function b9e(t){return t.get(OI).flags.simulation}a(b9e,"isRunningInSimulation");function ruo(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||PPt(e,"VERBOSE")||kHr(t,e)}a(ruo,"determineVerboseLoggingEnabled");function PPt(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(PPt,"determineEnvFlagEnabled");p();var Td=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 MHr=require("os"),OHr=de(require("path"));function hCe(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(hCe,"redactPaths");var nuo=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),iuo=[/^[\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 DPt(t){if(nuo.has(t))return t;for(let e of iuo)if(e.test(t))return t;return hCe(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(DPt,"redactMessage");function aoe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(aoe,"escapeForRegExp");var ouo=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+aoe((0,MHr.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function kPt(t){return t.replace(ouo,"~")}a(kPt,"redactHomeDir");var BHr="[\\\\/]?([^:)]*)(?=:\\d)",DHr=new RegExp(aoe(OHr.sep),"g"),NHr=new RegExp(aoe(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+BHr,"gi");function NPt(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(NHr.test(l))o.stack+=` -${hCe(l.replace(NHr,(u,d)=>"./"+d.replace(DHr,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` -${hCe(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(aoe(f.replace(/[\\/]$/,""))+BHr,"gi");if(h.test(l)){o.stack+=` -${hCe(l.replace(h,(m,g)=>d+g.replace(DHr,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` -${kPt(l)}`:o.stack+=` - at [redacted]:0:0`}}else r&&s&&(o.stack=kPt(s));return t.cause instanceof Error&&(o.cause=NPt(t.cause,e,r,n)),o}a(NPt,"cloneError");function LHr(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(LHr,"errorMessageWithoutPath");function FHr(t,e){return NPt(t,a(function(n){return kPt(LHr(n))},"prepareMessage"),!0,e)}a(FHr,"prepareErrorForRestrictedTelemetry");function UHr(t,e,r=!1){return NPt(t,a(function(o){if(r)return DPt(LHr(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=hCe(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(UHr,"redactError");p();p();var xy={};Ri(xy,{HasPropertyKey:()=>S9e,IsArray:()=>kp,IsAsyncIterator:()=>MPt,IsBigInt:()=>mCe,IsBoolean:()=>zB,IsDate:()=>gW,IsFunction:()=>OPt,IsIterator:()=>BPt,IsNull:()=>LPt,IsNumber:()=>R1,IsObject:()=>$c,IsRegExp:()=>gCe,IsString:()=>Ml,IsSymbol:()=>FPt,IsUint8Array:()=>YB,IsUndefined:()=>Dp});p();function S9e(t,e){return e in t}a(S9e,"HasPropertyKey");function MPt(t){return $c(t)&&!kp(t)&&!YB(t)&&Symbol.asyncIterator in t}a(MPt,"IsAsyncIterator");function kp(t){return Array.isArray(t)}a(kp,"IsArray");function mCe(t){return typeof t=="bigint"}a(mCe,"IsBigInt");function zB(t){return typeof t=="boolean"}a(zB,"IsBoolean");function gW(t){return t instanceof globalThis.Date}a(gW,"IsDate");function OPt(t){return typeof t=="function"}a(OPt,"IsFunction");function BPt(t){return $c(t)&&!kp(t)&&!YB(t)&&Symbol.iterator in t}a(BPt,"IsIterator");function LPt(t){return t===null}a(LPt,"IsNull");function R1(t){return typeof t=="number"}a(R1,"IsNumber");function $c(t){return typeof t=="object"&&t!==null}a($c,"IsObject");function gCe(t){return t instanceof globalThis.RegExp}a(gCe,"IsRegExp");function Ml(t){return typeof t=="string"}a(Ml,"IsString");function FPt(t){return typeof t=="symbol"}a(FPt,"IsSymbol");function YB(t){return t instanceof globalThis.Uint8Array}a(YB,"IsUint8Array");function Dp(t){return t===void 0}a(Dp,"IsUndefined");function suo(t){return t.map(e=>T9e(e))}a(suo,"ArrayType");function auo(t){return new Date(t.getTime())}a(auo,"DateType");function cuo(t){return new Uint8Array(t)}a(cuo,"Uint8ArrayType");function luo(t){return new RegExp(t.source,t.flags)}a(luo,"RegExpType");function uuo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=T9e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=T9e(t[r]);return e}a(uuo,"ObjectType");function T9e(t){return kp(t)?suo(t):gW(t)?auo(t):YB(t)?cuo(t):gCe(t)?luo(t):$c(t)?uuo(t):t}a(T9e,"Visit");function Mu(t){return T9e(t)}a(Mu,"Clone");function coe(t,e){return e===void 0?Mu(t):Mu({...e,...t})}a(coe,"CloneType");p();p();p();function I9e(t){return bo(t)&&globalThis.Symbol.asyncIterator in t}a(I9e,"IsAsyncIterator");function x9e(t){return bo(t)&&globalThis.Symbol.iterator in t}a(x9e,"IsIterator");function UPt(t){return bo(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(UPt,"IsStandardObject");function w9e(t){return t instanceof globalThis.Promise}a(w9e,"IsPromise");function u_(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(u_,"IsDate");function QHr(t){return t instanceof globalThis.Map}a(QHr,"IsMap");function qHr(t){return t instanceof globalThis.Set}a(qHr,"IsSet");function BI(t){return globalThis.ArrayBuffer.isView(t)}a(BI,"IsTypedArray");function loe(t){return t instanceof globalThis.Uint8Array}a(loe,"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 Ou(t){return t===void 0}a(Ou,"IsUndefined");function KB(t){return t===null}a(KB,"IsNull");function WN(t){return typeof t=="boolean"}a(WN,"IsBoolean");function ai(t){return typeof t=="number"}a(ai,"IsNumber");function R9e(t){return globalThis.Number.isInteger(t)}a(R9e,"IsInteger");function nA(t){return typeof t=="bigint"}a(nA,"IsBigInt");function va(t){return typeof t=="string"}a(va,"IsString");function X9(t){return typeof t=="function"}a(X9,"IsFunction");function JB(t){return typeof t=="symbol"}a(JB,"IsSymbol");function P1(t){return nA(t)||WN(t)||KB(t)||ai(t)||va(t)||JB(t)||Ou(t)}a(P1,"IsValueType");var tu;(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=Ou(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(tu||(tu={}));p();function duo(t){return globalThis.Object.freeze(t).map(e=>ACe(e))}a(duo,"ImmutableArray");function fuo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=ACe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=ACe(t[r]);return globalThis.Object.freeze(e)}a(fuo,"ImmutableObject");function ACe(t){return kp(t)?duo(t):gW(t)?t:YB(t)?t:gCe(t)?t:$c(t)?fuo(t):t}a(ACe,"Immutable");function wt(t,e){let r=e!==void 0?{...e,...t}:t;switch(tu.InstanceMode){case"freeze":return ACe(r);case"clone":return Mu(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 Id=Symbol.for("TypeBox.Transform"),xP=Symbol.for("TypeBox.Readonly"),iA=Symbol.for("TypeBox.Optional"),LI=Symbol.for("TypeBox.Hint"),Tt=Symbol.for("TypeBox.Kind");function uoe(t){return $c(t)&&t[xP]==="Readonly"}a(uoe,"IsReadonly");function Zv(t){return $c(t)&&t[iA]==="Optional"}a(Zv,"IsOptional");function QPt(t){return ia(t,"Any")}a(QPt,"IsAny");function qPt(t){return ia(t,"Argument")}a(qPt,"IsArgument");function wP(t){return ia(t,"Array")}a(wP,"IsArray");function AW(t){return ia(t,"AsyncIterator")}a(AW,"IsAsyncIterator");function yW(t){return ia(t,"BigInt")}a(yW,"IsBigInt");function ZB(t){return ia(t,"Boolean")}a(ZB,"IsBoolean");function RP(t){return ia(t,"Computed")}a(RP,"IsComputed");function PP(t){return ia(t,"Constructor")}a(PP,"IsConstructor");function puo(t){return ia(t,"Date")}a(puo,"IsDate");function kP(t){return ia(t,"Function")}a(kP,"IsFunction");function DP(t){return ia(t,"Integer")}a(DP,"IsInteger");function rf(t){return ia(t,"Intersect")}a(rf,"IsIntersect");function EW(t){return ia(t,"Iterator")}a(EW,"IsIterator");function ia(t,e){return $c(t)&&Tt in t&&t[Tt]===e}a(ia,"IsKindOf");function P9e(t){return zB(t)||R1(t)||Ml(t)}a(P9e,"IsLiteralValue");function k1(t){return ia(t,"Literal")}a(k1,"IsLiteral");function D1(t){return ia(t,"MappedKey")}a(D1,"IsMappedKey");function Bu(t){return ia(t,"MappedResult")}a(Bu,"IsMappedResult");function eU(t){return ia(t,"Never")}a(eU,"IsNever");function huo(t){return ia(t,"Not")}a(huo,"IsNot");function yCe(t){return ia(t,"Null")}a(yCe,"IsNull");function NP(t){return ia(t,"Number")}a(NP,"IsNumber");function Np(t){return ia(t,"Object")}a(Np,"IsObject");function _W(t){return ia(t,"Promise")}a(_W,"IsPromise");function vW(t){return ia(t,"Record")}a(vW,"IsRecord");function Uf(t){return ia(t,"Ref")}a(Uf,"IsRef");function jPt(t){return ia(t,"RegExp")}a(jPt,"IsRegExp");function XB(t){return ia(t,"String")}a(XB,"IsString");function ECe(t){return ia(t,"Symbol")}a(ECe,"IsSymbol");function N1(t){return ia(t,"TemplateLiteral")}a(N1,"IsTemplateLiteral");function muo(t){return ia(t,"This")}a(muo,"IsThis");function Za(t){return $c(t)&&Id in t}a(Za,"IsTransform");function M1(t){return ia(t,"Tuple")}a(M1,"IsTuple");function eL(t){return ia(t,"Undefined")}a(eL,"IsUndefined");function Ca(t){return ia(t,"Union")}a(Ca,"IsUnion");function guo(t){return ia(t,"Uint8Array")}a(guo,"IsUint8Array");function Auo(t){return ia(t,"Unknown")}a(Auo,"IsUnknown");function yuo(t){return ia(t,"Unsafe")}a(yuo,"IsUnsafe");function Euo(t){return ia(t,"Void")}a(Euo,"IsVoid");function tU(t){return $c(t)&&Tt in t&&Ml(t[Tt])}a(tU,"IsKind");function xd(t){return QPt(t)||qPt(t)||wP(t)||ZB(t)||yW(t)||AW(t)||RP(t)||PP(t)||puo(t)||kP(t)||DP(t)||rf(t)||EW(t)||k1(t)||D1(t)||Bu(t)||eU(t)||huo(t)||yCe(t)||NP(t)||Np(t)||_W(t)||vW(t)||Uf(t)||jPt(t)||XB(t)||ECe(t)||N1(t)||muo(t)||M1(t)||eL(t)||Ca(t)||guo(t)||Auo(t)||yuo(t)||Euo(t)||tU(t)}a(xd,"IsSchema");var it={};Ri(it,{IsAny:()=>$Hr,IsArgument:()=>VHr,IsArray:()=>WHr,IsAsyncIterator:()=>zHr,IsBigInt:()=>YHr,IsBoolean:()=>KHr,IsComputed:()=>JHr,IsConstructor:()=>ZHr,IsDate:()=>XHr,IsFunction:()=>eGr,IsImport:()=>Tuo,IsInteger:()=>tGr,IsIntersect:()=>rGr,IsIterator:()=>nGr,IsKind:()=>RGr,IsKindOf:()=>Ms,IsLiteral:()=>vCe,IsLiteralBoolean:()=>Iuo,IsLiteralNumber:()=>oGr,IsLiteralString:()=>iGr,IsLiteralValue:()=>sGr,IsMappedKey:()=>aGr,IsMappedResult:()=>cGr,IsNever:()=>lGr,IsNot:()=>uGr,IsNull:()=>dGr,IsNumber:()=>fGr,IsObject:()=>pGr,IsOptional:()=>Suo,IsPromise:()=>hGr,IsProperties:()=>k9e,IsReadonly:()=>buo,IsRecord:()=>mGr,IsRecursive:()=>xuo,IsRef:()=>gGr,IsRegExp:()=>AGr,IsSchema:()=>Lu,IsString:()=>yGr,IsSymbol:()=>EGr,IsTemplateLiteral:()=>_Gr,IsThis:()=>vGr,IsTransform:()=>CGr,IsTuple:()=>bGr,IsUint8Array:()=>TGr,IsUndefined:()=>SGr,IsUnion:()=>VPt,IsUnionLiteral:()=>wuo,IsUnknown:()=>IGr,IsUnsafe:()=>xGr,IsVoid:()=>wGr,TypeGuardUnknownTypeError:()=>HPt});p();var HPt=class extends qi{static{a(this,"TypeGuardUnknownTypeError")}},_uo=["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 jHr(t){try{return new RegExp(t),!0}catch{return!1}}a(jHr,"IsPattern");function GPt(t){if(!Ml(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(GPt,"IsControlCharacterFree");function HHr(t){return $Pt(t)||Lu(t)}a(HHr,"IsAdditionalProperties");function _Ce(t){return Dp(t)||mCe(t)}a(_Ce,"IsOptionalBigInt");function Ol(t){return Dp(t)||R1(t)}a(Ol,"IsOptionalNumber");function $Pt(t){return Dp(t)||zB(t)}a($Pt,"IsOptionalBoolean");function Vc(t){return Dp(t)||Ml(t)}a(Vc,"IsOptionalString");function vuo(t){return Dp(t)||Ml(t)&&GPt(t)&&jHr(t)}a(vuo,"IsOptionalPattern");function Cuo(t){return Dp(t)||Ml(t)&&GPt(t)}a(Cuo,"IsOptionalFormat");function GHr(t){return Dp(t)||Lu(t)}a(GHr,"IsOptionalSchema");function buo(t){return $c(t)&&t[xP]==="Readonly"}a(buo,"IsReadonly");function Suo(t){return $c(t)&&t[iA]==="Optional"}a(Suo,"IsOptional");function $Hr(t){return Ms(t,"Any")&&Vc(t.$id)}a($Hr,"IsAny");function VHr(t){return Ms(t,"Argument")&&R1(t.index)}a(VHr,"IsArgument");function WHr(t){return Ms(t,"Array")&&t.type==="array"&&Vc(t.$id)&&Lu(t.items)&&Ol(t.minItems)&&Ol(t.maxItems)&&$Pt(t.uniqueItems)&&GHr(t.contains)&&Ol(t.minContains)&&Ol(t.maxContains)}a(WHr,"IsArray");function zHr(t){return Ms(t,"AsyncIterator")&&t.type==="AsyncIterator"&&Vc(t.$id)&&Lu(t.items)}a(zHr,"IsAsyncIterator");function YHr(t){return Ms(t,"BigInt")&&t.type==="bigint"&&Vc(t.$id)&&_Ce(t.exclusiveMaximum)&&_Ce(t.exclusiveMinimum)&&_Ce(t.maximum)&&_Ce(t.minimum)&&_Ce(t.multipleOf)}a(YHr,"IsBigInt");function KHr(t){return Ms(t,"Boolean")&&t.type==="boolean"&&Vc(t.$id)}a(KHr,"IsBoolean");function JHr(t){return Ms(t,"Computed")&&Ml(t.target)&&kp(t.parameters)&&t.parameters.every(e=>Lu(e))}a(JHr,"IsComputed");function ZHr(t){return Ms(t,"Constructor")&&t.type==="Constructor"&&Vc(t.$id)&&kp(t.parameters)&&t.parameters.every(e=>Lu(e))&&Lu(t.returns)}a(ZHr,"IsConstructor");function XHr(t){return Ms(t,"Date")&&t.type==="Date"&&Vc(t.$id)&&Ol(t.exclusiveMaximumTimestamp)&&Ol(t.exclusiveMinimumTimestamp)&&Ol(t.maximumTimestamp)&&Ol(t.minimumTimestamp)&&Ol(t.multipleOfTimestamp)}a(XHr,"IsDate");function eGr(t){return Ms(t,"Function")&&t.type==="Function"&&Vc(t.$id)&&kp(t.parameters)&&t.parameters.every(e=>Lu(e))&&Lu(t.returns)}a(eGr,"IsFunction");function Tuo(t){return Ms(t,"Import")&&S9e(t,"$defs")&&$c(t.$defs)&&k9e(t.$defs)&&S9e(t,"$ref")&&Ml(t.$ref)&&t.$ref in t.$defs}a(Tuo,"IsImport");function tGr(t){return Ms(t,"Integer")&&t.type==="integer"&&Vc(t.$id)&&Ol(t.exclusiveMaximum)&&Ol(t.exclusiveMinimum)&&Ol(t.maximum)&&Ol(t.minimum)&&Ol(t.multipleOf)}a(tGr,"IsInteger");function k9e(t){return $c(t)&&Object.entries(t).every(([e,r])=>GPt(e)&&Lu(r))}a(k9e,"IsProperties");function rGr(t){return Ms(t,"Intersect")&&!(Ml(t.type)&&t.type!=="object")&&kp(t.allOf)&&t.allOf.every(e=>Lu(e)&&!CGr(e))&&Vc(t.type)&&($Pt(t.unevaluatedProperties)||GHr(t.unevaluatedProperties))&&Vc(t.$id)}a(rGr,"IsIntersect");function nGr(t){return Ms(t,"Iterator")&&t.type==="Iterator"&&Vc(t.$id)&&Lu(t.items)}a(nGr,"IsIterator");function Ms(t,e){return $c(t)&&Tt in t&&t[Tt]===e}a(Ms,"IsKindOf");function iGr(t){return vCe(t)&&Ml(t.const)}a(iGr,"IsLiteralString");function oGr(t){return vCe(t)&&R1(t.const)}a(oGr,"IsLiteralNumber");function Iuo(t){return vCe(t)&&zB(t.const)}a(Iuo,"IsLiteralBoolean");function vCe(t){return Ms(t,"Literal")&&Vc(t.$id)&&sGr(t.const)}a(vCe,"IsLiteral");function sGr(t){return zB(t)||R1(t)||Ml(t)}a(sGr,"IsLiteralValue");function aGr(t){return Ms(t,"MappedKey")&&kp(t.keys)&&t.keys.every(e=>R1(e)||Ml(e))}a(aGr,"IsMappedKey");function cGr(t){return Ms(t,"MappedResult")&&k9e(t.properties)}a(cGr,"IsMappedResult");function lGr(t){return Ms(t,"Never")&&$c(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(lGr,"IsNever");function uGr(t){return Ms(t,"Not")&&Lu(t.not)}a(uGr,"IsNot");function dGr(t){return Ms(t,"Null")&&t.type==="null"&&Vc(t.$id)}a(dGr,"IsNull");function fGr(t){return Ms(t,"Number")&&t.type==="number"&&Vc(t.$id)&&Ol(t.exclusiveMaximum)&&Ol(t.exclusiveMinimum)&&Ol(t.maximum)&&Ol(t.minimum)&&Ol(t.multipleOf)}a(fGr,"IsNumber");function pGr(t){return Ms(t,"Object")&&t.type==="object"&&Vc(t.$id)&&k9e(t.properties)&&HHr(t.additionalProperties)&&Ol(t.minProperties)&&Ol(t.maxProperties)}a(pGr,"IsObject");function hGr(t){return Ms(t,"Promise")&&t.type==="Promise"&&Vc(t.$id)&&Lu(t.item)}a(hGr,"IsPromise");function mGr(t){return Ms(t,"Record")&&t.type==="object"&&Vc(t.$id)&&HHr(t.additionalProperties)&&$c(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&jHr(r[0])&&$c(e.patternProperties)&&Lu(e.patternProperties[r[0]])})(t)}a(mGr,"IsRecord");function xuo(t){return $c(t)&&LI in t&&t[LI]==="Recursive"}a(xuo,"IsRecursive");function gGr(t){return Ms(t,"Ref")&&Vc(t.$id)&&Ml(t.$ref)}a(gGr,"IsRef");function AGr(t){return Ms(t,"RegExp")&&Vc(t.$id)&&Ml(t.source)&&Ml(t.flags)&&Ol(t.maxLength)&&Ol(t.minLength)}a(AGr,"IsRegExp");function yGr(t){return Ms(t,"String")&&t.type==="string"&&Vc(t.$id)&&Ol(t.minLength)&&Ol(t.maxLength)&&vuo(t.pattern)&&Cuo(t.format)}a(yGr,"IsString");function EGr(t){return Ms(t,"Symbol")&&t.type==="symbol"&&Vc(t.$id)}a(EGr,"IsSymbol");function _Gr(t){return Ms(t,"TemplateLiteral")&&t.type==="string"&&Ml(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(_Gr,"IsTemplateLiteral");function vGr(t){return Ms(t,"This")&&Vc(t.$id)&&Ml(t.$ref)}a(vGr,"IsThis");function CGr(t){return $c(t)&&Id in t}a(CGr,"IsTransform");function bGr(t){return Ms(t,"Tuple")&&t.type==="array"&&Vc(t.$id)&&R1(t.minItems)&&R1(t.maxItems)&&t.minItems===t.maxItems&&(Dp(t.items)&&Dp(t.additionalItems)&&t.minItems===0||kp(t.items)&&t.items.every(e=>Lu(e)))}a(bGr,"IsTuple");function SGr(t){return Ms(t,"Undefined")&&t.type==="undefined"&&Vc(t.$id)}a(SGr,"IsUndefined");function wuo(t){return VPt(t)&&t.anyOf.every(e=>iGr(e)||oGr(e))}a(wuo,"IsUnionLiteral");function VPt(t){return Ms(t,"Union")&&Vc(t.$id)&&$c(t)&&kp(t.anyOf)&&t.anyOf.every(e=>Lu(e))}a(VPt,"IsUnion");function TGr(t){return Ms(t,"Uint8Array")&&t.type==="Uint8Array"&&Vc(t.$id)&&Ol(t.minByteLength)&&Ol(t.maxByteLength)}a(TGr,"IsUint8Array");function IGr(t){return Ms(t,"Unknown")&&Vc(t.$id)}a(IGr,"IsUnknown");function xGr(t){return Ms(t,"Unsafe")}a(xGr,"IsUnsafe");function wGr(t){return Ms(t,"Void")&&t.type==="void"&&Vc(t.$id)}a(wGr,"IsVoid");function RGr(t){return $c(t)&&Tt in t&&Ml(t[Tt])&&!_uo.includes(t[Tt])}a(RGr,"IsKind");function Lu(t){return $c(t)&&($Hr(t)||VHr(t)||WHr(t)||KHr(t)||YHr(t)||zHr(t)||JHr(t)||ZHr(t)||XHr(t)||eGr(t)||tGr(t)||rGr(t)||nGr(t)||vCe(t)||aGr(t)||cGr(t)||lGr(t)||uGr(t)||dGr(t)||fGr(t)||pGr(t)||hGr(t)||mGr(t)||gGr(t)||AGr(t)||yGr(t)||EGr(t)||_Gr(t)||vGr(t)||bGr(t)||SGr(t)||VPt(t)||TGr(t)||IGr(t)||xGr(t)||wGr(t)||RGr(t))}a(Lu,"IsSchema");p();var WPt="(true|false)",CCe="(0|[1-9][0-9]*)",zPt="(.*)",Ruo="(?!.*)",Mll=`^${WPt}$`,rU=`^${CCe}$`,nU=`^${zPt}$`,PGr=`^${Ruo}$`;p();var MP={};Ri(MP,{Clear:()=>kuo,Delete:()=>Duo,Entries:()=>Puo,Get:()=>Ouo,Has:()=>Nuo,Set:()=>Muo});p();var doe=new Map;function Puo(){return new Map(doe)}a(Puo,"Entries");function kuo(){return doe.clear()}a(kuo,"Clear");function Duo(t){return doe.delete(t)}a(Duo,"Delete");function Nuo(t){return doe.has(t)}a(Nuo,"Has");function Muo(t,e){doe.set(t,e)}a(Muo,"Set");function Ouo(t){return doe.get(t)}a(Ouo,"Get");var d_={};Ri(d_,{Clear:()=>Luo,Delete:()=>Fuo,Entries:()=>Buo,Get:()=>quo,Has:()=>Uuo,Set:()=>Quo});p();var foe=new Map;function Buo(){return new Map(foe)}a(Buo,"Entries");function Luo(){return foe.clear()}a(Luo,"Clear");function Fuo(t){return foe.delete(t)}a(Fuo,"Delete");function Uuo(t){return foe.has(t)}a(Uuo,"Has");function Quo(t,e){foe.set(t,e)}a(Quo,"Set");function quo(t){return foe.get(t)}a(quo,"Get");p();function kGr(t,e){return t.includes(e)}a(kGr,"SetIncludes");function DGr(t){return[...new Set(t)]}a(DGr,"SetDistinct");function juo(t,e){return t.filter(r=>e.includes(r))}a(juo,"SetIntersect");function Huo(t,e){return t.reduce((r,n)=>juo(r,n),e)}a(Huo,"SetIntersectManyResolve");function NGr(t){return t.length===1?t[0]:t.length>1?Huo(t.slice(1),t[0]):[]}a(NGr,"SetIntersectMany");function MGr(t){let e=[];for(let r of t)e.push(...r);return e}a(MGr,"SetUnionMany");p();function iU(t){return wt({[Tt]:"Any"},t)}a(iU,"Any");p();function poe(t,e){return wt({[Tt]:"Array",type:"array",items:t},e)}a(poe,"Array");p();function OGr(t){return wt({[Tt]:"Argument",index:t})}a(OGr,"Argument");p();function hoe(t,e){return wt({[Tt]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(hoe,"AsyncIterator");p();p();function ru(t,e,r){return wt({[Tt]:"Computed",target:t,parameters:e},r)}a(ru,"Computed");p();p();function Guo(t,e){let{[e]:r,...n}=t;return n}a(Guo,"DiscardKey");function nf(t,e){return e.reduce((r,n)=>Guo(r,n),t)}a(nf,"Discard");p();function Ko(t){return wt({[Tt]:"Never",not:{}},t)}a(Ko,"Never");p();p();function Fa(t){return wt({[Tt]:"MappedResult",properties:t})}a(Fa,"MappedResult");p();p();function moe(t,e,r){return wt({[Tt]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(moe,"Constructor");p();function zN(t,e,r){return wt({[Tt]:"Function",type:"Function",parameters:t,returns:e},r)}a(zN,"Function");p();p();p();p();function bCe(t,e){return wt({[Tt]:"Union",anyOf:t},e)}a(bCe,"UnionCreate");function $uo(t){return t.some(e=>Zv(e))}a($uo,"IsUnionOptional");function BGr(t){return t.map(e=>Zv(e)?Vuo(e):e)}a(BGr,"RemoveOptionalFromRest");function Vuo(t){return nf(t,[iA])}a(Vuo,"RemoveOptionalFromType");function Wuo(t,e){return $uo(t)?wy(bCe(BGr(t),e)):bCe(BGr(t),e)}a(Wuo,"ResolveUnion");function YN(t,e){return t.length===1?wt(t[0],e):t.length===0?Ko(e):Wuo(t,e)}a(YN,"UnionEvaluated");p();function Xa(t,e){return t.length===0?Ko(e):t.length===1?wt(t[0],e):bCe(t,e)}a(Xa,"Union");p();p();p();var D9e=class extends qi{static{a(this,"TemplateLiteralParserError")}};function zuo(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(zuo,"Unescape");function YPt(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(YPt,"IsNonEscaped");function rL(t,e){return YPt(t,e,"(")}a(rL,"IsOpenParen");function SCe(t,e){return YPt(t,e,")")}a(SCe,"IsCloseParen");function LGr(t,e){return YPt(t,e,"|")}a(LGr,"IsSeparator");function Yuo(t){if(!(rL(t,0)&&SCe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(goe(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(goe(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(Xuo,"Or");function edo(t){function e(o,s){if(!rL(o,s))throw new D9e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(goe(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(edo,"And");function goe(t){return Yuo(t)?goe(Kuo(t)):Juo(t)?Xuo(t):Zuo(t)?edo(t):{type:"const",const:zuo(t)}}a(goe,"TemplateLiteralParse");function Aoe(t){return goe(t.slice(1,t.length-1))}a(Aoe,"TemplateLiteralParseExact");var KPt=class extends qi{static{a(this,"TemplateLiteralFiniteError")}};function tdo(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(tdo,"IsNumberExpression");function rdo(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(rdo,"IsBooleanExpression");function ndo(t){return t.type==="const"&&t.const===".*"}a(ndo,"IsStringExpression");function CW(t){return tdo(t)||ndo(t)?!1:rdo(t)?!0:t.type==="and"?t.expr.every(e=>CW(e)):t.type==="or"?t.expr.every(e=>CW(e)):t.type==="const"?!0:(()=>{throw new KPt("Unknown expression type")})()}a(CW,"IsTemplateLiteralExpressionFinite");function N9e(t){let e=Aoe(t.pattern);return CW(e)}a(N9e,"IsTemplateLiteralFinite");p();var JPt=class extends qi{static{a(this,"TemplateLiteralGenerateError")}};function*FGr(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of FGr(t.slice(1)))yield`${e}${r}`}a(FGr,"GenerateReduce");function*ido(t){return yield*FGr(t.expr.map(e=>[...TCe(e)]))}a(ido,"GenerateAnd");function*odo(t){for(let e of t.expr)yield*TCe(e)}a(odo,"GenerateOr");function*sdo(t){return yield t.const}a(sdo,"GenerateConst");function*TCe(t){return t.type==="and"?yield*ido(t):t.type==="or"?yield*odo(t):t.type==="const"?yield*sdo(t):(()=>{throw new JPt("Unknown expression")})()}a(TCe,"TemplateLiteralExpressionGenerate");function yoe(t){let e=Aoe(t.pattern);return CW(e)?[...TCe(e)]:[]}a(yoe,"TemplateLiteralGenerate");p();p();function oa(t,e){return wt({[Tt]:"Literal",const:t,type:typeof t},e)}a(oa,"Literal");p();function M9e(t){return wt({[Tt]:"Boolean",type:"boolean"},t)}a(M9e,"Boolean");p();function Eoe(t){return wt({[Tt]:"BigInt",type:"bigint"},t)}a(Eoe,"BigInt");p();function FI(t){return wt({[Tt]:"Number",type:"number"},t)}a(FI,"Number");p();function f_(t){return wt({[Tt]:"String",type:"string"},t)}a(f_,"String");function*ado(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield M9e():e==="number"?yield FI():e==="bigint"?yield Eoe():e==="string"?yield f_():yield(()=>{let r=e.split("|").map(n=>oa(n.trim()));return r.length===0?Ko():r.length===1?r[0]:YN(r)})()}a(ado,"FromUnion");function*cdo(t){if(t[1]!=="{"){let e=oa("$"),r=ZPt(t.slice(1));return yield*[e,...r]}for(let e=2;eQGr(r,e)).join("|")})`:NP(t)?`${e}${CCe}`:DP(t)?`${e}${CCe}`:yW(t)?`${e}${CCe}`:XB(t)?`${e}${zPt}`:k1(t)?`${e}${ldo(t.const.toString())}`:ZB(t)?`${e}${WPt}`:(()=>{throw new XPt(`Unexpected Kind '${t[Tt]}'`)})()}a(QGr,"Visit");function ekt(t){return`^${t.map(e=>QGr(e,"")).join("")}$`}a(ekt,"TemplateLiteralPattern");p();function bW(t){let r=yoe(t).map(n=>oa(n));return YN(r)}a(bW,"TemplateLiteralToUnion");p();function O9e(t,e){let r=Ml(t)?ekt(UGr(t)):ekt(t);return wt({[Tt]:"TemplateLiteral",type:"string",pattern:r},e)}a(O9e,"TemplateLiteral");function udo(t){return yoe(t).map(r=>r.toString())}a(udo,"FromTemplateLiteral");function ddo(t){let e=[];for(let r of t)e.push(...Xv(r));return e}a(ddo,"FromUnion");function fdo(t){return[t.toString()]}a(fdo,"FromLiteral");function Xv(t){return[...new Set(N1(t)?udo(t):Ca(t)?ddo(t.anyOf):k1(t)?fdo(t.const):NP(t)?["[number]"]:DP(t)?["[number]"]:[])]}a(Xv,"IndexPropertyKeys");p();function pdo(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=oU(t,Xv(e[o]),r);return n}a(pdo,"FromProperties");function hdo(t,e,r){return pdo(t,e.properties,r)}a(hdo,"FromMappedResult");function qGr(t,e,r){let n=hdo(t,e,r);return Fa(n)}a(qGr,"IndexFromMappedResult");function HGr(t,e){return t.map(r=>GGr(r,e))}a(HGr,"FromRest");function mdo(t){return t.filter(e=>!eU(e))}a(mdo,"FromIntersectRest");function gdo(t,e){return B9e(mdo(HGr(t,e)))}a(gdo,"FromIntersect");function Ado(t){return t.some(e=>eU(e))?[]:t}a(Ado,"FromUnionRest");function ydo(t,e){return YN(Ado(HGr(t,e)))}a(ydo,"FromUnion");function Edo(t,e){return e in t?t[e]:e==="[number]"?YN(t):Ko()}a(Edo,"FromTuple");function _do(t,e){return e==="[number]"?t:Ko()}a(_do,"FromArray");function vdo(t,e){return e in t?t[e]:Ko()}a(vdo,"FromProperty");function GGr(t,e){return rf(t)?gdo(t.allOf,e):Ca(t)?ydo(t.anyOf,e):M1(t)?Edo(t.items??[],e):wP(t)?_do(t.items,e):Np(t)?vdo(t.properties,e):Ko()}a(GGr,"IndexFromPropertyKey");function ICe(t,e){return e.map(r=>GGr(t,r))}a(ICe,"IndexFromPropertyKeys");function jGr(t,e){return YN(ICe(t,e))}a(jGr,"FromSchema");function oU(t,e,r){if(Uf(t)||Uf(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!xd(t)||!xd(e))throw new qi(n);return ru("Index",[t,e])}return Bu(e)?qGr(t,e,r):D1(e)?$Gr(t,e,r):wt(xd(e)?jGr(t,Xv(e)):jGr(t,e),r)}a(oU,"Index");function Cdo(t,e,r){return{[e]:oU(t,[e],Mu(r))}}a(Cdo,"MappedIndexPropertyKey");function bdo(t,e,r){return e.reduce((n,o)=>({...n,...Cdo(t,o,r)}),{})}a(bdo,"MappedIndexPropertyKeys");function Sdo(t,e,r){return bdo(t,e.keys,r)}a(Sdo,"MappedIndexProperties");function $Gr(t,e,r){let n=Sdo(t,e,r);return Fa(n)}a($Gr,"IndexFromMappedKey");p();function _oe(t,e){return wt({[Tt]:"Iterator",type:"Iterator",items:t},e)}a(_oe,"Iterator");p();function Tdo(t){return globalThis.Object.keys(t).filter(e=>!Zv(t[e]))}a(Tdo,"RequiredArray");function Ido(t,e){let r=Tdo(t),n=r.length>0?{[Tt]:"Object",type:"object",required:r,properties:t}:{[Tt]:"Object",type:"object",properties:t};return wt(n,e)}a(Ido,"_Object");var ec=Ido;p();function L9e(t,e){return wt({[Tt]:"Promise",type:"Promise",item:t},e)}a(L9e,"Promise");p();p();function xdo(t){return wt(nf(t,[xP]))}a(xdo,"RemoveReadonly");function wdo(t){return wt({...t,[xP]:"Readonly"})}a(wdo,"AddReadonly");function Rdo(t,e){return e===!1?xdo(t):wdo(t)}a(Rdo,"ReadonlyWithFlag");function eC(t,e){let r=e??!0;return Bu(t)?VGr(t,r):Rdo(t,r)}a(eC,"Readonly");function Pdo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=eC(t[n],e);return r}a(Pdo,"FromProperties");function kdo(t,e){return Pdo(t.properties,e)}a(kdo,"FromMappedResult");function VGr(t,e){let r=kdo(t,e);return Fa(r)}a(VGr,"ReadonlyFromMappedResult");p();function UI(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(UI,"Tuple");function WGr(t,e){return t in e?QI(t,e[t]):Fa(e)}a(WGr,"FromMappedResult");function Ddo(t){return{[t]:oa(t)}}a(Ddo,"MappedKeyToKnownMappedResultProperties");function Ndo(t){let e={};for(let r of t)e[r]=oa(r);return e}a(Ndo,"MappedKeyToUnknownMappedResultProperties");function Mdo(t,e){return kGr(e,t)?Ddo(t):Ndo(e)}a(Mdo,"MappedKeyToMappedResultProperties");function Odo(t,e){let r=Mdo(t,e);return WGr(t,r)}a(Odo,"FromMappedKey");function xCe(t,e){return e.map(r=>QI(t,r))}a(xCe,"FromRest");function Bdo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=QI(t,e[n]);return r}a(Bdo,"FromProperties");function QI(t,e){let r={...e};return Zv(e)?wy(QI(t,nf(e,[iA]))):uoe(e)?eC(QI(t,nf(e,[xP]))):Bu(e)?WGr(t,e.properties):D1(e)?Odo(t,e.keys):PP(e)?moe(xCe(t,e.parameters),QI(t,e.returns),r):kP(e)?zN(xCe(t,e.parameters),QI(t,e.returns),r):AW(e)?hoe(QI(t,e.items),r):EW(e)?_oe(QI(t,e.items),r):rf(e)?Ry(xCe(t,e.allOf),r):Ca(e)?Xa(xCe(t,e.anyOf),r):M1(e)?UI(xCe(t,e.items??[]),r):Np(e)?ec(Bdo(t,e.properties),r):wP(e)?poe(QI(t,e.items),r):_W(e)?L9e(QI(t,e.item),r):e}a(QI,"FromSchemaType");function Ldo(t,e){let r={};for(let n of t)r[n]=QI(n,e);return r}a(Ldo,"MappedFunctionReturnType");function zGr(t,e,r){let n=xd(t)?Xv(t):t,o=e({[Tt]:"MappedKey",keys:n}),s=Ldo(n,o);return ec(s,r)}a(zGr,"Mapped");p();function Fdo(t){return wt(nf(t,[iA]))}a(Fdo,"RemoveOptional");function Udo(t){return wt({...t,[iA]:"Optional"})}a(Udo,"AddOptional");function Qdo(t,e){return e===!1?Fdo(t):Udo(t)}a(Qdo,"OptionalWithFlag");function wy(t,e){let r=e??!0;return Bu(t)?YGr(t,r):Qdo(t,r)}a(wy,"Optional");function qdo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=wy(t[n],e);return r}a(qdo,"FromProperties");function jdo(t,e){return qdo(t.properties,e)}a(jdo,"FromMappedResult");function YGr(t,e){let r=jdo(t,e);return Fa(r)}a(YGr,"OptionalFromMappedResult");p();function wCe(t,e={}){let r=t.every(o=>Np(o)),n=xd(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return wt(e.unevaluatedProperties===!1||xd(e.unevaluatedProperties)||r?{...n,[Tt]:"Intersect",type:"object",allOf:t}:{...n,[Tt]:"Intersect",allOf:t},e)}a(wCe,"IntersectCreate");function Hdo(t){return t.every(e=>Zv(e))}a(Hdo,"IsIntersectOptional");function Gdo(t){return nf(t,[iA])}a(Gdo,"RemoveOptionalFromType");function KGr(t){return t.map(e=>Zv(e)?Gdo(e):e)}a(KGr,"RemoveOptionalFromRest");function $do(t,e){return Hdo(t)?wy(wCe(KGr(t),e)):wCe(KGr(t),e)}a($do,"ResolveIntersect");function B9e(t,e={}){if(t.length===1)return wt(t[0],e);if(t.length===0)return Ko(e);if(t.some(r=>Za(r)))throw new Error("Cannot intersect transform types");return $do(t,e)}a(B9e,"IntersectEvaluated");p();function Ry(t,e){if(t.length===1)return wt(t[0],e);if(t.length===0)return Ko(e);if(t.some(r=>Za(r)))throw new Error("Cannot intersect transform types");return wCe(t,e)}a(Ry,"Intersect");p();function qI(...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(qI,"Ref");function Vdo(t,e){return ru("Awaited",[ru(t,e)])}a(Vdo,"FromComputed");function Wdo(t){return ru("Awaited",[qI(t)])}a(Wdo,"FromRef");function zdo(t){return Ry(JGr(t))}a(zdo,"FromIntersect");function Ydo(t){return Xa(JGr(t))}a(Ydo,"FromUnion");function Kdo(t){return voe(t)}a(Kdo,"FromPromise");function JGr(t){return t.map(e=>voe(e))}a(JGr,"FromRest");function voe(t,e){return wt(RP(t)?Vdo(t.target,t.parameters):rf(t)?zdo(t.allOf):Ca(t)?Ydo(t.anyOf):_W(t)?Kdo(t.item):Uf(t)?Wdo(t.$ref):t,e)}a(voe,"Awaited");p();p();p();p();function ZGr(t){let e=[];for(let r of t)e.push(tC(r));return e}a(ZGr,"FromRest");function Jdo(t){let e=ZGr(t);return MGr(e)}a(Jdo,"FromIntersect");function Zdo(t){let e=ZGr(t);return NGr(e)}a(Zdo,"FromUnion");function Xdo(t){return t.map((e,r)=>r.toString())}a(Xdo,"FromTuple");function efo(t){return["[number]"]}a(efo,"FromArray");function tfo(t){return globalThis.Object.getOwnPropertyNames(t)}a(tfo,"FromProperties");function rfo(t){return tkt?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(rfo,"FromPatternProperties");function tC(t){return rf(t)?Jdo(t.allOf):Ca(t)?Zdo(t.anyOf):M1(t)?Xdo(t.items??[]):wP(t)?efo(t.items):Np(t)?tfo(t.properties):vW(t)?rfo(t.patternProperties):[]}a(tC,"KeyOfPropertyKeys");var tkt=!1;function nL(t){tkt=!0;let e=tC(t);return tkt=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(nL,"KeyOfPattern");function nfo(t,e){return ru("KeyOf",[ru(t,e)])}a(nfo,"FromComputed");function ifo(t){return ru("KeyOf",[qI(t)])}a(ifo,"FromRef");function ofo(t,e){let r=tC(t),n=sfo(r),o=YN(n);return wt(o,e)}a(ofo,"KeyOfFromType");function sfo(t){return t.map(e=>e==="[number]"?FI():oa(e))}a(sfo,"KeyOfPropertyKeysToRest");function Coe(t,e){return RP(t)?nfo(t.target,t.parameters):Uf(t)?ifo(t.$ref):Bu(t)?XGr(t,e):ofo(t,e)}a(Coe,"KeyOf");function afo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Coe(t[n],Mu(e));return r}a(afo,"FromProperties");function cfo(t,e){return afo(t.properties,e)}a(cfo,"FromMappedResult");function XGr(t,e){let r=cfo(t,e);return Fa(r)}a(XGr,"KeyOfFromMappedResult");p();function F9e(t){let e=tC(t),r=ICe(t,e);return e.map((n,o)=>[e[o],r[o]])}a(F9e,"KeyOfPropertyEntries");function lfo(t){let e=[];for(let r of t)e.push(...tC(r));return DGr(e)}a(lfo,"CompositeKeys");function ufo(t){return t.filter(e=>!eU(e))}a(ufo,"FilterNever");function dfo(t,e){let r=[];for(let n of t)r.push(...ICe(n,[e]));return ufo(r)}a(dfo,"CompositeProperty");function ffo(t,e){let r={};for(let n of e)r[n]=B9e(dfo(t,n));return r}a(ffo,"CompositeProperties");function e$r(t,e){let r=lfo(t),n=ffo(t,r);return ec(n,e)}a(e$r,"Composite");p();p();function U9e(t){return wt({[Tt]:"Date",type:"Date"},t)}a(U9e,"Date");p();function Q9e(t){return wt({[Tt]:"Null",type:"null"},t)}a(Q9e,"Null");p();function q9e(t){return wt({[Tt]:"Symbol",type:"symbol"},t)}a(q9e,"Symbol");p();function j9e(t){return wt({[Tt]:"Undefined",type:"undefined"},t)}a(j9e,"Undefined");p();function H9e(t){return wt({[Tt]:"Uint8Array",type:"Uint8Array"},t)}a(H9e,"Uint8Array");p();function OP(t){return wt({[Tt]:"Unknown"},t)}a(OP,"Unknown");function pfo(t){return t.map(e=>rkt(e,!1))}a(pfo,"FromArray");function hfo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=eC(rkt(t[r],!1));return e}a(hfo,"FromProperties");function G9e(t,e){return e===!0?t:eC(t)}a(G9e,"ConditionalReadonly");function rkt(t,e){return MPt(t)?G9e(iU(),e):BPt(t)?G9e(iU(),e):kp(t)?eC(UI(pfo(t))):YB(t)?H9e():gW(t)?U9e():$c(t)?G9e(ec(hfo(t)),e):OPt(t)?G9e(zN([],OP()),e):Dp(t)?j9e():LPt(t)?Q9e():FPt(t)?q9e():mCe(t)?Eoe():R1(t)?oa(t):zB(t)?oa(t):Ml(t)?oa(t):ec({})}a(rkt,"FromValue");function t$r(t,e){return wt(rkt(t,!0),e)}a(t$r,"Const");p();function r$r(t,e){return PP(t)?UI(t.parameters,e):Ko(e)}a(r$r,"ConstructorParameters");p();function n$r(t,e){if(Dp(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>oa(s));return Xa(o,{...e,[LI]:"Enum"})}a(n$r,"Enum");p();p();p();var ikt=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 jI(t){return t===Rt.False?t:Rt.True}a(jI,"IntoBooleanResult");function boe(t){throw new ikt(t)}a(boe,"Throw");function vh(t){return it.IsNever(t)||it.IsIntersect(t)||it.IsUnion(t)||it.IsUnknown(t)||it.IsAny(t)}a(vh,"IsStructuralRight");function Ch(t,e){return it.IsNever(e)?u$r(t,e):it.IsIntersect(e)?$9e(t,e):it.IsUnion(e)?ckt(t,e):it.IsUnknown(e)?h$r(t,e):it.IsAny(e)?akt(t,e):boe("StructuralRight")}a(Ch,"StructuralRight");function akt(t,e){return Rt.True}a(akt,"FromAnyRight");function mfo(t,e){return it.IsIntersect(e)?$9e(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(mfo,"FromAny");function gfo(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)?Rt.True:Rt.False}a(gfo,"FromArrayRight");function Afo(t,e){return it.IsObject(e)&&V9e(e)?Rt.True:vh(e)?Ch(t,e):it.IsArray(e)?jI(Wc(t.items,e.items)):Rt.False}a(Afo,"FromArray");function yfo(t,e){return vh(e)?Ch(t,e):it.IsAsyncIterator(e)?jI(Wc(t.items,e.items)):Rt.False}a(yfo,"FromAsyncIterator");function Efo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsRecord(e)?HI(t,e):it.IsBigInt(e)?Rt.True:Rt.False}a(Efo,"FromBigInt");function c$r(t,e){return it.IsLiteralBoolean(t)||it.IsBoolean(t)?Rt.True:Rt.False}a(c$r,"FromBooleanRight");function _fo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsRecord(e)?HI(t,e):it.IsBoolean(e)?Rt.True:Rt.False}a(_fo,"FromBoolean");function vfo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsConstructor(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>jI(Wc(e.parameters[n],r))===Rt.True)?jI(Wc(t.returns,e.returns)):Rt.False:Rt.False}a(vfo,"FromConstructor");function Cfo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsRecord(e)?HI(t,e):it.IsDate(e)?Rt.True:Rt.False}a(Cfo,"FromDate");function bfo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsFunction(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>jI(Wc(e.parameters[n],r))===Rt.True)?jI(Wc(t.returns,e.returns)):Rt.False:Rt.False}a(bfo,"FromFunction");function l$r(t,e){return it.IsLiteral(t)&&xy.IsNumber(t.const)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(l$r,"FromIntegerRight");function Sfo(t,e){return it.IsInteger(e)||it.IsNumber(e)?Rt.True:vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsRecord(e)?HI(t,e):Rt.False}a(Sfo,"FromInteger");function $9e(t,e){return e.allOf.every(r=>Wc(t,r)===Rt.True)?Rt.True:Rt.False}a($9e,"FromIntersectRight");function Tfo(t,e){return t.allOf.some(r=>Wc(r,e)===Rt.True)?Rt.True:Rt.False}a(Tfo,"FromIntersect");function Ifo(t,e){return vh(e)?Ch(t,e):it.IsIterator(e)?jI(Wc(t.items,e.items)):Rt.False}a(Ifo,"FromIterator");function xfo(t,e){return it.IsLiteral(e)&&e.const===t.const?Rt.True:vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsRecord(e)?HI(t,e):it.IsString(e)?p$r(t,e):it.IsNumber(e)?d$r(t,e):it.IsInteger(e)?l$r(t,e):it.IsBoolean(e)?c$r(t,e):Rt.False}a(xfo,"FromLiteral");function u$r(t,e){return Rt.False}a(u$r,"FromNeverRight");function wfo(t,e){return Rt.True}a(wfo,"FromNever");function i$r(t){let[e,r]=[t,0];for(;it.IsNot(e);)e=e.not,r+=1;return r%2===0?e:OP()}a(i$r,"UnwrapTNot");function Rfo(t,e){return it.IsNot(t)?Wc(i$r(t),e):it.IsNot(e)?Wc(t,i$r(e)):boe("Invalid fallthrough for Not")}a(Rfo,"FromNot");function Pfo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsRecord(e)?HI(t,e):it.IsNull(e)?Rt.True:Rt.False}a(Pfo,"FromNull");function d$r(t,e){return it.IsLiteralNumber(t)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(d$r,"FromNumberRight");function kfo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsRecord(e)?HI(t,e):it.IsInteger(e)||it.IsNumber(e)?Rt.True:Rt.False}a(kfo,"FromNumber");function rC(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(rC,"IsObjectPropertyCount");function o$r(t){return V9e(t)}a(o$r,"IsObjectStringLike");function s$r(t){return rC(t,0)||rC(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(s$r,"IsObjectSymbolLike");function nkt(t){return rC(t,0)}a(nkt,"IsObjectNumberLike");function a$r(t){return rC(t,0)}a(a$r,"IsObjectBooleanLike");function Dfo(t){return rC(t,0)}a(Dfo,"IsObjectBigIntLike");function Nfo(t){return rC(t,0)}a(Nfo,"IsObjectDateLike");function Mfo(t){return V9e(t)}a(Mfo,"IsObjectUint8ArrayLike");function Ofo(t){let e=FI();return rC(t,0)||rC(t,1)&&"length"in t.properties&&jI(Wc(t.properties.length,e))===Rt.True}a(Ofo,"IsObjectFunctionLike");function Bfo(t){return rC(t,0)}a(Bfo,"IsObjectConstructorLike");function V9e(t){let e=FI();return rC(t,0)||rC(t,1)&&"length"in t.properties&&jI(Wc(t.properties.length,e))===Rt.True}a(V9e,"IsObjectArrayLike");function Lfo(t){let e=zN([iU()],iU());return rC(t,0)||rC(t,1)&&"then"in t.properties&&jI(Wc(t.properties.then,e))===Rt.True}a(Lfo,"IsObjectPromiseLike");function f$r(t,e){return Wc(t,e)===Rt.False||it.IsOptional(t)&&!it.IsOptional(e)?Rt.False:Rt.True}a(f$r,"Property");function Py(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)||it.IsLiteralString(t)&&o$r(e)||it.IsLiteralNumber(t)&&nkt(e)||it.IsLiteralBoolean(t)&&a$r(e)||it.IsSymbol(t)&&s$r(e)||it.IsBigInt(t)&&Dfo(e)||it.IsString(t)&&o$r(e)||it.IsSymbol(t)&&s$r(e)||it.IsNumber(t)&&nkt(e)||it.IsInteger(t)&&nkt(e)||it.IsBoolean(t)&&a$r(e)||it.IsUint8Array(t)&&Mfo(e)||it.IsDate(t)&&Nfo(e)||it.IsConstructor(t)&&Bfo(e)||it.IsFunction(t)&&Ofo(e)?Rt.True:it.IsRecord(t)&&it.IsString(okt(t))?e[LI]==="Record"?Rt.True:Rt.False:it.IsRecord(t)&&it.IsNumber(okt(t))&&rC(e,0)?Rt.True:Rt.False}a(Py,"FromObjectRight");function Ffo(t,e){return vh(e)?Ch(t,e):it.IsRecord(e)?HI(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(f$r(t.properties[r],e.properties[r])===Rt.False)return Rt.False}return Rt.True})():Rt.False}a(Ffo,"FromObject");function Ufo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)&&Lfo(e)?Rt.True:it.IsPromise(e)?jI(Wc(t.item,e.item)):Rt.False}a(Ufo,"FromPromise");function okt(t){return rU in t.patternProperties?FI():nU in t.patternProperties?f_():boe("Unknown record key pattern")}a(okt,"RecordKey");function skt(t){return rU in t.patternProperties?t.patternProperties[rU]:nU in t.patternProperties?t.patternProperties[nU]:boe("Unable to get record value schema")}a(skt,"RecordValue");function HI(t,e){let[r,n]=[okt(e),skt(e)];return it.IsLiteralString(t)&&it.IsNumber(r)&&jI(Wc(t,n))===Rt.True?Rt.True:it.IsUint8Array(t)&&it.IsNumber(r)||it.IsString(t)&&it.IsNumber(r)||it.IsArray(t)&&it.IsNumber(r)?Wc(t,n):it.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(f$r(n,t.properties[o])===Rt.False)return Rt.False;return Rt.True})():Rt.False}a(HI,"FromRecordRight");function Qfo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsRecord(e)?Wc(skt(t),skt(e)):Rt.False}a(Qfo,"FromRecord");function qfo(t,e){let r=it.IsRegExp(t)?f_():t,n=it.IsRegExp(e)?f_():e;return Wc(r,n)}a(qfo,"FromRegExp");function p$r(t,e){return it.IsLiteral(t)&&xy.IsString(t.const)||it.IsString(t)?Rt.True:Rt.False}a(p$r,"FromStringRight");function jfo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsRecord(e)?HI(t,e):it.IsString(e)?Rt.True:Rt.False}a(jfo,"FromString");function Hfo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsRecord(e)?HI(t,e):it.IsSymbol(e)?Rt.True:Rt.False}a(Hfo,"FromSymbol");function Gfo(t,e){return it.IsTemplateLiteral(t)?Wc(bW(t),e):it.IsTemplateLiteral(e)?Wc(t,bW(e)):boe("Invalid fallthrough for TemplateLiteral")}a(Gfo,"FromTemplateLiteral");function $fo(t,e){return it.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Wc(r,e.items)===Rt.True)}a($fo,"IsArrayOfTuple");function Vfo(t,e){return it.IsNever(t)?Rt.True:it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:Rt.False}a(Vfo,"FromTupleRight");function Wfo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)&&V9e(e)||it.IsArray(e)&&$fo(t,e)?Rt.True:it.IsTuple(e)?xy.IsUndefined(t.items)&&!xy.IsUndefined(e.items)||!xy.IsUndefined(t.items)&&xy.IsUndefined(e.items)?Rt.False:xy.IsUndefined(t.items)&&!xy.IsUndefined(e.items)||t.items.every((r,n)=>Wc(r,e.items[n])===Rt.True)?Rt.True:Rt.False:Rt.False}a(Wfo,"FromTuple");function zfo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsRecord(e)?HI(t,e):it.IsUint8Array(e)?Rt.True:Rt.False}a(zfo,"FromUint8Array");function Yfo(t,e){return vh(e)?Ch(t,e):it.IsObject(e)?Py(t,e):it.IsRecord(e)?HI(t,e):it.IsVoid(e)?Zfo(t,e):it.IsUndefined(e)?Rt.True:Rt.False}a(Yfo,"FromUndefined");function ckt(t,e){return e.anyOf.some(r=>Wc(t,r)===Rt.True)?Rt.True:Rt.False}a(ckt,"FromUnionRight");function Kfo(t,e){return t.anyOf.every(r=>Wc(r,e)===Rt.True)?Rt.True:Rt.False}a(Kfo,"FromUnion");function h$r(t,e){return Rt.True}a(h$r,"FromUnknownRight");function Jfo(t,e){return it.IsNever(e)?u$r(t,e):it.IsIntersect(e)?$9e(t,e):it.IsUnion(e)?ckt(t,e):it.IsAny(e)?akt(t,e):it.IsString(e)?p$r(t,e):it.IsNumber(e)?d$r(t,e):it.IsInteger(e)?l$r(t,e):it.IsBoolean(e)?c$r(t,e):it.IsArray(e)?gfo(t,e):it.IsTuple(e)?Vfo(t,e):it.IsObject(e)?Py(t,e):it.IsUnknown(e)?Rt.True:Rt.False}a(Jfo,"FromUnknown");function Zfo(t,e){return it.IsUndefined(t)||it.IsUndefined(t)?Rt.True:Rt.False}a(Zfo,"FromVoidRight");function Xfo(t,e){return it.IsIntersect(e)?$9e(t,e):it.IsUnion(e)?ckt(t,e):it.IsUnknown(e)?h$r(t,e):it.IsAny(e)?akt(t,e):it.IsObject(e)?Py(t,e):it.IsVoid(e)?Rt.True:Rt.False}a(Xfo,"FromVoid");function Wc(t,e){return it.IsTemplateLiteral(t)||it.IsTemplateLiteral(e)?Gfo(t,e):it.IsRegExp(t)||it.IsRegExp(e)?qfo(t,e):it.IsNot(t)||it.IsNot(e)?Rfo(t,e):it.IsAny(t)?mfo(t,e):it.IsArray(t)?Afo(t,e):it.IsBigInt(t)?Efo(t,e):it.IsBoolean(t)?_fo(t,e):it.IsAsyncIterator(t)?yfo(t,e):it.IsConstructor(t)?vfo(t,e):it.IsDate(t)?Cfo(t,e):it.IsFunction(t)?bfo(t,e):it.IsInteger(t)?Sfo(t,e):it.IsIntersect(t)?Tfo(t,e):it.IsIterator(t)?Ifo(t,e):it.IsLiteral(t)?xfo(t,e):it.IsNever(t)?wfo(t,e):it.IsNull(t)?Pfo(t,e):it.IsNumber(t)?kfo(t,e):it.IsObject(t)?Ffo(t,e):it.IsRecord(t)?Qfo(t,e):it.IsString(t)?jfo(t,e):it.IsSymbol(t)?Hfo(t,e):it.IsTuple(t)?Wfo(t,e):it.IsPromise(t)?Ufo(t,e):it.IsUint8Array(t)?zfo(t,e):it.IsUndefined(t)?Yfo(t,e):it.IsUnion(t)?Kfo(t,e):it.IsUnknown(t)?Jfo(t,e):it.IsVoid(t)?Xfo(t,e):boe(`Unknown left type operand '${t[Tt]}'`)}a(Wc,"Visit");function sU(t,e){return Wc(t,e)}a(sU,"ExtendsCheck");p();p();p();function epo(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=Soe(t[c],e,r,n,Mu(o));return s}a(epo,"FromProperties");function tpo(t,e,r,n,o){return epo(t.properties,e,r,n,o)}a(tpo,"FromMappedResult");function m$r(t,e,r,n,o){let s=tpo(t,e,r,n,o);return Fa(s)}a(m$r,"ExtendsFromMappedResult");function rpo(t,e,r,n){let o=sU(t,e);return o===Rt.Union?Xa([r,n]):o===Rt.True?r:n}a(rpo,"ExtendsResolve");function Soe(t,e,r,n,o){return Bu(t)?m$r(t,e,r,n,o):D1(t)?wt(g$r(t,e,r,n,o)):wt(rpo(t,e,r,n),o)}a(Soe,"Extends");function npo(t,e,r,n,o){return{[t]:Soe(oa(t),e,r,n,Mu(o))}}a(npo,"FromPropertyKey");function ipo(t,e,r,n,o){return t.reduce((s,c)=>({...s,...npo(c,e,r,n,o)}),{})}a(ipo,"FromPropertyKeys");function opo(t,e,r,n,o){return ipo(t.keys,e,r,n,o)}a(opo,"FromMappedKey");function g$r(t,e,r,n,o){let s=opo(t,e,r,n,o);return Fa(s)}a(g$r,"ExtendsFromMappedKey");p();function spo(t){return t.allOf.every(e=>iL(e))}a(spo,"Intersect");function apo(t){return t.anyOf.some(e=>iL(e))}a(apo,"Union");function cpo(t){return!iL(t.not)}a(cpo,"Not");function iL(t){return t[Tt]==="Intersect"?spo(t):t[Tt]==="Union"?apo(t):t[Tt]==="Not"?cpo(t):t[Tt]==="Undefined"}a(iL,"ExtendsUndefinedCheck");p();function A$r(t,e){return Toe(bW(t),e)}a(A$r,"ExcludeFromTemplateLiteral");function lpo(t,e){let r=t.filter(n=>sU(n,e)===Rt.False);return r.length===1?r[0]:Xa(r)}a(lpo,"ExcludeRest");function Toe(t,e,r={}){return N1(t)?wt(A$r(t,e),r):Bu(t)?wt(y$r(t,e),r):wt(Ca(t)?lpo(t.anyOf,e):sU(t,e)!==Rt.False?Ko():t,r)}a(Toe,"Exclude");function upo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Toe(t[n],e);return r}a(upo,"FromProperties");function dpo(t,e){return upo(t.properties,e)}a(dpo,"FromMappedResult");function y$r(t,e){let r=dpo(t,e);return Fa(r)}a(y$r,"ExcludeFromMappedResult");p();p();p();function E$r(t,e){return Ioe(bW(t),e)}a(E$r,"ExtractFromTemplateLiteral");function fpo(t,e){let r=t.filter(n=>sU(n,e)!==Rt.False);return r.length===1?r[0]:Xa(r)}a(fpo,"ExtractRest");function Ioe(t,e,r){return N1(t)?wt(E$r(t,e),r):Bu(t)?wt(_$r(t,e),r):wt(Ca(t)?fpo(t.anyOf,e):sU(t,e)!==Rt.False?t:Ko(),r)}a(Ioe,"Extract");function ppo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Ioe(t[n],e);return r}a(ppo,"FromProperties");function hpo(t,e){return ppo(t.properties,e)}a(hpo,"FromMappedResult");function _$r(t,e){let r=hpo(t,e);return Fa(r)}a(_$r,"ExtractFromMappedResult");p();function v$r(t,e){return PP(t)?wt(t.returns,e):Ko(e)}a(v$r,"InstanceType");p();p();function W9e(t){return eC(wy(t))}a(W9e,"ReadonlyOptional");p();function SW(t,e,r){return wt({[Tt]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(SW,"RecordCreateFromPattern");function lkt(t,e,r){let n={};for(let o of t)n[o]=e;return ec(n,{...r,[LI]:"Record"})}a(lkt,"RecordCreateFromKeys");function mpo(t,e,r){return N9e(t)?lkt(Xv(t),e,r):SW(t.pattern,e,r)}a(mpo,"FromTemplateLiteralKey");function gpo(t,e,r){return lkt(Xv(Xa(t)),e,r)}a(gpo,"FromUnionKey");function Apo(t,e,r){return lkt([t.toString()],e,r)}a(Apo,"FromLiteralKey");function ypo(t,e,r){return SW(t.source,e,r)}a(ypo,"FromRegExpKey");function Epo(t,e,r){let n=Dp(t.pattern)?nU:t.pattern;return SW(n,e,r)}a(Epo,"FromStringKey");function _po(t,e,r){return SW(nU,e,r)}a(_po,"FromAnyKey");function vpo(t,e,r){return SW(PGr,e,r)}a(vpo,"FromNeverKey");function Cpo(t,e,r){return ec({true:e,false:e},r)}a(Cpo,"FromBooleanKey");function bpo(t,e,r){return SW(rU,e,r)}a(bpo,"FromIntegerKey");function Spo(t,e,r){return SW(rU,e,r)}a(Spo,"FromNumberKey");function z9e(t,e,r={}){return Ca(t)?gpo(t.anyOf,e,r):N1(t)?mpo(t,e,r):k1(t)?Apo(t.const,e,r):ZB(t)?Cpo(t,e,r):DP(t)?bpo(t,e,r):NP(t)?Spo(t,e,r):jPt(t)?ypo(t,e,r):XB(t)?Epo(t,e,r):QPt(t)?_po(t,e,r):eU(t)?vpo(t,e,r):Ko(r)}a(z9e,"Record");function Y9e(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(Y9e,"RecordPattern");function C$r(t){let e=Y9e(t);return e===nU?f_():e===rU?FI():f_({pattern:e})}a(C$r,"RecordKey");function K9e(t){return t.patternProperties[Y9e(t)]}a(K9e,"RecordValue");function Tpo(t,e){return e.parameters=RCe(t,e.parameters),e.returns=BP(t,e.returns),e}a(Tpo,"FromConstructor");function Ipo(t,e){return e.parameters=RCe(t,e.parameters),e.returns=BP(t,e.returns),e}a(Ipo,"FromFunction");function xpo(t,e){return e.allOf=RCe(t,e.allOf),e}a(xpo,"FromIntersect");function wpo(t,e){return e.anyOf=RCe(t,e.anyOf),e}a(wpo,"FromUnion");function Rpo(t,e){return Dp(e.items)||(e.items=RCe(t,e.items)),e}a(Rpo,"FromTuple");function Ppo(t,e){return e.items=BP(t,e.items),e}a(Ppo,"FromArray");function kpo(t,e){return e.items=BP(t,e.items),e}a(kpo,"FromAsyncIterator");function Dpo(t,e){return e.items=BP(t,e.items),e}a(Dpo,"FromIterator");function Npo(t,e){return e.item=BP(t,e.item),e}a(Npo,"FromPromise");function Mpo(t,e){let r=Fpo(t,e.properties);return{...e,...ec(r)}}a(Mpo,"FromObject");function Opo(t,e){let r=BP(t,C$r(e)),n=BP(t,K9e(e)),o=z9e(r,n);return{...e,...o}}a(Opo,"FromRecord");function Bpo(t,e){return e.index in t?t[e.index]:OP()}a(Bpo,"FromArgument");function Lpo(t,e){let r=uoe(e),n=Zv(e),o=BP(t,e);return r&&n?W9e(o):r&&!n?eC(o):!r&&n?wy(o):o}a(Lpo,"FromProperty");function Fpo(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:Lpo(t,e[n])}),{})}a(Fpo,"FromProperties");function RCe(t,e){return e.map(r=>BP(t,r))}a(RCe,"FromTypes");function BP(t,e){return PP(e)?Tpo(t,e):kP(e)?Ipo(t,e):rf(e)?xpo(t,e):Ca(e)?wpo(t,e):M1(e)?Rpo(t,e):wP(e)?Ppo(t,e):AW(e)?kpo(t,e):EW(e)?Dpo(t,e):_W(e)?Npo(t,e):Np(e)?Mpo(t,e):vW(e)?Opo(t,e):qPt(e)?Bpo(t,e):e}a(BP,"FromType");function b$r(t,e){return BP(e,coe(t))}a(b$r,"Instantiate");p();function S$r(t){return wt({[Tt]:"Integer",type:"integer"},t)}a(S$r,"Integer");p();p();p();function Upo(t,e,r){return{[t]:LP(oa(t),e,Mu(r))}}a(Upo,"MappedIntrinsicPropertyKey");function Qpo(t,e,r){return t.reduce((o,s)=>({...o,...Upo(s,e,r)}),{})}a(Qpo,"MappedIntrinsicPropertyKeys");function qpo(t,e,r){return Qpo(t.keys,e,r)}a(qpo,"MappedIntrinsicProperties");function T$r(t,e,r){let n=qpo(t,e,r);return Fa(n)}a(T$r,"IntrinsicFromMappedKey");function jpo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(jpo,"ApplyUncapitalize");function Hpo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(Hpo,"ApplyCapitalize");function Gpo(t){return t.toUpperCase()}a(Gpo,"ApplyUppercase");function $po(t){return t.toLowerCase()}a($po,"ApplyLowercase");function Vpo(t,e,r){let n=Aoe(t.pattern);if(!CW(n))return{...t,pattern:I$r(t.pattern,e)};let c=[...TCe(n)].map(d=>oa(d)),l=x$r(c,e),u=Xa(l);return O9e([u],r)}a(Vpo,"FromTemplateLiteral");function I$r(t,e){return typeof t=="string"?e==="Uncapitalize"?jpo(t):e==="Capitalize"?Hpo(t):e==="Uppercase"?Gpo(t):e==="Lowercase"?$po(t):t:t.toString()}a(I$r,"FromLiteralValue");function x$r(t,e){return t.map(r=>LP(r,e))}a(x$r,"FromRest");function LP(t,e,r={}){return D1(t)?T$r(t,e,r):N1(t)?Vpo(t,e,r):Ca(t)?Xa(x$r(t.anyOf,e),r):k1(t)?oa(I$r(t.const,e),r):wt(t,r)}a(LP,"Intrinsic");function w$r(t,e={}){return LP(t,"Capitalize",e)}a(w$r,"Capitalize");p();function R$r(t,e={}){return LP(t,"Lowercase",e)}a(R$r,"Lowercase");p();function P$r(t,e={}){return LP(t,"Uncapitalize",e)}a(P$r,"Uncapitalize");p();function k$r(t,e={}){return LP(t,"Uppercase",e)}a(k$r,"Uppercase");p();p();p();p();p();function Wpo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=aU(t[o],e,Mu(r));return n}a(Wpo,"FromProperties");function zpo(t,e,r){return Wpo(t.properties,e,r)}a(zpo,"FromMappedResult");function D$r(t,e,r){let n=zpo(t,e,r);return Fa(n)}a(D$r,"OmitFromMappedResult");function Ypo(t,e){return t.map(r=>ukt(r,e))}a(Ypo,"FromIntersect");function Kpo(t,e){return t.map(r=>ukt(r,e))}a(Kpo,"FromUnion");function Jpo(t,e){let{[e]:r,...n}=t;return n}a(Jpo,"FromProperty");function Zpo(t,e){return e.reduce((r,n)=>Jpo(r,n),t)}a(Zpo,"FromProperties");function Xpo(t,e,r){let n=nf(t,[Id,"$id","required","properties"]),o=Zpo(r,e);return ec(o,n)}a(Xpo,"FromObject");function eho(t){let e=t.reduce((r,n)=>P9e(n)?[...r,oa(n)]:r,[]);return Xa(e)}a(eho,"UnionFromPropertyKeys");function ukt(t,e){return rf(t)?Ry(Ypo(t.allOf,e)):Ca(t)?Xa(Kpo(t.anyOf,e)):Np(t)?Xpo(t,e,t.properties):ec({})}a(ukt,"OmitResolve");function aU(t,e,r){let n=kp(e)?eho(e):e,o=xd(e)?Xv(e):e,s=Uf(t),c=Uf(e);return Bu(t)?D$r(t,o,r):D1(e)?N$r(t,e,r):s&&c?ru("Omit",[t,n],r):!s&&c?ru("Omit",[t,n],r):s&&!c?ru("Omit",[t,n],r):wt({...ukt(t,o),...r})}a(aU,"Omit");function tho(t,e,r){return{[e]:aU(t,[e],Mu(r))}}a(tho,"FromPropertyKey");function rho(t,e,r){return e.reduce((n,o)=>({...n,...tho(t,o,r)}),{})}a(rho,"FromPropertyKeys");function nho(t,e,r){return rho(t,e.keys,r)}a(nho,"FromMappedKey");function N$r(t,e,r){let n=nho(t,e,r);return Fa(n)}a(N$r,"OmitFromMappedKey");p();p();p();function iho(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=cU(t[o],e,Mu(r));return n}a(iho,"FromProperties");function oho(t,e,r){return iho(t.properties,e,r)}a(oho,"FromMappedResult");function M$r(t,e,r){let n=oho(t,e,r);return Fa(n)}a(M$r,"PickFromMappedResult");function sho(t,e){return t.map(r=>dkt(r,e))}a(sho,"FromIntersect");function aho(t,e){return t.map(r=>dkt(r,e))}a(aho,"FromUnion");function cho(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(cho,"FromProperties");function lho(t,e,r){let n=nf(t,[Id,"$id","required","properties"]),o=cho(r,e);return ec(o,n)}a(lho,"FromObject");function uho(t){let e=t.reduce((r,n)=>P9e(n)?[...r,oa(n)]:r,[]);return Xa(e)}a(uho,"UnionFromPropertyKeys");function dkt(t,e){return rf(t)?Ry(sho(t.allOf,e)):Ca(t)?Xa(aho(t.anyOf,e)):Np(t)?lho(t,e,t.properties):ec({})}a(dkt,"PickResolve");function cU(t,e,r){let n=kp(e)?uho(e):e,o=xd(e)?Xv(e):e,s=Uf(t),c=Uf(e);return Bu(t)?M$r(t,o,r):D1(e)?O$r(t,e,r):s&&c?ru("Pick",[t,n],r):!s&&c?ru("Pick",[t,n],r):s&&!c?ru("Pick",[t,n],r):wt({...dkt(t,o),...r})}a(cU,"Pick");function dho(t,e,r){return{[e]:cU(t,[e],Mu(r))}}a(dho,"FromPropertyKey");function fho(t,e,r){return e.reduce((n,o)=>({...n,...dho(t,o,r)}),{})}a(fho,"FromPropertyKeys");function pho(t,e,r){return fho(t,e.keys,r)}a(pho,"FromMappedKey");function O$r(t,e,r){let n=pho(t,e,r);return Fa(n)}a(O$r,"PickFromMappedKey");p();p();function hho(t,e){return ru("Partial",[ru(t,e)])}a(hho,"FromComputed");function mho(t){return ru("Partial",[qI(t)])}a(mho,"FromRef");function gho(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=wy(t[r]);return e}a(gho,"FromProperties");function Aho(t,e){let r=nf(t,[Id,"$id","required","properties"]),n=gho(e);return ec(n,r)}a(Aho,"FromObject");function B$r(t){return t.map(e=>L$r(e))}a(B$r,"FromRest");function L$r(t){return RP(t)?hho(t.target,t.parameters):Uf(t)?mho(t.$ref):rf(t)?Ry(B$r(t.allOf)):Ca(t)?Xa(B$r(t.anyOf)):Np(t)?Aho(t,t.properties):yW(t)||ZB(t)||DP(t)||k1(t)||yCe(t)||NP(t)||XB(t)||ECe(t)||eL(t)?t:ec({})}a(L$r,"PartialResolve");function xoe(t,e){return Bu(t)?F$r(t,e):wt({...L$r(t),...e})}a(xoe,"Partial");function yho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=xoe(t[n],Mu(e));return r}a(yho,"FromProperties");function Eho(t,e){return yho(t.properties,e)}a(Eho,"FromMappedResult");function F$r(t,e){let r=Eho(t,e);return Fa(r)}a(F$r,"PartialFromMappedResult");p();p();function _ho(t,e){return ru("Required",[ru(t,e)])}a(_ho,"FromComputed");function vho(t){return ru("Required",[qI(t)])}a(vho,"FromRef");function Cho(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=nf(t[r],[iA]);return e}a(Cho,"FromProperties");function bho(t,e){let r=nf(t,[Id,"$id","required","properties"]),n=Cho(e);return ec(n,r)}a(bho,"FromObject");function U$r(t){return t.map(e=>Q$r(e))}a(U$r,"FromRest");function Q$r(t){return RP(t)?_ho(t.target,t.parameters):Uf(t)?vho(t.$ref):rf(t)?Ry(U$r(t.allOf)):Ca(t)?Xa(U$r(t.anyOf)):Np(t)?bho(t,t.properties):yW(t)||ZB(t)||DP(t)||k1(t)||yCe(t)||NP(t)||XB(t)||ECe(t)||eL(t)?t:ec({})}a(Q$r,"RequiredResolve");function woe(t,e){return Bu(t)?q$r(t,e):wt({...Q$r(t),...e})}a(woe,"Required");function Sho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=woe(t[n],e);return r}a(Sho,"FromProperties");function Tho(t,e){return Sho(t.properties,e)}a(Tho,"FromMappedResult");function q$r(t,e){let r=Tho(t,e);return Fa(r)}a(q$r,"RequiredFromMappedResult");function Iho(t,e){return e.map(r=>Uf(r)?fkt(t,r.$ref):O1(t,r))}a(Iho,"DereferenceParameters");function fkt(t,e){return e in t?Uf(t[e])?fkt(t,t[e].$ref):O1(t,t[e]):Ko()}a(fkt,"Dereference");function xho(t){return voe(t[0])}a(xho,"FromAwaited");function who(t){return oU(t[0],t[1])}a(who,"FromIndex");function Rho(t){return Coe(t[0])}a(Rho,"FromKeyOf");function Pho(t){return xoe(t[0])}a(Pho,"FromPartial");function kho(t){return aU(t[0],t[1])}a(kho,"FromOmit");function Dho(t){return cU(t[0],t[1])}a(Dho,"FromPick");function Nho(t){return woe(t[0])}a(Nho,"FromRequired");function Mho(t,e,r){let n=Iho(t,r);return e==="Awaited"?xho(n):e==="Index"?who(n):e==="KeyOf"?Rho(n):e==="Partial"?Pho(n):e==="Omit"?kho(n):e==="Pick"?Dho(n):e==="Required"?Nho(n):Ko()}a(Mho,"FromComputed");function Oho(t,e){return poe(O1(t,e))}a(Oho,"FromArray");function Bho(t,e){return hoe(O1(t,e))}a(Bho,"FromAsyncIterator");function Lho(t,e,r){return moe(PCe(t,e),O1(t,r))}a(Lho,"FromConstructor");function Fho(t,e,r){return zN(PCe(t,e),O1(t,r))}a(Fho,"FromFunction");function Uho(t,e){return Ry(PCe(t,e))}a(Uho,"FromIntersect");function Qho(t,e){return _oe(O1(t,e))}a(Qho,"FromIterator");function qho(t,e){return ec(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:O1(t,e[n])}),{}))}a(qho,"FromObject");function jho(t,e){let[r,n]=[O1(t,K9e(e)),Y9e(e)],o=coe(e);return o.patternProperties[n]=r,o}a(jho,"FromRecord");function Hho(t,e){return Uf(e)?{...fkt(t,e.$ref),[Id]:e[Id]}:e}a(Hho,"FromTransform");function Gho(t,e){return UI(PCe(t,e))}a(Gho,"FromTuple");function $ho(t,e){return Xa(PCe(t,e))}a($ho,"FromUnion");function PCe(t,e){return e.map(r=>O1(t,r))}a(PCe,"FromTypes");function O1(t,e){return Zv(e)?wt(O1(t,nf(e,[iA])),e):uoe(e)?wt(O1(t,nf(e,[xP])),e):Za(e)?wt(Hho(t,e),e):wP(e)?wt(Oho(t,e.items),e):AW(e)?wt(Bho(t,e.items),e):RP(e)?wt(Mho(t,e.target,e.parameters)):PP(e)?wt(Lho(t,e.parameters,e.returns),e):kP(e)?wt(Fho(t,e.parameters,e.returns),e):rf(e)?wt(Uho(t,e.allOf),e):EW(e)?wt(Qho(t,e.items),e):Np(e)?wt(qho(t,e.properties),e):vW(e)?wt(jho(t,e)):M1(e)?wt(Gho(t,e.items||[]),e):Ca(e)?wt($ho(t,e.anyOf),e):e}a(O1,"FromType");function Vho(t,e){return e in t?O1(t,t[e]):Ko()}a(Vho,"ComputeType");function j$r(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:Vho(t,r)}),{})}a(j$r,"ComputeModuleProperties");var pkt=class{static{a(this,"TModule")}constructor(e){let r=j$r(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 H$r(t){return new pkt(t)}a(H$r,"Module");p();function G$r(t,e){return wt({[Tt]:"Not",not:t},e)}a(G$r,"Not");p();function $$r(t,e){return kP(t)?UI(t.parameters,e):Ko()}a($$r,"Parameters");p();var Who=0;function V$r(t,e={}){Dp(e.$id)&&(e.$id=`T${Who++}`);let r=coe(t({[Tt]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,wt({[LI]:"Recursive",...r},e)}a(V$r,"Recursive");p();function W$r(t,e){let r=Ml(t)?new globalThis.RegExp(t):t;return wt({[Tt]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(W$r,"RegExp");p();function zho(t){return rf(t)?t.allOf:Ca(t)?t.anyOf:M1(t)?t.items??[]:[]}a(zho,"RestResolve");function z$r(t){return zho(t)}a(z$r,"Rest");p();function Y$r(t,e){return kP(t)?wt(t.returns,e):Ko(e)}a(Y$r,"ReturnType");p();var hkt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new mkt(this.schema,e)}},mkt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[Id].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[Id].Decode(c)),"Decode")};return{...r,[Id]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[Id]:n}}Encode(e){return Za(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function K$r(t){return new hkt(t)}a(K$r,"Transform");p();function J$r(t={}){return wt({[Tt]:t[Tt]??"Unsafe"},t)}a(J$r,"Unsafe");p();function Z$r(t){return wt({[Tt]:"Void",type:"void"},t)}a(Z$r,"Void");p();var gkt={};Ri(gkt,{Any:()=>iU,Argument:()=>OGr,Array:()=>poe,AsyncIterator:()=>hoe,Awaited:()=>voe,BigInt:()=>Eoe,Boolean:()=>M9e,Capitalize:()=>w$r,Composite:()=>e$r,Const:()=>t$r,Constructor:()=>moe,ConstructorParameters:()=>r$r,Date:()=>U9e,Enum:()=>n$r,Exclude:()=>Toe,Extends:()=>Soe,Extract:()=>Ioe,Function:()=>zN,Index:()=>oU,InstanceType:()=>v$r,Instantiate:()=>b$r,Integer:()=>S$r,Intersect:()=>Ry,Iterator:()=>_oe,KeyOf:()=>Coe,Literal:()=>oa,Lowercase:()=>R$r,Mapped:()=>zGr,Module:()=>H$r,Never:()=>Ko,Not:()=>G$r,Null:()=>Q9e,Number:()=>FI,Object:()=>ec,Omit:()=>aU,Optional:()=>wy,Parameters:()=>$$r,Partial:()=>xoe,Pick:()=>cU,Promise:()=>L9e,Readonly:()=>eC,ReadonlyOptional:()=>W9e,Record:()=>z9e,Recursive:()=>V$r,Ref:()=>qI,RegExp:()=>W$r,Required:()=>woe,Rest:()=>z$r,ReturnType:()=>Y$r,String:()=>f_,Symbol:()=>q9e,TemplateLiteral:()=>O9e,Transform:()=>K$r,Tuple:()=>UI,Uint8Array:()=>H9e,Uncapitalize:()=>P$r,Undefined:()=>j9e,Union:()=>Xa,Unknown:()=>OP,Unsafe:()=>J$r,Uppercase:()=>k$r,Void:()=>Z$r});p();var S=gkt;p();p();function Yho(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(Yho,"DefaultErrorFunction");var Kho=Yho;function X$r(){return Kho}a(X$r,"GetErrorFunction");p();var Akt=class extends qi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function Jho(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new Akt(t);return ba(r,e)}a(Jho,"Resolve");function Q0(t,e){return!va(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Q0,"Pushref");function ba(t,e){return t[Tt]==="This"||t[Tt]==="Ref"?Jho(t,e):t}a(ba,"Deref");p();var ykt=class extends qi{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}},B1;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(B1||(B1={}));var Roe=BigInt("14695981039346656037"),[Zho,Xho]=[BigInt("1099511628211"),BigInt("18446744073709551616")],emo=Array.from({length:256}).map((t,e)=>BigInt(e)),eVr=new Float64Array(1),tVr=new DataView(eVr.buffer),rVr=new Uint8Array(eVr.buffer);function*tmo(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(tmo,"NumberToBytes");function rmo(t){ky(B1.Array);for(let e of t)Poe(e)}a(rmo,"ArrayType");function nmo(t){ky(B1.Boolean),ky(t?1:0)}a(nmo,"BooleanType");function imo(t){ky(B1.BigInt),tVr.setBigInt64(0,t);for(let e of rVr)ky(e)}a(imo,"BigIntType");function omo(t){ky(B1.Date),Poe(t.getTime())}a(omo,"DateType");function smo(t){ky(B1.Null)}a(smo,"NullType");function amo(t){ky(B1.Number),tVr.setFloat64(0,t);for(let e of rVr)ky(e)}a(amo,"NumberType");function cmo(t){ky(B1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())Poe(e),Poe(t[e])}a(cmo,"ObjectType");function lmo(t){ky(B1.String);for(let e=0;e=t.minItems)||$s(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!q0(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=lU(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!($s(t.contains)||ai(t.minContains)||ai(t.maxContains)))return!0;let n=$s(t.contains)?t.contains:Ko(),o=r.reduce((s,c)=>q0(n,e,c)?s+1:s,0);return!(o===0||ai(t.minContains)&&ot.maxContains)}a(gmo,"FromArray");function Amo(t,e,r){return I9e(r)}a(Amo,"FromAsyncIterator");function ymo(t,e,r){return!(!nA(r)||$s(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||$s(t.maximum)&&!(r<=t.maximum)||$s(t.minimum)&&!(r>=t.minimum)||$s(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(ymo,"FromBigInt");function Emo(t,e,r){return WN(r)}a(Emo,"FromBoolean");function _mo(t,e,r){return q0(t.returns,e,r.prototype)}a(_mo,"FromConstructor");function vmo(t,e,r){return!(!u_(r)||$s(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||$s(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||$s(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||$s(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(vmo,"FromDate");function Cmo(t,e,r){return X9(r)}a(Cmo,"FromFunction");function bmo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return q0(o,[...e,...n],r)}a(bmo,"FromImport");function Smo(t,e,r){return!(!R9e(r)||$s(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||$s(t.maximum)&&!(r<=t.maximum)||$s(t.minimum)&&!(r>=t.minimum)||$s(t.multipleOf)&&r%t.multipleOf!==0)}a(Smo,"FromInteger");function Tmo(t,e,r){let n=t.allOf.every(o=>q0(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(nL(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(xd(t.unevaluatedProperties)){let o=new RegExp(nL(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||q0(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(Tmo,"FromIntersect");function Imo(t,e,r){return x9e(r)}a(Imo,"FromIterator");function xmo(t,e,r){return r===t.const}a(xmo,"FromLiteral");function wmo(t,e,r){return!1}a(wmo,"FromNever");function Rmo(t,e,r){return!q0(t.not,e,r)}a(Rmo,"FromNot");function Pmo(t,e,r){return KB(r)}a(Pmo,"FromNull");function kmo(t,e,r){return!(!tu.IsNumberLike(r)||$s(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||$s(t.minimum)&&!(r>=t.minimum)||$s(t.maximum)&&!(r<=t.maximum)||$s(t.multipleOf)&&r%t.multipleOf!==0)}a(kmo,"FromNumber");function Dmo(t,e,r){if(!tu.IsObjectLike(r)||$s(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||$s(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(!q0(s,e,r[o])||(iL(s)||pmo(s))&&!(o in r))return!1}else if(tu.IsExactOptionalProperty(r,o)&&!q0(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)||q0(t.additionalProperties,e,r[s])):!0}a(Dmo,"FromObject");function Nmo(t,e,r){return w9e(r)}a(Nmo,"FromPromise");function Mmo(t,e,r){if(!tu.IsRecordLike(r)||$s(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||$s(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)?q0(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:q0(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(Mmo,"FromRecord");function Omo(t,e,r){return q0(ba(t,e),e,r)}a(Omo,"FromRef");function Bmo(t,e,r){let n=new RegExp(t.source,t.flags);return $s(t.minLength)&&!(r.length>=t.minLength)||$s(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(Bmo,"FromRegExp");function Lmo(t,e,r){return!va(r)||$s(t.minLength)&&!(r.length>=t.minLength)||$s(t.maxLength)&&!(r.length<=t.maxLength)||$s(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:$s(t.format)?MP.Has(t.format)?MP.Get(t.format)(r):!1:!0}a(Lmo,"FromString");function Fmo(t,e,r){return JB(r)}a(Fmo,"FromSymbol");function Umo(t,e,r){return va(r)&&new RegExp(t.pattern).test(r)}a(Umo,"FromTemplateLiteral");function Qmo(t,e,r){return q0(ba(t,e),e,r)}a(Qmo,"FromThis");function qmo(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;nq0(n,e,r))}a(Hmo,"FromUnion");function Gmo(t,e,r){return!(!loe(r)||$s(t.maxByteLength)&&!(r.length<=t.maxByteLength)||$s(t.minByteLength)&&!(r.length>=t.minByteLength))}a(Gmo,"FromUint8Array");function $mo(t,e,r){return!0}a($mo,"FromUnknown");function Vmo(t,e,r){return tu.IsVoidLike(r)}a(Vmo,"FromVoid");function Wmo(t,e,r){return d_.Has(t[Tt])?d_.Get(t[Tt])(t,r):!1}a(Wmo,"FromKind");function q0(t,e,r){let n=$s(t.$id)?Q0(t,e):e,o=t;switch(o[Tt]){case"Any":return hmo(o,n,r);case"Argument":return mmo(o,n,r);case"Array":return gmo(o,n,r);case"AsyncIterator":return Amo(o,n,r);case"BigInt":return ymo(o,n,r);case"Boolean":return Emo(o,n,r);case"Constructor":return _mo(o,n,r);case"Date":return vmo(o,n,r);case"Function":return Cmo(o,n,r);case"Import":return bmo(o,n,r);case"Integer":return Smo(o,n,r);case"Intersect":return Tmo(o,n,r);case"Iterator":return Imo(o,n,r);case"Literal":return xmo(o,n,r);case"Never":return wmo(o,n,r);case"Not":return Rmo(o,n,r);case"Null":return Pmo(o,n,r);case"Number":return kmo(o,n,r);case"Object":return Dmo(o,n,r);case"Promise":return Nmo(o,n,r);case"Record":return Mmo(o,n,r);case"Ref":return Omo(o,n,r);case"RegExp":return Bmo(o,n,r);case"String":return Lmo(o,n,r);case"Symbol":return Fmo(o,n,r);case"TemplateLiteral":return Umo(o,n,r);case"This":return Qmo(o,n,r);case"Tuple":return qmo(o,n,r);case"Undefined":return jmo(o,n,r);case"Union":return Hmo(o,n,r);case"Uint8Array":return Gmo(o,n,r);case"Unknown":return $mo(o,n,r);case"Void":return Vmo(o,n,r);default:if(!d_.Has(o[Tt]))throw new Ekt(o);return Wmo(o,n,r)}}a(q0,"Visit");function Jo(...t){return t.length===3?q0(t[0],t[1],t[2]):q0(t[0],[],t[1])}a(Jo,"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 _kt=class extends qi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function oL(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(oL,"EscapeKey");function Vs(t){return t!==void 0}a(Vs,"IsDefined");var uU=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};function on(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:X$r()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(on,"Create");function*zmo(t,e,r,n){}a(zmo,"FromAny");function*Ymo(t,e,r,n){}a(Ymo,"FromArgument");function*Kmo(t,e,r,n){if(!Pi(n))return yield on(St.Array,t,r,n);Vs(t.minItems)&&!(n.length>=t.minItems)&&(yield on(St.ArrayMinItems,t,r,n)),Vs(t.maxItems)&&!(n.length<=t.maxItems)&&(yield on(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 on(St.ArrayContains,t,r,n)),ai(t.minContains)&&st.maxContains&&(yield on(St.ArrayMaxContains,t,r,n))}a(Kmo,"FromArray");function*Jmo(t,e,r,n){I9e(n)||(yield on(St.AsyncIterator,t,r,n))}a(Jmo,"FromAsyncIterator");function*Zmo(t,e,r,n){if(!nA(n))return yield on(St.BigInt,t,r,n);Vs(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield on(St.BigIntExclusiveMinimum,t,r,n)),Vs(t.maximum)&&!(n<=t.maximum)&&(yield on(St.BigIntMaximum,t,r,n)),Vs(t.minimum)&&!(n>=t.minimum)&&(yield on(St.BigIntMinimum,t,r,n)),Vs(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield on(St.BigIntMultipleOf,t,r,n))}a(Zmo,"FromBigInt");function*Xmo(t,e,r,n){WN(n)||(yield on(St.Boolean,t,r,n))}a(Xmo,"FromBoolean");function*e0o(t,e,r,n){yield*j0(t.returns,e,r,n.prototype)}a(e0o,"FromConstructor");function*t0o(t,e,r,n){if(!u_(n))return yield on(St.Date,t,r,n);Vs(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield on(St.DateExclusiveMinimumTimestamp,t,r,n)),Vs(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield on(St.DateMaximumTimestamp,t,r,n)),Vs(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield on(St.DateMinimumTimestamp,t,r,n)),Vs(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield on(St.DateMultipleOfTimestamp,t,r,n))}a(t0o,"FromDate");function*r0o(t,e,r,n){X9(n)||(yield on(St.Function,t,r,n))}a(r0o,"FromFunction");function*n0o(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*j0(s,[...e,...o],r,n)}a(n0o,"FromImport");function*i0o(t,e,r,n){if(!R9e(n))return yield on(St.Integer,t,r,n);Vs(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield on(St.IntegerExclusiveMinimum,t,r,n)),Vs(t.maximum)&&!(n<=t.maximum)&&(yield on(St.IntegerMaximum,t,r,n)),Vs(t.minimum)&&!(n>=t.minimum)&&(yield on(St.IntegerMinimum,t,r,n)),Vs(t.multipleOf)&&n%t.multipleOf!==0&&(yield on(St.IntegerMultipleOf,t,r,n))}a(i0o,"FromInteger");function*o0o(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 on(St.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(nL(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield on(St.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(nL(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(o0o,"FromIntersect");function*s0o(t,e,r,n){x9e(n)||(yield on(St.Iterator,t,r,n))}a(s0o,"FromIterator");function*a0o(t,e,r,n){n!==t.const&&(yield on(St.Literal,t,r,n))}a(a0o,"FromLiteral");function*c0o(t,e,r,n){yield on(St.Never,t,r,n)}a(c0o,"FromNever");function*l0o(t,e,r,n){j0(t.not,e,r,n).next().done===!0&&(yield on(St.Not,t,r,n))}a(l0o,"FromNot");function*u0o(t,e,r,n){KB(n)||(yield on(St.Null,t,r,n))}a(u0o,"FromNull");function*d0o(t,e,r,n){if(!tu.IsNumberLike(n))return yield on(St.Number,t,r,n);Vs(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield on(St.NumberExclusiveMinimum,t,r,n)),Vs(t.maximum)&&!(n<=t.maximum)&&(yield on(St.NumberMaximum,t,r,n)),Vs(t.minimum)&&!(n>=t.minimum)&&(yield on(St.NumberMinimum,t,r,n)),Vs(t.multipleOf)&&n%t.multipleOf!==0&&(yield on(St.NumberMultipleOf,t,r,n))}a(d0o,"FromNumber");function*f0o(t,e,r,n){if(!tu.IsObjectLike(n))return yield on(St.Object,t,r,n);Vs(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield on(St.ObjectMinProperties,t,r,n)),Vs(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield on(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 on(St.ObjectRequiredProperty,t.properties[l],`${r}/${oL(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield on(St.ObjectAdditionalProperties,t,`${r}/${oL(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*j0(t.additionalProperties,e,`${r}/${oL(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*j0(u,e,`${r}/${oL(l)}`,n[l]),iL(t)&&!(l in n)&&(yield on(St.ObjectRequiredProperty,u,`${r}/${oL(l)}`,void 0))):tu.IsExactOptionalProperty(n,l)&&(yield*j0(u,e,`${r}/${oL(l)}`,n[l]))}}a(f0o,"FromObject");function*p0o(t,e,r,n){w9e(n)||(yield on(St.Promise,t,r,n))}a(p0o,"FromPromise");function*h0o(t,e,r,n){if(!tu.IsRecordLike(n))return yield on(St.Object,t,r,n);Vs(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield on(St.ObjectMinProperties,t,r,n)),Vs(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield on(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}/${oL(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*j0(t.additionalProperties,e,`${r}/${oL(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield on(St.ObjectAdditionalProperties,t,`${r}/${oL(l)}`,u)}}a(h0o,"FromRecord");function*m0o(t,e,r,n){yield*j0(ba(t,e),e,r,n)}a(m0o,"FromRef");function*g0o(t,e,r,n){if(!va(n))return yield on(St.String,t,r,n);if(Vs(t.minLength)&&!(n.length>=t.minLength)&&(yield on(St.StringMinLength,t,r,n)),Vs(t.maxLength)&&!(n.length<=t.maxLength)&&(yield on(St.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield on(St.RegExp,t,r,n)}a(g0o,"FromRegExp");function*A0o(t,e,r,n){if(!va(n))return yield on(St.String,t,r,n);Vs(t.minLength)&&!(n.length>=t.minLength)&&(yield on(St.StringMinLength,t,r,n)),Vs(t.maxLength)&&!(n.length<=t.maxLength)&&(yield on(St.StringMaxLength,t,r,n)),va(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield on(St.StringPattern,t,r,n))),va(t.format)&&(MP.Has(t.format)?MP.Get(t.format)(n)||(yield on(St.StringFormat,t,r,n)):yield on(St.StringFormatUnknown,t,r,n))}a(A0o,"FromString");function*y0o(t,e,r,n){JB(n)||(yield on(St.Symbol,t,r,n))}a(y0o,"FromSymbol");function*E0o(t,e,r,n){if(!va(n))return yield on(St.String,t,r,n);new RegExp(t.pattern).test(n)||(yield on(St.StringPattern,t,r,n))}a(E0o,"FromTemplateLiteral");function*_0o(t,e,r,n){yield*j0(ba(t,e),e,r,n)}a(_0o,"FromThis");function*v0o(t,e,r,n){if(!Pi(n))return yield on(St.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield on(St.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield on(St.TupleLength,t,r,n);if(t.items)for(let o=0;onew uU(j0(s,e,r,n)));yield on(St.Union,t,r,n,o)}a(b0o,"FromUnion");function*S0o(t,e,r,n){if(!loe(n))return yield on(St.Uint8Array,t,r,n);Vs(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield on(St.Uint8ArrayMaxByteLength,t,r,n)),Vs(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield on(St.Uint8ArrayMinByteLength,t,r,n))}a(S0o,"FromUint8Array");function*T0o(t,e,r,n){}a(T0o,"FromUnknown");function*I0o(t,e,r,n){tu.IsVoidLike(n)||(yield on(St.Void,t,r,n))}a(I0o,"FromVoid");function*x0o(t,e,r,n){d_.Get(t[Tt])(t,n)||(yield on(St.Kind,t,r,n))}a(x0o,"FromKind");function*j0(t,e,r,n){let o=Vs(t.$id)?[...e,t]:e,s=t;switch(s[Tt]){case"Any":return yield*zmo(s,o,r,n);case"Argument":return yield*Ymo(s,o,r,n);case"Array":return yield*Kmo(s,o,r,n);case"AsyncIterator":return yield*Jmo(s,o,r,n);case"BigInt":return yield*Zmo(s,o,r,n);case"Boolean":return yield*Xmo(s,o,r,n);case"Constructor":return yield*e0o(s,o,r,n);case"Date":return yield*t0o(s,o,r,n);case"Function":return yield*r0o(s,o,r,n);case"Import":return yield*n0o(s,o,r,n);case"Integer":return yield*i0o(s,o,r,n);case"Intersect":return yield*o0o(s,o,r,n);case"Iterator":return yield*s0o(s,o,r,n);case"Literal":return yield*a0o(s,o,r,n);case"Never":return yield*c0o(s,o,r,n);case"Not":return yield*l0o(s,o,r,n);case"Null":return yield*u0o(s,o,r,n);case"Number":return yield*d0o(s,o,r,n);case"Object":return yield*f0o(s,o,r,n);case"Promise":return yield*p0o(s,o,r,n);case"Record":return yield*h0o(s,o,r,n);case"Ref":return yield*m0o(s,o,r,n);case"RegExp":return yield*g0o(s,o,r,n);case"String":return yield*A0o(s,o,r,n);case"Symbol":return yield*y0o(s,o,r,n);case"TemplateLiteral":return yield*E0o(s,o,r,n);case"This":return yield*_0o(s,o,r,n);case"Tuple":return yield*v0o(s,o,r,n);case"Undefined":return yield*C0o(s,o,r,n);case"Union":return yield*b0o(s,o,r,n);case"Uint8Array":return yield*S0o(s,o,r,n);case"Unknown":return yield*T0o(s,o,r,n);case"Void":return yield*I0o(s,o,r,n);default:if(!d_.Has(s[Tt]))throw new _kt(t);return yield*x0o(s,o,r,n)}}a(j0,"Visit");function KN(...t){let e=t.length===3?j0(t[0],t[1],"",t[2]):j0(t[0],[],"",t[1]);return new uU(e)}a(KN,"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}},vkt=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 wd(t,e,r){try{return Za(t)?t[Id].Decode(r):r}catch(n){throw new vkt(t,e,r,n)}}a(wd,"Default");function w0o(t,e,r,n){return Pi(n)?wd(t,r,n.map((o,s)=>FP(t.items,e,`${r}/${s}`,o))):wd(t,r,n)}a(w0o,"FromArray");function R0o(t,e,r,n){if(!bo(n)||P1(n))return wd(t,r,n);let o=F9e(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=FP(h,e,`${r}/${f}`,c[f]));if(!Za(t.unevaluatedProperties))return wd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=wd(u,`${r}/${f}`,d[f]));return wd(t,r,d)}a(R0o,"FromIntersect");function P0o(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=FP(s,[...e,...o],r,n);return wd(t,r,c)}a(P0o,"FromImport");function k0o(t,e,r,n){return wd(t,r,FP(t.not,e,r,n))}a(k0o,"FromNot");function D0o(t,e,r,n){if(!bo(n))return wd(t,r,n);let o=tC(t),s={...n};for(let d of o)Qi(s,d)&&(Ou(s[d])&&(!eL(t.properties[d])||tu.IsExactOptionalProperty(s,d))||(s[d]=FP(t.properties[d],e,`${r}/${d}`,s[d])));if(!xd(t.additionalProperties))return wd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=wd(l,`${r}/${d}`,u[d]));return wd(t,r,u)}a(D0o,"FromObject");function N0o(t,e,r,n){if(!bo(n))return wd(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]=FP(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!xd(t.additionalProperties))return wd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=wd(u,`${r}/${f}`,d[f]));return wd(t,r,d)}a(N0o,"FromRecord");function M0o(t,e,r,n){let o=ba(t,e);return wd(t,r,FP(o,e,r,n))}a(M0o,"FromRef");function O0o(t,e,r,n){let o=ba(t,e);return wd(t,r,FP(o,e,r,n))}a(O0o,"FromThis");function B0o(t,e,r,n){return Pi(n)&&Pi(t.items)?wd(t,r,t.items.map((o,s)=>FP(o,e,`${r}/${s}`,n[s]))):wd(t,r,n)}a(B0o,"FromTuple");function L0o(t,e,r,n){for(let o of t.anyOf){if(!Jo(o,e,n))continue;let s=FP(o,e,r,n);return wd(t,r,s)}return wd(t,r,n)}a(L0o,"FromUnion");function FP(t,e,r,n){let o=Q0(t,e),s=t;switch(t[Tt]){case"Array":return w0o(s,o,r,n);case"Import":return P0o(s,o,r,n);case"Intersect":return R0o(s,o,r,n);case"Not":return k0o(s,o,r,n);case"Object":return D0o(s,o,r,n);case"Record":return N0o(s,o,r,n);case"Ref":return M0o(s,o,r,n);case"Symbol":return wd(s,r,n);case"This":return O0o(s,o,r,n);case"Tuple":return B0o(s,o,r,n);case"Union":return L0o(s,o,r,n);default:return wd(s,r,n)}}a(FP,"Visit");function Doe(t,e,r){return FP(t,e,"",r)}a(Doe,"TransformDecode");p();var Noe=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}},Ckt=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 oA(t,e,r){try{return Za(t)?t[Id].Encode(r):r}catch(n){throw new Ckt(t,e,r,n)}}a(oA,"Default");function F0o(t,e,r,n){let o=oA(t,r,n);return Pi(o)?o.map((s,c)=>UP(t.items,e,`${r}/${c}`,s)):o}a(F0o,"FromArray");function U0o(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=oA(t,r,n);return UP(s,[...e,...o],r,c)}a(U0o,"FromImport");function Q0o(t,e,r,n){let o=oA(t,r,n);if(!bo(n)||P1(n))return o;let s=F9e(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=UP(m,e,`${r}/${h}`,l[h]));if(!Za(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=oA(d,`${r}/${h}`,f[h]));return f}a(Q0o,"FromIntersect");function q0o(t,e,r,n){return oA(t.not,r,oA(t,r,n))}a(q0o,"FromNot");function j0o(t,e,r,n){let o=oA(t,r,n);if(!bo(o))return o;let s=tC(t),c={...o};for(let f of s)Qi(c,f)&&(Ou(c[f])&&(!eL(t.properties[f])||tu.IsExactOptionalProperty(c,f))||(c[f]=UP(t.properties[f],e,`${r}/${f}`,c[f])));if(!xd(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=oA(u,`${r}/${f}`,d[f]));return d}a(j0o,"FromObject");function H0o(t,e,r,n){let o=oA(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]=UP(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!xd(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=oA(d,`${r}/${h}`,f[h]));return f}a(H0o,"FromRecord");function G0o(t,e,r,n){let o=ba(t,e),s=UP(o,e,r,n);return oA(t,r,s)}a(G0o,"FromRef");function $0o(t,e,r,n){let o=ba(t,e),s=UP(o,e,r,n);return oA(t,r,s)}a($0o,"FromThis");function V0o(t,e,r,n){let o=oA(t,r,n);return Pi(t.items)?t.items.map((s,c)=>UP(s,e,`${r}/${c}`,o[c])):[]}a(V0o,"FromTuple");function W0o(t,e,r,n){for(let o of t.anyOf){if(!Jo(o,e,n))continue;let s=UP(o,e,r,n);return oA(t,r,s)}for(let o of t.anyOf){let s=UP(o,e,r,n);if(Jo(t,e,s))return oA(t,r,s)}return oA(t,r,n)}a(W0o,"FromUnion");function UP(t,e,r,n){let o=Q0(t,e),s=t;switch(t[Tt]){case"Array":return F0o(s,o,r,n);case"Import":return U0o(s,o,r,n);case"Intersect":return Q0o(s,o,r,n);case"Not":return q0o(s,o,r,n);case"Object":return j0o(s,o,r,n);case"Record":return H0o(s,o,r,n);case"Ref":return G0o(s,o,r,n);case"This":return $0o(s,o,r,n);case"Tuple":return V0o(s,o,r,n);case"Union":return W0o(s,o,r,n);default:return oA(s,r,n)}}a(UP,"Visit");function Moe(t,e,r){return UP(t,e,"",r)}a(Moe,"TransformEncode");p();function z0o(t,e){return Za(t)||Bm(t.items,e)}a(z0o,"FromArray");function Y0o(t,e){return Za(t)||Bm(t.items,e)}a(Y0o,"FromAsyncIterator");function K0o(t,e){return Za(t)||Bm(t.returns,e)||t.parameters.some(r=>Bm(r,e))}a(K0o,"FromConstructor");function J0o(t,e){return Za(t)||Bm(t.returns,e)||t.parameters.some(r=>Bm(r,e))}a(J0o,"FromFunction");function Z0o(t,e){return Za(t)||Za(t.unevaluatedProperties)||t.allOf.some(r=>Bm(r,e))}a(Z0o,"FromIntersect");function X0o(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return Za(t)||Bm(n,[...r,...e])}a(X0o,"FromImport");function ego(t,e){return Za(t)||Bm(t.items,e)}a(ego,"FromIterator");function tgo(t,e){return Za(t)||Bm(t.not,e)}a(tgo,"FromNot");function rgo(t,e){return Za(t)||Object.values(t.properties).some(r=>Bm(r,e))||xd(t.additionalProperties)&&Bm(t.additionalProperties,e)}a(rgo,"FromObject");function ngo(t,e){return Za(t)||Bm(t.item,e)}a(ngo,"FromPromise");function igo(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return Za(t)||Bm(n,e)||xd(t.additionalProperties)&&Za(t.additionalProperties)}a(igo,"FromRecord");function ogo(t,e){return Za(t)?!0:Bm(ba(t,e),e)}a(ogo,"FromRef");function sgo(t,e){return Za(t)?!0:Bm(ba(t,e),e)}a(sgo,"FromThis");function ago(t,e){return Za(t)||!Ou(t.items)&&t.items.some(r=>Bm(r,e))}a(ago,"FromTuple");function cgo(t,e){return Za(t)||t.anyOf.some(r=>Bm(r,e))}a(cgo,"FromUnion");function Bm(t,e){let r=Q0(t,e),n=t;if(t.$id&&bkt.has(t.$id))return!1;switch(t.$id&&bkt.add(t.$id),t[Tt]){case"Array":return z0o(n,r);case"AsyncIterator":return Y0o(n,r);case"Constructor":return K0o(n,r);case"Function":return J0o(n,r);case"Import":return X0o(n,r);case"Intersect":return Z0o(n,r);case"Iterator":return ego(n,r);case"Not":return tgo(n,r);case"Object":return rgo(n,r);case"Promise":return ngo(n,r);case"Record":return igo(n,r);case"Ref":return ogo(n,r);case"This":return sgo(n,r);case"Tuple":return ago(n,r);case"Union":return cgo(n,r);default:return Za(t)}}a(Bm,"Visit");var bkt=new Set;function sL(t,e){return bkt.clear(),Bm(t,e)}a(sL,"HasTransform");var Skt=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=sL(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return KN(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?Doe(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?Moe(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new Noe(this.schema,e,this.Errors(e).First());return r}},aL;(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})(aL||(aL={}));var J9e;(function(t){function e(s){return s.length===0?!1:aL.IsNumeric(s.charCodeAt(0))}a(e,"IsFirstCharacterNumeric");function r(s){if(e(s))return!1;for(let c=0;c= ${Z.minItems}`);let ue=J(Z.items,ee,"value");if(yield`((array) => { for(const ${he} of array) if(!(${ue})) { return false }; return true; })(${K})`,Lu(Z.contains)||ai(Z.minContains)||ai(Z.maxContains)){let je=Lu(Z.contains)?Z.contains:Ko(),ie=J(je,ee,"value"),le=ai(Z.minContains)?[`(count >= ${Z.minContains})`]:[],Ne=ai(Z.maxContains)?[`(count <= ${Z.maxContains})`]:[],we=`const count = value.reduce((${X}, ${he}) => ${ie} ? acc + 1 : acc, 0)`,Le=["(count > 0)",...le,...Ne].join(" && ");yield`((${he}) => { ${we}; return ${Le}})(${K})`}Z.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(Z,ee,K){yield`(typeof value === 'object' && Symbol.asyncIterator in ${K})`}a(s,"FromAsyncIterator");function*c(Z,ee,K){yield`(typeof ${K} === 'bigint')`,nA(Z.exclusiveMaximum)&&(yield`${K} < BigInt(${Z.exclusiveMaximum})`),nA(Z.exclusiveMinimum)&&(yield`${K} > BigInt(${Z.exclusiveMinimum})`),nA(Z.maximum)&&(yield`${K} <= BigInt(${Z.maximum})`),nA(Z.minimum)&&(yield`${K} >= BigInt(${Z.minimum})`),nA(Z.multipleOf)&&(yield`(${K} % BigInt(${Z.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(Z,ee,K){yield`(typeof ${K} === 'boolean')`}a(l,"FromBoolean");function*u(Z,ee,K){yield*$(Z.returns,ee,`${K}.prototype`)}a(u,"FromConstructor");function*d(Z,ee,K){yield`(${K} instanceof Date) && Number.isFinite(${K}.getTime())`,ai(Z.exclusiveMaximumTimestamp)&&(yield`${K}.getTime() < ${Z.exclusiveMaximumTimestamp}`),ai(Z.exclusiveMinimumTimestamp)&&(yield`${K}.getTime() > ${Z.exclusiveMinimumTimestamp}`),ai(Z.maximumTimestamp)&&(yield`${K}.getTime() <= ${Z.maximumTimestamp}`),ai(Z.minimumTimestamp)&&(yield`${K}.getTime() >= ${Z.minimumTimestamp}`),ai(Z.multipleOfTimestamp)&&(yield`(${K}.getTime() % ${Z.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(Z,ee,K){yield`(typeof ${K} === 'function')`}a(f,"FromFunction");function*h(Z,ee,K){let he=globalThis.Object.getOwnPropertyNames(Z.$defs).reduce((X,ue)=>[...X,Z.$defs[ue]],[]);yield*$(qI(Z.$ref),[...ee,...he],K)}a(h,"FromImport");function*m(Z,ee,K){yield`Number.isInteger(${K})`,ai(Z.exclusiveMaximum)&&(yield`${K} < ${Z.exclusiveMaximum}`),ai(Z.exclusiveMinimum)&&(yield`${K} > ${Z.exclusiveMinimum}`),ai(Z.maximum)&&(yield`${K} <= ${Z.maximum}`),ai(Z.minimum)&&(yield`${K} >= ${Z.minimum}`),ai(Z.multipleOf)&&(yield`(${K} % ${Z.multipleOf}) === 0`)}a(m,"FromInteger");function*g(Z,ee,K){let he=Z.allOf.map(X=>J(X,ee,K)).join(" && ");if(Z.unevaluatedProperties===!1){let X=H(`${new RegExp(nL(Z))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${X}.test(key))`;yield`(${he} && ${ue})`}else if(Lu(Z.unevaluatedProperties)){let X=H(`${new RegExp(nL(Z))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${X}.test(key) || ${J(Z.unevaluatedProperties,ee,`${K}[key]`)})`;yield`(${he} && ${ue})`}else yield`(${he})`}a(g,"FromIntersect");function*A(Z,ee,K){yield`(typeof value === 'object' && Symbol.iterator in ${K})`}a(A,"FromIterator");function*y(Z,ee,K){typeof Z.const=="number"||typeof Z.const=="boolean"?yield`(${K} === ${Z.const})`:yield`(${K} === '${Ikt.Escape(Z.const)}')`}a(y,"FromLiteral");function*E(Z,ee,K){yield"false"}a(E,"FromNever");function*_(Z,ee,K){yield`(!${J(Z.not,ee,K)})`}a(_,"FromNot");function*v(Z,ee,K){yield`(${K} === null)`}a(v,"FromNull");function*b(Z,ee,K){yield TW.IsNumberLike(K),ai(Z.exclusiveMaximum)&&(yield`${K} < ${Z.exclusiveMaximum}`),ai(Z.exclusiveMinimum)&&(yield`${K} > ${Z.exclusiveMinimum}`),ai(Z.maximum)&&(yield`${K} <= ${Z.maximum}`),ai(Z.minimum)&&(yield`${K} >= ${Z.minimum}`),ai(Z.multipleOf)&&(yield`(${K} % ${Z.multipleOf}) === 0`)}a(b,"FromNumber");function*T(Z,ee,K){yield TW.IsObjectLike(K),ai(Z.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${Z.minProperties}`),ai(Z.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${Z.maxProperties}`);let he=Object.getOwnPropertyNames(Z.properties);for(let X of he){let ue=J9e.Encode(K,X),je=Z.properties[X];if(Z.required&&Z.required.includes(X))yield*$(je,ee,ue),(iL(je)||e(je))&&(yield`('${X}' in ${K})`);else{let ie=J(je,ee,ue);yield TW.IsExactOptionalProperty(K,X,ie)}}if(Z.additionalProperties===!1)if(Z.required&&Z.required.length===he.length)yield`Object.getOwnPropertyNames(${K}).length === ${he.length}`;else{let X=`[${he.map(ue=>`'${ue}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${K}).every(key => ${X}.includes(key))`}if(typeof Z.additionalProperties=="object"){let X=J(Z.additionalProperties,ee,`${K}[key]`),ue=`[${he.map(je=>`'${je}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${K}).every(key => ${ue}.includes(key) || ${X}))`}}a(T,"FromObject");function*w(Z,ee,K){yield`${K} instanceof Promise`}a(w,"FromPromise");function*R(Z,ee,K){yield TW.IsRecordLike(K),ai(Z.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${Z.minProperties}`),ai(Z.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${Z.maxProperties}`);let[he,X]=Object.entries(Z.patternProperties)[0],ue=H(`${new RegExp(he)}`),je=J(X,ee,"value"),ie=Lu(Z.additionalProperties)?J(Z.additionalProperties,ee,K):Z.additionalProperties===!1?"false":"true",le=`(${ue}.test(key) ? ${je} : ${ie})`;yield`(Object.entries(${K}).every(([key, value]) => ${le}))`}a(R,"FromRecord");function*x(Z,ee,K){let he=ba(Z,ee);if(W.functions.has(Z.$ref))return yield`${ne(Z.$ref)}(${K})`;yield*$(he,ee,K)}a(x,"FromRef");function*P(Z,ee,K){let he=H(`${new RegExp(Z.source,Z.flags)};`);yield`(typeof ${K} === 'string')`,ai(Z.maxLength)&&(yield`${K}.length <= ${Z.maxLength}`),ai(Z.minLength)&&(yield`${K}.length >= ${Z.minLength}`),yield`${he}.test(${K})`}a(P,"FromRegExp");function*D(Z,ee,K){yield`(typeof ${K} === 'string')`,ai(Z.maxLength)&&(yield`${K}.length <= ${Z.maxLength}`),ai(Z.minLength)&&(yield`${K}.length >= ${Z.minLength}`),Z.pattern!==void 0&&(yield`${H(`${new RegExp(Z.pattern)};`)}.test(${K})`),Z.format!==void 0&&(yield`format('${Z.format}', ${K})`)}a(D,"FromString");function*N(Z,ee,K){yield`(typeof ${K} === 'symbol')`}a(N,"FromSymbol");function*B(Z,ee,K){yield`(typeof ${K} === 'string')`,yield`${H(`${new RegExp(Z.pattern)};`)}.test(${K})`}a(B,"FromTemplateLiteral");function*L(Z,ee,K){yield`${ne(Z.$ref)}(${K})`}a(L,"FromThis");function*j(Z,ee,K){if(yield`Array.isArray(${K})`,Z.items===void 0)return yield`${K}.length === 0`;yield`(${K}.length === ${Z.maxItems})`;for(let he=0;heJ(X,ee,K)).join(" || ")})`}a(O,"FromUnion");function*q(Z,ee,K){yield`${K} instanceof Uint8Array`,ai(Z.maxByteLength)&&(yield`(${K}.length <= ${Z.maxByteLength})`),ai(Z.minByteLength)&&(yield`(${K}.length >= ${Z.minByteLength})`)}a(q,"FromUint8Array");function*Q(Z,ee,K){yield"true"}a(Q,"FromUnknown");function*U(Z,ee,K){yield TW.IsVoidLike(K)}a(U,"FromVoid");function*z(Z,ee,K){let he=W.instances.size;W.instances.set(he,Z),yield`kind('${Z[Tt]}', ${he}, ${K})`}a(z,"FromKind");function*$(Z,ee,K,he=!0){let X=va(Z.$id)?[...ee,Z]:ee,ue=Z;if(he&&va(Z.$id)){let je=ne(Z.$id);if(W.functions.has(je))return yield`${je}(${K})`;{W.functions.set(je,"");let ie=re(je,Z,ee,"value",!1);return W.functions.set(je,ie),yield`${je}(${K})`}}switch(ue[Tt]){case"Any":return yield*r(ue,X,K);case"Argument":return yield*n(ue,X,K);case"Array":return yield*o(ue,X,K);case"AsyncIterator":return yield*s(ue,X,K);case"BigInt":return yield*c(ue,X,K);case"Boolean":return yield*l(ue,X,K);case"Constructor":return yield*u(ue,X,K);case"Date":return yield*d(ue,X,K);case"Function":return yield*f(ue,X,K);case"Import":return yield*h(ue,X,K);case"Integer":return yield*m(ue,X,K);case"Intersect":return yield*g(ue,X,K);case"Iterator":return yield*A(ue,X,K);case"Literal":return yield*y(ue,X,K);case"Never":return yield*E(ue,X,K);case"Not":return yield*_(ue,X,K);case"Null":return yield*v(ue,X,K);case"Number":return yield*b(ue,X,K);case"Object":return yield*T(ue,X,K);case"Promise":return yield*w(ue,X,K);case"Record":return yield*R(ue,X,K);case"Ref":return yield*x(ue,X,K);case"RegExp":return yield*P(ue,X,K);case"String":return yield*D(ue,X,K);case"Symbol":return yield*N(ue,X,K);case"TemplateLiteral":return yield*B(ue,X,K);case"This":return yield*L(ue,X,K);case"Tuple":return yield*j(ue,X,K);case"Undefined":return yield*M(ue,X,K);case"Union":return yield*O(ue,X,K);case"Uint8Array":return yield*q(ue,X,K);case"Unknown":return yield*Q(ue,X,K);case"Void":return yield*U(ue,X,K);default:if(!d_.Has(ue[Tt]))throw new xkt(Z);return yield*z(ue,X,K)}}a($,"Visit");let W={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function J(Z,ee,K,he=!0){return`(${[...$(Z,ee,K,he)].join(" && ")})`}a(J,"CreateExpression");function ne(Z){return`check_${Tkt.Encode(Z)}`}a(ne,"CreateFunctionName");function H(Z){let ee=`local_${W.variables.size}`;return W.variables.set(ee,`const ${ee} = ${Z}`),ee}a(H,"CreateVariable");function re(Z,ee,K,he,X=!0){let[ue,je]=[` -`,we=>"".padStart(we," ")],ie=ae("value","any"),le=Be("boolean"),Ne=[...$(ee,K,he,X)].map(we=>`${je(4)}${we}`).join(` &&${ue}`);return`function ${Z}(${ie})${le} {${ue}${je(2)}return (${ue}${Ne}${ue}${je(2)}) -}`}a(re,"CreateFunction");function ae(Z,ee){let K=W.language==="typescript"?`: ${ee}`:"";return`${Z}${K}`}a(ae,"CreateParameter");function Be(Z){return W.language==="typescript"?`: ${Z}`:""}a(Be,"CreateReturns");function ve(Z,ee,K){let he=re("check",Z,ee,"value"),X=ae("value","any"),ue=Be("boolean"),je=[...W.functions.values()],ie=[...W.variables.values()],le=va(Z.$id)?`return function check(${X})${ue} { - return ${ne(Z.$id)}(value) -}`:`return ${he}`;return[...ie,...je,le].join(` -`)}a(ve,"Build");function Ue(...Z){let ee={language:"javascript"},[K,he,X]=Z.length===2&&Pi(Z[1])?[Z[0],Z[1],ee]:Z.length===2&&!Pi(Z[1])?[Z[0],[],Z[1]]:Z.length===3?[Z[0],Z[1],Z[2]]:Z.length===1?[Z[0],[],ee]:[null,[],ee];if(W.language=X.language,W.variables.clear(),W.functions.clear(),W.instances.clear(),!Lu(K))throw new Z9e(K);for(let ue of he)if(!Lu(ue))throw new Z9e(ue);return ve(K,he,X)}a(Ue,"Code"),t.Code=Ue;function Pe(Z,ee=[]){let K=Ue(Z,ee,{language:"javascript"}),he=globalThis.Function("kind","format","hash",K),X=new Map(W.instances);function ue(Ne,we,Le){if(!d_.Has(Ne)||!X.has(we))return!1;let rt=d_.Get(Ne),st=X.get(we);return rt(st,Le)}a(ue,"typeRegistryFunction");function je(Ne,we){return MP.Has(Ne)?MP.Get(Ne)(we):!1}a(je,"formatRegistryFunction");function ie(Ne){return lU(Ne)}a(ie,"hashFunction");let le=he(ue,je,ie);return new Skt(Z,ee,le,K)}a(Pe,"Compile"),t.Compile=Pe})(Fu||(Fu={}));var FUe=de(J9()),ese=de(require("os"));jo();var UUe=de(ri());function jCe(t){return t===1}a(jCe,"isRestricted");var qCe=8192,fAo=21;var G0=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return jCe(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(rse(e))return this.reporterRestricted;if(fCe(e))return new _9e}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()))}},pAo=S.Object({},{additionalProperties:S.String()}),hAo=S.Object({meanLogProb:S.Optional(S.Number()),meanAlternativeLogProb:S.Optional(S.Number())},{additionalProperties:S.Number()}),mAo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function gAo(t){return mAo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(gAo,"isOomError");function AAo(t){return zI(t)?"network":gAo(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(AAo,"getErrorType");var Wt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=Fu.Compile(pAo)}static{this.validateTelemetryMeasurements=Fu.Compile(hAo)}static{this.keysExemptedFromSanitization=["abexp.assignmentcontext","VSCode.ABExp.Features"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},pl())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=pl())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(Zt).getFallbackExpAndFilters();n.addToTelemetry(e,this),r.addToTelemetry(this)}extendWithCoreEditorAgnosticFields(e){this.properties.editor_version=x1(e.get(Ir).getEditorInfo()),this.properties.editor_plugin_version=x1(e.get(Ir).getEditorPluginInfo());let r=e.get(La);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${U1(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=x1(r.getEditorInfo());let n=e.get(tr);this.properties.fetcher=n.name;let o=e.get(Mo).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=LYr(e);r["copilot.build"]=FYr(e),r["copilot.buildType"]=_U(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(jCe(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>qCe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+qCe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(tse,"telemetrizePromptLength");function pl(){return performance.now()}a(pl,"now");function vAo(t){return Math.floor(t/1e3)}a(vAo,"nowSeconds");function rse(t){return t.get(Pp).optedIn}a(rse,"shouldSendRestricted");function Et(t,e,r,n){return t.get(Td).register(CAo(t,e,pl(),r?.extendedBy(),n))}a(Et,"telemetry");function WI(t,e,r){return t.get(Td).register(qUe(t,e,r?.extendedBy()))}a(WI,"telemetryMsft");function yt(t,e,r,n){let o=Wt.createAndMarkAsIssued(r,n);return t.get(Td).register(qUe(t,e,o))}a(yt,"telemetryMs");function QUe(t,e,r,n){let o=(n||Wt.createAndMarkAsIssued()).extendedBy(DYr(r));return t.get(Td).register(qUe(t,e,o))}a(QUe,"telemetryMsftWithError");function Zn(t,e,r,n,o){let s=Wt.createAndMarkAsIssued({...n,...DYr(r)},o);return t.get(Td).register(qUe(t,e,s))}a(Zn,"telemetryMsWithError");function DYr(t){let e={};if(t){let r=TAo(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(DYr,"buildErrorProperties");async function CAo(t,e,r,n,o=0){let s=n||Wt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!jCe(o)||rse(t))&&HCe(t,o,e,s),yAo(t,e,s)}a(CAo,"_telemetry");async function qUe(t,e,r){let n=r||Wt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),_Ao(t,e,n)}a(qUe,"_telemetryMsft");function N6e(t,e){return t.get(Td).register(bAo(t,e,pl()))}a(N6e,"telemetryExpProblem");async function bAo(t,e,r){let n="expProblem",o=Wt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),HCe(t,0,n,o)}a(bAo,"_telemetryExpProblem");function nse(t,e,r,n,o=0){let s={...r,...NYr(t)};HCe(t,o,e,{properties:s,measurements:n})}a(nse,"telemetryRaw");function NYr(t){let e=t.get(Ir),r={unique_id:Gt(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:x1(e.getEditorInfo())};return{...t.get(Pp).getProperties(),...r}}a(NYr,"createRequiredProperties");var tDt=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,FUe.SHA256)(FUe.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function Ua(t,e,r,n,o){return t.get(Td).register(MYr(t,e,pl(),r,{...n},o))}a(Ua,"telemetryException");async function MYr(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||Lm(c)||c instanceof UUe.ConnectionError||c instanceof UUe.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new tDt(e),e&&typeof e=="object"&&e.name==="ExitStatus")return;if(c.stack?.startsWith(`${c} +`,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} { + 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} `)){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=rse(t),f=UHr(c,u,d),h=AAo(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=DPt(y.value):y.value="[redacted]");s??=bHr(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(VN).isThrottled(A)){if(d){let y=FHr(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,HCe(t,1,`error.${h}`,E)}m&&(g.properties.failbot_payload=JSON.stringify(s)),HCe(t,0,`error.${h}`,g)}}a(MYr,"_telemetryException");function U0(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await MYr(t,c,pl(),r,n)}},"wrapped");return(...s)=>t.get(Td).register(o(...s))}a(U0,"telemetryCatch");function $0(t,e,r,n){return t.get(Td).register(SAo(t,e,pl(),r?.extendedBy(),n))}a($0,"telemetryError");async function SAo(t,e,r,n,o=0){if(jCe(o)&&!rse(t))return;let s=n||Wt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),EAo(t,o,e,s)}a(SAo,"_telemetryError");function OYr(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(OYr,"logEngineCompletion");function BYr(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(BYr,"logEnginePrompt");function TAo(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(TAo,"buildErrorFromUnknown");p();var kW=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Lm(t){return!t||typeof t!="object"?!1:t instanceof kW||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Lm,"isAbortError");var ise=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},eM=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}`}},IAo=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 zI(t,e=!0){return t instanceof Error?e&&"cause"in t&&zI(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof ise||t instanceof eM||t?.message?.startsWith("net::")||IAo.has(t.code??""):!1}a(zI,"isNetworkError");var YI=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 ise(`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 ise(`Response body truncated: actualLength=${s}`,"Truncated"):new ise(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function vU(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(vU,"parseRetryAfterSeconds");var tr=class{static{a(this,"Fetcher")}getImplementation(){return this}};function DW(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={...l,...m?{}:{Authorization:`Bearer ${r}`},...Oy(t)};d===void 0&&(g["Openai-Organization"]="github-copilot",g["X-Request-Id"]=o,g["VScode-SessionId"]=t.get(La).sessionId,g["VScode-MachineId"]=t.get(La).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(xAo(_))return Et(t,"networking.disconnectAll"),y.disconnectAll().then(()=>y.fetch(e,A));throw _})}a(DW,"postRequest");function xAo(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(xAo,"isInterruptedNetworkError");p();function jUe(){return typeof process>"u"}a(jUe,"isWeb");function uL(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(uL,"isMsBenchModeEnabled");var rDt=class extends eM{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 qf(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...jUe()?{}:Oy(t),...n.headers}};let o=await t.get(tr).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new eM(o);if(!o.headers.get("x-github-request-id"))throw new rDt(o);return o}a(qf,"apiFetch");p();p();var _s=class{constructor(){this.recentNotifications=new En(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 sa=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 qYr=require("os"),HUe=require("path");p();var UYr;(()=>{"use strict";var t={975:B=>{function L(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}a(L,"e");function j(O,q){for(var Q,U="",z=0,$=-1,W=0,J=0;J<=O.length;++J){if(J2){var ne=U.lastIndexOf("/");if(ne!==U.length-1){ne===-1?(U="",z=0):z=(U=U.slice(0,ne)).length-1-U.lastIndexOf("/"),$=J,W=0;continue}}else if(U.length===2||U.length===1){U="",z=0,$=J,W=0;continue}}q&&(U.length>0?U+="/..":U="..",z=2)}else U.length>0?U+="/"+O.slice($+1,J):U=O.slice($+1,J),z=J-$-1;$=J,W=0}else Q===46&&W!==-1?++W:W=-1}return U}a(j,"r");var M={resolve:a(function(){for(var O,q="",Q=!1,U=arguments.length-1;U>=-1&&!Q;U--){var z;U>=0?z=arguments[U]:(O===void 0&&(O=process.cwd()),z=O),L(z),z.length!==0&&(q=z+"/"+q,Q=z.charCodeAt(0)===47)}return q=j(q,!Q),Q?q.length>0?"/"+q:"/":q.length>0?q:"."},"resolve"),normalize:a(function(O){if(L(O),O.length===0)return".";var q=O.charCodeAt(0)===47,Q=O.charCodeAt(O.length-1)===47;return(O=j(O,!q)).length!==0||q||(O="."),O.length>0&&Q&&(O+="/"),q?"/"+O:O},"normalize"),isAbsolute:a(function(O){return L(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var O,q=0;q0&&(O===void 0?O=Q:O+="/"+Q)}return O===void 0?".":M.normalize(O)},"join"),relative:a(function(O,q){if(L(O),L(q),O===q||(O=M.resolve(O))===(q=M.resolve(q)))return"";for(var Q=1;QJ){if(q.charCodeAt($+H)===47)return q.slice($+H+1);if(H===0)return q.slice($+H)}else z>J&&(O.charCodeAt(Q+H)===47?ne=H:H===0&&(ne=0));break}var re=O.charCodeAt(Q+H);if(re!==q.charCodeAt($+H))break;re===47&&(ne=H)}var ae="";for(H=Q+ne+1;H<=U;++H)H!==U&&O.charCodeAt(H)!==47||(ae.length===0?ae+="..":ae+="/..");return ae.length>0?ae+q.slice($+ne):($+=ne,q.charCodeAt($)===47&&++$,q.slice($))},"relative"),_makeLong:a(function(O){return O},"_makeLong"),dirname:a(function(O){if(L(O),O.length===0)return".";for(var q=O.charCodeAt(0),Q=q===47,U=-1,z=!0,$=O.length-1;$>=1;--$)if((q=O.charCodeAt($))===47){if(!z){U=$;break}}else z=!1;return U===-1?Q?"/":".":Q&&U===1?"//":O.slice(0,U)},"dirname"),basename:a(function(O,q){if(q!==void 0&&typeof q!="string")throw new TypeError('"ext" argument must be a string');L(O);var Q,U=0,z=-1,$=!0;if(q!==void 0&&q.length>0&&q.length<=O.length){if(q.length===O.length&&q===O)return"";var W=q.length-1,J=-1;for(Q=O.length-1;Q>=0;--Q){var ne=O.charCodeAt(Q);if(ne===47){if(!$){U=Q+1;break}}else J===-1&&($=!1,J=Q+1),W>=0&&(ne===q.charCodeAt(W)?--W==-1&&(z=Q):(W=-1,z=J))}return U===z?z=J:z===-1&&(z=O.length),O.slice(U,z)}for(Q=O.length-1;Q>=0;--Q)if(O.charCodeAt(Q)===47){if(!$){U=Q+1;break}}else z===-1&&($=!1,z=Q+1);return z===-1?"":O.slice(U,z)},"basename"),extname:a(function(O){L(O);for(var q=-1,Q=0,U=-1,z=!0,$=0,W=O.length-1;W>=0;--W){var J=O.charCodeAt(W);if(J!==47)U===-1&&(z=!1,U=W+1),J===46?q===-1?q=W:$!==1&&($=1):q!==-1&&($=-1);else if(!z){Q=W+1;break}}return q===-1||U===-1||$===0||$===1&&q===U-1&&q===Q+1?"":O.slice(q,U)},"extname"),format:a(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(q,Q){var U=Q.dir||Q.root,z=Q.base||(Q.name||"")+(Q.ext||"");return U?U===Q.root?U+z:U+"/"+z:z})(0,O)},"format"),parse:a(function(O){L(O);var q={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return q;var Q,U=O.charCodeAt(0),z=U===47;z?(q.root="/",Q=1):Q=0;for(var $=-1,W=0,J=-1,ne=!0,H=O.length-1,re=0;H>=Q;--H)if((U=O.charCodeAt(H))!==47)J===-1&&(ne=!1,J=H+1),U===46?$===-1?$=H:re!==1&&(re=1):$!==-1&&(re=-1);else if(!ne){W=H+1;break}return $===-1||J===-1||re===0||re===1&&$===J-1&&$===W+1?J!==-1&&(q.base=q.name=W===0&&z?O.slice(1,J):O.slice(W,J)):(W===0&&z?(q.name=O.slice(1,$),q.base=O.slice(1,J)):(q.name=O.slice(W,$),q.base=O.slice(W,J)),q.ext=O.slice($,J)),W>0?q.dir=O.slice(0,W-1):z&&(q.dir="/"),q},"parse"),sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,B.exports=M}},e={};function r(B){var L=e[B];if(L!==void 0)return L.exports;var j=e[B]={exports:{}};return t[B](j,j.exports,r),j.exports}a(r,"r"),r.d=(B,L)=>{for(var j in L)r.o(L,j)&&!r.o(B,j)&&Object.defineProperty(B,j,{enumerable:!0,get:L[j]})},r.o=(B,L)=>Object.prototype.hasOwnProperty.call(B,L),r.r=B=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(B,"__esModule",{value:!0})};var n={};let o;r.r(n),r.d(n,{URI:a(()=>m,"URI"),Utils:a(()=>N,"Utils")}),typeof process=="object"?o=process.platform==="win32":typeof navigator=="object"&&(o=navigator.userAgent.indexOf("Windows")>=0);let s=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function u(B,L){if(!B.scheme&&L)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${B.authority}", path: "${B.path}", query: "${B.query}", fragment: "${B.fragment}"}`);if(B.scheme&&!s.test(B.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(B.path){if(B.authority){if(!c.test(B.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(B.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(u,"a");let d="",f="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{static{a(this,"l")}static isUri(L){return L instanceof m||!!L&&typeof L.authority=="string"&&typeof L.fragment=="string"&&typeof L.path=="string"&&typeof L.query=="string"&&typeof L.scheme=="string"&&typeof L.fsPath=="string"&&typeof L.with=="function"&&typeof L.toString=="function"}scheme;authority;path;query;fragment;constructor(L,j,M,O,q,Q=!1){typeof L=="object"?(this.scheme=L.scheme||d,this.authority=L.authority||d,this.path=L.path||d,this.query=L.query||d,this.fragment=L.fragment||d):(this.scheme=(function(U,z){return U||z?U:"file"})(L,Q),this.authority=j||d,this.path=(function(U,z){switch(U){case"https":case"http":case"file":z?z[0]!==f&&(z=f+z):z=f}return z})(this.scheme,M||d),this.query=O||d,this.fragment=q||d,u(this,Q))}get fsPath(){return v(this,!1)}with(L){if(!L)return this;let{scheme:j,authority:M,path:O,query:q,fragment:Q}=L;return j===void 0?j=this.scheme:j===null&&(j=d),M===void 0?M=this.authority:M===null&&(M=d),O===void 0?O=this.path:O===null&&(O=d),q===void 0?q=this.query:q===null&&(q=d),Q===void 0?Q=this.fragment:Q===null&&(Q=d),j===this.scheme&&M===this.authority&&O===this.path&&q===this.query&&Q===this.fragment?this:new A(j,M,O,q,Q)}static parse(L,j=!1){let M=h.exec(L);return M?new A(M[2]||d,R(M[4]||d),R(M[5]||d),R(M[7]||d),R(M[9]||d),j):new A(d,d,d,d,d)}static file(L){let j=d;if(o&&(L=L.replace(/\\/g,f)),L[0]===f&&L[1]===f){let M=L.indexOf(f,2);M===-1?(j=L.substring(2),L=f):(j=L.substring(2,M),L=L.substring(M)||f)}return new A("file",j,L,d,d)}static from(L){let j=new A(L.scheme,L.authority,L.path,L.query,L.fragment);return u(j,!0),j}toString(L=!1){return b(this,L)}toJSON(){return this}static revive(L){if(L){if(L instanceof m)return L;{let j=new A(L);return j._formatted=L.external,j._fsPath=L._sep===g?L.fsPath:null,j}}return L}}let g=o?1:void 0;class A extends m{static{a(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=v(this,!1)),this._fsPath}toString(L=!1){return L?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){let L={$mid:1};return this._fsPath&&(L.fsPath=this._fsPath,L._sep=g),this._formatted&&(L.external=this._formatted),this.path&&(L.path=this.path),this.scheme&&(L.scheme=this.scheme),this.authority&&(L.authority=this.authority),this.query&&(L.query=this.query),this.fragment&&(L.fragment=this.fragment),L}}let y={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function E(B,L,j){let M,O=-1;for(let q=0;q=97&&Q<=122||Q>=65&&Q<=90||Q>=48&&Q<=57||Q===45||Q===46||Q===95||Q===126||L&&Q===47||j&&Q===91||j&&Q===93||j&&Q===58)O!==-1&&(M+=encodeURIComponent(B.substring(O,q)),O=-1),M!==void 0&&(M+=B.charAt(q));else{M===void 0&&(M=B.substr(0,q));let U=y[Q];U!==void 0?(O!==-1&&(M+=encodeURIComponent(B.substring(O,q)),O=-1),M+=U):O===-1&&(O=q)}}return O!==-1&&(M+=encodeURIComponent(B.substring(O))),M!==void 0?M:B}a(E,"m");function _(B){let L;for(let j=0;j1&&B.scheme==="file"?`//${B.authority}${B.path}`:B.path.charCodeAt(0)===47&&(B.path.charCodeAt(1)>=65&&B.path.charCodeAt(1)<=90||B.path.charCodeAt(1)>=97&&B.path.charCodeAt(1)<=122)&&B.path.charCodeAt(2)===58?L?B.path.substr(1):B.path[1].toLowerCase()+B.path.substr(2):B.path,o&&(j=j.replace(/\//g,"\\")),j}a(v,"v");function b(B,L){let j=L?_:E,M="",{scheme:O,authority:q,path:Q,query:U,fragment:z}=B;if(O&&(M+=O,M+=":"),(q||O==="file")&&(M+=f,M+=f),q){let $=q.indexOf("@");if($!==-1){let W=q.substr(0,$);q=q.substr($+1),$=W.lastIndexOf(":"),$===-1?M+=j(W,!1,!1):(M+=j(W.substr(0,$),!1,!1),M+=":",M+=j(W.substr($+1),!1,!0)),M+="@"}q=q.toLowerCase(),$=q.lastIndexOf(":"),$===-1?M+=j(q,!1,!0):(M+=j(q.substr(0,$),!1,!0),M+=q.substr($))}if(Q){if(Q.length>=3&&Q.charCodeAt(0)===47&&Q.charCodeAt(2)===58){let $=Q.charCodeAt(1);$>=65&&$<=90&&(Q=`/${String.fromCharCode($+32)}:${Q.substr(3)}`)}else if(Q.length>=2&&Q.charCodeAt(1)===58){let $=Q.charCodeAt(0);$>=65&&$<=90&&(Q=`${String.fromCharCode($+32)}:${Q.substr(2)}`)}M+=j(Q,!0,!1)}return U&&(M+="?",M+=j(U,!1,!1)),z&&(M+="#",M+=L?z:E(z,!1,!1)),M}a(b,"b");function T(B){try{return decodeURIComponent(B)}catch{return B.length>3?B.substr(0,3)+T(B.substr(3)):B}}a(T,"C");let w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function R(B){return B.match(w)?B.replace(w,(L=>T(L))):B}a(R,"w");var x=r(975);let P=x.posix||x,D="/";var N;(function(B){B.joinPath=function(L,...j){return L.with({path:P.join(L.path,...j)})},B.resolvePath=function(L,...j){let M=L.path,O=!1;M[0]!==D&&(M=D+M,O=!0);let q=P.resolve(M,...j);return O&&q[0]===D&&!L.authority&&(q=q.substring(1)),L.with({path:q})},B.dirname=function(L){if(L.path.length===0||L.path===D)return L;let j=P.dirname(L.path);return j.length===1&&j.charCodeAt(0)===46&&(j=""),L.with({path:j})},B.basename=function(L){return P.basename(L.path)},B.extname=function(L){return P.extname(L.path)}})(N||(N={})),UYr=n})();var{URI:CU,Utils:GCe}=UYr;function jYr(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+jYr(t.substring(3)):t}}a(jYr,"decodeURIComponentGraceful");var QYr=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function nDt(t){return t.match(QYr)?t.replace(QYr,e=>jYr(e)):t}a(nDt,"percentDecode");function Ta(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 CU.file(t).toString()}a(Ta,"makeFsUri");function ro(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?CU.parse(e[1]+e[2],!0):CU.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(ro,"parseUri");function GUe(t){return ro(t),t}a(GUe,"validateUri");function Os(t){try{return ro(t).toString()}catch{return t}}a(Os,"normalizeUri");function HYr(t){let e=Os(t);return e.endsWith("/")?e.slice(0,-1):e}a(HYr,"normalizeUriNoTrailingSlash");var NW=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function gn(t){let e=ro(t);if(!NW.has(e.scheme)&&!sa.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,qYr.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,HUe.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(gn,"fsPath");function Zo(t){try{return gn(t)}catch{return}}a(Zo,"getFsPath");function GYr(t){let e=Zo(t);if(e)return CU.file(e).toString()}a(GYr,"getFsUri");function MW(t,...e){let r,n=Zo(t);return n?r=Ta((0,HUe.resolve)(n,...e)):r=GCe.resolvePath(ro(t),...e.map(o=>$Yr(o))).toString(),typeof t=="string"?r:{uri:r}}a(MW,"resolveFilePath");function Ia(t,...e){let r=GCe.joinPath(ro(t),...e.map($Yr)).toString();return typeof t=="string"?r:{uri:r}}a(Ia,"joinPath");function $Yr(t){return wAo(t)?t.replaceAll("\\","/"):t}a($Yr,"pathToURIPath");function wAo(t){return/^[^/\\]*\\/.test(t)}a(wAo,"isWinPath");function Ji(t){return nDt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(Ji,"basename");function sf(t){let e=GCe.dirname(ro(t)),r;return NW.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(sf,"dirname");function VYr(t){return GCe.extname(ro(t))}a(VYr,"extname");var Fm=class{static{a(this,"NetworkConfiguration")}};function $Ue(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!oDt(t)&&r.protocol==="http:")return r.href}catch{}}a($Ue,"ensurePermittedUrl");var OW={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 iDt(t,e,r){if(r&&w1(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(iDt,"urlConfigOverride");function RAo(t,e){switch(e){case"api":return iDt(t,[Ke.DebugOverrideCapiUrl,Ke.DebugOverrideCapiUrlLegacy],[Ke.DebugTestOverrideCapiUrl,Ke.DebugTestOverrideCapiUrlLegacy]);case"proxy":return iDt(t,[Ke.DebugOverrideProxyUrl,Ke.DebugOverrideProxyUrlLegacy],[Ke.DebugTestOverrideProxyUrl,Ke.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!oDt(t))return iDt(t,[Ke.DebugSnippyOverrideUrl])}}a(RAo,"getEndpointOverrideUrl");function KI(t,e,r,...n){let o=RAo(t,r)??e.endpoints[r];return Ia(o,...n)}a(KI,"getEndpointUrl");function dL(t){return JI(t)?.endpoints??OW}a(dL,"getLastKnownEndpoints");function VUe(t,e){if(e&&!$Ue(t,e)){t.get(_s).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get(Fm).setConfiguredUrls(t,{serverUrl:e})}a(VUe,"updateServerUrl");p();var Um=class{static{a(this,"UrlOpener")}};var p_=new pe("auth"),sDt=60,PAo=300;var kAo=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],DAo="4535c7beffc844b46bb1ed4aa04d759a";function By(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(By,"fillGitHubUrls");function bU(){return Math.floor(Date.now()/1e3)}a(bU,"nowSeconds");async function aDt(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 qf(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 p_.info(t,`${h}${y}`),$0(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:h}}if(!s.ok||!c.token){p_.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),$0(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"&&NAo(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+sDt,u=await $Ce(t,e),d;u.ok&&(d=await u.json());let f=new BW(c,d,l);return Et(t,"auth.new_token",n.extendedBy({...TPt(f)},{adjusted_expires_at:f.expiresAt,expires_at:c.expires_at,current_time:bU()})),{copilotToken:f}}a(aDt,"authFromGitHubSession");var Sh=class{static{a(this,"CopilotTokenFetcher")}},WUe=class extends Sh{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await aDt(e,r,n)}};async function $Ce(t,e){return await qf(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a($Ce,"fetchCopilotUserInfo");function NAo(t,e,r){e&&t.get(_s).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(Um).open(l)}e.notification_id&&s&&await MAo(t,e.notification_id,r)}).catch(n=>{p_.exception(t,n,"copilotToken.notification")})}a(NAo,"notifyUser");async function MAo(t,e,r){let n=await qf(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&p_.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(MAo,"sendNotificationResultToGitHub");var BW=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 h6e(r)}static{a(this,"CopilotToken")}get endpoints(){return{...OW,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-PAo(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(DAo)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var Ai=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function zUe(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(zUe,"authEnvVarConflictMessage");var SU=class extends Ai{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function WYr(t){let e=t.trim();if(!e)throw new Ai("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new Ai("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new Ai("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new Ai("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(WYr,"validateGitHubServerUrl");p();p();var ZI=class{static{a(this,"AuthRepository")}};p();function zYr(t){let e=t.trim();if(!e)throw new Ai("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=WYr(r),{apiUrl:o}=By({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(zYr,"buildAuthServerEndpoint");function TU(t,e){if(e!==void 0)return zYr(e);{let r=t.get(Fm),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(TU,"resolveAuthServerEndpoint");function cDt(t){if(!t)return!1;try{return zYr(t),!0}catch{return!1}}a(cDt,"isValidAuthServer");p();p();p();p();p();p();p();p();function hL(t,e){return t||e}a(hL,"_pureAssign");function Qm(t,e){return t[e]}a(Qm,"_pureRef");var aC=void 0,Th=null,bDt="",r7e="function",WCe="object",fL="prototype",vDt="__proto__",LW="undefined",ZUe="constructor",SDt="Symbol",OAo="_polyfill",FW="length",XUe="name",aA="call",n7e="toString",XI=hL(Object),TDt=Qm(XI,fL),eKr=hL(String),UW=Qm(eKr,fL),zCe=hL(Math),tKr=hL(Array),i7e=Qm(tKr,fL),pL=Qm(i7e,"slice");function jf(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a(jf,"safe");function BAo(t,e){var r=jf(t);return r.e?e:r.v}a(BAo,"safeGet");var lDt;function o7e(t){return function(e){return typeof e===t}}a(o7e,"_createIs");function rKr(t){var e="[object "+t+"]";return function(r){return!!(r&&YCe(r)===e)}}a(rKr,"_createObjIs");function YCe(t){return TDt[n7e].call(t)}a(YCe,"objToString");function Nn(t){return typeof t===LW||t===LW}a(Nn,"isUndefined");function LAo(t){return!ase(t)}a(LAo,"isStrictUndefined");function Xt(t){return t===Th||Nn(t)}a(Xt,"isNullOrUndefined");function FAo(t){return t===Th||!ase(t)}a(FAo,"isStrictNullOrUndefined");function ase(t){return!!t||t!==aC}a(ase,"isDefined");function UAo(t){return!lDt&&(lDt=["string","number","boolean",LW,"symbol","bigint"]),t!==WCe&&lDt.indexOf(t)!==-1}a(UAo,"isPrimitiveType");var yi=o7e("string"),Or=o7e(r7e);function qu(t){return!t&&Xt(t)?!1:!!t&&typeof t===WCe}a(qu,"isObject");var ur=Qm(tKr,"isArray"),s7e=rKr("Date"),xh=o7e("number"),jP=o7e("boolean");var mL=rKr("Error");function V0(t){return!!(t&&t.then&&Or(t.then))}a(V0,"isPromiseLike");function Q1(t){return!(!t||BAo(function(){return!(t&&0+t)},!t))}a(Q1,"isTruthy");var cse=Qm(XI,"getOwnPropertyDescriptor");function W0(t,e){return!!t&&TDt.hasOwnProperty[aA](t,e)}a(W0,"objHasOwnProperty");var cA=hL(Qm(XI,"hasOwn"),QAo);function QAo(t,e){return W0(t,e)||!!cse(t,e)}a(QAo,"polyObjHasOwn");function Yr(t,e,r){if(t&&qu(t)){for(var n in t)if(cA(t,n)&&e[aA](r||t,n,t[n])===-1)break}}a(Yr,"objForEachKey");var YUe={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function qAo(t){var e={};if(e[YUe.c]=!0,e[YUe.e]=!0,t.l){e.get=function(){return t.l.v};var r=cse(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return Yr(t,function(n,o){e[YUe[n]]=LAo(o)?e[YUe[n]]:o}),e}a(qAo,"_createProp");var h_=Qm(XI,"defineProperty"),nKr=Qm(XI,"defineProperties");function ji(t,e,r){return h_(t,e,qAo(r))}a(ji,"objDefine");function iKr(t,e,r,n,o){var s={};return Yr(t,function(c,l){e7e(s,c,e?l:c),e7e(s,l,r?l:c)}),n?n(s):s}a(iKr,"_createKeyValueMap");function e7e(t,e,r,n){h_(t,e,{value:r,enumerable:!0,writable:!1})}a(e7e,"_assignMapValue");var Qu=hL(eKr),jAo="[object Error]";function dr(t,e){var r=bDt,n=TDt[n7e][aA](t);n===jAo&&(t={stack:Qu(t.stack),message:Qu(t.message),name:Qu(t.name)});try{r=JSON.stringify(t,Th,e?typeof e=="number"?e:4:aC),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):Th)||Qu(t)}catch(o){r=" - "+dr(o,e)}return n+": "+r}a(dr,"dumpObj");function zc(t){throw new Error(t)}a(zc,"throwError");function qm(t){throw new TypeError(t)}a(qm,"throwTypeError");var oKr=Qm(XI,"freeze");function HAo(t){return t}a(HAo,"_doNothing");function GAo(t){return t[vDt]||Th}a(GAo,"_getProto");var gL=Qm(XI,"assign"),ju=Qm(XI,"keys");function m_(t){return oKr&&Yr(t,function(e,r){(ur(r)||qu(r))&&m_(r)}),wh(t)}a(m_,"objDeepFreeze");var wh=hL(oKr,HAo);var CDt=hL(Qm(XI,"getPrototypeOf"),GAo);function a7e(t){return iKr(t,1,0,wh)}a(a7e,"createEnum");function $Ao(t){return iKr(t,0,0,wh)}a($Ao,"createEnumKeyMap");function VAo(t){var e={};return Yr(t,function(r,n){e7e(e,r,n[1]),e7e(e,n[0],n[1])}),wh(e)}a(VAo,"createSimpleMap");function IDt(t){return VAo(t)}a(IDt,"createTypeMap");var sKr=$Ao({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}),YYr="__tsUtils$gblCfg",uDt;function aKr(){var t;return typeof globalThis!==LW&&(t=globalThis),!t&&typeof self!==LW&&(t=self),!t&&typeof window!==LW&&(t=window),!t&&typeof global!==LW&&(t=global),t}a(aKr,"_getGlobalValue");function cKr(){if(!uDt){var t=jf(aKr).v||{};uDt=t[YYr]=t[YYr]||{}}return uDt}a(cKr,"_getGlobalConfig");var lse=KCe;function KCe(t,e,r){var n=e?e[t]:Th;return function(o){var s=(o?o[t]:Th)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?pL[aA](c,1):c)}qm('"'+Qu(t)+'" not defined for '+dr(o))}}a(KCe,"_unwrapFunctionWithPoly");function WAo(t){return function(e){return e[t]}}a(WAo,"_unwrapProp");var IU=Qm(zCe,"min"),HP=Qm(zCe,"max"),KYr=lse("slice",UW),Hf=lse("substring",UW),c7e=KCe("substr",UW,zAo);function zAo(t,e,r){return Xt(t)&&qm("Invalid "+dr(t)),r<0?bDt:(e=e||0,e<0&&(e=HP(e+t[FW],0)),Nn(r)?KYr(t,e):KYr(t,e,e+r))}a(zAo,"polyStrSubstr");function tM(t,e){return Hf(t,0,e)}a(tM,"strLeft");var JYr="_urid",dDt;function YAo(){if(!dDt){var t=cKr();dDt=t.gblSym=t.gblSym||{k:{},s:{}}}return dDt}a(YAo,"_globalSymbolRegistry");var KUe;function xDt(t){var e={description:Qu(t),toString:a(function(){return SDt+"("+t+")"},"toString")};return e[OAo]=!0,e}a(xDt,"polyNewSymbol");function KAo(t){var e=YAo();if(!cA(e.k,t)){var r=xDt(t),n=ju(e.s).length;r[JYr]=function(){return n+"_"+r[n7e]()},e.k[t]=r,e.s[r[JYr]()]=Qu(t)}return e.k[t]}a(KAo,"polySymbolFor");function JAo(t){!KUe&&(KUe={});var e,r=sKr[t];return r&&(e=KUe[r]=KUe[r]||xDt(SDt+"."+r)),e}a(JAo,"polyGetKnownSymbol");var Ih;function xU(){Ih=cKr()}a(xU,"_initTestHooks");function l7e(t){var e={};return!Ih&&xU(),e.b=Ih.lzy,h_(e,"v",{configurable:!0,get:a(function(){var r=t();return Ih.lzy||h_(e,"v",{value:r}),e.b=Ih.lzy,r},"get")}),e}a(l7e,"getLazy");function q1(t){return h_({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(q1,"createCachedValue");var lKr="window",VCe;function u7e(t,e){var r;return function(){return!Ih&&xU(),(!r||Ih.lzy)&&(r=q1(jf(t,e).v)),r.v}}a(u7e,"_getGlobalInstFn");function Ly(t){return!Ih&&xU(),(!VCe||t===!1||Ih.lzy)&&(VCe=q1(jf(aKr).v||Th)),VCe.v}a(Ly,"getGlobal");function ki(t,e){var r;if(!VCe||e===!1?r=Ly(e):r=VCe.v,r&&r[t])return r[t];if(t===lKr)try{return window}catch{}return Th}a(ki,"getInst");function AL(){return!!af()}a(AL,"hasDocument");var af=u7e(ki,["document"]);function use(){return!!cf()}a(use,"hasWindow");var cf=u7e(ki,[lKr]);function QW(){return!!Hu()}a(QW,"hasNavigator");var Hu=u7e(ki,["navigator"]);var uKr=u7e(function(){return!!jf(function(){return process&&(process.versions||{}).node}).v});var sse,fDt;function d7e(){return sse=q1(jf(ki,[SDt]).v),sse}a(d7e,"_initSymbol");function ZAo(t){var e=(Ih.lzy?0:sse)||d7e();return e.v?e.v[t]:aC}a(ZAo,"_getSymbolKey");function dKr(){return!!XAo()}a(dKr,"hasSymbol");function XAo(){return!Ih&&xU(),((Ih.lzy?0:sse)||d7e()).v}a(XAo,"getSymbol");function JCe(t,e){var r=sKr[t];!Ih&&xU();var n=(Ih.lzy?0:sse)||d7e();return n.v?n.v[r||t]:e?aC:JAo(t)}a(JCe,"getKnownSymbol");function ex(t,e){!Ih&&xU();var r=(Ih.lzy?0:sse)||d7e();return r.v?r.v(t):e?Th:xDt(t)}a(ex,"newSymbol");function wU(t){return!Ih&&xU(),fDt=(Ih.lzy?0:fDt)||q1(jf(ZAo,["for"]).v),(fDt.v||KAo)(t)}a(wU,"symbolFor");function t7e(t){return!!t&&Or(t.next)}a(t7e,"isIterator");function wDt(t){return!FAo(t)&&Or(t[JCe(3)])}a(wDt,"isIterable");var JUe;function f7e(t,e,r){if(t&&(t7e(t)||(!JUe&&(JUe=q1(JCe(3))),t=t[JUe.v]?t[JUe.v]():Th),t7e(t))){var n=aC,o=aC;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=Th,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(f7e,"iterForOf");function ose(t,e,r){return t.apply(e,r)}a(ose,"fnApply");function Rh(t,e){return!Nn(e)&&t&&(ur(e)?ose(t.push,t,e):t7e(e)||wDt(e)?f7e(e,function(r){t.push(r)}):t.push(e)),t}a(Rh,"arrAppend");function Ct(t,e,r){if(t)for(var n=t[FW]>>>0,o=0;o0?r:0;return Hf(t,o,o+n[FW])===n}a(hyo,"polyStrStartsWith");var yDt="ref",EDt="unref",_Dt="hasRef",myo="enabled";function gyo(t,e,r){var n=!0,o=t?e(Th):Th,s;function c(){return n=!1,o&&o[EDt]&&o[EDt](),s}a(c,"_unref");function l(){o&&r(o),o=Th}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[_Dt]=function(){return o&&o[_Dt]?o[_Dt]():n},s[yDt]=function(){return n=!0,o&&o[yDt]&&o[yDt](),s},s[EDt]=c,s=h_(s,myo,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=Th},"dn")}}a(gyo,"_createTimerHandler");function PDt(t,e,r){var n=ur(e),o=n?e.length:0,s=(o>0?e[0]:n?aC:e)||setTimeout,c=(o>1?e[1]:aC)||clearTimeout,l=r[0];r[0]=function(){u.dn(),ose(l,aC,pL[aA](arguments))};var u=gyo(t,function(d){if(d){if(d.refresh)return d.refresh(),d;ose(c,aC,[d])}return ose(s,aC,r)},function(d){ose(c,aC,[d])});return u.h}a(PDt,"_createTimeoutWith");function Mp(t,e){return PDt(!0,aC,pL[aA](arguments))}a(Mp,"scheduleTimeout");function AKr(t,e,r){return PDt(!0,t,pL[aA](arguments,1))}a(AKr,"scheduleTimeoutWith");function p7e(t,e){return PDt(!1,aC,pL[aA](arguments))}a(p7e,"createTimeout");var rbe=a7e,kDt=IDt;p();var GP=rbe({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var $P="toLowerCase",ln="length",pse="warnToConsole",_L="throwInternal",nM="watch",PU="apply",Fi="push",tx="splice",Gu="logger",iM="cancel",vL="initialize",oM="identifier",hse="removeNotificationListener",mse="addNotificationListener",cC="isInitialized",nbe="getNotifyMgr",kU="getPlugin",H1="name",jm="processNext",h7e="getProcessTelContext",CL="value",DU="enabled",DDt="stopPollingInternalLogs",rx="unload",ibe="onComplete",m7e="version",g7e="loggingLevelConsole",sM="createNew",G1="teardown",gse="messageId",aM="message",lC="diagLog",NU="_doTeardown",jW="update",$1="getNext",MU="setNextPlugin",obe="userAgent",nx="split",VP="replace",sbe="substring",abe="indexOf",bL="type",NDt="evtName",WP="status",MDt="getAllResponseHeaders",cbe="isChildEvt",V1="data",HW="getCtx",zP="setCtx",ODt="itemsReceived",lbe="headers",Ase="urlString",GW="timeout";var A7e="traceFlags";var BDt;function yKr(t,e){BDt||(BDt=XCe("AggregationError",function(n,o){o[ln]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` -`.concat(o," > ").concat(dr(n))}),new BDt(r,e||[])}a(yKr,"throwAggregationError");p();p();p();var yse="function",ix="object",W1="undefined",z1="prototype";var OU=Object,ube=OU[z1];p();var Gxl=(Ly()||{}).Symbol,$xl=(Ly()||{}).Reflect;var EKr="hasOwnProperty",yyo=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(zDt,"_hasVisited");function vyo(t,e,r,n){function o(u,d,f){var h=d[f];if(h[QDt]&&n){var m=u[S7e]||{};m[dbe]!==!1&&(h=(m[d[Ese]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=rM(null);T7e(r,function(u){s[u]=o(e,r,u)});for(var c=VW(t),l=[];c&&!VDt(c)&&!zDt(l,c);)T7e(c,function(u){!s[u]&&WDt(c,u,!fbe)&&(s[u]=o(e,c,u))}),l.push(c),c=VW(c);return s}a(vyo,"_getBaseFuncs");function Cyo(t,e,r,n){var o=null;if(t&&W0(r,Ese)){var s=t[S7e]||rM(null);if(o=(s[r[Ese]]||rM(null))[e],o||I7e("Missing ["+e+"] "+b7e),!o[qDt]&&s[dbe]!==!1){for(var c=!W0(t,e),l=VW(t),u=[];c&&l&&!VDt(l)&&!zDt(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=VW(l)}try{c&&(t[e]=o),o[qDt]=1}catch{s[dbe]=!1}}}return o}a(Cyo,"_getInstFunc");function byo(t,e,r){var n=e[t];return n===r&&(n=VW(e)[t]),typeof n!==b7e&&I7e("["+t+"] is not a "+b7e),n}a(byo,"_getProtoFunc");function Syo(t,e,r,n,o){function s(u,d){var f=a(function(){var h=Cyo(this,d,u,f)||byo(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[QDt]=1,f}if(a(s,"_createDynamicPrototype"),!v7e(t)){var c=r[S7e]=r[S7e]||rM(null);if(!v7e(c)){var l=c[e]=c[e]||rM(null);c[dbe]!==!1&&(c[dbe]=!!o),v7e(l)||T7e(r,function(u){WDt(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!W0(t,u)||t[u]&&!t[u][QDt])&&(t[u]=s(t,u)))})}}}a(Syo,"_populatePrototype");function Tyo(t,e){if(fbe){for(var r=[],n=VW(e);n&&!VDt(n)&&!zDt(r,n);){if(n===t)return!0;r.push(n),n=VW(n)}return!1}return!0}a(Tyo,"_checkPrototype");function UDt(t,e){return W0(t,SL)?t.name||e||_Kr:((t||{})[C7e]||{}).name||e||_Kr}a(UDt,"_getObjName");function Si(t,e,r,n){W0(t,SL)||I7e("theClass is an invalid class definition.");var o=t[SL];Tyo(o,e)||I7e("["+UDt(t)+"] not in hierarchy of ["+UDt(e)+"]");var s=null;W0(o,Ese)?s=o[Ese]:(s=Eyo+UDt(t,"_")+"$"+HDt.n,HDt.n++,o[Ese]=s);var c=Si[SKr],l=!!c[_7e];l&&n&&n[_7e]!==void 0&&(l=!!n[_7e]);var u=_yo(e),d=vyo(o,e,u,l);r(e,d);var f=!!fbe&&!!c[jDt];f&&n&&(f=!!n[jDt]),Syo(o,s,e,u,f!==!1)}a(Si,"dynamicProto");Si[SKr]=HDt.o;p();var w7e="Promise";var rNt="rejected";function ml(t,e){return R7e(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:rNt,rejected:!0,reason:r}):r})}a(ml,"doAwaitResponse");function R7e(t,e,r,n){var o=t;try{if(V0(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&&Iyo(o,n)}return o}a(R7e,"doAwait");function Iyo(t,e){var r=t;return e&&(V0(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(Iyo,"doFinally");var YDt,KDt,JDt,TKr=!1;function xyo(t,e,r,n){YDt=YDt||{toString:a(function(){return"[[PromiseState]]"},"toString")},KDt=KDt||{toString:a(function(){return"[[PromiseResult]]"},"toString")},JDt=JDt||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[YDt]={get:e},o[KDt]={get:r},o[JDt]={get:n},nKr(t,o)}a(xyo,"_addDebugState$1");var wKr=["pending","resolving","resolved",rNt],IKr="dispatchEvent",x7e;function wyo(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(wyo,"_hasInitEventFn");function Ryo(t,e,r,n){var o=af();!x7e&&(x7e=q1(!!jf(wyo,[o]).v));var s=x7e.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),x7e.v&&s.initEvent(e,!1,!0),s&&t[IKr])t[IKr](s);else{var c=t["on"+e];if(c)c(s);else{var l=ki("console");l&&(l.error||l.log)(e,dr(s))}}}a(Ryo,"emitEvent");var RKr="unhandledRejection",Pyo=RKr.toLowerCase(),pbe=[],kyo=0,Dyo=10;var ZDt;function xKr(t){return Or(t)?t.toString():dr(t)}a(xKr,"dumpFnObj");function PKr(t,e,r){var n=RU(arguments,3),o=0,s=!1,c,l=[],u=kyo++,d=pbe.length>0?pbe[pbe.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{pbe.push(u),f=!0,h&&h.cancel(),h=null;var x=t(function(P,D){l.push(function(){try{var N=o===2?w:R,B=Nn(N)?c:Or(N)?N(c):N;V0(B)?B.then(P,D):N?P(B):o===3?D(B):P(B)}catch(L){D(L)}}),s&&_()},n);return x}finally{pbe.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 wKr[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&&V0(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,_(),!f&&w===3&&!h&&(h=Mp(b,Dyo))}}}a(v,"_createSettleIfFn");function b(){if(!f)if(f=!0,uKr())process.emit(RKr,c,m);else{var w=cf()||Ly();!ZDt&&(ZDt=q1(jf(ki,[w7e+"RejectionEvent"]).v)),Ryo(w,Pyo,function(R){return ji(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!ZDt.v)}}a(b,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},h_(m,"state",{get:E}),TKr&&xyo(m,E,function(){return YCe(c)},function(){return f}),dKr()&&(m[JCe(11)]="IPromise");function T(){return"IPromise"+(TKr?"["+u+(Nn(d)?"":":"+d)+"]":"")+" "+E()+(s?" - "+xKr(c):"")}return a(T,"_toString"),m.toString=T,a((function(){Or(r)||qm(w7e+": executor is not a function - "+xKr(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(PKr,"_createPromise");function Nyo(t){return function(e){var r=RU(arguments,1);return t(function(n,o){try{var s=[],c=1;f7e(e,function(l,u){l&&(c++,R7e(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a(Nyo,"_createAllPromise");function Myo(t){return q1(function(e){var r=RU(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,ml(u,function(f){f.rejected?s[d]={status:rNt,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{ur(e)?Ct(e,l):wDt(e)?f7e(e,l):qm("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(Myo,"_createAllSettledPromise");function kKr(t){Ct(t,function(e){try{e()}catch{}})}a(kKr,"syncItemProcessor");function Oyo(t){var e=xh(t)?t:0;return function(r){Mp(function(){kKr(r)},e)}}a(Oyo,"timeoutItemProcessor");function DKr(t,e){return PKr(DKr,Oyo(e),t,e)}a(DKr,"createAsyncPromise");var XDt;function Byo(t,e){!XDt&&(XDt=q1(jf(ki,[w7e]).v||null));var r=XDt.v;if(!r)return DKr(t);Or(t)||qm(w7e+": executor is not a function - "+dr(t));var n=0;function o(){return wKr[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 h_(s,"state",{get:o}),s}a(Byo,"createNativePromise");var eNt;function hbe(t){return PKr(hbe,kKr,t)}a(hbe,"createSyncPromise");function P7e(t,e){return!eNt&&(eNt=Myo(hbe)),eNt.v(t,e)}a(P7e,"createSyncAllSettledPromise");var tNt;function Pd(t,e){return!tNt&&(tNt=q1(Byo)),tNt.v.call(this,t,e)}a(Pd,"createPromise");var k7e=Nyo(Pd);var Swl=JCe(11);p();p();p();p();var Y1=void 0,So="",WW="channels",Gf="core",D7e="createPerfMgr",mbe="disabled",TL="extensionConfig",zW="extensions",uC="processTelemetry",YW="priority",_se="eventsSent",BU="eventsDiscarded",vse="eventsSendRequest",cM="perfEvent",N7e="offlineEventsStored",M7e="offlineBatchSent",O7e="offlineBatchDrop",Cse="getPerfMgr",B7e="domain",L7e="path",NKr="Not dynamic - ",MKr="REDACTED",nNt=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var Lyo="getPrototypeOf",Fyo=/-([a-z])/g,Uyo=/([^\w\d_$])/g,Qyo=/^(\d+[\w\d_$])/,Mwl=Object[Lyo];function LU(t){return!Xt(t)}a(LU,"isNotNullOrUndefined");function gbe(t){var e=t;return e&&yi(e)&&(e=e[VP](Fyo,function(r,n){return n.toUpperCase()}),e=e[VP](Uyo,"_"),e=e[VP](Qyo,function(r,n){return"_"+n})),e}a(gbe,"normalizeJsName");function Hm(t,e){return t&&e?iu(t,e)!==-1:!1}a(Hm,"strContains");function FU(t){return t&&t.toISOString()||""}a(FU,"toISOString");function Op(t){return mL(t)?t[H1]:So}a(Op,"getExceptionName");function lM(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(lM,"setValue");function iNt(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(iNt,"getSetValue");function qyo(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][PU](n,o)}}a(qyo,"_createProxyFunction");function KW(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=qyo(r,n))}a(KW,"proxyFunctionAs");function JW(t,e,r,n){return t&&e&&qu(t)&&ur(r)&&Ct(r,function(o){yi(o)&&KW(t,o,e,o,n)}),t}a(JW,"proxyFunctions");function oNt(t){return(function(){function e(){var r=this;t&&Yr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(oNt,"createClassFromInterface");function U7e(t){return t&&gL&&(t=OU(gL({},t))),t}a(U7e,"optimizeObject");function Q7e(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[ln],d=!1,f=1;for(u>0&&jP(l)&&(d=l,l=c[f]||{},f++),qu(l)||(l={});f>>=0),vbe=jKr+t&XW,Cbe=HKr-t&XW,GKr=!0}a(tEo,"_mwcSeed");function rEo(){try{var t=hl()&2147483647;tEo((Math.random()*qKr^t)+t)}catch{}}a(rEo,"_autoSeedMwc");function QKr(t){var e=0,r=hNt()||mNt();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&XW),e===0&&Tse()&&(GKr||rEo(),e=nEo()&XW),e===0&&(e=j1(qKr*Math.random()|0)),t||(e>>>=0),e}a(QKr,"random32");function nEo(t){Cbe=36969*(Cbe&65535)+(Cbe>>16)&XW,vbe=18e3*(vbe&65535)+(vbe>>16)&XW;var e=(Cbe<<16)+(vbe&65535)>>>0&XW|0;return t||(e>>>=0),e}a(nEo,"mwcRandom32");function $Kr(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=QKr()>>>0,n=0,o=So;o[ln]>>=6,n===5&&(r=(QKr()<<2&4294967295|r&3)>>>0,n=0);return o}a($Kr,"newId");var VKr="3.3.11",iEo="."+$Kr(6),oEo=0;function WKr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(WKr,"_canAcceptData");function sEo(t,e){var r=e[t.id];if(!r){r={};try{WKr(e)&&ji(e,t.id,{e:!1,v:r})}catch{}}return r}a(sEo,"_getCache");function K1(t,e){return e===void 0&&(e=!1),gbe(t+oEo+++(e?"."+VKr:So)+iEo)}a(K1,"createUniqueNamespace");function H7e(t){var e={id:K1("_aiData-"+(t||So)+"."+VKr),accept:a(function(r){return WKr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[gbe(n)]:(s&&(c=sEo(e,r),c[gbe(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(H7e,"createElmNodeData");p();function G7e(t){return t&&qu(t)&&!ur(t)&&(t.isVal||t.fb||cA(t,"v")||cA(t,"mrg")||cA(t,"ref")||t.set)}a(G7e,"_isConfigDefaults");function zKr(t,e,r){var n,o=r.dfVal||ase;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&yKr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[ln]>0){c||(c=[]),l||(l=Mp(function(){l=null,f()},0));for(var A=0;A0?ml(IL(t[0],e),function(){Y7e(RU(t,1),e,r)}):r(),n}a(Y7e,"doUnloadAll");p();var XKr=500,vNt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function hEo(t,e,r){return!t&&Xt(t)?e:jP(t)?t:Qu(t)[$P]()==="true"}a(hEo,"_stringToBoolOrDefault");function CNt(t){return{mrg:!0,v:t}}a(CNt,"cfgDfMerge");function xse(t,e,r){return{fb:r,isVal:t,v:e}}a(xse,"cfgDfValidate");function ax(t,e){return{fb:e,set:hEo,v:!!t}}a(ax,"cfgDfBoolean");p();p();var bNt=[_se,BU,vse,cM],J7e=null,K7e;function mEo(t,e){return function(){var r=arguments,n=SNt(e);if(n){var o=n.listener;o&&o[t]&&o[t][PU](o,r)}}}a(mEo,"_listenerProxyFunc");function gEo(){var t=ki("Microsoft");return t&&(J7e=t.ApplicationInsights),J7e}a(gEo,"_getExtensionNamespace");function SNt(t){var e=J7e;return!e&&t.disableDbgExt!==!0&&(e=J7e||gEo()),e?e.ChromeDbgExt:null}a(SNt,"getDebugExt");function eJr(t){if(!K7e){K7e={};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){TNt("debug",A),g("warning",A)},d[pse]=function(A){TNt("warn",A),g("warning",A)},d.errorToConsole=function(A){TNt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[rx]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=EEo+y[gse];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 wbe(23,v,!1);d.queue[Fi](b),A===1?d.errorToConsole(v):d[pse](v)}}}a(f,"_logInternalMessage");function h(A){return sx(Ph(A,_Eo,d).cfg,function(y){var E=y.cfg;o=E[g7e],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=SNt(e||{});E&&E[lC]&&E[lC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function nJr(t){return t||new Rse}a(nJr,"_getLogger");function Wr(t,e,r,n,o,s){s===void 0&&(s=!1),nJr(t)[_L](e,r,n,o,s)}a(Wr,"_throwInternal");function xL(t,e){nJr(t)[pse](e)}a(xL,"_warnToConsole");var INt,qU,iJr="toGMTString",oJr="toUTCString",PNt="cookie",xNt="expires",sJr="isCookieUseDisabled",Rbe="disableCookiesUsage",aJr="_ckMgr",Z7e=null,wNt=null,cJr=null,dM,lJr={},uJr={},CEo=(INt={cookieCfg:CNt((qU={},qU[B7e]={fb:"cookieDomain",dfVal:LU},qU.path={fb:"cookiePath",dfVal:LU},qU.enabled=Y1,qU.ignoreCookies=Y1,qU.blockedCookies=Y1,qU.disableCookieDefer=!1,qU)),cookieDomain:Y1,cookiePath:Y1},INt[Rbe]=Y1,INt);function kNt(){!dM&&(dM=l7e(function(){return af()}))}a(kNt,"_getDoc");function X7e(t){return t?t.isEnabled():!0}a(X7e,"_isMgrEnabled");function gJr(t,e){return e&&t&&ur(t.ignoreCookies)?Ho(t.ignoreCookies,e)!==-1:!1}a(gJr,"_isIgnoredCookie");function dJr(t,e){return e&&t&&ur(t.blockedCookies)&&Ho(t.blockedCookies,e)!==-1?!0:gJr(t,e)}a(dJr,"_isBlockedCookie");function fJr(t,e){var r=e[DU];if(Xt(r)){var n=void 0;Nn(t[sJr])||(n=!t[sJr]),Nn(t[Rbe])||(n=!t[Rbe]),r=n}return r}a(fJr,"_isCfgEnabled");function AJr(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[L7e]=E||"/",_[xNt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return Tse()||(v["max-age"]="0"),hJr(So,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Di(E||So),R=iu(w,";");if(R!==-1&&(w=Di(tM(E,R)),T=yJr(Hf(E,R+1))),lM(T,B7e,v||o,Q1,Nn),!Xt(_)){var x=Tse();if(Nn(T[xNt])){var P=hl(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),lM(T,xNt,pJr(N,x?iJr:oJr)||pJr(N,x?iJr:oJr)||So,Q1)}}x||lM(T,"max-age",So+_,null,Nn)}var B=Ebe();return B&&B.protocol==="https:"&&(lM(T,"secure",null,null,Nn),wNt===null&&(wNt=!SEo((Hu()||{})[obe])),wNt&&lM(T,"SameSite","None",null,Nn)),lM(T,L7e,b||n,null,Nn),hJr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[ln]-1;_>=0;_--)f[_].n===E&&f[tx](_,1)}a(g,"_removePendingCookie");function A(){RNt(e)&&f&&(Ct(f,function(E){dJr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=Ph(t||uJr,null,e).cfg,s=sx(t,function(E){E.setDf(E.cfg,CEo),r=E.ref(E.cfg,"cookieCfg"),n=r[L7e]||"/",o=r[B7e],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=fJr(t,r)!==!1,l=r.getCookie||bEo,u=r.setCookie||mJr,d=r.delCookie||mJr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=fJr(t,r)!==!1&&c&&RNt(e),_=uJr[aJr];return E&&_&&y!==_&&(E=X7e(_)),E},"isEnabled"),setEnabled:a(function(E){r[DU]=E,Nn(t[Rbe])||(t[Rbe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=dJr(r,E);if(!R){var x=m(_,v,b,T);X7e(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=gJr(r,E);if(!v){if(X7e(y))_=l(E);else if(f)for(var b=f[ln]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=iu(w,";");_=R!==-1?Di(tM(w,R)):Di(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return X7e(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 RNt(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[aJr]=y,y}a(AJr,"createCookieMgr");function RNt(t){if(Z7e===null){Z7e=!1,!dM&&kNt();try{var e=dM.v||{};Z7e=e[PNt]!==void 0}catch(r){Wr(t,2,68,"Cannot access document.cookie - "+Op(r),{exception:dr(r)})}}return Z7e}a(RNt,"areCookiesSupported");function yJr(t){var e={};if(t&&t[ln]){var r=Di(t)[nx](";");Ct(r,function(n){if(n=Di(n||So),n){var o=iu(n,"=");o===-1?e[n]=null:e[Di(tM(n,o))]=Di(Hf(n,o+1))}})}return e}a(yJr,"_extractParts");function pJr(t,e){return Or(t[e])?t[e]():null}a(pJr,"_formatDate");function hJr(t,e){var r=t||So;return Yr(e,function(n,o){r+="; "+n+(Xt(o)?So:"="+o)}),r}a(hJr,"_formatCookieValue");function bEo(t){var e=So;if(!dM&&kNt(),dM.v){var r=dM.v[PNt]||So;cJr!==r&&(lJr=yJr(r),cJr=r),e=Di(lJr[t]||So)}return e}a(bEo,"_getCookieValue");function mJr(t,e){!dM&&kNt(),dM.v&&(dM.v[PNt]=t+"="+e)}a(mJr,"_setCookieValue");function SEo(t){return yi(t)?!!(Hm(t,"CPU iPhone OS 12")||Hm(t,"iPad; CPU OS 12")||Hm(t,"Macintosh; Intel Mac OS X 10_14")&&Hm(t,"Version/")&&Hm(t,"Safari")||Hm(t,"Macintosh; Intel Mac OS X 10_14")&&EL(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||Hm(t,"Chrome/5")||Hm(t,"Chrome/6")||Hm(t,"UnrealEngine")&&!Hm(t,"Chrome")||Hm(t,"UCBrowser/12")||Hm(t,"UCBrowser/11")):!1}a(SEo,"uaDisallowsSameSiteNone");p();var TEo={perfEvtsSendAll:!1};function IEo(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){jf(r.fn,[r.arg])})}a(IEo,"_runScheduledListeners");function jU(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[Fi]({fn:n,arg:o}),r.h=r.h||Mp(IEo,0,r)):jf(n,[o]))})}a(jU,"_runListeners");var EJr=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Ph(e,TEo);n=c[nM](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[hse]=function(u){for(var d=Ho(o,u);d>-1;)o[tx](d,1),d=Ho(o,u)},l[_se]=function(u){jU(o,_se,s,function(d){d[_se](u)})},l[BU]=function(u,d,f){jU(o,BU,s,function(h){h[BU](u,d,f)})},l[vse]=function(u,d){jU(o,vse,d?s:null,function(f){f[vse](u,d)})},l[cM]=function(u){u&&(r||!u[cbe]())&&jU(o,cM,null,function(d){u.isAsync?Mp(function(){return d[cM](u)},0):d[cM](u)})},l[N7e]=function(u){u&&u[ln]&&jU(o,N7e,s,function(d){d[N7e](u)})},l[M7e]=function(u){u&&u[V1]&&jU(o,M7e,s,function(d){d[M7e](u)})},l[O7e]=function(u,d){if(u>0){var f=d||0;jU(o,O7e,s,function(h){h[O7e](u,f)})}},l[rx]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[iM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(jU(o,"unload",null,function(h){var m=h[rx](u);m&&(f||(f=[]),f[Fi](m))}),f)return Pd(function(h){return ml(k7e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Pse="ctx",NNt="ParentContextKey",Pbe="ChildrenContextKey",xEo=null,eQe=(function(){function t(e,r,n){var o=this;if(o.start=hl(),o[H1]=e,o.isAsync=n,o[cbe]=function(){return!1},Or(r)){var s;ji(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[HW]=function(c){return c?c===t[NNt]||c===t[Pbe]?o[c]:(o[Pse]||{})[c]:null},o[zP]=function(c,l){if(c)if(c===t[NNt])o[c]||(o[cbe]=function(){return!0}),o[c]=l;else if(c===t[Pbe])o[c]=l;else{var u=o[Pse]=o[Pse]||{};u[c]=l}},o.complete=function(){var c=0,l=o[HW](t[Pbe]);if(ur(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Wr(r[Gu],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[TL];!_&&A&&(_={}),E[TL]=_,_=e.ref(E,TL),_&&(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)}bbe(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[kU]();y&&g(y)}}return a(m,"_iterateChain"),c}a(LNt,"_createInternalContext");function YP(t,e,r,n){var o=Ph(e),s=LNt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[uC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=HU(d,o.cfg,r,f)),YP(d||c[$1](),o.cfg,r,f)}return a(u,"_createNew"),c[jm]=l,c[sM]=u,c}a(YP,"createProcessTelemetryContext");function kse(t,e,r){var n=Ph(e.config),o=LNt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[rx](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=HU(u,n.cfg,e,d)),kse(u||s[$1](),e,d)}return a(l,"_createNew"),s[jm]=c,s[sM]=l,s}a(kse,"createProcessTelemetryUnloadContext");function kbe(t,e,r){var n=Ph(e.config),o=LNt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[jW])&&d[jW](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=HU(u,n.cfg,e,d)),kbe(u||s[$1](),e,d)}return a(l,"_createNew"),s[jm]=c,s[sM]=l,s}a(kbe,"createProcessTelemetryUpdateContext");function HU(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[ln]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[uC])){var u=NEo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?HU([n],e,r):o}a(HU,"createTelemetryProxyChain");function NEo(t,e,r){var n=null,o=Or(t[uC]),s=Or(t[MU]),c;t?c=t[oM]+"-"+t[YW]+"-"+IJr++:c="Unknown-0-"+IJr++;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[TJr])&&(g=t[TJr]()),g||(g=YP(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[oM]:kEo,T=g[SJr];return T||(T=g[SJr]={}),g.setNext(n),t&&tQe(g[Gf](),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[lC](),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 _=wL(t);return _[G1]||_[mbe]?!1:(s&&t[MU](n),t[uC](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 _=wL(t),v=t[Gf]||_[Gf];t&&(!v||v===g.core())&&!_[G1]&&(_[Gf]=null,_[G1]=!0,_[cC]=!1,t[G1]&&t[G1](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 _=wL(t),v=t[Gf]||_[Gf];t&&(!v||v===g.core())&&!_[G1]&&t[jW]&&t[jW](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[jm](A)}return a(m,"_updatePlugin"),wh(l)}a(NEo,"createTelemetryPluginProxy");var MEo=(function(){function t(e,r,n,o){var s=this,c=YP(e,r,n,o);JW(s,c,ju(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function nQe(){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[lC](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(nQe,"createUnloadHandlerContainer");p();var iQe,oQe;function sQe(){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))}}),iQe&&o[ln]>iQe&&(oQe?oQe("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&&(Rh(t,n),iQe&&t[ln]>iQe&&(oQe?oQe("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(sQe,"createUnloadHookContainer");var FNt,GU="getPlugin",OEo=(FNt={},FNt[TL]={isVal:LU,v:{}},FNt),Dbe=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[vL]=function(h,m,g,A){u(h,m,A),r=!0},f[G1]=function(h,m){var g=f[Gf];if(!g||h&&g!==h[Gf]())return;var A,y=!1,E=h||kse(null,g,o&&o[GU]?o[GU]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[lC]()),A===!0&&E[jm](_),d())}return a(v,"_unloadCallback"),!f[NU]||f[NU](E,_,v)!==!0?v():A=!0,A},f[jW]=function(h,m){var g=f[Gf];if(!g||h&&g!==h[Gf]())return;var A,y=!1,E=h||kbe(null,g,o&&o[GU]?o[GU]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[$1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},KW(f,"_addUnloadCb",function(){return s},"add"),KW(f,"_addHook",function(){return c},"add"),ji(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[lC]=function(f){return l(f)[lC]()},e[cC]=function(){return r},e.setInitialized=function(f){r=f},e[MU]=function(f){o=f},e[jm]=function(f,h){h?h[jm](f):o&&Or(o[uC])&&o[uC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||YP(null,{},e[Gf]);o&&o[GU]?h=m[sM](null,o[GU]):h=m[sM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Ph(f,OEo,ez(h)),!m&&h&&(m=h[h7e]()[$1]());var g=o;o&&o[GU]&&(g=o[GU]()),e[Gf]=h,n=YP(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Gf]=null,n=null,o=null,c=sQe(),s=nQe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function BEo(t,e,r){var n={id:e,fn:r};Rh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[tx](c,1),-1})},"remove")};return o}a(BEo,"_addInitializer");function LEo(t,e,r){for(var n=!1,o=t[ln],s=0;s"},"v")})}a(WEo,"_createUnloadHook");var qNt=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,B,L,j,M,O,q,Q;Si(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[cC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[vL]=function(ie,le,Ne,we){g&&zc(wJr),U[cC]()&&zc("Core cannot be initialized more than once"),e=Ph(ie,UNt,Ne||U[Gu],!1),ie=e.cfg,je(e[nM](function(st){var _t=st.cfg;L=_t.initInMemoMaxSize||QEo,z(_t);var kt=st.ref(st.cfg,TL);Yr(kt,function($t){st.ref(kt,$t)})})),s=we,b=VEo(e,v,s&&U[nbe](),b),K(),U[Gu]=Ne;var Le=ie[zW];if(f=[],f[Fi].apply(f,$W($W([],le,!1),Le,!1)),h=ie[WW],Be(null),(!m||m[ln]===0)&&zc("No "+WW+" available"),h&&h[ln]>1){var rt=U[kU]("TeeChannelController");(!rt||!rt.plugin)&&Wr(n,1,28,"TeeChannel required")}$Eo(ie,R,n),R=null,r=!0,N===GP.ACTIVE&&J()},U.getChannels=function(){var ie=[];return m&&Ct(m,function(le){ie[Fi](le)}),wh(ie)},U.track=function(ie){tQe(U[Cse](),function(){return"AppInsightsCore:track"},function(){ie===null&&(ue(ie),zc("Invalid telemetry item")),!ie[H1]&&Xt(ie[H1])&&(ue(ie),zc("telemetry name required")),ie.iKey=ie.iKey||w,ie.time=ie.time||FU(new Date),ie.ver=ie.ver||"4.0",!g&&U[cC]()&&N===GP.ACTIVE?ae()[jm](ie):N!==GP.INACTIVE&&o[ln]<=L&&o[Fi](ie)},function(){return{item:ie}},!ie.sync)},U[h7e]=ae,U[nbe]=function(){return s||(s=new EJr(e.cfg),U[FEo]=s),s},U[mse]=function(ie){U.getNotifyMgr()[mse](ie)},U[hse]=function(ie){s&&s[hse](ie)},U.getCookieMgr=function(){return u||(u=AJr(e.cfg,U[Gu])),u},U.setCookieMgr=function(ie){u!==ie&&(IL(u,!1),u=ie)},U[Cse]=function(){return c||l||vJr()},U.setPerfMgr=function(ie){c=ie},U.eventCnt=function(){return o[ln]},U.releaseQueue=function(){if(r&&o[ln]>0){var ie=o;o=[],N===2?Ct(ie,function(le){le.iKey=le.iKey||w,ae()[jm](le)}):Wr(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ie){return y=ie||null,Q=!1,O&&O[iM](),ne(!0)};function z(ie){var le=ie.instrumentationKey,Ne=ie.endpointUrl;if(N!==3){if(Xt(le)){w=null,N=GP.INACTIVE;var we="Please provide instrumentation key";r?(Wr(n,1,100,we),J()):zc(we);return}var Le=[];V0(le)?(Le[Fi](le),w=null):w=le,V0(Ne)?(Le[Fi](Ne),B=null):B=Ne,Le[ln]?$(ie,Le):W()}}a(z,"_handleIKeyEndpointPromises");function $(ie,le){j=!1,N=3;var Ne=LU(ie.initTimeOut)?ie.initTimeOut:qEo,we=P7e(le);M&&M[iM](),M=Mp(function(){M=null,j||W()},Ne),ml(we,function(Le){try{if(j)return;if(!Le.rejected){var rt=Le[CL];if(rt&&rt[ln]){var st=rt[0];if(w=st&&st[CL],rt[ln]>1){var _t=rt[1];B=_t&&_t[CL]}}w&&(ie.instrumentationKey=w,ie.endpointUrl=B)}W()}catch{j||W()}})}a($,"_waitForInitPromises");function W(){j=!0,Xt(w)?(N=GP.INACTIVE,Wr(n,1,112,"ikey can't be resolved from promises")):N=GP.ACTIVE,J()}a(W,"_setStatus");function J(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(J,"_releaseQueues");function ne(ie){if((!O||!O[DU])&&!Q){var le=ie||n&&n.queue[ln]>0;le&&(q||(q=!0,je(e[nM](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Le=!1;O&&(Le=O[DU],O[iM]()),O=p7e(Z,we),O.unref(),O[DU]=Le}))),O[DU]=!0)}return O}a(ne,"_startLogPoller"),U[DDt]=function(){Q=!0,O&&O[iM](),Z()},JW(U,function(){return A},["addTelemetryInitializer"]),U[rx]=function(ie,le,Ne){ie===void 0&&(ie=!0),r||zc(UEo),g&&zc(wJr);var we={reason:50,isAsync:ie,flushComplete:!1},Le;ie&&!le&&(Le=Pd(function(_t){le=_t}));var rt=kse(Ue(),U);rt[ibe](function(){v.run(U[Gu]),Y7e([u,s,n],ie,function(){re(),le&&le(we)})},U);function st(_t){we.flushComplete=_t,g=!0,_.run(rt,we),U[DDt](),rt[jm](we)}return a(st,"_doUnload"),Z(),ee(ie,st,6,Ne)||st(!1),Le},U[kU]=ve,U.addPlugin=function(ie,le,Ne,we){if(!ie){we&&we(!1),X(kJr);return}var Le=ve(ie[oM]);if(Le&&!le){we&&we(!1),X("Plugin ["+ie[oM]+"] is already loaded!");return}var rt={reason:16};function st($t){f[Fi](ie),rt.added=[ie],Be(rt),we&&we(!0)}if(a(st,"_addPlugin"),Le){var _t=[Le.plugin],kt={reason:2,isAsync:!!Ne};Pe(_t,kt,function($t){$t?(rt.removed=_t,rt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ie,le){le===void 0&&(le=!0);var Ne;if(U[cC]()){Ne={reason:1,cfg:e.cfg,oldCfg:dse({},e.cfg),newConfig:dse({},ie),merge:le},ie=Ne.newConfig;var we=e.cfg;ie[zW]=we[zW],ie[WW]=we[WW]}e._block(function(Le){var rt=Le.cfg;QNt(Le,rt,ie,le),le||Yr(rt,function(st){cA(ie,st)||Le.set(rt,st,Y1)}),Le.setDf(rt,UNt)},!0),e.notify(),Ne&&he(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ie){return T||(T=bJr()),T},U.setTraceCtx=function(ie){T=ie||null},U.addUnloadHook=je,KW(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ie){var le;return r?le=sx(e.cfg,ie,U[Gu]):le=GEo(R,ie),WEo(le)},U.getWParam=function(){return AL()||e.cfg.enableWParam?0:-1};function H(){var ie={};P=[];var le=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[oM]&&we[m7e]&&!ie[we.identifier]){var Le=we[oM]+"="+we[m7e];P[Fi](Le),ie[we.identifier]=we}})},"_addPluginVersions");le(m),h&&Ct(h,function(Ne){le(Ne)}),le(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Ph({},UNt,U[Gu]),e.cfg[g7e]=1,ji(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(le){U.updateCfg(le,!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 Rse(e.cfg),e[Gu]=n),n},"g"),s:a(function(le){e[Gu]=le,n!==le&&(IL(n,!1),n=le)},"s")}),U[Gu]=new Rse(e.cfg),x=[];var ie=U.config[zW]||[];ie.splice(0,ie[ln]),Rh(ie,x),A=new xJr,o=[],IL(s,!1),s=null,c=null,l=null,IL(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=K1("AIBaseCore",!0),_=nQe(),T=null,w=null,v=sQe(),R=[],D=null,P=null,Q=!1,O=null,q=!1,N=0,B=null,L=null,j=!1,M=null}a(re,"_initDefaults");function ae(){var ie=YP(Ue(),e.cfg,U);return ie[ibe](ne),ie}a(ae,"_createTelCtx");function Be(ie){var le=HEo(U[Gu],XKr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=rQe(Rh(m,le[WW]));var Ne=Rh(rQe(le[Gf]),m);x=wh(Ne);var we=U.config[zW]||[];we.splice(0,we[ln]),Rh(we,x);var Le=ae();m&&m[ln]>0&&BNt(Le[sM](m),Ne),BNt(Le,Ne),ie&&he(ie)}a(Be,"_initPluginChain");function ve(ie){var le=null,Ne=null,we=[];return Ct(x,function(Le){if(Le[oM]===ie&&Le!==A)return Ne=Le,-1;Le.getChannel&&we[Fi](Le)}),!Ne&&we[ln]>0&&Ct(we,function(Le){if(Ne=Le.getChannel(ie),!Ne)return-1}),Ne&&(le={plugin:Ne,setEnabled:a(function(Le){wL(Ne)[mbe]=!Le},"setEnabled"),isEnabled:a(function(){var Le=wL(Ne);return!Le[G1]&&!Le[mbe]},"isEnabled"),remove:a(function(Le,rt){Le===void 0&&(Le=!0);var st=[Ne],_t={reason:1,isAsync:Le};Pe(st,_t,function(kt){kt&&Be({reason:32,removed:st}),rt&&rt(kt)})},"remove")}),le}a(ve,"_getPlugin");function Ue(){if(!d){var ie=(x||[]).slice();Ho(ie,A)===-1&&ie[Fi](A),d=HU(rQe(ie),e.cfg,U)}return d}a(Ue,"_getPluginChain");function Pe(ie,le,Ne){if(ie&&ie[ln]>0){var we=HU(ie,e.cfg,U),Le=kse(we,U);Le[ibe](function(){var rt=!1,st=[];Ct(f,function(kt,$t){RJr(kt,ie)?rt=!0:st[Fi](kt)}),f=st,D=null,P=null;var _t=[];h&&(Ct(h,function(kt,$t){var Ht=[];Ct(kt,function(Ie){RJr(Ie,ie)?rt=!0:Ht[Fi](Ie)}),_t[Fi](Ht)}),h=_t),Ne&&Ne(rt),ne()}),Le[jm](le)}else Ne(!1)}a(Pe,"_removePlugins");function Z(){if(n&&n.queue){var ie=n.queue.slice(0);n.queue[ln]=0,Ct(ie,function(le){var Ne={name:y||"InternalMessageId: "+le[gse],iKey:w,time:FU(new Date),baseType:wbe.dataType,baseData:{message:le[aM]}};U.track(Ne)})}}a(Z,"_flushInternalLogs");function ee(ie,le,Ne,we){var Le=1,rt=!1,st=null;we=we||5e3;function _t(){Le--,rt&&Le===0&&(st&&st[iM](),st=null,le&&le(rt),le=null)}if(a(_t,"doCallback"),m&&m[ln]>0){var kt=ae()[sM](m);kt.iterate(function($t){if($t.flush){Le++;var Ht=!1;$t.flush(ie,function(){Ht=!0,_t()},Ne)||Ht||(ie&&st==null?st=Mp(function(){st=null,_t()},we):_t())}})}return rt=!0,_t(),!0}a(ee,"_flushChannels");function K(){var ie;je(e[nM](function(le){var Ne=le.cfg.enablePerfMgr;if(Ne){var we=le.cfg[D7e];(ie!==we||!ie)&&(we||(we=jEo),iNt(le.cfg,D7e,we),ie=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[nbe]()))}else l=null,ie=null}))}a(K,"_initPerfManager");function he(ie){var le=kbe(Ue(),U);le[ibe](ne),(!U._updateHook||U._updateHook(le,ie)!==!0)&&le[jm](ie)}a(he,"_doUpdate");function X(ie){var le=U[Gu];le?(Wr(le,2,73,ie),ne()):zc(ie)}a(X,"_logOrThrowError");function ue(ie){var le=U[nbe]();le&&le[BU]([ie],2)}a(ue,"_notifyInvalidEvent");function je(ie){v.add(ie)}a(je,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function Nbe(t,e){try{if(t&&t!==""){var r=g_().parse(t);if(r&&r[ODt]&&r[ODt]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[ln])return r}}catch(n){Wr(e,1,43,"Cannot parse the response. "+(n[H1]||dr(n)),{response:t})}return null}a(Nbe,"parseResponse");p();var KP="",zEo="NoResponseBody",DJr="&"+zEo+"=true",jNt="POST",HNt=(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;j(),E[vL]=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=Ebe();O&&O.protocol&&O.protocol[$P]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[ln]?R(M,O):null},E.getFallbackInst=function(){return d},E[NU]=function(M,O){j()},E.preparePayload=function(M,O,q,Q){if(!O||Q||!q[V1]){M(q);return}try{var U=ki("CompressionStream");if(!Or(U)){M(q);return}var z=new ReadableStream({start:a(function(re){re.enqueue(yi(q[V1])?new TextEncoder().encode(q[V1]):q[V1]),re.close()},"start")}),$=z.pipeThrough(new U("gzip")),W=$.getReader(),J=[],ne=0,H=!1;return ml(W.read(),a(function re(ae){if(!H&&!ae.rejected){var Be=ae[CL];if(!Be.done)return J[Fi](Be[CL]),ne+=Be.value[ln],ml(W.read(),re);for(var ve=new Uint8Array(ne),Ue=0,Pe=0,Z=J;Pe0&&(Ct(ju(ve),function(K){H.append(K,ve[K])}),Ue[lbe]=H),u?Ue.credentials=u:v&&s&&(Ue.credentials="include"),q&&(Ue.keepalive=!0,e+=re,s?M._sendReason===2&&(ae=!0,A&&(U+=DJr)):ae=!0);var Pe=new Request(U,Ue);try{Pe[vNt]=!0}catch{}if(!q&&r&&(W=Pd(function(K,he){J=K,ne=he})),!U){w(O),J&&J(!1);return}function Z(K,he){he?x(O,s?0:he,{},s?KP:K):x(O,s?0:400,{},s?KP:K)}a(Z,"_handleError");function ee(K,he,X){var ue=K[WP],je=c.fetchOnComplete;je&&Or(je)?je(K,O,X||KP,he):x(O,ue,{},X||KP)}a(ee,"_onFetchComplete");try{ml(fetch(s?U:Pe,s?Ue:null),function(K){if(q&&(e-=re,re=0),!Be)if(Be=!0,K.rejected)Z(K.reason&&K.reason[aM],499),ne&&ne(K.reason);else{var he=K[CL];try{!s&&!he.ok?(he[WP]?Z(he.statusText,he[WP]):Z(he.statusText,499),J&&J(!1)):s&&!he.body?(ee(he,null,KP),J&&J(!0)):ml(he.text(),function(X){ee(he,M,X[CL]),J&&J(!0)})}catch(X){he&&he[WP]?Z(dr(X),he[WP]):Z(dr(X),499),ne&&ne(X)}}})}catch(K){Be||(Z(dr(K),499),ne&&ne(K))}return ae&&!Be&&(Be=!0,x(O,200,{}),J&&J(!0)),s&&!Be&&M[GW]>0&&y&&y.set(function(){Be||(Be=!0,x(O,500,{}),J&&J(!0))},M[GW]),W}a(B,"_doFetchSender");function L(M,O,q){var Q=cf(),U=new XDomainRequest,z=M[V1];U.onload=function(){var H=bse(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?KP:Abe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var $=Q&&Q.location&&Q.location.protocol||"",W=M[Ase];if(!W){w(O);return}if(!s&&W.lastIndexOf($,0)!==0){var J="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Wr(o,2,40,". "+J),T(J,O);return}var ne=s?W:W[VP](/^(https?:)/,"");U.open(jNt,ne),M[GW]&&(U[GW]=M[GW]),U.send(z),s&&q?y&&y.set(function(){U.send(z)},0):U.send(z)}a(L,"_xdrSender");function j(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(j,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var UJr="on",NJr="attachEvent",MJr="addEventListener",OJr="detachEvent",BJr="removeEventListener",GNt="events";var j2l=K1("aiEvtPageHide"),H2l=K1("aiEvtPageShow"),YEo=/\.[\.]+/g,KEo=/[\.]+$/,JEo=1,aQe=H7e("events"),ZEo=/^([^.]*)(?:\.(.+)|)/;function LJr(t){return t&&t[VP]?t[VP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,So):t}a(LJr,"_normalizeNamespace");function $Nt(t,e){if(e){var r=So;ur(e)?(r=So,Ct(e,function(o){o=LJr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=LJr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||So)+r)}var n=ZEo.exec(t||So)||[];return{type:n[1],ns:(n[2]||So).replace(YEo,".").replace(KEo,So)[nx](".").sort().join(".")}}a($Nt,"_getEvtNamespace");function QJr(t,e,r){r===void 0&&(r=!0);var n=aQe.get(t,GNt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(QJr,"_getRegisteredEvents");function qJr(t,e,r,n){t&&e&&e[bL]&&(t[BJr]?t[BJr](e[bL],r,n):t[OJr]&&t[OJr](UJr+e[bL],r))}a(qJr,"_doDetach");function XEo(t,e,r,n){var o=!1;return t&&e&&e[bL]&&r&&(t[MJr]?(t[MJr](e[bL],r,n),o=!0):t[NJr]&&(t[NJr](UJr+e[bL],r),o=!0)),o}a(XEo,"_doAttach");function FJr(t,e,r,n){for(var o=e[ln];o--;){var s=e[o];s&&(!r.ns||r.ns===s[NDt].ns)&&(!n||n(s))&&(qJr(t,s[NDt],s.handler,s.capture),e[tx](o,1))}}a(FJr,"_doUnregister");function e_o(t,e,r){if(e[bL])FJr(t,QJr(t,e[bL]),e,r);else{var n=aQe.get(t,GNt,{});Yr(n,function(o,s){FJr(t,s,e,r)}),ju(n)[ln]===0&&aQe.kill(t,GNt)}}a(e_o,"_unregisterEvents");function Mbe(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=$Nt("xx",r).ns[nx](".")):r=t,r}a(Mbe,"mergeEvtNamespace");function cQe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=$Nt(e,n);if(s=XEo(t,c,r,o),s&&aQe.accept(t)){var l={guid:JEo++,evtName:c,handler:r,capture:o};QJr(t,c.type)[Fi](l)}}catch{}return s}a(cQe,"eventOn");function VNt(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=$Nt(e,n),c=!1;e_o(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||qJr(t,s,r,o)}catch{}}a(VNt,"eventOff");p();var Obe="sampleRate",Bbe="ProcessLegacy",lQe="http.method",tz="https://dc.services.visualstudio.com",fM="/v2/track",Uy="not_specified";p();var uQe=kDt({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 rz="split",mo="length",nz="toLowerCase",VU="ingestionendpoint",WU="toString",WNt="removeItem",Dse="message",zJr="count";var Lbe="stringify",Fbe="pathname",iz="match";var Qy="name";var lA="properties",qy="measurements",Ube="sizeInBytes",Qbe="typeName",Nse="exceptions",oz="severityLevel",dQe="problemGroup",sz="parsedStack",qbe="hasFullStack",jbe="assembly",pM="fileName",az="line",Mse="aiDataContract",cz="duration";function zNt(t,e,r){var n=e[mo],o=YJr(t,e);if(o[mo]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=Hf(o,0,147)+KJr(s);o=c}return o}a(zNt,"dataSanitizeKeyAndAddUniqueness");function YJr(t,e){var r;return e&&(e=Di(Qu(e)),e[mo]>150&&(r=Hf(e,0,150),Wr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(YJr,"dataSanitizeKey");function ou(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Di(Qu(e)),e[mo]>r&&(n=Hf(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(ou,"dataSanitizeString");function lz(t,e,r){return yi(e)&&(e=yNt(e,r)),JNt(t,e,2048,66)}a(lz,"dataSanitizeUrl");function Hbe(t,e){var r;return e&&e[mo]>32768&&(r=Hf(e,0,32768),Wr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(Hbe,"dataSanitizeMessage");function YNt(t,e){var r;if(e){var n=""+e;n[mo]>32768&&(r=Hf(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(YNt,"dataSanitizeException");function A_(t,e){if(e){var r={};Yr(e,function(n,o){if(qu(o)&&UU())try{o=g_()[Lbe](o)}catch(s){Wr(t,2,49,"custom property is not valid",{exception:s},!0)}o=ou(t,o,8192),n=zNt(t,n,r),r[n]=o}),e=r}return e}a(A_,"dataSanitizeProperties");function y_(t,e){if(e){var r={};Yr(e,function(n,o){n=zNt(t,n,r),r[n]=o}),e=r}return e}a(y_,"dataSanitizeMeasurements");function KNt(t,e){return e&&JNt(t,e,128,69)[WU]()}a(KNt,"dataSanitizeId");function JNt(t,e,r,n){var o;return e&&(e=Di(Qu(e)),e[mo]>r&&(o=Hf(e,0,r),Wr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(JNt,"dataSanitizeInput");function KJr(t){var e="00"+t;return c7e(e,e[mo]-3)}a(KJr,"dsPadNumber");p();var JJr=af()||{},ZJr=0,r_o=[null,null,null,null,null];function XJr(t){var e=ZJr,r=r_o,n=r[e];return JJr.createElement?r[e]||(n=r[e]=JJr.createElement("a")):n={host:n_o(t,!0)},n.href=t,e++,e>=r[mo]&&(e=0),ZJr=e,n}a(XJr,"urlParseUrl");function n_o(t,e){var r=eZr(t,e)||"";if(r){var n=r[iz](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>3&&yi(n[2])&&n[2][mo]>0)return n[2]+(n[3]||"")}return r}a(n_o,"urlParseHost");function eZr(t,e){var r=null;if(t){var n=t[iz](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>2&&yi(n[2])&&n[2][mo]>0&&(r=n[2]||"",e&&n[mo]>2)){var o=(n[1]||"")[nz](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(eZr,"urlParseFullHost");var i_o=[tz+fM,"https://breeze.aimon.applicationinsights.io"+fM,"https://dc-int.services.visualstudio.com"+fM];function fQe(t){return Ho(i_o,t[nz]())!==-1}a(fQe,"isInternalApplicationInsightsEndpoint");function tZr(t,e,r,n){var o,s=n,c=n;if(e&&e[mo]>0){var l=XJr(e);if(o=l.host,!s)if(l[Fbe]!=null){var u=l.pathname[mo]===0?"/":l[Fbe];u.charAt(0)!=="/"&&(u="/"+u),c=l[Fbe],s=ou(t,r?r+" "+u:u)}else s=ou(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a(tZr,"AjaxHelperParseDependencyPath");p();p();var pQe=rbe({LocalStorage:0,SessionStorage:1});var Ose=void 0,rZr="";function nZr(t){try{if(Xt(Ly()))return null;var e=new Date()[WU](),r=ki(t===pQe.LocalStorage?"localStorage":"sessionStorage"),n=rZr+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[WNt](n),!o)return r}catch{}return null}a(nZr,"_getVerifiedStorageObject");function ZNt(){return hQe()?nZr(pQe.SessionStorage):null}a(ZNt,"_getSessionStorageObject");function XNt(t){rZr=t||""}a(XNt,"utlSetStoragePrefix");function hQe(t){return(t||Ose===void 0)&&(Ose=!!nZr(pQe.SessionStorage)),Ose}a(hQe,"utlCanUseSessionStorage");function eMt(t,e){var r=ZNt();if(r!==null)try{return r.getItem(e)}catch(n){Ose=!1,Wr(t,2,2,"Browser failed read of session storage. "+Op(n),{exception:dr(n)})}return null}a(eMt,"utlGetSessionStorage");function tMt(t,e,r){var n=ZNt();if(n!==null)try{return n.setItem(e,r),!0}catch(o){Ose=!1,Wr(t,2,4,"Browser failed write to session storage. "+Op(o),{exception:dr(o)})}return!1}a(tMt,"utlSetSessionStorage");function rMt(t,e){var r=ZNt();if(r!==null)try{return r[WNt](e),!0}catch(n){Ose=!1,Wr(t,2,6,"Browser failed removal of session storage item. "+Op(n),{exception:dr(n)})}return!1}a(rMt,"utlRemoveSessionStorage");p();var o_o=";",s_o="=";function Gbe(t){if(!t)return{};var e=t[rz](o_o),r=ZCe(e,function(o,s){var c=s[rz](s_o);if(c[mo]===2){var l=c[0][nz](),u=c[1];o[l]=u}return o},{});if(ju(r)[mo]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[VU]=r[VU]||"https://"+n+"dc."+r.endpointsuffix}r[VU]=r[VU]||tz,EL(r[VU],"/")&&(r[VU]=r[VU].slice(0,-1))}return r}a(Gbe,"parseConnectionString");p();var nMt=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[Qy]=ou(e,n)||Uy,s.data=r,s.time=FU(new Date),s[Mse]={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 RL=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[Qy]=ou(e,r)||Uy,s[lA]=A_(e,n),s[qy]=y_(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var a_o=58,c_o=/^\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\?]+)?)/,l_o=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,u_o=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,d_o=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,f_o=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,p_o=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,h_o=/([^\(\s\n]+):([0-9]+)$/,iZr="",Bse="error",cx="stack",oMt="stackDetails",oZr="errorSrc",sMt="message",lZr="description",sZr=[{re:l_o,len:5,m:1,fn:2,ln:3,col:4},{chk:g_o,pre:m_o,re:u_o,len:4,m:1,fn:2,ln:3},{re:d_o,len:3,m:1,fn:2,hdl:cZr},{re:f_o,len:2,fn:1,hdl:cZr}];function m_o(t){return t.replace(/(\(anonymous\))/,"")}a(m_o,"_scrubAnonymous");function g_o(t){return iu(t,"[native")<0}a(g_o,"_ignoreNative");function aMt(t,e){var r=t;return r&&!yi(r)&&(JSON&&JSON[Lbe]?(r=JSON[Lbe](t),e&&(!r||r==="{}")&&(Or(t[WU])?r=t[WU]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a(aMt,"_stringify");function uZr(t,e){var r=t;return t&&(r&&!yi(r)&&(r=t[sMt]||t[lZr]||r),r&&!yi(r)&&(r=aMt(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&iu(r||"",e)===-1&&(r=e+": "+r),r||""}a(uZr,"_formatMessage");function A_o(t){try{if(qu(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(A_o,"_isExceptionDetailsInternal");function y_o(t){try{if(qu(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(y_o,"_isExceptionInternal");function aZr(t){return t&&t.src&&yi(t.src)&&t.obj&&ur(t.obj)}a(aZr,"_isStackDetails");function uz(t){var e=t||"";yi(e)||(yi(e[cx])?e=e[cx]:e=""+e);var r=e[rz](` -`);return{src:e,obj:r}}a(uz,"_convertStackObj");function E_o(t){for(var e=[],r=t[rz](` -`),n=0;n0){e=[];var n=0,o=!1,s=0;Ct(r,function(y){if(o||T_o(y)){var E=Qu(y);o=!0;var _=I_o(E,n);_&&(s+=_[Ube],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(v_o,"_parseStack");function mQe(t){var e="";if(t&&(e=t.typeName||t[Qy]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[WU]());e=n&&n[mo]>1?n[1]:""}catch{}return e}a(mQe,"_getErrorType");function iMt(t){if(t)try{if(!yi(t)){var e=mQe(t),r=aMt(t,!1);return(!r||r==="{}")&&(t[Bse]&&(t=t[Bse],e=mQe(t)),r=aMt(t,!0)),iu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(iMt,"_formatErrorCode");var dz=(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,y_o(r)?(l[Nse]=r[Nse]||[],l[lA]=r[lA],l[qy]=r[qy],r[oz]&&(l[oz]=r[oz]),r.id&&(l.id=r.id,r[lA].id=r.id),r[dQe]&&(l[dQe]=r[dQe]),Xt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[Nse]=[fZr(e,r,n)],l[lA]=A_(e,n),l[qy]=y_(e,o),s&&(l[oz]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=mQe(s||c||e);return{message:uZr(e,d),url:r,lineNumber:n,columnNumber:o,error:iMt(s||c||e),evt:iMt(c||e),typeName:d,stackDetails:dZr(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[Nse]&&yL(r[Nse],function(l){return S_o(e,l)}),c=new t(e,ox(ox({},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&&yL(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[qbe]=!0,l.message=e,l.stack=s,l.typeName=r,l)]}},t.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",t.dataType="ExceptionData",t.formatError=iMt,t})();var C_o=wh({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function b_o(){var t=this,e=ur(t[sz])&&yL(t[sz],function(n){return w_o(n)}),r={id:t.id,outerId:t.outerId,typeName:t[Qbe],message:t[Dse],hasFullStack:t[qbe],stack:t[cx],parsedStack:e||void 0};return r}a(b_o,"_toInterface");function fZr(t,e,r){var n,o,s,c,l,u,d,f;if(A_o(e))c=e[Qbe],l=e[Dse],d=e[cx],f=e[sz]||[],u=e[qbe];else{var h=e,m=h&&h.evt;mL(h)||(h=h[Bse]||m||h),c=ou(t,mQe(h))||Uy,l=Hbe(t,uZr(e||h,c))||Uy;var g=e[oMt]||dZr(e);f=v_o(g),ur(f)&&yL(f,function(A){A[jbe]=ou(t,A[jbe]),A[pM]=ou(t,A[pM])}),d=YNt(t,__o(g)),u=ur(f)&&f[mo]>0,r&&(r[Qbe]=r[Qbe]||c)}return n={},n[Mse]=C_o,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[qbe]=u,n.stack=d,n.parsedStack=f,n.toInterface=b_o,n}a(fZr,"_createExceptionDetails");function S_o(t,e){var r=ur(e[sz])&&yL(e[sz],function(o){return x_o(o)})||e[sz],n=fZr(t,ox(ox({},e),{parsedStack:r}));return n}a(S_o,"_createExDetailsFromInterface");function pZr(t,e){var r=e[iz](p_o);if(r&&r[mo]>=4)t[pM]=r[1],t[az]=parseInt(r[2]);else{var n=e[iz](h_o);n&&n[mo]>=3?(t[pM]=n[1],t[az]=parseInt(n[2])):t[pM]=e}}a(pZr,"_parseFilename");function cZr(t,e,r){var n=t[pM];e.fn&&r&&r[mo]>e.fn&&(e.ln&&r[mo]>e.ln?(n=Di(r[e.fn]||""),t[az]=parseInt(Di(r[e.ln]||""))||0):n=Di(r[e.fn]||"")),n&&pZr(t,n)}a(cZr,"_handleFilename");function T_o(t){var e=!1;if(t&&yi(t)){var r=Di(t);r&&(e=c_o.test(r))}return e}a(T_o,"_isStackFrame");var hZr=wh({level:1,method:1,assembly:0,fileName:0,line:0});function I_o(t,e){var r,n;if(t&&yi(t)&&Di(t)){n=(r={},r[Mse]=hZr,r.level=e,r.assembly=Di(t),r.method=iZr,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o=s.len){s.m&&(n.method=Di(c[s.m]||iZr)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[pM]=Di(c[s.fn]||""),n[az]=parseInt(Di(c[s.ln]||""))||0):pZr(n,c[s.fn]||""));break}o++}}return mZr(n)}a(I_o,"_extractStackFrame");function x_o(t){var e,r=(e={},e[Mse]=hZr,e.level=t.level,e.method=t.method,e.assembly=t[jbe],e.fileName=t[pM],e.line=t[az],e.sizeInBytes=0,e);return mZr(r)}a(x_o,"_stackFrameFromInterface");function mZr(t){var e=a_o;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[Ube]=e),t}a(mZr,"_populateFrameSizeInBytes");function w_o(t){return{level:t.level,method:t.method,assembly:t[jbe],fileName:t[pM],line:t[az]}}a(w_o,"_parsedFrameToInterface");p();p();var gZr=(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 PL=(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 gZr;h[zJr]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[Qy]=ou(e,r)||Uy,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[lA]=A_(e,u),f[qy]=y_(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var $be="";function gQe(t){(isNaN(t)||t<0)&&(t=0),t=gKr(t);var e=$be+t%1e3,r=$be+j1(t/1e3)%60,n=$be+j1(t/(1e3*60))%60,o=$be+j1(t/(1e3*60*60))%24,s=j1(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+".":$be)+o+":"+n+":"+r+"."+e}a(gQe,"msToTimeSpan");var fz=(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=KNt(e,l),u.url=lz(e,n),u[Qy]=ou(e,r)||Uy,isNaN(o)||(u[cz]=gQe(o)),u[lA]=A_(e,s),u[qy]=y_(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var pz=(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[cz]=gQe(s),g.success=c,g.resultCode=l+"",g.type=ou(e,d);var A=tZr(e,n,u,o);g.data=lz(e,o)||A.data,g.target=ou(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[Qy]=ou(e,A[Qy]),g[lA]=A_(e,h),g[qy]=y_(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var hz=(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||Uy,c[Dse]=Hbe(e,r),c[lA]=A_(e,o),c[qy]=y_(e,s),n&&(c[oz]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var mz=(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=lz(e,n),u[Qy]=ou(e,r)||Uy,u[lA]=A_(e,s),u[qy]=y_(e,c),l&&(u.domProcessing=l.domProcessing,u[cz]=l[cz],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 kL=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function YU(t){var e="ai."+t+".";return function(r){return e+r}}a(YU,"_aiNameFunc");var Vbe=YU("application"),Gm=YU("device"),AQe=YU("location"),Lse=YU("operation"),cMt=YU("session"),zU=YU("user"),gz=YU("cloud"),Wbe=YU("internal"),zbe=(function(t){Fy(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(oNt({applicationVersion:Vbe("ver"),applicationBuild:Vbe("build"),applicationTypeId:Vbe("typeId"),applicationId:Vbe("applicationId"),applicationLayer:Vbe("layer"),deviceId:Gm("id"),deviceIp:Gm("ip"),deviceLanguage:Gm("language"),deviceLocale:Gm("locale"),deviceModel:Gm("model"),deviceFriendlyName:Gm("friendlyName"),deviceNetwork:Gm("network"),deviceNetworkName:Gm("networkName"),deviceOEMName:Gm("oemName"),deviceOS:Gm("os"),deviceOSVersion:Gm("osVersion"),deviceRoleInstance:Gm("roleInstance"),deviceRoleName:Gm("roleName"),deviceScreenResolution:Gm("screenResolution"),deviceType:Gm("type"),deviceMachineName:Gm("machineName"),deviceVMName:Gm("vmName"),deviceBrowser:Gm("browser"),deviceBrowserVersion:Gm("browserVersion"),locationIp:AQe("ip"),locationCountry:AQe("country"),locationProvince:AQe("province"),locationCity:AQe("city"),operationId:Lse("id"),operationName:Lse("name"),operationParentId:Lse("parentId"),operationRootId:Lse("rootId"),operationSyntheticSource:Lse("syntheticSource"),operationCorrelationVector:Lse("correlationVector"),sessionId:cMt("id"),sessionIsFirst:cMt("isFirst"),sessionIsNew:cMt("isNew"),userAccountAcquisitionDate:zU("accountAcquisitionDate"),userAccountId:zU("accountId"),userAgent:zU("userAgent"),userId:zU("id"),userStoreRegion:zU("storeRegion"),userAuthUserId:zU("authUserId"),userAnonymousUserAcquisitionDate:zU("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:zU("authUserAcquisitionDate"),cloudName:gz("name"),cloudRole:gz("role"),cloudRoleVer:gz("roleVer"),cloudRoleInstance:gz("roleInstance"),cloudEnvironment:gz("environment"),cloudLocation:gz("location"),cloudDeploymentUnit:gz("deploymentUnit"),internalNodeName:Wbe("nodeName"),internalSdkVersion:Wbe("sdkVersion"),internalAgentVersion:Wbe("agentVersion"),internalSnippet:Wbe("snippet"),internalSdkSrc:Wbe("sdkSrc")}));p();var kh=new zbe;p();function AZr(t,e){VNt(t,null,null,e)}a(AZr,"_disableEvents");function lMt(t){var e=af(),r=Hu(),n=!1,o=[],s=1;r&&!Xt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=Mbe(K1("OfflineListener"),t);try{if(f(cf())&&(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=cQe(b,"online",y,u),T&&cQe(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=cf();if(b&&n){if(AZr(b,u),e){var T=e.body||e;Nn(T.ononline)||AZr(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(lMt,"createOfflineListener");var yQe="AppInsightsChannelPlugin";p();p();p();p();p();var KU="duration";p();var Dh="tags",EQe="deviceType",dC="data",hM="name",Az="traceID",Oo="length",JU="stringify",ZU="measurements",lx="dataType",XU="envelopeType",DL="toString",NL="enqueue",ML="count",ux="push",Ybe="emitLineDelimitedJson",e7="clear",Fse="markAsSent",yz="clearSent",Kbe="bufferOverride",Use="BUFFER_KEY",OL="SENT_BUFFER_KEY",t7="concat",Qse="MAX_BUFFER_SIZE",qse="triggerSend",uA="diagLog",_Qe="initialize",jse="_sender",Hse="endpointUrl",Gse="instrumentationKey",vQe="customHeaders",uMt="maxBatchSizeInBytes",CQe="onunloadDisableBeacon",bQe="isBeaconApiDisabled",dMt="alwaysUseXhrOverride",fMt="enableSessionStorageBuffer",JP="_buffer",pMt="onunloadDisableFetch",hMt="disableSendBeaconSplit",Jbe="getSenderInst",r7="_onError",SQe="_onPartialSuccess",Zbe="_onSuccess",TQe="itemsReceived",IQe="itemsAccepted",xQe="baseType",$se="sampleRate",yZr="getHashCodeScore";var mMt="baseType",kd="baseData",z0="properties",EZr="true";function Bp(t,e,r){return lM(t,e,r,Q1)}a(Bp,"_setValueIf");function R_o(t,e,r){var n=r[Dh]=r[Dh]||{},o=e.ext=e.ext||{},s=e[Dh]=e[Dh]||[],c=o.user;c&&(Bp(n,kh.userAuthUserId,c.authId),Bp(n,kh.userId,c.id||c.localId));var l=o.app;l&&Bp(n,kh.sessionId,l.sesId);var u=o.device;u&&(Bp(n,kh.deviceId,u.id||u.localId),Bp(n,kh[EQe],u.deviceClass),Bp(n,kh.deviceIp,u.ip),Bp(n,kh.deviceModel,u.model),Bp(n,kh[EQe],u[EQe]));var d=e.ext.web;if(d){Bp(n,kh.deviceLanguage,d.browserLang),Bp(n,kh.deviceBrowserVersion,d.browserVer),Bp(n,kh.deviceBrowser,d.browser);var f=r[dC]=r[dC]||{},h=f[kd]=f[kd]||{},m=h[z0]=h[z0]||{};Bp(m,"domain",d.domain),Bp(m,"isManual",d.isManual?EZr:null),Bp(m,"screenRes",d.screenRes),Bp(m,"userConsent",d.userConsent?EZr:null)}var g=o.os;g&&(Bp(n,kh.deviceOS,g[hM]),Bp(n,kh.deviceOSVersion,g.osVer));var A=o.trace;A&&(Bp(n,kh.operationParentId,A.parentID),Bp(n,kh.operationName,ou(t,A[hM])),Bp(n,kh.operationId,A[Az]));for(var y={},E=s[Oo]-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=ox(ox({},n),y);v[kh.internalSdkVersion]||(v[kh.internalSdkVersion]=ou(t,"javascript:".concat(P_o.Version),64)),r[Dh]=U7e(v)}a(R_o,"_extractPartAExtensions");function n7(t,e,r){Xt(t)||Yr(t,function(n,o){xh(o)?r[n]=o:yi(o)?e[n]=o:UU()&&(e[n]=g_()[JU](o))})}a(n7,"_extractPropsAndMeasurements");function Ez(t,e){Xt(t)||Yr(t,function(r,n){t[r]=n||e})}a(Ez,"_convertPropsUndefinedToCustomDefinedValue");function _z(t,e,r,n){var o=new nMt(t,n,e);Bp(o,"sampleRate",r[Obe]),(r[kd]||{}).startTime&&(o.time=FU(r[kd].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[hM]=o[hM].replace("{0}",s),R_o(t,r,o),r[Dh]=r[Dh]||[],U7e(o)}a(_z,"_createEnvelope");function vz(t,e){Xt(e[kd])&&Wr(t,1,46,"telemetryItem.baseData cannot be null.")}a(vz,"EnvelopeCreatorInit");var P_o={Version:"3.3.11"};function _Zr(t,e,r){vz(t,e);var n=e[kd][ZU]||{},o=e[kd][z0]||{};n7(e[dC],o,n),Xt(r)||Ez(o,r);var s=e[kd];if(Xt(s))return xL(t,"Invalid input for dependency data"),null;var c=s[z0]&&s[z0][lQe]?s[z0][lQe]:"GET",l=new pz(t,s.id,s.target,s[hM],s[KU],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new kL(pz[lx],l);return _z(t,pz[XU],e,u)}a(_Zr,"DependencyEnvelopeCreator");function gMt(t,e,r){vz(t,e);var n={},o={};e[mMt]!==RL[lx]&&(n.baseTypeSource=e[mMt]),e[mMt]===RL[lx]?(n=e[kd][z0]||{},o=e[kd][ZU]||{}):e[kd]&&n7(e[kd],n,o),n7(e[dC],n,o),Xt(r)||Ez(n,r);var s=e[kd][hM],c=new RL(t,s,n,o),l=new kL(RL[lx],c);return _z(t,RL[XU],e,l)}a(gMt,"EventEnvelopeCreator");function vZr(t,e,r){vz(t,e);var n=e[kd][ZU]||{},o=e[kd][z0]||{};n7(e[dC],o,n),Xt(r)||Ez(o,r);var s=e[kd],c=dz.CreateFromInterface(t,s,o,n),l=new kL(dz[lx],c);return _z(t,dz[XU],e,l)}a(vZr,"ExceptionEnvelopeCreator");function CZr(t,e,r){vz(t,e);var n=e[kd],o=n[z0]||{},s=n[ZU]||{};n7(e[dC],o,s),Xt(r)||Ez(o,r);var c=new PL(t,n[hM],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new kL(PL[lx],c);return _z(t,PL[XU],e,l)}a(CZr,"MetricEnvelopeCreator");function bZr(t,e,r){vz(t,e);var n,o=e[kd];!Xt(o)&&!Xt(o[z0])&&!Xt(o[z0][KU])?(n=o[z0][KU],delete o[z0][KU]):!Xt(e[dC])&&!Xt(e[dC][KU])&&(n=e[dC][KU],delete e[dC][KU]);var s=e[kd],c;((e.ext||{}).trace||{})[Az]&&(c=e.ext.trace[Az]);var l=s.id||c,u=s[hM],d=s.uri,f=s[z0]||{},h=s[ZU]||{};if(Xt(s.refUri)||(f.refUri=s.refUri),Xt(s.pageType)||(f.pageType=s.pageType),Xt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[DL]()),!Xt(s[z0])){var m=s[z0];Yr(m,function(y,E){f[y]=E})}n7(e[dC],f,h),Xt(r)||Ez(f,r);var g=new fz(t,u,d,n,f,h,l),A=new kL(fz[lx],g);return _z(t,fz[XU],e,A)}a(bZr,"PageViewEnvelopeCreator");function SZr(t,e,r){vz(t,e);var n=e[kd],o=n[hM],s=n.uri||n.url,c=n[z0]||{},l=n[ZU]||{};n7(e[dC],c,l),Xt(r)||Ez(c,r);var u=new mz(t,o,s,void 0,c,l,n),d=new kL(mz[lx],u);return _z(t,mz[XU],e,d)}a(SZr,"PageViewPerformanceEnvelopeCreator");function TZr(t,e,r){vz(t,e);var n=e[kd].message,o=e[kd].severityLevel,s=e[kd][z0]||{},c=e[kd][ZU]||{};n7(e[dC],s,c),Xt(r)||Ez(s,r);var l=new hz(t,n,o,s,c),u=new kL(hz[lx],l);return _z(t,hz[XU],e,u)}a(TZr,"TraceEnvelopeCreator");p();var IZr=(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[NL]=function(l){if(c[ML]()>=r.eventsLimitInMem){o||(Wr(e,2,105,"Maximum in-memory buffer size reached: "+c[ML](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Xt(s)&&l.cnt>s)&&n[ux](l)},c[ML]=function(){return n[Oo]},c.size=function(){for(var l=n[Oo],u=0;u0){var u=[];Ct(l,function(f){u[ux](f.item)});var d=r[Ybe]?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 AMt(l,u):new wQe(l,u);return Ct(f,function(m){h[NL](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),wQe=(function(t){Fy(e,t);function e(r,n){var o=t.call(this,r,n)||this;return Si(e,o,function(s,c){s[Fse]=function(l){c[e7]()},s[yz]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(IZr);var k_o=["AI_buffer","AI_sentBuffer"],AMt=(function(t){Fy(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[Kbe]||{getItem:eMt,setItem:tMt},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return Si(e,s,function(m,g){var A=T(e[Use]),y=T(e[OL]),E=x(),_=y[t7](E),v=m._set(A[t7](_));v[Oo]>e[Qse]&&(v[Oo]=e[Qse]),R(e[OL],[]),R(e[Use],v),m[NL]=function(D){if(m[ML]()>=e[Qse]){c||(Wr(n,2,67,"Maximum buffer size reached: "+m[ML](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Xt(h)&&D.cnt>h)&&(g[NL](D),R(e[Use],m._get()))},m[e7]=function(){g[e7](),R(e[Use],m._get()),R(e[OL],[]),c=!1},m[Fse]=function(D){R(e[Use],m._set(b(D,m._get())));var N=T(e[OL]);N instanceof Array&&D instanceof Array&&(N=N[t7](D),N[Oo]>e[Qse]&&(Wr(n,1,67,"Sent buffer reached its maximum size: "+N[Oo],!0),N[Oo]=e[Qse]),R(e[OL],N))},m[yz]=function(D){var N=T(e[OL]);N=b(D,N),R(e[OL],N)},m.createNew=function(D,N,B){B=!!B;var L=m._get().slice(0),j=T(e[OL]).slice(0);D=D||n,N=N||{},m[e7]();var M=B?new e(D,N):new wQe(D,N);return Ct(L,function(O){M[NL](O)}),B&&M[Fse](j),M};function b(D,N){var B=[],L=[];return Ct(D,function(j){L[ux](j.item)}),Ct(N,function(j){!Or(j)&&Ho(L,j.item)===-1&&B[ux](j)}),B}a(b,"_removePayloadsFromBuffer");function T(D){var N=D;return N=l?l+"_"+N:N,w(N)}a(T,"_getBuffer");function w(D){try{var N=d(n,D);if(N){var B=g_().parse(N);if(yi(B)&&(B=g_().parse(B)),B&&ur(B))return B}}catch(L){Wr(n,1,42," storage key: "+D+", "+Op(L),{exception:dr(L)})}return[]}a(w,"_getBufferBase");function R(D,N){var B=D;try{B=l?l+"_"+B:B;var L=JSON[JU](N);f(n,B,L)}catch(j){f(n,B,JSON[JU]([])),Wr(n,2,41," storage key: "+B+", "+Op(j)+". Buffer cleared",{exception:dr(j)})}}a(R,"_setBuffer");function x(){var D=[];try{return Ct(k_o,function(N){var B=P(N);if(D=D[t7](B),l){var L=l+"_"+N,j=P(L);D=D[t7](j)}}),D}catch(N){Wr(n,2,41,"Transfer events from previous buffers: "+Op(N)+". previous Buffer items can not be removed",{exception:dr(N)})}return[]}a(x,"_getPreviousEvents");function P(D){try{var N=w(D),B=[];return Ct(N,function(L){var j={item:L,cnt:0};B[ux](j)}),rMt(n,D),B}catch{}return[]}a(P,"_getItemsFromPreviousKey")}),s}a(e,"SessionStorageSendBuffer");var r;return r=e,e.VERSION="_1",e.BUFFER_KEY="AI_buffer"+r.VERSION,e.SENT_BUFFER_KEY="AI_sentBuffer"+r.VERSION,e.MAX_BUFFER_SIZE=2e3,e})(IZr);p();var xZr=(function(){function t(e){Si(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return g_()[JU](l)}catch(u){Wr(e,1,48,u&&Or(u[DL])?u[DL]():"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{g_()[JU](c),d=c}catch(f){Wr(e,1,48,f&&Or(f[DL])?f[DL]():"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=qu(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[$se]=e,this.samplingScoreGenerator=new RZr}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[$se],n=!1;return r==null||r>=100||e.baseType===PL[lx]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(O_o,"_chkSampling");var B_o=(BL={},BL[RL.dataType]=gMt,BL[hz.dataType]=TZr,BL[fz.dataType]=bZr,BL[mz.dataType]=SZr,BL[dz.dataType]=vZr,BL[PL.dataType]=CZr,BL[pz.dataType]=_Zr,BL),yMt=(function(t){Fy(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=yQe;var n,o,s,c,l,u,d,f,h=0,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,B,L,j,M,O,q,Q,U,z,$,W,J,ne;return Si(e,r,function(H,re){Ge(),H.pause=function(){fe(),c=!0},H.resume=function(){c&&(c=!1,o=null,rt(),Qe())},H.flush=function(Y,se,me){if(Y===void 0&&(Y=!0),!c){fe();try{var Ce=H[qse](Y,null,me||1);return ml(Ce,function(He){return se?(se(!He.rejected),!0):Y?Pd(function($e){$e(!He.rejected)}):Ce})}catch(He){Wr(H[uA](),1,22,"flush failed, telemetry will not be collected: "+Op(He),{exception:dr(He)})}}},H.onunloadFlush=function(){if(!c)if(v||O)try{return H[qse](!0,kt,2)}catch(Y){Wr(H[uA](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+Op(Y),{exception:dr(Y)})}else H.flush(!1)},H.addHeader=function(Y,se){f[Y]=se},H[_Qe]=function(Y,se,me,Ce){H.isInitialized()&&Wr(H[uA](),1,28,"Sender is already initialized"),re[_Qe](Y,se,me,Ce);var He=H.identifier;u=new xZr(se.logger),n=0,o=null,s=0,H[jse]=null,d=0;var $e=H[uA]();A=Mbe(K1("Sender"),se.evtNamespace&&se.evtNamespace()),g=lMt(A),H._addHook(sx(Y,function(et){var ct=et.cfg;ct.storagePrefix&&XNt(ct.storagePrefix);var bt=YP(null,ct,se),ht=bt.getExtCfg(He,NZr),We=ht[Hse];if(y&&We===y){var ce=ct[Hse];ce&&ce!==We&&(ht[Hse]=ce)}var Re=ki("CompressionStream");ne=sNt("zipPayload",ct,!1),Or(Re)||(ne=!1);var Me=ht.corsPolicy;Me?(Me==="same-origin"||Me==="same-site"||Me==="cross-origin")&&r.addHeader(MZr,Me):delete f[MZr],V0(ht[Gse])&&(ht[Gse]=ct[Gse]),ji(H,"_senderConfig",{g:a(function(){return ht},"g")}),E!==ht[Hse]&&(y=E=ht[Hse]),se.activeStatus()===GP.PENDING?H.pause():se.activeStatus()===GP.ACTIVE&&H.resume(),w&&w!==ht[vQe]&&Ct(w,function(_r){delete f[_r.header]}),_=ht[uMt],v=(ht[CQe]===!1||ht[bQe]===!1)&&QU(),b=ht[CQe]===!1&&QU(),T=ht[bQe]===!1&&QU(),O=ht[dMt],q=!!ht.disableXhr,J=ht.retryCodes;var Ae=ht[Kbe],oe=!!ht[fMt]&&(!!Ae||hQe()),ze=ht.namePrefix,at=oe!==B||oe&&j!==ze||oe&&L!==Ae;if(H[JP]){if(at)try{H[JP]=H[JP].createNew($e,ht,oe)}catch(_r){Wr(H[uA](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+Op(_r),{exception:dr(_r)})}rt()}else H[JP]=oe?new AMt($e,ht):new wQe($e,ht);j=ze,B=oe,L=Ae,Q=!ht[pMt]&&_be(!0),$=!!ht[hMt],H._sample=new PZr(ht.samplingPercentage,$e),x=ht[Gse],!V0(x)&&!Te(x,ct)&&Wr($e,1,100,"Invalid Instrumentation key "+x),w=ht[vQe],yi(y)&&!fQe(y)&&w&&w[Oo]>0?Ct(w,function(_r){r.addHeader(_r.header,_r.value)}):w=null,M=ht.enableSendPromise;var Vt=Be();W?W.SetConfig(Vt):(W=new HNt,W[_Qe](Vt,$e));var gr=ht.httpXHROverride,cr=null,Mr=null,Hr=q7e([3,1,2],ht.transports);cr=W&&W[Jbe](Hr,!1);var Gr=W&&W.getFallbackInst();U=a(function(_r,B0){return Ne(Gr,_r,B0)},"_xhrSend"),z=a(function(_r,B0){return Ne(Gr,_r,B0,!1)},"_fallbackSend"),cr=O?gr:cr||gr||Gr,H[jse]=function(_r,B0){return Ne(cr,_r,B0)},Q&&(m=Ie);var Yt=q7e([3,1],ht.unloadTransports);Q||(Yt=Yt.filter(function(_r){return _r!==2})),Mr=W&&W[Jbe](Yt,!0),Mr=O?gr:Mr||gr,(O||ht.unloadTransports||!m)&&Mr&&(m=a(function(_r,B0){return Ne(Mr,_r,B0)},"_syncUnloadSender")),m||(m=U),R=ht.disableTelemetry,P=ht.convertUndefined||ZP,D=ht.isRetryDisabled,N=ht.maxBatchInterval}))},H.processTelemetry=function(Y,se){se=H._getTelCtx(se);var me=se[uA]();try{var Ce=K(Y,me);if(!Ce)return;var He=he(Y,me);if(!He)return;var $e=u.serialize(He),et=H[JP];rt($e);var ct={item:$e,cnt:0};et[NL](ct),Qe()}catch(bt){Wr(me,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Op(bt),{exception:dr(bt)})}H.processNext(Y,se)},H.isCompletelyIdle=function(){return!c&&h===0&&H._buffer[ML]()===0},H.getOfflineListener=function(){return g},H._xhrReadyStateChange=function(Y,se,me){if(!Ht(se))return ve(Y,se,me)},H[qse]=function(Y,se,me){Y===void 0&&(Y=!0);var Ce;if(!c)try{var He=H[JP];if(R)He[e7]();else{if(He[ML]()>0){var $e=He.getItems();te(me||0,Y),se?Ce=se.call(H,$e,Y):Ce=H[jse]($e,Y)}s=+new Date}fe()}catch(ct){var et=gNt();(!et||et>9)&&Wr(H[uA](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+Op(ct),{exception:dr(ct)})}return Ce},H.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:je,serialize:X,batch:ue,shouldProcess:a(function(Y){return!!K(Y)},"shouldProcess")}},H._doTeardown=function(Y,se){H.onunloadFlush(),IL(g,!1),Ge()},H[r7]=function(Y,se,me){if(!Ht(Y))return Ue(Y,se,me)},H[SQe]=function(Y,se){if(!Ht(Y))return Pe(Y,se)},H[Zbe]=function(Y,se){if(!Ht(Y))return Z(Y,se)},H._xdrOnLoad=function(Y,se){if(!Ht(se))return ae(Y,se)};function ae(Y,se){var me=DZr(Y);if(Y&&(me+""=="200"||me===""))n=0,H[Zbe](se,0);else{var Ce=Nbe(me);Ce&&Ce[TQe]&&Ce[TQe]>Ce[IQe]&&!D?H[SQe](se,Ce):H[r7](se,Abe(Y))}}a(ae,"_xdrOnLoad");function Be(){try{var Y={xdrOnComplete:a(function(me,Ce,He){var $e=ee(He);if($e)return ae(me,$e)},"xdrOnComplete"),fetchOnComplete:a(function(me,Ce,He,$e){var et=ee($e);if(et)return st(me.status,et,me.url,et[Oo],me.statusText,He||"")},"fetchOnComplete"),xhrOnComplete:a(function(me,Ce,He){var $e=ee(He);if($e)return ve(me,$e,$e[Oo])},"xhrOnComplete"),beaconOnRetry:a(function(me,Ce,He){return $t(me,Ce,He)},"beaconOnRetry")},se={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:q,disableBeacon:!T,disableBeaconSync:!b,senderOnCompleteCallBack:Y};return se}catch{}return null}a(Be,"_getSendPostMgrConfig");function ve(Y,se,me){Y.readyState===4&&st(Y.status,se,Y.responseURL,me,ZW(Y),DZr(Y)||Y.response)}a(ve,"_xhrReadyStateChange");function Ue(Y,se,me){Wr(H[uA](),2,26,"Failed to send telemetry.",{message:se}),H._buffer&&H._buffer[yz](Y)}a(Ue,"_onError");function Pe(Y,se){for(var me=[],Ce=[],He=se.errors.reverse(),$e=0,et=He;$e0&&H[Zbe](Y,se[IQe]),me[Oo]>0&&H[r7](me,ZW(null,["partial success",se[IQe],"of",se.itemsReceived].join(" "))),Ce[Oo]>0&&(F(Ce),Wr(H[uA](),2,40,"Partial success. Delivered: "+Y[Oo]+", Failed: "+me[Oo]+". Will retry to send "+Ce[Oo]+" our of "+se[TQe]+" items"))}a(Pe,"_onPartialSuccess");function Z(Y,se){H._buffer&&H._buffer[yz](Y)}a(Z,"_onSuccess");function ee(Y){try{if(Y){var se=Y,me=se.oriPayload;return me&&me[Oo]?me:null}}catch{}return null}a(ee,"_getPayloadArr");function K(Y,se){if(R)return!1;if(!Y)return se&&Wr(se,1,7,"Cannot send empty telemetry"),!1;if(Y.baseData&&!Y[xQe])return se&&Wr(se,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(Y[xQe]||(Y[xQe]="EventData"),!H[jse])return se&&Wr(se,1,28,"Sender was not initialized"),!1;if(ie(Y))Y[Obe]=H._sample[$se];else return se&&Wr(se,2,33,"Telemetry item was sampled out and not sent",{SampleRate:H._sample[$se]}),!1;return!0}a(K,"_validate");function he(Y,se){var me=Y.iKey||x,Ce=e.constructEnvelope(Y,me,se,P);if(!Ce){Wr(se,1,47,"Unable to create an AppInsights envelope");return}var He=!1;if(Y[Dh]&&Y[Dh][Bbe]&&(Ct(Y[Dh][Bbe],function($e){try{$e&&$e(Ce)===!1&&(He=!0,xL(se,"Telemetry processor check returns false"))}catch(et){Wr(se,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+Op(et),{exception:dr(et)},!0)}}),delete Y[Dh][Bbe]),!He)return Ce}a(he,"_getEnvelope");function X(Y){var se=kZr,me=H[uA]();try{var Ce=K(Y,me),He=null;Ce&&(He=he(Y,me)),He&&(se=u.serialize(He))}catch{}return se}a(X,"_serialize");function ue(Y){var se=kZr;return Y&&Y[Oo]&&(se="["+Y.join(",")+"]"),se}a(ue,"_batch");function je(Y){var se=Le();return{urlString:y,data:Y,headers:se}}a(je,"_createPayload");function ie(Y){return H._sample.isSampledIn(Y)}a(ie,"_isSampledIn");function le(Y,se,me,Ce){se===200&&Y?H._onSuccess(Y,Y[Oo]):Ce&&H[r7](Y,Ce)}a(le,"_getOnComplete");function Ne(Y,se,me,Ce){Ce===void 0&&(Ce=!0);var He=a(function(ce,Re,Me){return le(se,ce,Re,Me)},"onComplete"),$e=we(se),et=Y&&Y.sendPOST;if(et&&$e){Ce&&H._buffer[Fse](se);var ct,bt=!1,ht,We;return W.preparePayload(function(ce){ct=et(ce,He,!me),bt=!0,ht&&R7e(ct,ht,We)},ne,$e,!me),bt?ct:Pd(function(ce,Re){ht=ce,We=Re})}return null}a(Ne,"_doSend");function we(Y){if(ur(Y)&&Y[Oo]>0){var se=H[JP].batchPayloads(Y),me=Le(),Ce={data:se,urlString:y,headers:me,disableXhrSync:q,disableFetchKeepAlive:!Q,oriPayload:Y};return Ce}return null}a(we,"_getPayload");function Le(){try{var Y=f||{};return fQe(y)&&(Y[uQe[6]]=uQe[7]),Y}catch{}return null}a(Le,"_getHeaders");function rt(Y){var se=Y?Y[Oo]:0;return H[JP].size()+se>_?((!g||g.isOnline())&&H[qse](!0,null,10),!0):!1}a(rt,"_checkMaxSize");function st(Y,se,me,Ce,He,$e){var et=null;if(H._appId||(et=Nbe($e),et&&et.appId&&(H._appId=et.appId)),(Y<200||Y>=300)&&Y!==0){if((Y===301||Y===307||Y===308)&&!_t(me)){H[r7](se,He);return}if(g&&!g.isOnline()){if(!D){var ct=10;F(se,ct),Wr(H[uA](),2,40,". Offline - Response Code: ".concat(Y,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(se.length," items."))}return}!D&&Se(Y)?(F(se),Wr(H[uA](),2,40,". Response code "+Y+". Will retry to send "+se[Oo]+" items.")):H[r7](se,He)}else _t(me),Y===206?(et||(et=Nbe($e)),et&&!D?H[SQe](se,et):H[r7](se,He)):(n=0,H[Zbe](se,Ce))}a(st,"_checkResponsStatus");function _t(Y){return d>=10?!1:!Xt(Y)&&Y!==""&&Y!==y?(y=Y,++d,!0):!1}a(_t,"_checkAndUpdateEndPointUrl");function kt(Y,se){if(m)m(Y,!1);else{var me=W&&W[Jbe]([3],!0);return Ne(me,Y,se)}}a(kt,"_doUnloadSend");function $t(Y,se,me){var Ce=Y,He=Ce&&Ce.oriPayload;if($)z&&z(He,!0),Wr(H[uA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var $e=[],et=0;et0&&(z&&z($e,!0),Wr(H[uA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a($t,"_onBeaconRetry");function Ht(Y){try{if(Y&&Y[Oo])return yi(Y[0])}catch{}return null}a(Ht,"_isStringArr");function Ie(Y,se){var me=null;if(ur(Y)){for(var Ce=Y[Oo],He=0;He-1}a(Se,"_isRetriable");function Fe(){var Y="getNotifyMgr",se,me=H.core;return me&&(me[Y]?se=me[Y]():se=me._notificationManager),se}a(Fe,"_getNotifyMgr");function te(Y,se){var me=Fe();if(me&&me.eventsSendRequest)try{me.eventsSendRequest(Y,se)}catch(Ce){Wr(H[uA](),1,74,"send request notification failed: "+Op(Ce),{exception:dr(Ce)})}}a(te,"_notifySendRequest");function Te(Y,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(Y)}a(Te,"_validateInstrumentationKey");function Ge(){H[jse]=null,H[JP]=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=ZP,D=!1,B=null,j=ZP,q=!1,Q=!1,$=!1,U=null,z=null,W=null,ji(H,"_senderConfig",{g:a(function(){return Q7e({},NZr)},"g")})}a(Ge,"_initDefaults")}),r}return a(e,"Sender"),e.constructEnvelope=function(r,n,o,s){var c;n!==r.iKey&&!Xt(n)?c=ox(ox({},r),{iKey:n}):c=r;var l=B_o[c.baseType]||gMt;return l(o,c,s)},e})(Dbe);p();var Cz="instrumentationKey",Xbe="connectionString",Vse="endpointUrl",Wse="userOverrideEndpointUrl";var bz,EMt,_Mt=void 0,L_o=(bz={diagnosticLogInterval:xse(F_o,1e4)},bz[Xbe]=_Mt,bz.endpointUrl=_Mt,bz[Cz]=_Mt,bz.featureOptIn=(EMt={},EMt.zipPayload={mode:1},EMt),bz.extensionConfig={},bz);function F_o(t){return t&&t>0}a(F_o,"_chkDiagLevel");var OZr=(function(){function t(e){var r=new qNt,n;(Xt(e)||Xt(e[Cz])&&Xt(e[Xbe]))&&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,JW(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=Ph(e||{},L_o);n=l.cfg,r.addUnloadHook(sx(l,function(){var u=n[Xbe];if(V0(u)){var d=hbe(function(g,A){ml(u,function(y){var E=y.value,_=n[Cz];if(!y.rejected&&E){n[Xbe]=E;var v=Gbe(E);_=v.instrumentationkey||_}g(_)})}),f=hbe(function(g,A){ml(u,function(y){var E=y.value,_=n[Vse];if(!y.rejected&&E){var v=Gbe(E),b=v.ingestionendpoint;_=b?b+fM:_}g(_)})});n[Cz]=d,n[Vse]=n[Wse]||f}if(yi(u)){var h=Gbe(u),m=h.ingestionendpoint;n[Vse]=n[Wse]?n[Wse]:m+fM,n[Cz]=h.instrumentationkey||n[Cz]}n[Vse]=n[Wse]?n[Wse]:n[Vse]})),r.initialize(n,[new yMt])}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 J1=de(require("os"));var zse=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 OZr({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[yQe]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:U_o(e),this.commonProperties=n?.excludeCommonProperties?{}:Q_o(e),this.#e=Es(e,this.onCopilotToken),o&&this.onCopilotToken(o)}static{a(this,"AppInsightsReporter")}#e;sendTelemetryEvent(e,r,n){r={...r,...this.commonProperties};let o=this.qualifyEventName(e);this.client.track({name:o,tags:this.tags,data:{...r,...n},baseType:"EventData",baseData:{name:o,properties:r,measurements:n}})}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}};function U_o(t){let e={},r=t.get(La);e["ai.session.id"]=r.sessionId;let n=t.get(Pp);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${J1.type()} ${J1.release()}`,e["ai.device.osArchitecture"]=J1.arch(),e["ai.device.osPlatform"]=J1.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(as).getVersion(),e}a(U_o,"getTags");function Q_o(t){let e={};e.common_os=J1.platform(),e.common_platformversion=J1.release(),e.common_arch=J1.arch(),e.common_cpu=Array.from(new Set(J1.cpus().map(n=>n.model))).join();let r=t.get(La);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(Q_o,"getCommonProperties");p();p();p();p();p();p();var e1e=a7e;var mM=e1e({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var i7=e1e({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Sz="toLowerCase",bn="length",Yse="warnToConsole",LL="throwInternal",gM="watch",o7="apply",no="push",dx="splice",$u="logger",AM="cancel",FL="initialize",yM="identifier",Kse="removeNotificationListener",Jse="addNotificationListener",fC="isInitialized",t1e="getNotifyMgr",s7="getPlugin",XP="name",$m="processNext",RQe="getProcessTelContext",UL="value",a7="enabled",vMt="stopPollingInternalLogs",fx="unload",r1e="onComplete",PQe="version",kQe="loggingLevelConsole",EM="createNew",Z1="teardown",Zse="messageId",_M="message",pC="diagLog",c7="_doTeardown",Tz="update",X1="getNext",l7="setNextPlugin",n1e="userAgent",QL="split",ek="replace",CMt="substring",DQe="indexOf",qL="type",bMt="evtName",tk="status",SMt="getAllResponseHeaders",i1e="isChildEvt",eS="data",Iz="getCtx",rk="setCtx";var o1e="headers",Xse="urlString",xz="timeout";var NQe="traceFlags";var TMt;function BZr(t,e){TMt||(TMt=XCe("AggregationError",function(n,o){o[bn]>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 TMt(r,e||[])}a(BZr,"throwAggregationError");p();p();p();p();p();var tS=void 0,vs="",wz="channels",$f="core",MQe="createPerfMgr",s1e="disabled",jL="extensionConfig",Rz="extensions",hC="processTelemetry",Pz="priority",eae="eventsSent",u7="eventsDiscarded",tae="eventsSendRequest",vM="perfEvent",OQe="offlineEventsStored",BQe="offlineBatchSent",LQe="offlineBatchDrop",rae="getPerfMgr",FQe="domain",UQe="path",LZr="Not dynamic - ";var q_o="getPrototypeOf",j_o=/-([a-z])/g,H_o=/([^\w\d_$])/g,G_o=/^(\d+[\w\d_$])/,O4l=Object[q_o];function d7(t){return!Xt(t)}a(d7,"isNotNullOrUndefined");function nae(t){var e=t;return e&&yi(e)&&(e=e[ek](j_o,function(r,n){return n.toUpperCase()}),e=e[ek](H_o,"_"),e=e[ek](G_o,function(r,n){return"_"+n})),e}a(nae,"normalizeJsName");function Y0(t,e){return t&&e?iu(t,e)!==-1:!1}a(Y0,"strContains");function iae(t){return t&&t.toISOString()||""}a(iae,"toISOString");function oae(t){return mL(t)?t[XP]:vs}a(oae,"getExceptionName");function HL(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(HL,"setValue");function QQe(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(QQe,"getSetValue");function $_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][o7](n,o)}}a($_o,"_createProxyFunction");function f7(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=$_o(r,n))}a(f7,"proxyFunctionAs");function p7(t,e,r,n){return t&&e&&qu(t)&&ur(r)&&Ct(r,function(o){yi(o)&&f7(t,o,e,o,n)}),t}a(p7,"proxyFunctions");function CM(t){return t&&gL&&(t=OU(gL({},t))),t}a(CM,"optimizeObject");function qQe(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(qQe,"isFeatureEnabled");function bM(t){try{return t.responseText}catch{}return null}a(bM,"getResponseText");function jQe(t,e){return t?"XDomainRequest,Response:"+bM(t)||"":e}a(jQe,"formatErrorMessageXdr");function c1e(t,e){return t?"XMLHttpRequest,Status:"+t[tk]+",Response:"+bM(t)||t.response||"":e}a(c1e,"formatErrorMessageXhr");function l1e(t,e){return e&&(xh(e)?t=[e].concat(t):ur(e)&&(t=e.concat(t))),t}a(l1e,"prependTransports");var V_o="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",FZr="withCredentials",W_o="timeout";function IMt(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,V_o,n),r&&c(l,FZr,r),l.open(t,e,!o),r&&c(l,FZr,r),!o&&s&&c(l,W_o,s),l}a(IMt,"openXhr");function xMt(t){var e={};if(yi(t)){var r=Di(t)[QL](/[\r\n]+/);Ct(r,function(n){if(n){var o=n[DQe](": ");if(o!==-1){var s=Di(n.substring(0,o))[Sz](),c=Di(n[CMt](o+1));e[s]=c}else e[Di(n)]=1}})}return e}a(xMt,"convertAllHeadersToMap");function a1e(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Di(n))}return t}a(a1e,"_appendHeader");var z_o="kill-duration",Y_o="kill-duration-seconds",K_o="time-delta-millis";function h7(t,e){var r={};return t[SMt]?r=xMt(t[SMt]()):e&&(r=a1e(r,t,K_o),r=a1e(r,t,z_o),r=a1e(r,t,Y_o)),r}a(h7,"_getAllResponseHeaders");p();p();var J_o="location",Z_o="console",UZr="JSON",X_o="crypto",evo="msCrypto",tvo="ReactNative",rvo="msie",nvo="trident/",QZr="XMLHttpRequest",wMt=null,RMt=null,ivo=!1,sae=null,PMt=null;function qZr(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[z1];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!Nn(o[e])}catch{}}return r}a(qZr,"_hasProperty");function aae(t){if(t&&ivo){var e=ki("__mockLocation");if(e)return e}return typeof location===ix&&location?location:ki(J_o)}a(aae,"getLocation");function HQe(){return typeof console!==W1?console:ki(Z_o)}a(HQe,"getConsole");function u1e(){return!!(typeof JSON===ix&&JSON||ki(UZr)!==null)}a(u1e,"hasJSON");function GQe(){return u1e()?JSON||ki(UZr):null}a(GQe,"getJSON");function $Qe(){return ki(X_o)}a($Qe,"getCrypto");function VQe(){return ki(evo)}a(VQe,"getMsCrypto");function cae(){var t=Hu();return t&&t.product?t.product===tvo:!1}a(cae,"isReactNative");function kz(){var t=Hu();if(t&&(t[n1e]!==RMt||wMt===null)){RMt=t[n1e];var e=(RMt||vs)[Sz]();wMt=Y0(e,rvo)||Y0(e,nvo)}return wMt}a(kz,"isIE");function lae(t){return(PMt===null||t===!1)&&(PMt=QW()&&!!Hu().sendBeacon),PMt}a(lae,"isBeaconsSupported");function uae(t){var e=!1;try{e=!!ki("fetch");var r=ki("Request");e&&t&&r&&(e=qZr(r,"keepalive"))}catch{}return e}a(uae,"isFetchSupported");function WQe(){return sae===null&&(sae=typeof XDomainRequest!==W1,sae&&d1e()&&(sae=sae&&!qZr(ki(QZr),"withCredentials"))),sae}a(WQe,"useXDomainRequest");function d1e(){var t=!1;try{var e=ki(QZr);t=!!e}catch{}return t}a(d1e,"isXhrSupported");var jZr=4294967296,Dz=4294967295,HZr=123456789,GZr=987654321,$Zr=!1,f1e=HZr,p1e=GZr;function ovo(t){t<0&&(t>>>=0),f1e=HZr+t&Dz,p1e=GZr-t&Dz,$Zr=!0}a(ovo,"_mwcSeed");function svo(){try{var t=hl()&2147483647;ovo((Math.random()*jZr^t)+t)}catch{}}a(svo,"_autoSeedMwc");function kMt(t){var e=0,r=$Qe()||VQe();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&Dz),e===0&&kz()&&($Zr||svo(),e=avo()&Dz),e===0&&(e=j1(jZr*Math.random()|0)),t||(e>>>=0),e}a(kMt,"random32");function avo(t){p1e=36969*(p1e&65535)+(p1e>>16)&Dz,f1e=18e3*(f1e&65535)+(f1e>>16)&Dz;var e=(p1e<<16)+(f1e&65535)>>>0&Dz|0;return t||(e>>>=0),e}a(avo,"mwcRandom32");function DMt(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=kMt()>>>0,n=0,o=vs;o[bn]>>=6,n===5&&(r=(kMt()<<2&4294967295|r&3)>>>0,n=0);return o}a(DMt,"newId");var VZr="3.3.10",cvo="."+DMt(6),lvo=0;function WZr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(WZr,"_canAcceptData");function uvo(t,e){var r=e[t.id];if(!r){r={};try{WZr(e)&&ji(e,t.id,{e:!1,v:r})}catch{}}return r}a(uvo,"_getCache");function px(t,e){return e===void 0&&(e=!1),nae(t+lvo+++(e?"."+VZr:vs)+cvo)}a(px,"createUniqueNamespace");function zQe(t){var e={id:px("_aiData-"+(t||vs)+"."+VZr),accept:a(function(r){return WZr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[nae(n)]:(s&&(c=uvo(e,r),c[nae(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(zQe,"createElmNodeData");p();function YQe(t){return t&&qu(t)&&!ur(t)&&(t.isVal||t.fb||cA(t,"v")||cA(t,"mrg")||cA(t,"ref")||t.set)}a(YQe,"_isConfigDefaults");function zZr(t,e,r){var n,o=r.dfVal||ase;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&BZr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[bn]>0){c||(c=[]),l||(l=Mp(function(){l=null,f()},0));for(var A=0;A0?ml(fae(t[0],e),function(){LMt(RU(t,1),e,r)}):r(),n}a(LMt,"doUnloadAll");p();var JZr=500,FMt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function ZZr(t){return{mrg:!0,v:t}}a(ZZr,"cfgDfMerge");p();p();var UMt=[eae,u7,tae,vM],tqe=null,eqe;function yvo(t,e){return function(){var r=arguments,n=QMt(e);if(n){var o=n.listener;o&&o[t]&&o[t][o7](o,r)}}}a(yvo,"_listenerProxyFunc");function Evo(){var t=ki("Microsoft");return t&&(tqe=t.ApplicationInsights),tqe}a(Evo,"_getExtensionNamespace");function QMt(t){var e=tqe;return!e&&t.disableDbgExt!==!0&&(e=tqe||Evo()),e?e.ChromeDbgExt:null}a(QMt,"getDebugExt");function XZr(t){if(!eqe){eqe={};for(var e=0;e=A&&(d[T](b[_M]),n[w]=!0)}else o>=A&&d[T](b[_M]);f(A,b)}},d.debugToConsole=function(A){qMt("debug",A),g("warning",A)},d[Yse]=function(A){qMt("warn",A),g("warning",A)},d.errorToConsole=function(A){qMt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[fx]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=Cvo+y[Zse];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[no](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new hae(23,v,!1);d.queue[no](b),A===1?d.errorToConsole(v):d[Yse](v)}}}a(f,"_logInternalMessage");function h(A){return rS(Lp(A,bvo,d).cfg,function(y){var E=y.cfg;o=E[kQe],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=QMt(e||{});E&&E[pC]&&E[pC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function rXr(t){return t||new Nz}a(rXr,"_getLogger");function xa(t,e,r,n,o,s){s===void 0&&(s=!1),rXr(t)[LL](e,r,n,o,s)}a(xa,"_throwInternal");function TM(t,e){rXr(t)[Yse](e)}a(TM,"_warnToConsole");var jMt,m7,nXr="toGMTString",iXr="toUTCString",$Mt="cookie",HMt="expires",oXr="isCookieUseDisabled",_1e="disableCookiesUsage",sXr="_ckMgr",rqe=null,GMt=null,aXr=null,IM,cXr={},lXr={},Tvo=(jMt={cookieCfg:ZZr((m7={},m7[FQe]={fb:"cookieDomain",dfVal:d7},m7.path={fb:"cookiePath",dfVal:d7},m7.enabled=tS,m7.ignoreCookies=tS,m7.blockedCookies=tS,m7.disableCookieDefer=!1,m7)),cookieDomain:tS,cookiePath:tS},jMt[_1e]=tS,jMt);function VMt(){!IM&&(IM=l7e(function(){return af()}))}a(VMt,"_getDoc");function nqe(t){return t?t.isEnabled():!0}a(nqe,"_isMgrEnabled");function mXr(t,e){return e&&t&&ur(t.ignoreCookies)?Ho(t.ignoreCookies,e)!==-1:!1}a(mXr,"_isIgnoredCookie");function uXr(t,e){return e&&t&&ur(t.blockedCookies)&&Ho(t.blockedCookies,e)!==-1?!0:mXr(t,e)}a(uXr,"_isBlockedCookie");function dXr(t,e){var r=e[a7];if(Xt(r)){var n=void 0;Nn(t[oXr])||(n=!t[oXr]),Nn(t[_1e])||(n=!t[_1e]),r=n}return r}a(dXr,"_isCfgEnabled");function WMt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[UQe]=E||"/",_[HMt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return kz()||(v["max-age"]="0"),pXr(vs,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Di(E||vs),R=iu(w,";");if(R!==-1&&(w=Di(tM(E,R)),T=gXr(Hf(E,R+1))),HL(T,FQe,v||o,Q1,Nn),!Xt(_)){var x=kz();if(Nn(T[HMt])){var P=hl(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),HL(T,HMt,fXr(N,x?nXr:iXr)||fXr(N,x?nXr:iXr)||vs,Q1)}}x||HL(T,"max-age",vs+_,null,Nn)}var B=aae();return B&&B.protocol==="https:"&&(HL(T,"secure",null,null,Nn),GMt===null&&(GMt=!AXr((Hu()||{})[n1e])),GMt&&HL(T,"SameSite","None",null,Nn)),HL(T,UQe,b||n,null,Nn),pXr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[bn]-1;_>=0;_--)f[_].n===E&&f[dx](_,1)}a(g,"_removePendingCookie");function A(){E1e(e)&&f&&(Ct(f,function(E){uXr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=Lp(t||lXr,null,e).cfg,s=rS(t,function(E){E.setDf(E.cfg,Tvo),r=E.ref(E.cfg,"cookieCfg"),n=r[UQe]||"/",o=r[FQe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=dXr(t,r)!==!1,l=r.getCookie||Ivo,u=r.setCookie||hXr,d=r.delCookie||hXr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=dXr(t,r)!==!1&&c&&E1e(e),_=lXr[sXr];return E&&_&&y!==_&&(E=nqe(_)),E},"isEnabled"),setEnabled:a(function(E){r[a7]=E,Nn(t[_1e])||(t[_1e]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=uXr(r,E);if(!R){var x=m(_,v,b,T);nqe(y)?(u(E,x),w=!0):f&&(g(E),f[no]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=vs,v=mXr(r,E);if(!v){if(nqe(y))_=l(E);else if(f)for(var b=f[bn]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=iu(w,";");_=R!==-1?Di(tM(w,R)):Di(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return nqe(y)?v=y.purge(E,_):f&&(g(E),f[no]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return E1e(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[sXr]=y,y}a(WMt,"createCookieMgr");function E1e(t){if(rqe===null){rqe=!1,!IM&&VMt();try{var e=IM.v||{};rqe=e[$Mt]!==void 0}catch(r){xa(t,2,68,"Cannot access document.cookie - "+oae(r),{exception:dr(r)})}}return rqe}a(E1e,"areCookiesSupported");function gXr(t){var e={};if(t&&t[bn]){var r=Di(t)[QL](";");Ct(r,function(n){if(n=Di(n||vs),n){var o=iu(n,"=");o===-1?e[n]=null:e[Di(tM(n,o))]=Di(Hf(n,o+1))}})}return e}a(gXr,"_extractParts");function fXr(t,e){return Or(t[e])?t[e]():null}a(fXr,"_formatDate");function pXr(t,e){var r=t||vs;return Yr(e,function(n,o){r+="; "+n+(Xt(o)?vs:"="+o)}),r}a(pXr,"_formatCookieValue");function Ivo(t){var e=vs;if(!IM&&VMt(),IM.v){var r=IM.v[$Mt]||vs;aXr!==r&&(cXr=gXr(r),aXr=r),e=Di(cXr[t]||vs)}return e}a(Ivo,"_getCookieValue");function hXr(t,e){!IM&&VMt(),IM.v&&(IM.v[$Mt]=t+"="+e)}a(hXr,"_setCookieValue");function AXr(t){return yi(t)?!!(Y0(t,"CPU iPhone OS 12")||Y0(t,"iPad; CPU OS 12")||Y0(t,"Macintosh; Intel Mac OS X 10_14")&&Y0(t,"Version/")&&Y0(t,"Safari")||Y0(t,"Macintosh; Intel Mac OS X 10_14")&&EL(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||Y0(t,"Chrome/5")||Y0(t,"Chrome/6")||Y0(t,"UnrealEngine")&&!Y0(t,"Chrome")||Y0(t,"UCBrowser/12")||Y0(t,"UCBrowser/11")):!1}a(AXr,"uaDisallowsSameSiteNone");p();var xvo={perfEvtsSendAll:!1};function wvo(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){jf(r.fn,[r.arg])})}a(wvo,"_runScheduledListeners");function g7(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[no]({fn:n,arg:o}),r.h=r.h||Mp(wvo,0,r)):jf(n,[o]))})}a(g7,"_runListeners");var zMt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Lp(e,xvo);n=c[gM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){ji(l,"listeners",{g:a(function(){return o},"g")}),l[Jse]=function(u){o[no](u)},l[Kse]=function(u){for(var d=Ho(o,u);d>-1;)o[dx](d,1),d=Ho(o,u)},l[eae]=function(u){g7(o,eae,s,function(d){d[eae](u)})},l[u7]=function(u,d){g7(o,u7,s,function(f){f[u7](u,d)})},l[tae]=function(u,d){g7(o,tae,d?s:null,function(f){f[tae](u,d)})},l[vM]=function(u){u&&(r||!u[i1e]())&&g7(o,vM,null,function(d){u.isAsync?Mp(function(){return d[vM](u)},0):d[vM](u)})},l[OQe]=function(u){u&&u[bn]&&g7(o,OQe,s,function(d){d[OQe](u)})},l[BQe]=function(u){u&&u[eS]&&g7(o,BQe,s,function(d){d[BQe](u)})},l[LQe]=function(u,d){if(u>0){var f=d||0;g7(o,LQe,s,function(h){h[LQe](u,f)})}},l[fx]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[AM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(g7(o,"unload",null,function(h){var m=h[fx](u);m&&(f||(f=[]),f[no](m))}),f)return Pd(function(h){return ml(k7e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var gae="ctx",KMt="ParentContextKey",v1e="ChildrenContextKey",Rvo=null,Aae=(function(){function t(e,r,n){var o=this;if(o.start=hl(),o[XP]=e,o.isAsync=n,o[i1e]=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[KMt]||c===t[v1e]?o[c]:(o[gae]||{})[c]:null},o[rk]=function(c,l){if(c)if(c===t[KMt])o[c]||(o[i1e]=function(){return!0}),o[c]=l;else if(c===t[v1e])o[c]=l;else{var u=o[gae]=o[gae]||{};u[c]=l}},o.complete=function(){var c=0,l=o[Iz](t[v1e]);if(ur(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){xa(r[$u],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[jL];!_&&A&&(_={}),E[jL]=_,_=e.ref(E,jL),_&&(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)}h1e(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[s7]();y&&g(y)}}return a(m,"_iterateChain"),c}a(tOt,"_createInternalContext");function hx(t,e,r,n){var o=Lp(e),s=tOt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[hC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=A7(d,o.cfg,r,f)),hx(d||c[X1](),o.cfg,r,f)}return a(u,"_createNew"),c[$m]=l,c[EM]=u,c}a(hx,"createProcessTelemetryContext");function yae(t,e,r){var n=Lp(e.config),o=tOt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[fx](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=A7(u,n.cfg,e,d)),yae(u||s[X1](),e,d)}return a(l,"_createNew"),s[$m]=c,s[EM]=l,s}a(yae,"createProcessTelemetryUnloadContext");function C1e(t,e,r){var n=Lp(e.config),o=tOt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[Tz])&&d[Tz](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=A7(u,n.cfg,e,d)),C1e(u||s[X1](),e,d)}return a(l,"_createNew"),s[$m]=c,s[EM]=l,s}a(C1e,"createProcessTelemetryUpdateContext");function A7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[bn]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[hC])){var u=Ovo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?A7([n],e,r):o}a(A7,"createTelemetryProxyChain");function Ovo(t,e,r){var n=null,o=Or(t[hC]),s=Or(t[l7]),c;t?c=t[yM]+"-"+t[Pz]+"-"+CXr++:c="Unknown-0-"+CXr++;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[vXr])&&(g=t[vXr]()),g||(g=hx(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[yM]:Nvo,T=g[_Xr];return T||(T=g[_Xr]={}),g.setNext(n),t&&Fp(g[$f](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:vs;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&xa(g[pC](),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 _=GL(t);return _[Z1]||_[s1e]?!1:(s&&t[l7](n),t[hC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[$m](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=GL(t),v=t[$f]||_[$f];t&&(!v||v===g.core())&&!_[Z1]&&(_[$f]=null,_[Z1]=!0,_[fC]=!1,t[Z1]&&t[Z1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[$m](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=GL(t),v=t[$f]||_[$f];t&&(!v||v===g.core())&&!_[Z1]&&t[Tz]&&t[Tz](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[$m](A)}return a(m,"_updatePlugin"),wh(l)}a(Ovo,"createTelemetryPluginProxy");var bXr=(function(){function t(e,r,n,o){var s=this,c=hx(e,r,n,o);p7(s,c,ju(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function b1e(){var t=[];function e(n){n&&t[no](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){xa(n[pC](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(b1e,"createUnloadHandlerContainer");p();var sqe,aqe;function cqe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){xa(n,2,73,"Unloading:"+dr(c))}}),sqe&&o[bn]>sqe&&(aqe?aqe("doUnload",o):xa(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Rh(t,n),sqe&&t[bn]>sqe&&(aqe?aqe("Add",t):xa(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(cqe,"createUnloadHookContainer");var rOt,y7="getPlugin",Bvo=(rOt={},rOt[jL]={isVal:d7,v:{}},rOt),Eae=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[FL]=function(h,m,g,A){u(h,m,A),r=!0},f[Z1]=function(h,m){var g=f[$f];if(!g||h&&g!==h[$f]())return;var A,y=!1,E=h||yae(null,g,o&&o[y7]?o[y7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[pC]()),A===!0&&E[$m](_),d())}return a(v,"_unloadCallback"),!f[c7]||f[c7](E,_,v)!==!0?v():A=!0,A},f[Tz]=function(h,m){var g=f[$f];if(!g||h&&g!==h[$f]())return;var A,y=!1,E=h||C1e(null,g,o&&o[y7]?o[y7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[X1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},f7(f,"_addUnloadCb",function(){return s},"add"),f7(f,"_addHook",function(){return c},"add"),ji(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[pC]=function(f){return l(f)[pC]()},e[fC]=function(){return r},e.setInitialized=function(f){r=f},e[l7]=function(f){o=f},e[$m]=function(f,h){h?h[$m](f):o&&Or(o[hC])&&o[hC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||hx(null,{},e[$f]);o&&o[y7]?h=m[EM](null,o[y7]):h=m[EM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Lp(f,Bvo,mae(h)),!m&&h&&(m=h[RQe]()[X1]());var g=o;o&&o[y7]&&(g=o[y7]()),e[$f]=h,n=hx(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[$f]=null,n=null,o=null,c=cqe(),s=b1e()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function Lvo(t,e,r){var n={id:e,fn:r};Rh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[dx](c,1),-1})},"remove")};return o}a(Lvo,"_addInitializer");function Fvo(t,e,r){for(var n=!1,o=t[bn],s=0;s"},"v")})}a(zvo,"_createUnloadHook");var lqe=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,B,L,j,M,O,q,Q;Si(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[fC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[FL]=function(ie,le,Ne,we){g&&zc(TXr),U[fC]()&&zc("Core cannot be initialized more than once"),e=Lp(ie,nOt,Ne||U[$u],!1),ie=e.cfg,je(e[gM](function(st){var _t=st.cfg;L=_t.initInMemoMaxSize||qvo,z(_t);var kt=st.ref(st.cfg,jL);Yr(kt,function($t){st.ref(kt,$t)})})),s=we,b=Wvo(e,v,s&&U[t1e](),b),K(),U[$u]=Ne;var Le=ie[Rz];if(f=[],f[no].apply(f,$W($W([],le,!1),Le,!1)),h=ie[wz],Be(null),(!m||m[bn]===0)&&zc("No "+wz+" available"),h&&h[bn]>1){var rt=U[s7]("TeeChannelController");(!rt||!rt.plugin)&&xa(n,1,28,"TeeChannel required")}Vvo(ie,R,n),R=null,r=!0,N===i7.ACTIVE&&J()},U.getChannels=function(){var ie=[];return m&&Ct(m,function(le){ie[no](le)}),wh(ie)},U.track=function(ie){Fp(U[rae](),function(){return"AppInsightsCore:track"},function(){ie===null&&(ue(ie),zc("Invalid telemetry item")),!ie[XP]&&Xt(ie[XP])&&(ue(ie),zc("telemetry name required")),ie.iKey=ie.iKey||w,ie.time=ie.time||iae(new Date),ie.ver=ie.ver||"4.0",!g&&U[fC]()&&N===i7.ACTIVE?ae()[$m](ie):N!==i7.INACTIVE&&o[bn]<=L&&o[no](ie)},function(){return{item:ie}},!ie.sync)},U[RQe]=ae,U[t1e]=function(){return s||(s=new zMt(e.cfg),U[Uvo]=s),s},U[Jse]=function(ie){U.getNotifyMgr()[Jse](ie)},U[Kse]=function(ie){s&&s[Kse](ie)},U.getCookieMgr=function(){return u||(u=WMt(e.cfg,U[$u])),u},U.setCookieMgr=function(ie){u!==ie&&(fae(u,!1),u=ie)},U[rae]=function(){return c||l||JMt()},U.setPerfMgr=function(ie){c=ie},U.eventCnt=function(){return o[bn]},U.releaseQueue=function(){if(r&&o[bn]>0){var ie=o;o=[],N===2?Ct(ie,function(le){le.iKey=le.iKey||w,ae()[$m](le)}):xa(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ie){return y=ie||null,Q=!1,O&&O[AM](),ne(!0)};function z(ie){var le=ie.instrumentationKey,Ne=ie.endpointUrl;if(N!==3){if(Xt(le)){w=null,N=i7.INACTIVE;var we="Please provide instrumentation key";r?(xa(n,1,100,we),J()):zc(we);return}var Le=[];V0(le)?(Le[no](le),w=null):w=le,V0(Ne)?(Le[no](Ne),B=null):B=Ne,Le[bn]?$(ie,Le):W()}}a(z,"_handleIKeyEndpointPromises");function $(ie,le){j=!1,N=3;var Ne=d7(ie.initTimeOut)?ie.initTimeOut:jvo,we=P7e(le);M&&M[AM](),M=Mp(function(){M=null,j||W()},Ne),ml(we,function(Le){try{if(j)return;if(!Le.rejected){var rt=Le[UL];if(rt&&rt[bn]){var st=rt[0];if(w=st&&st[UL],rt[bn]>1){var _t=rt[1];B=_t&&_t[UL]}}w&&(ie.instrumentationKey=w,ie.endpointUrl=B)}W()}catch{j||W()}})}a($,"_waitForInitPromises");function W(){j=!0,Xt(w)?(N=i7.INACTIVE,xa(n,1,112,"ikey can't be resolved from promises")):N=i7.ACTIVE,J()}a(W,"_setStatus");function J(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(J,"_releaseQueues");function ne(ie){if((!O||!O[a7])&&!Q){var le=ie||n&&n.queue[bn]>0;le&&(q||(q=!0,je(e[gM](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Le=!1;O&&(Le=O[a7],O[AM]()),O=p7e(Z,we),O.unref(),O[a7]=Le}))),O[a7]=!0)}return O}a(ne,"_startLogPoller"),U[vMt]=function(){Q=!0,O&&O[AM](),Z()},p7(U,function(){return A},["addTelemetryInitializer"]),U[fx]=function(ie,le,Ne){ie===void 0&&(ie=!0),r||zc(Qvo),g&&zc(TXr);var we={reason:50,isAsync:ie,flushComplete:!1},Le;ie&&!le&&(Le=Pd(function(_t){le=_t}));var rt=yae(Ue(),U);rt[r1e](function(){v.run(U[$u]),LMt([u,s,n],ie,function(){re(),le&&le(we)})},U);function st(_t){we.flushComplete=_t,g=!0,_.run(rt,we),U[vMt](),rt[$m](we)}return a(st,"_doUnload"),Z(),ee(ie,st,6,Ne)||st(!1),Le},U[s7]=ve,U.addPlugin=function(ie,le,Ne,we){if(!ie){we&&we(!1),X(wXr);return}var Le=ve(ie[yM]);if(Le&&!le){we&&we(!1),X("Plugin ["+ie[yM]+"] is already loaded!");return}var rt={reason:16};function st($t){f[no](ie),rt.added=[ie],Be(rt),we&&we(!0)}if(a(st,"_addPlugin"),Le){var _t=[Le.plugin],kt={reason:2,isAsync:!!Ne};Pe(_t,kt,function($t){$t?(rt.removed=_t,rt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ie,le){le===void 0&&(le=!0);var Ne;if(U[fC]()){Ne={reason:1,cfg:e.cfg,oldCfg:dse({},e.cfg),newConfig:dse({},ie),merge:le},ie=Ne.newConfig;var we=e.cfg;ie[Rz]=we[Rz],ie[wz]=we[wz]}e._block(function(Le){var rt=Le.cfg;iOt(Le,rt,ie,le),le||Yr(rt,function(st){cA(ie,st)||Le.set(rt,st,tS)}),Le.setDf(rt,nOt)},!0),e.notify(),Ne&&he(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ie){return T||(T=EXr()),T},U.setTraceCtx=function(ie){T=ie||null},U.addUnloadHook=je,f7(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ie){var le;return r?le=rS(e.cfg,ie,U[$u]):le=$vo(R,ie),zvo(le)},U.getWParam=function(){return AL()||e.cfg.enableWParam?0:-1};function H(){var ie={};P=[];var le=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[yM]&&we[PQe]&&!ie[we.identifier]){var Le=we[yM]+"="+we[PQe];P[no](Le),ie[we.identifier]=we}})},"_addPluginVersions");le(m),h&&Ct(h,function(Ne){le(Ne)}),le(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Lp({},nOt,U[$u]),e.cfg[kQe]=1,ji(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(le){U.updateCfg(le,!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||vs},"g")}),ji(U,"logger",{g:a(function(){return n||(n=new Nz(e.cfg),e[$u]=n),n},"g"),s:a(function(le){e[$u]=le,n!==le&&(fae(n,!1),n=le)},"s")}),U[$u]=new Nz(e.cfg),x=[];var ie=U.config[Rz]||[];ie.splice(0,ie[bn]),Rh(ie,x),A=new SXr,o=[],fae(s,!1),s=null,c=null,l=null,fae(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=px("AIBaseCore",!0),_=b1e(),T=null,w=null,v=cqe(),R=[],D=null,P=null,Q=!1,O=null,q=!1,N=0,B=null,L=null,j=!1,M=null}a(re,"_initDefaults");function ae(){var ie=hx(Ue(),e.cfg,U);return ie[r1e](ne),ie}a(ae,"_createTelCtx");function Be(ie){var le=Gvo(U[$u],JZr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=oqe(Rh(m,le[wz]));var Ne=Rh(oqe(le[$f]),m);x=wh(Ne);var we=U.config[Rz]||[];we.splice(0,we[bn]),Rh(we,x);var Le=ae();m&&m[bn]>0&&eOt(Le[EM](m),Ne),eOt(Le,Ne),ie&&he(ie)}a(Be,"_initPluginChain");function ve(ie){var le=null,Ne=null,we=[];return Ct(x,function(Le){if(Le[yM]===ie&&Le!==A)return Ne=Le,-1;Le.getChannel&&we[no](Le)}),!Ne&&we[bn]>0&&Ct(we,function(Le){if(Ne=Le.getChannel(ie),!Ne)return-1}),Ne&&(le={plugin:Ne,setEnabled:a(function(Le){GL(Ne)[s1e]=!Le},"setEnabled"),isEnabled:a(function(){var Le=GL(Ne);return!Le[Z1]&&!Le[s1e]},"isEnabled"),remove:a(function(Le,rt){Le===void 0&&(Le=!0);var st=[Ne],_t={reason:1,isAsync:Le};Pe(st,_t,function(kt){kt&&Be({reason:32,removed:st}),rt&&rt(kt)})},"remove")}),le}a(ve,"_getPlugin");function Ue(){if(!d){var ie=(x||[]).slice();Ho(ie,A)===-1&&ie[no](A),d=A7(oqe(ie),e.cfg,U)}return d}a(Ue,"_getPluginChain");function Pe(ie,le,Ne){if(ie&&ie[bn]>0){var we=A7(ie,e.cfg,U),Le=yae(we,U);Le[r1e](function(){var rt=!1,st=[];Ct(f,function(kt,$t){IXr(kt,ie)?rt=!0:st[no](kt)}),f=st,D=null,P=null;var _t=[];h&&(Ct(h,function(kt,$t){var Ht=[];Ct(kt,function(Ie){IXr(Ie,ie)?rt=!0:Ht[no](Ie)}),_t[no](Ht)}),h=_t),Ne&&Ne(rt),ne()}),Le[$m](le)}else Ne(!1)}a(Pe,"_removePlugins");function Z(){if(n&&n.queue){var ie=n.queue.slice(0);n.queue[bn]=0,Ct(ie,function(le){var Ne={name:y||"InternalMessageId: "+le[Zse],iKey:w,time:iae(new Date),baseType:hae.dataType,baseData:{message:le[_M]}};U.track(Ne)})}}a(Z,"_flushInternalLogs");function ee(ie,le,Ne,we){var Le=1,rt=!1,st=null;we=we||5e3;function _t(){Le--,rt&&Le===0&&(st&&st[AM](),st=null,le&&le(rt),le=null)}if(a(_t,"doCallback"),m&&m[bn]>0){var kt=ae()[EM](m);kt.iterate(function($t){if($t.flush){Le++;var Ht=!1;$t.flush(ie,function(){Ht=!0,_t()},Ne)||Ht||(ie&&st==null?st=Mp(function(){st=null,_t()},we):_t())}})}return rt=!0,_t(),!0}a(ee,"_flushChannels");function K(){var ie;je(e[gM](function(le){var Ne=le.cfg.enablePerfMgr;if(Ne){var we=le.cfg[MQe];(ie!==we||!ie)&&(we||(we=Hvo),QQe(le.cfg,MQe,we),ie=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[t1e]()))}else l=null,ie=null}))}a(K,"_initPerfManager");function he(ie){var le=C1e(Ue(),U);le[r1e](ne),(!U._updateHook||U._updateHook(le,ie)!==!0)&&le[$m](ie)}a(he,"_doUpdate");function X(ie){var le=U[$u];le?(xa(le,2,73,ie),ne()):zc(ie)}a(X,"_logOrThrowError");function ue(ie){var le=U[t1e]();le&&le[u7]([ie],2)}a(ue,"_notifyInvalidEvent");function je(ie){v.add(ie)}a(je,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var nk="",Yvo="NoResponseBody",RXr="&"+Yvo+"=true",oOt="POST",uqe=(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;j(),E[FL]=function(M,O){o=O,n&&xa(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=aae();O&&O.protocol&&O.protocol[Sz]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[bn]?R(M,O):null},E.getFallbackInst=function(){return d},E[c7]=function(M,O){j()},E.preparePayload=function(M,O,q,Q){if(!O||Q||!q[eS]){M(q);return}try{var U=ki("CompressionStream");if(!Or(U)){M(q);return}var z=new ReadableStream({start:a(function(re){re.enqueue(yi(q[eS])?new TextEncoder().encode(q[eS]):q[eS]),re.close()},"start")}),$=z.pipeThrough(new U("gzip")),W=$.getReader(),J=[],ne=0,H=!1;return ml(W.read(),a(function re(ae){if(!H&&!ae.rejected){var Be=ae[UL];if(!Be.done)return J[no](Be[UL]),ne+=Be.value[bn],ml(W.read(),re);for(var ve=new Uint8Array(ne),Ue=0,Pe=0,Z=J;Pe0&&(Ct(ju(ve),function(K){H.append(K,ve[K])}),Ue[o1e]=H),u?Ue.credentials=u:v&&s&&(Ue.credentials="include"),q&&(Ue.keepalive=!0,e+=re,s?M._sendReason===2&&(ae=!0,A&&(U+=RXr)):ae=!0);var Pe=new Request(U,Ue);try{Pe[FMt]=!0}catch{}if(!q&&r&&(W=Pd(function(K,he){J=K,ne=he})),!U){w(O),J&&J(!1);return}function Z(K,he){he?x(O,s?0:he,{},s?nk:K):x(O,s?0:400,{},s?nk:K)}a(Z,"_handleError");function ee(K,he,X){var ue=K[tk],je=c.fetchOnComplete;je&&Or(je)?je(K,O,X||nk,he):x(O,ue,{},X||nk)}a(ee,"_onFetchComplete");try{ml(fetch(s?U:Pe,s?Ue:null),function(K){if(q&&(e-=re,re=0),!Be)if(Be=!0,K.rejected)Z(K.reason&&K.reason[_M],499),ne&&ne(K.reason);else{var he=K[UL];try{!s&&!he.ok?(he[tk]?Z(he.statusText,he[tk]):Z(he.statusText,499),J&&J(!1)):s&&!he.body?(ee(he,null,nk),J&&J(!0)):ml(he.text(),function(X){ee(he,M,X[UL]),J&&J(!0)})}catch(X){he&&he[tk]?Z(dr(X),he[tk]):Z(dr(X),499),ne&&ne(X)}}})}catch(K){Be||(Z(dr(K),499),ne&&ne(K))}return ae&&!Be&&(Be=!0,x(O,200,{}),J&&J(!0)),s&&!Be&&M[xz]>0&&y&&y.set(function(){Be||(Be=!0,x(O,500,{}),J&&J(!0))},M[xz]),W}a(B,"_doFetchSender");function L(M,O,q){var Q=cf(),U=new XDomainRequest,z=M[eS];U.onload=function(){var H=bM(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?nk:jQe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var $=Q&&Q.location&&Q.location.protocol||"",W=M[Xse];if(!W){w(O);return}if(!s&&W.lastIndexOf($,0)!==0){var J="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";xa(o,2,40,". "+J),T(J,O);return}var ne=s?W:W[ek](/^(https?:)/,"");U.open(oOt,ne),M[xz]&&(U[xz]=M[xz]),U.send(z),s&&q?y&&y.set(function(){U.send(z)},0):U.send(z)}a(L,"_xdrSender");function j(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(j,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var BXr="on",PXr="attachEvent",kXr="addEventListener",DXr="detachEvent",NXr="removeEventListener",sOt="events",I1e="visibilitychange",fqe="pagehide",LXr="pageshow",FXr="unload",UXr="beforeunload",QXr=px("aiEvtPageHide"),qXr=px("aiEvtPageShow"),Kvo=/\.[\.]+/g,Jvo=/[\.]+$/,Zvo=1,dqe=zQe("events"),Xvo=/^([^.]*)(?:\.(.+)|)/;function MXr(t){return t&&t[ek]?t[ek](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,vs):t}a(MXr,"_normalizeNamespace");function aOt(t,e){if(e){var r=vs;ur(e)?(r=vs,Ct(e,function(o){o=MXr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=MXr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||vs)+r)}var n=Xvo.exec(t||vs)||[];return{type:n[1],ns:(n[2]||vs).replace(Kvo,".").replace(Jvo,vs)[QL](".").sort().join(".")}}a(aOt,"_getEvtNamespace");function jXr(t,e,r){r===void 0&&(r=!0);var n=dqe.get(t,sOt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(jXr,"_getRegisteredEvents");function HXr(t,e,r,n){t&&e&&e[qL]&&(t[NXr]?t[NXr](e[qL],r,n):t[DXr]&&t[DXr](BXr+e[qL],r))}a(HXr,"_doDetach");function eCo(t,e,r,n){var o=!1;return t&&e&&e[qL]&&r&&(t[kXr]?(t[kXr](e[qL],r,n),o=!0):t[PXr]&&(t[PXr](BXr+e[qL],r),o=!0)),o}a(eCo,"_doAttach");function OXr(t,e,r,n){for(var o=e[bn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[bMt].ns)&&(!n||n(s))&&(HXr(t,s[bMt],s.handler,s.capture),e[dx](o,1))}}a(OXr,"_doUnregister");function tCo(t,e,r){if(e[qL])OXr(t,jXr(t,e[qL]),e,r);else{var n=dqe.get(t,sOt,{});Yr(n,function(o,s){OXr(t,s,e,r)}),ju(n)[bn]===0&&dqe.kill(t,sOt)}}a(tCo,"_unregisterEvents");function _7(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=aOt("xx",r).ns[QL](".")):r=t,r}a(_7,"mergeEvtNamespace");function S1e(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=aOt(e,n);if(s=eCo(t,c,r,o),s&&dqe.accept(t)){var l={guid:Zvo++,evtName:c,handler:r,capture:o};jXr(t,c.type)[no](l)}}catch{}return s}a(S1e,"eventOn");function T1e(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=aOt(e,n),c=!1;tCo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||HXr(t,s,r,o)}catch{}}a(T1e,"eventOff");function cOt(t,e,r){var n=!1,o=cf();o&&(n=S1e(o,t,e,r),n=S1e(o.body,t,e,r)||n);var s=af();return s&&(n=S1e(s,t,e,r)||n),n}a(cOt,"addEventHandler");function lOt(t,e,r){var n=cf();n&&(T1e(n,t,e,r),T1e(n.body,t,e,r));var o=af();o&&T1e(o,t,e,r)}a(lOt,"removeEventHandler");function _ae(t,e,r,n){var o=!1;return e&&t&&t[bn]>0&&Ct(t,function(s){s&&(!r||Ho(r,s)===-1)&&(o=cOt(s,e,n)||o)}),o}a(_ae,"_addEventListeners");function uOt(t,e,r,n){var o=!1;return e&&t&&ur(t)&&(o=_ae(t,e,r,n),!o&&r&&r[bn]>0&&(o=_ae(t,e,null,n))),o}a(uOt,"addEventListeners");function Mz(t,e,r){t&&ur(t)&&Ct(t,function(n){n&&lOt(n,e,r)})}a(Mz,"removeEventListeners");function pqe(t,e,r){return uOt([UXr,FXr,fqe],t,e,r)}a(pqe,"addPageUnloadEventListener");function hqe(t,e){Mz([UXr,FXr,fqe],t,e)}a(hqe,"removePageUnloadEventListener");function x1e(t,e,r){function n(c){var l=af();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=_7(QXr,r),s=_ae([fqe],t,e,o);return(!e||Ho(e,I1e)===-1)&&(s=_ae([I1e],n,e,o)||s),!s&&e&&(s=x1e(t,null,r)),s}a(x1e,"addPageHideEventListener");function mqe(t,e){var r=_7(QXr,e);Mz([fqe],t,r),Mz([I1e],null,r)}a(mqe,"removePageHideEventListener");function w1e(t,e,r){function n(c){var l=af();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=_7(qXr,r),s=_ae([LXr],t,e,o);return s=_ae([I1e],n,e,o)||s,!s&&e&&(s=w1e(t,null,r)),s}a(w1e,"addPageShowEventListener");function gqe(t,e){var r=_7(qXr,e);Mz([LXr],t,r),Mz([I1e],null,r)}a(gqe,"removePageShowEventListener");p();var vae="",GXr="https://browser.events.data.microsoft.com/OneCollector/1.0/",dOt="version",Aqe="properties";p();p();var fOt="initialize",pOt="indexOf",xM="timings",hOt="pollInternalLogs",nS="value",yqe="length",Eqe="processTelemetryStart";var $L,$Xr="4.3.10",R1e="1DS-Web-JS-"+$Xr,VXr=ube.hasOwnProperty;var dCo=($L={},$L[0]=0,$L[2]=6,$L[1]=1,$L[3]=7,$L[4098]=6,$L[4097]=1,$L[4099]=7,$L);var fCo=AL(),pCo=use();function mx(t){return!(t===vae||Xt(t))}a(mx,"isValueAssigned");function mOt(t){if(t){var e=iu(t,"-");if(e>-1)return tM(t,e)}return vae}a(mOt,"getTenantId");function gOt(t){return!!(t&&xh(t)&&t>=1&&t<=4)}a(gOt,"isLatency");function AOt(t,e,r){if(!e&&!mx(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"&&!VXr.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Xt(e[nS])||e[nS]===vae||!yi(e[nS])&&!xh(e[nS])&&!jP(e[nS])&&!ur(e[nS]))return null;if(ur(e[nS])&&!zXr(e[nS]))return null;if(!Xt(e.kind)){if(ur(e[nS])||!WXr(e.kind))return null;e[nS]=e[nS].toString()}return e}a(AOt,"sanitizeProperty");function P1e(t,e,r){var n=-1;if(!Nn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),hCo(r))n===-1&&(n=0),n|=r;else{var o=dCo[_qe(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(P1e,"getCommonSchemaMetaData");function Cae(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[yqe],d=arguments;for(jP(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(WXr,"isValueKind");function hCo(t){return t>=0&&t<=9}a(hCo,"isDataType");function zXr(t){return t[yqe]>0}a(zXr,"isArrayValid");function vqe(t,e){var r=t;r[xM]=r[xM]||{},r[xM][Eqe]=r[xM][Eqe]||{},r[xM][Eqe][e]=iS()}a(vqe,"setProcessTelemetryTimings");function _qe(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===ix&&(e=4,ur(t)?(e=4096,t[yqe]>0&&(e|=_qe(t[0]))):VXr.call(t,"value")&&(e=8192|_qe(t[nS])))}return e}a(_qe,"getFieldValueType");function yOt(){return!!ki("chrome")}a(yOt,"isChromium");function Oz(t){return t>0}a(Oz,"isGreaterThanZero");var mCo=m_({endpointUrl:GXr,propertyStorageOverride:{isVal:gCo}});function gCo(t){return t&&(!t.getProperty||!t.setProperty)&&zc("Invalid property storage override passed."),!0}a(gCo,"_chkPropOverride");var EOt=(function(t){Fy(e,t);function e(){var r=t.call(this)||this;return Si(e,r,function(n,o){n[fOt]=function(s,c,l,u){Fp(n,function(){return"AppInsightsCore.initialize"},function(){try{o[fOt](Lp(s,mCo,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=dr(h);f[pOt]("channels")!==-1&&(f+=` - - Channels must be provided through config.channels only!`),xa(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){Fp(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[xM]=c[xM]||{},c[xM].trackStart=iS(),gOt(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=R1e;var u=c.baseData=c.baseData||{};u[Aqe]=u[Aqe]||{};var d=u[Aqe];d[dOt]=d[dOt]||n.pluginVersionString||vae}o.track(c)},function(){return{item:s}},!s.sync)},n[hOt]=function(s){return o[hOt](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(lqe);p();p();var k1e="REAL_TIME",YXr="NEAR_REAL_TIME",KXr="BEST_EFFORT";p();p();p();var ik="";var Cqe="drop",JXr="send",_Ot="requeue",ZXr="rspFail",XXr="oth",vOt="no-cache, no-store",bqe="application/x-json-stream",D1e="cache-control",bae="content-type",een="kill-tokens",ten="kill-duration";var ren="time-delta-millis",Sqe="client-version",COt="client-id",Tqe="time-delta-to-apply-millis",Iqe="upload-time",xqe="apikey",N1e="AuthMsaDeviceTicket",bOt="WebAuthToken",SOt="AuthXToken";var nen="NoResponseBody",Sae="msfpc",TOt="trace",wqe="user";p();var M1e="allowRequestSending",Rqe="shouldAddClockSkewHeaders",Pqe="getClockSkewHeaderValue",O1e="setClockSkew",Go="length",wM="concat",oS="iKey",Vf="count",RM="events",Vm="push",PM="split",kqe="toLowerCase",Bz="hdrs",Dqe="useHdrs",Lz="initialize",Nqe="setTimeoutOverride",Mqe="clearTimeoutOverride",ien="payloadPreprocessor",IOt="overrideEndpointUrl",xOt="avoidOptions",oen="disableEventTimings",Oqe="enableCompoundKey",wOt="disableXhrSync",ROt="disableFetchKeepAlive",sen="addNoResponse",POt="useSendBeacon",kOt="fetchCredentials",DOt="alwaysUseXhrOverride",Bqe="serializeOfflineEvt",Lqe="getOfflineRequestDetails",Fqe="createPayload",B1e="createOneDSPayload",NOt="payloadBlob",ok="headers",Tae="_thePayload",jy="batches",mC="sendType",L1e="canSendRequest",Iae="sendQueuedRequests",F1e="setUnloading",aen="isTenantKilled",Uqe="sendSynchronousBatch",Qqe="_transport",xae="getWParam",MOt="isBeacon",U1e="timings",qqe="isTeardown",jqe="_sendReason",Hqe="setKillSwitchTenants",Gqe="_backOffTransmission",Q1e="identifier",cen="ignoreMc1Ms0CookieProcessing",OOt="autoFlushEventsLimit",len="disableAutoBatchFlushLimit",uen="overrideInstrumentationKey",q1e="sendAttempt",v7="latency",Fz="sync";function fen(t){var e=(t.ext||{}).intweb;return e&&mx(e[Sae])?e[Sae]:null}a(fen,"_getEventMsfpc");function den(t){for(var e=null,r=0;e===null&&rhl()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var yCo=.8,ECo=1.2,men=3e3,_Co=6e5;function gen(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a(gen,"retryPolicyShouldRetryForStatus");function $qe(t){var e=0,r=men*yCo,n=men*ECo,o=j1(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,IU(e,_Co)}a($qe,"retryPolicyGetMillisToBackoffForRetry");p();var vCo=20,CCo=3145728,yen=65e3,Een=2e6,bCo=IU(Een,yen),Aen="metadata",Vqe="f",SCo=/\./,_en=(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||P1e,_=TCo(l),v=Wqe(_.requestLimit,CCo,0),b=Wqe(_.requestLimit,yen,1),T=Wqe(_.recordLimit,Een,0),w=Math.min(Wqe(_.recordLimit,bCo,1),b);Si(t,this,function(R){R.createPayload=function(D,N,B,L,j,M){return{apiKeys:[],payloadBlob:ik,overflow:null,sizeExceed:[],failedEvts:[],batches:[],numEvents:0,retryCnt:D,isTeardown:N,isSync:B,isBeacon:L,sendType:M,sendReason:j}},R.appendPayload=function(D,N,B){var L=D&&N&&!D.overflow;return L&&Fp(e,function(){return"Serializer:appendPayload"},function(){for(var j=N.events(),M=D.payloadBlob,O=D.numEvents,q=!1,Q=[],U=[],z=D.isBeacon,$=z?b:v,W=z?w:T,J=0,ne=0;J=B){D.overflow=N.split(J);break}var re=R.getEventBlob(H);if(re&&re.length<=W){var ae=re.length,Be=M.length;if(Be+ae>$){D.overflow=N.split(J);break}M&&(M+=` -`),M+=re,ne++,ne>vCo&&(c7e(M,0,1),ne=0),q=!0,O++}else re?Q.push(H):U.push(H),j.splice(J,1),J--}J++}if(Q.length>0&&D.sizeExceed.push(C7.create(N.iKey(),Q)),U.length>0&&D.failedEvts.push(C7.create(N.iKey(),U)),q){D.batches.push(N),D.payloadBlob=M,D.numEvents=O;var ve=N.iKey();Ho(D.apiKeys,ve)===-1&&D.apiKeys.push(ve)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:B}}),L},R.getEventBlob=function(D){try{return Fp(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+mOt(D.iKey);var B={},L;y||(L=a(function(q,Q,U){ICo(E,B,q,Q,U)},"_addMetadataCallback"));var j=D[f];j&&(N[f]=B,Yr(j,function(q,Q){var U=B[q]={};P(Q,U,"ext."+q,!0,null,null,!0)}));var M=N[u]={};M.baseType=D.baseType;var O=M[d]={};return P(D.baseData,O,d,!1,[d],L,m),P(D.data,M,u,!1,[],L,m),JSON.stringify(N)},function(){return{item:D}})}catch{return null}};function x(D,N){var B=A[D];return B===void 0&&(D.length>=7&&(B=fse(D,"ext.metadata")||fse(D,"ext.web")),A[D]=B),B}a(x,"_isReservedField");function P(D,N,B,L,j,M,O){Yr(D,function(q,Q){var U=null;if(Q||mx(Q)){var z=B,$=q,W=j,J=N;if(h&&!L&&SCo.test(q)){var ne=q.split("."),H=ne.length;if(H>1){W&&(W=W.slice());for(var re=0;re0&&n<=e)return n}return e}a(Wqe,"_validateSizeLimit");function TCo(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a(TCo,"_getSizeLimtCfg");function ICo(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[Aen];c||(c=e[Aen]={f:{}});var l=c[Vqe];if(l||(l=c[Vqe]={}),r)for(var u=0;u0)for(var o=e[kqe](),s=0;s0&&(n&&LOt[e]?(t[Bz][LOt[e]]=r,t[Dqe]=!0):t.url+="&"+e+"="+r)}a(Rae,"_addRequestDetails");function PCo(t,e,r){for(var n=0;n=0&&Q.splice(Se,1)},"rm")}},H[Bqe]=function(fe){try{if(b)return b.getEventBlob(fe)}catch{}return ik},H[Lqe]=function(){try{var fe=b&&b[Fqe](0,!1,!1,!1,1,0);return we(fe,x)}catch{}return null},H[B1e]=function(fe,Se){try{var Fe=[];Ct(fe,function(se){Se&&(se=CM(se));var me=C7.create(se[oS],[se]);Fe[Vm](me)});for(var te=null;Fe[Go]>0&&b;){var Te=Fe.shift();Te&&Te[Vf]()>0&&(te=te||b[Fqe](0,!1,!1,!1,1,0),b.appendPayload(te,Te,ne))}var Ge=we(te,x),Y={data:te[NOt],urlString:Ge.url,headers:Ge[Bz],timeout:P,disableXhrSync:N,disableFetchKeepAlive:B};return x&&(zqe(Y[ok],D1e)||(Y[ok][D1e]=vOt),zqe(Y[ok],bae)||(Y[ok][bae]=bqe)),Y}catch{}return null};function ae(fe,Se){try{return W&&W.getSenderInst(fe,Se)}catch{}return null}a(ae,"_getSenderInterface"),H._getDbgPlgTargets=function(){return[g[0],c,b,g,Be(),s,ne]};function Be(){try{var fe={xdrOnComplete:ve,fetchOnComplete:Pe,xhrOnComplete:Z,beaconOnRetry:K},Se={enableSendPromise:!1,isOneDs:!0,disableCredentials:!re,fetchCredentials:J,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:B,timeWrapper:z,addNoResponse:j,senderOnCompleteCallBack:fe};return Se}catch{}return null}a(Be,"_getSendPostMgrConfig");function ve(fe,Se,Fe){var te=bM(fe);ee(Se,200,{},te),F(te)}a(ve,"_xdrOncomplete");function Ue(){var fe;s=null,c=new hen,l=!1,u=new pen,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=fe,N=fe,B=fe,L=fe,j=fe,M=[],O=fe,q=fe,Q=[],U=!1,z=wae(),$=!1,W=null,ne=null}a(Ue,"_initDefaults");function Pe(fe,Se,Fe,te){var Te=a(function(se,me,Ce){ee(Se,se,me,Ce),F(Ce)},"handleResponse"),Ge={},Y=fe[ok];Y&&Y.forEach(function(se,me){Ge[me]=se}),Te(fe.status,Ge,Fe||ik)}a(Pe,"_fetchOnComplete");function Z(fe,Se,Fe){var te=bM(fe);ee(Se,fe.status,h7(fe,!0),te),F(te)}a(Z,"_xhrOnComplete");function ee(fe,Se,Fe,te){try{fe(Se,Fe,te)}catch(Te){xa(m,2,518,dr(Te))}}a(ee,"_doOnComplete");function K(fe,Se,Fe){var te=fe,Te=200,Ge=te[Tae],Y=fe.urlString+(j?xCo:ik);try{var se=Hu();if(Ge){var me=!!A.getPlugin("LocalStorage"),Ce=[],He=[];Ct(Ge[jy],function($e){if(Ce&&$e&&$e[Vf]()>0)for(var et=$e[RM](),ct=0;ct0&&(Ge.sentEvts=He),me||be(Ce,8003,Ge[mC],!0)}else Te=0}catch($e){TM(m,"Failed to send telemetry using sendBeacon API. Ex:"+dr($e)),Te=0}finally{ee(Se,Te,{},ik)}}a(K,"_onBeaconRetry");function he(fe){return fe===2||fe===3}a(he,"_isBeaconPayload");function X(fe){return R&&he(fe)&&(fe=2),fe}a(X,"_adjustSendType"),H.addHeader=function(fe,Se){_[fe]=Se},H.removeHeader=function(fe){delete _[fe]},H[L1e]=function(){return ue()&&u[M1e]()},H[Iae]=function(fe,Se){Nn(fe)&&(fe=0),R&&(fe=X(fe),Se=2),ie(v,fe,0)&&Ne(je(),0,!1,fe,Se||0)},H.isCompletelyIdle=function(){return!l&&f===0&&v[Go]===0},H[F1e]=function(fe){R=fe},H.addBatch=function(fe){if(fe&&fe[Vf]()>0){if(c.isTenantKilled(fe[oS]()))return!1;v[Vm](fe)}return!0},H.teardown=function(){v[Go]>0&&Ne(je(),0,!0,2,2),Ct(M,function(fe){fe&&fe.rm&&fe.rm()}),M=[]},H.pause=function(){l=!0},H.resume=function(){l=!1,H[Iae](0,4)},H[Uqe]=function(fe,Se,Fe){fe&&fe[Vf]()>0&&(Xt(Se)&&(Se=1),R&&(Se=X(Se),Fe=2),Ne([fe],0,!1,Se,Fe||0))};function ue(){return!l&&f0&&!l&&g[Se]&&b&&(te=Se!==0||ue()&&(Fe>0||u[M1e]())),te}a(ie,"_canSendPayload");function le(fe){var Se={};return fe&&Ct(fe,function(Fe,te){Se[te]={iKey:Fe[oS](),evts:Fe[RM]()}}),Se}a(le,"_createDebugBatches");function Ne(fe,Se,Fe,te,Te){if(!(!fe||fe[Go]===0)){if(l){be(fe,1,te);return}te=X(te);try{var Ge=fe,Y=te!==0;Fp(A,function(){return"HttpManager:_sendBatches"},function(se){se&&(fe=fe.slice(0));for(var me=[],Ce=null,He=iS(),$e=g[te]||(Y?g[1]:g[0]),et=$e&&$e[Qqe],ct=L&&(R||he(te)||et===3||$e._isSync&&et===2);ie(fe,te,Se);){var bt=fe.shift();bt&&bt[Vf]()>0&&(c.isTenantKilled(bt[oS]())?me[Vm](bt):(Ce=Ce||b[Fqe](Se,Fe,Y,ct,Te,te),b.appendPayload(Ce,bt,ne)?Ce.overflow!==null&&(fe=[Ce.overflow][wM](fe),Ce.overflow=null,rt(Ce,He,iS(),Te),He=iS(),Ce=null):(rt(Ce,He,iS(),Te),He=iS(),fe=[bt][wM](fe),Ce=null)))}Ce&&rt(Ce,He,iS(),Te),fe[Go]>0&&(v=fe[wM](v)),be(me,8004,te)},function(){return{batches:le(Ge),retryCount:Se,isTeardown:Fe,isSynchronous:Y,sendReason:Te,useSendBeacon:he(te),sendType:te}},!Y)}catch(se){xa(m,2,48,"Unexpected Exception sending batch: "+dr(se))}}}a(Ne,"_sendBatches");function we(fe,Se){var Fe={url:s,hdrs:{},useHdrs:!1};Se?(Fe[Bz]=Cae(Fe[Bz],_),Fe.useHdrs=ju(Fe.hdrs)[Go]>0):Yr(_,function(se,me){FOt[se]?Rae(Fe,FOt[se],me,!1):(Fe[Bz][se]=me,Fe[Dqe]=!0)}),Rae(Fe,COt,"NO_AUTH",Se),Rae(Fe,Sqe,R1e,Se);var te=ik;Ct(fe.apiKeys,function(se){te[Go]>0&&(te+=","),te+=se}),Rae(Fe,xqe,te,Se),Rae(Fe,Iqe,hl().toString(),Se);var Te=Ie(fe);if(mx(Te)&&(Fe.url+="&ext.intweb.msfpc="+Te),u[Rqe]()&&Rae(Fe,Tqe,u[Pqe](),Se),A[xae]){var Ge=A[xae]();Ge>=0&&(Fe.url+="&w="+Ge)}for(var Y=0;Y0){var Te=!!O,Ge=g[fe.sendType];!he(fe[mC])&&fe[MOt]&&fe.sendReason===2&&(Ge=g[2]||g[3]||Ge);var Y=x;(fe.isBeacon||Ge[Qqe]===3)&&(Y=!1);var se=we(fe,Y);Y=Y||se[Dqe];var me=iS();Fp(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Ce=0;Ce0?ct[BOt]++:ct[BOt]=1}be(fe[jy],1e3+(te||0),fe[mC],!0);var ht={data:fe[NOt],urlString:se.url,headers:se[Bz],_thePayload:fe,_sendReason:te,timeout:P,disableXhrSync:N,disableFetchKeepAlive:B};Y&&(zqe(ht[ok],D1e)||(ht[ok][D1e]=vOt),zqe(ht[ok],bae)||(ht[ok][bae]=bqe));var We=null;Ge&&(We=a(function(ce){u.firstRequestSent();var Re=a(function(Ae,oe){_t(Ae,oe,fe,te)},"onComplete"),Me=fe[qqe]||fe.isSync;W.preparePayload(function(Ae){try{Ge.sendPOST(Ae,Re,Me),q&&q(ht,Ae,Me,fe[MOt])}catch(oe){ee(Re,0,{}),TM(m,"Unexpected exception sending payload. Ex:"+dr(oe))}},D,ce,Me)},"sender")),Fp(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(We)if(fe[mC]===0&&f++,Te&&!fe.isBeacon&&Ge[Qqe]!==3){var ce={data:ht.data,urlString:ht.urlString,headers:Cae({},ht[ok]),timeout:ht.timeout,disableXhrSync:ht[wOt],disableFetchKeepAlive:ht[ROt]},Re=!1;Fp(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{O(ce,function(Me){Re=!0,!y&&!Me[Tae]&&(Me[Tae]=Me[Tae]||ht[Tae],Me[jqe]=Me[jqe]||ht[jqe]),We(Me)},fe.isSync||fe[qqe])}catch{Re||We(ht)}})}else We(ht)})},function(){return{thePayload:fe,serializationStart:Se,serializationCompleted:Fe,sendReason:te}},fe.isSync)}fe.sizeExceed&&fe.sizeExceed[Go]>0&&be(fe.sizeExceed,8003,fe[mC]),fe.failedEvts&&fe.failedEvts[Go]>0&&be(fe.failedEvts,8002,fe[mC])}a(rt,"_doPayloadSend");function st(fe,Se){T&&Ct(fe,function(Fe){var te=Fe[U1e]=Fe[U1e]||{};Le(te,"sendEventCompleted",Se)})}a(st,"_addEventCompletedTimings");function _t(fe,Se,Fe,te){var Te=9e3,Ge=null,Y=!1,se=!1;try{var me=!0;if(typeof fe!==W1){if(Se){u[O1e](Se[ren]);var Ce=Se[ten]||Se["kill-duration-seconds"];Ct(c[Hqe](Se[een],Ce),function($e){Ct(Fe[jy],function(et){if(et[oS]()===$e){Ge=Ge||[];var ct=et[PM](0);Fe.numEvents-=ct[Vf](),Ge[Vm](ct)}})})}if(fe==200||fe==204){Te=200;return}(!gen(fe)||Fe.numEvents<=0)&&(me=!1),Te=9e3+fe%1e3}if(me){Te=100;var He=Fe.retryCnt;Fe[mC]===0&&(He0&&st(Fe[RM](),Se)})}}a($t,"_addCompleteTimings");function Ht(fe,Se,Fe){Se?fe():z.set(fe,Fe)}a(Ht,"_doAction");function Ie(fe){for(var Se=0;Se0&&o){var Te=o[Qe(Se)];if(Te){var Ge=Fe!==0;Fp(A,function(){return"HttpManager:_sendBatchesNotification"},function(){Ht(function(){try{Te.call(o,fe,Se,Ge,Fe)}catch(Y){xa(m,1,74,"send request notification failed: "+Y)}},te||Ge,0)},function(){return{batches:le(fe),reason:Se,isSync:Ge,sendSync:te,sendType:Fe}},!Ge)}}}a(be,"_sendBatchesNotification");function Qe(fe){var Se=RCo[fe];return mx(Se)||(Se=XXr,fe>=9e3&&fe<=9999?Se=ZXr:fe>=8e3&&fe<=8999?Se=Cqe:fe>=1e3&&fe<=1999&&(Se=JXr)),Se}a(Qe,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var DCo=.25,Sen=500,NCo=20,Ten=6,Ien=2,MCo=4,Cen=2,OCo=1,UOt=1e4,qz="eventsDiscarded",ben="",Nh=void 0,BCo=m_({eventsLimitInMem:{isVal:Oz,v:UOt},immediateEventLimit:{isVal:Oz,v:500},autoFlushEventsLimit:{isVal:Oz,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:LCo,v:Nh},overrideInstrumentationKey:Nh,overrideEndpointUrl:Nh,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:Nh,clearTimeoutOverride:Nh,payloadPreprocessor:Nh,payloadListener:Nh,disableEventTimings:Nh,valueSanitizer:Nh,stringifyObjects:Nh,enableCompoundKey:Nh,disableOptimizeObj:!1,fetchCredentials:Nh,transports:Nh,unloadTransports:Nh,useSendBeacon:Nh,disableFetchKeepAlive:Nh,avoidOptions:!1,xhrTimeout:Nh,disableXhrSync:Nh,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:xh,v:Ten},maxUnloadEventRetryAttempts:{isVal:xh,v:Ien},addNoResponse:Nh,maxEvtPerBatch:{isVal:xh,v:Sen},excludeCsMetaData:Nh,requestLimit:{}});function LCo(t){return t&&t.sendPOST}a(LCo,"isOverrideFn");var QOt=(function(t){Fy(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=k1e,A,y,E,_,v,b,T,w,R,x,P,D,N,B,L,j,M,O,q,Q,U,z,$;return Si(e,r,function(W,J){he(),W._getDbgPlgTargets=function(){return[v,n]},W[Lz]=function(Y,se,me){Fp(se,function(){return"PostChannel:initialize"},function(){J[Lz](Y,se,me),q=se.getNotifyMgr();try{L=_7(px(W[Q1e]),se.evtNamespace&&se.evtNamespace()),W._addHook(rS(Y,function(Ce){var He=Ce.cfg,$e=hx(null,He,se);n=$e.getExtCfg(W[Q1e],BCo),j=wae(n[Nqe],n[Mqe]),P=!n.disableOptimizeObj&&yOt(),M=n[cen],H(se),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[OOt],N=n.maxEventRetryAttempts,B=n.maxUnloadEventRetryAttempts,O=n[len],$=n.maxEvtPerBatch,V0(He.endpointUrl)?W.pause():l&&W.resume(),Ge(),U=n[uen],z=!!n.disableTelemetry,Q&&ne();var et=He.disablePageUnloadEvents||[];Q=pqe(Be,et,L),Q=x1e(Be,et,L)||Q,Q=w1e(ve,He.disablePageShowEvents,L)||Q})),v[Lz](Y,W.core,W)}catch(Ce){throw W.setInitialized(!1),Ce}},function(){return{theConfig:Y,core:se,extensions:me}})},W.processTelemetry=function(Y,se){vqe(Y,W[Q1e]),se=se||W._getTelCtx(se);var me=Y;!z&&!o&&(U&&(me[oS]=U),Pe(me,!0),D?je(2,2):K()),W.processNext(me,se)},W.getOfflineSupport=function(){try{var Y=v&&v[Lqe]();if(v)return{getUrl:a(function(){return Y?Y.url:null},"getUrl"),serialize:ae,batch:re,shouldProcess:a(function(se){return!z},"shouldProcess"),createPayload:a(function(se){return null},"createPayload"),createOneDSPayload:a(function(se){if(v[B1e])return v[B1e](se,P)},"createOneDSPayload")}}catch{}return null},W._doTeardown=function(Y,se){je(2,2),o=!0,v.teardown(),ne(),he()};function ne(){hqe(null,L),mqe(null,L),gqe(null,L)}a(ne,"_removeUnloadHandlers");function H(Y){var se=Y[xae];Y[xae]=function(){var me=0;return M&&(me=me|2),me|se.call(Y)}}a(H,"_hookWParam");function re(Y){var se=ben;return Y&&Y[Go]&&Ct(Y,function(me){se&&(se+=` -`),se+=me}),se}a(re,"_batch");function ae(Y){var se=ben;try{Ue(Y),se=v[Bqe](Y)}catch{}return se}a(ae,"_serialize");function Be(Y){var se=Y||cf().event;se.type!=="beforeunload"&&(D=!0,v[F1e](D)),je(2,2)}a(Be,"_handleUnloadEvents");function ve(Y){D=!1,v[F1e](D)}a(ve,"_handleShowEvents");function Ue(Y){Y.ext&&Y.ext[TOt]&&delete Y.ext[TOt],Y.ext&&Y.ext[wqe]&&Y.ext[wqe].id&&delete Y.ext[wqe].id,P&&(Y.ext=CM(Y.ext),Y.baseData&&(Y.baseData=CM(Y.baseData)),Y.data&&(Y.data=CM(Y.data)))}a(Ue,"_cleanEvent");function Pe(Y,se){if(Y[q1e]||(Y[q1e]=0),Y[v7]||(Y[v7]=1),Ue(Y),Y[Fz]){if(E||l)Y[v7]=3,Y[Fz]=!1;else if(v){P&&(Y=CM(Y)),v[Uqe](C7.create(Y[oS],[Y]),Y[Fz]===!0?1:Y[Fz],3);return}}var me=Y[v7],Ce=f,He=h;me===4&&(Ce=u,He=d);var $e=!1;if(CeY;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[Vf]()>=w&&(me=!0)})}Ne(!0,me)},W.pause=function(){ue(),l=!0,v&&v.pause()},W.resume=function(){l=!1,v&&v.resume(),K()},W._loadTransmitProfiles=function(Y){$t(),Yr(Y,function(se,me){var Ce=me[Go];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]=pKr($e)*me[1]}He>=0&&me[1]>=0&&He>me[1]&&(He=me[1]),me[Vm](He),m[se]=me}})},W.flush=function(Y,se,me){Y===void 0&&(Y=!0);var Ce;if(!l)if(me=me||1,Y)se||(Ce=Pd(function($e){se=$e})),c==null?(ue(),st(1,0,me),c=X(function(){c=null,_t(se,me)},0)):s[Vm](se);else{var He=ue();Z(1,1,me),se&&se(),He&&K()}return Ce},W.setMsaAuthTicket=function(Y){v.addHeader(N1e,Y)},W.setAuthPluginHeader=function(Y){v.addHeader(bOt,Y)},W.removeAuthPluginHeader=function(){v.removeHeader(bOt)},W.hasEvents=ee,W._setTransmitProfile=function(Y){g!==Y&&m[Y]!==void 0&&(ue(),g=Y,K())},p7(W,function(){return v},["addResponseHandler"]);function Z(Y,se,me){var Ce=st(Y,se,me);return v[Iae](se,me),Ce}a(Z,"_sendEventsForLatencyAndAbove");function ee(){return f>0}a(ee,"_hasEvents");function K(){if(R>=0&&st(R,0,x)&&v[Iae](0,x),u>0&&!y&&!l){var Y=m[g][2];Y>=0&&(y=X(function(){y=null,Z(4,0,1),K()},Y))}var se=m[g][1];!A&&!c&&se>=0&&!l&&(ee()?A=X(function(){A=null,Z(_===0?3:1,0,1),_++,_%=2,K()},se):_=0)}a(K,"_scheduleTimer"),W[Gqe]=function(){E0&&f>T&&(se=!0),se&&c==null&&W.flush(Y,function(){},20))}a(Ne,"_performAutoFlush");function we(Y,se){P&&(Y=CM(Y));var me=Y[v7],Ce=le(Y[oS],me,!0);return Ce.addEvent(Y)?(me!==4?(f++,se&&Y[q1e]===0&&Ne(!Y.sync,w>0&&Ce[Vf]()>=w)):u++,!0):!1}a(we,"_addEventToProperQueue");function Le(Y,se,me,Ce){for(;me<=se;){var He=le(Y,se,!0);if(He&&He[Vf]()>0){var $e=He[PM](0,Ce),et=$e[Vf]();if(et>0)return me===4?u-=et:f-=et,Qe(qz,[$e],mM.QueueFull),!0}me++}return rt(),!1}a(Le,"_dropEventWithLatencyOrLess");function rt(){for(var Y=0,se=0,me=a(function(He){var $e=b[He];$e&&$e[jy]&&Ct($e[jy],function(et){He===4?Y+=et[Vf]():se+=et[Vf]()})},"_loop_1"),Ce=1;Ce<=4;Ce++)me(Ce);f=se,u=Y}a(rt,"_resetQueueCounts");function st(Y,se,me){var Ce=!1,He=se===0;return!He||v[L1e]()?Fp(W.core,function(){return"PostChannel._queueBatches"},function(){for(var $e=[],et=4;et>=Y;){var ct=b[et];ct&&ct.batches&&ct.batches[Go]>0&&(Ct(ct[jy],function(bt){v.addBatch(bt)?Ce=Ce||bt&&bt[Vf]()>0:$e=$e[wM](bt[RM]()),et===4?u-=bt[Vf]():f-=bt[Vf]()}),ct[jy]=[],ct.iKeyMap={}),et--}$e[Go]>0&&be(qz,$e,mM.KillSwitch),Ce&&R>=Y&&(R=-1,x=0)},function(){return{latency:Y,sendType:se,sendReason:me}},!He):(R=R>=0?IU(R,Y):Y,x=HP(x,me)),Ce}a(st,"_queueBatches");function _t(Y,se){Z(1,0,se),rt(),kt(function(){Y&&Y(),s[Go]>0?c=X(function(){c=null,_t(s.shift(),se)},0):(c=null,K())})}a(_t,"_flushImpl");function kt(Y){v.isCompletelyIdle()?Y():c=X(function(){c=null,kt(Y)},DCo)}a(kt,"_waitForIdleManager");function $t(){ue(),Ht(),g=k1e,K()}a($t,"_resetTransmitProfiles");function Ht(){m={},m[k1e]=[2,1,0],m[YXr]=[6,3,0],m[KXr]=[18,9,0]}a(Ht,"_initializeProfiles");function Ie(Y,se){var me=[],Ce=N;D&&(Ce=B),Ct(Y,function(He){He&&He[Vf]()>0&&Ct(He[RM](),function($e){$e&&($e[Fz]&&($e[v7]=4,$e[Fz]=!1),$e[q1e]0&&be(qz,me,mM.NonRetryableStatus),D&&je(2,2)}a(Ie,"_requeueEvents");function F(Y,se){var me=q||{},Ce=me[Y];if(Ce)try{Ce.apply(me,se)}catch(He){xa(W.diagLog(),1,74,Y+" notification failed: "+He)}}a(F,"_callNotification");function be(Y,se){for(var me=[],Ce=2;Ce0&&F(Y,[se][wM](me))}a(be,"_notifyEvents");function Qe(Y,se){for(var me=[],Ce=2;Ce0&&Ct(se,function(He){He&&He[Vf]()>0&&F(Y,[He.events()][wM](me))})}a(Qe,"_notifyBatchEvents");function fe(Y,se,me){Y&&Y[Go]>0&&F("eventsSendRequest",[se>=1e3&&se<=1999?se-1e3:0,me!==!0])}a(fe,"_sendingEvent");function Se(Y,se){Qe("eventsSent",Y,se),K()}a(Se,"_eventsSentEvent");function Fe(Y,se){Qe(qz,Y,se>=8e3&&se<=8999?se-8e3:mM.Unknown)}a(Fe,"_eventsDropped");function te(Y){Qe(qz,Y,mM.NonRetryableStatus),K()}a(te,"_eventsResponseFail");function Te(Y,se){Qe(qz,Y,mM.Unknown),K()}a(Te,"_otherEvent");function Ge(){O?w=0:w=HP($*(Cen+1),h/6)}a(Ge,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(Eae);var sS=de(require("os"));var Yqe=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=FCo(e),this.commonProperties=UCo(e),this.#e=Es(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new EOt,n=new QOt,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 FCo(t){let e={},r=t.get(La);e["ai.session.id"]=r.sessionId;let n=t.get(Pp);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${sS.type()} ${sS.release()}`,e["ai.device.osArchitecture"]=sS.arch(),e["ai.device.osPlatform"]=sS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(as).getVersion(),e}a(FCo,"getTags");function UCo(t){let e={};e.common_os=sS.platform(),e.common_platformversion=sS.release(),e.common_arch=sS.arch(),e.common_cpu=Array.from(new Set(sS.cpus().map(n=>n.model))).join();let r=t.get(La);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(UCo,"getCommonProperties");var QCo="7d7048df-6dd0-4048-bb23-b716c1461f8f",qCo="3fdd7f28-937a-48c8-9a21-ba337db23bd1",jCo="b73649cf-ca8f-4768-9e0e-b789d8529db5",HCo="5fb6107a-6a29-423f-a824-22e3724fa2a6",GCo="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function $Co(t){return _U(t)==="prod"?jCo:HCo}a($Co,"getMsftInstrumentationKey");function xen(t){return new URL(t).hostname==="github.com"?OW.telemetry:t.replace("://","://copilot-telemetry-service.")}a(xen,"getEndpointForServerUrl");var lf=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=xen(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];Es(e,n=>{this.cachedToken=n,this.updateServiceEndpoints(n.endpoints)})}static{a(this,"TelemetryInitialization")}get endpointUrl(){return this.overrideEndpointUrlForTesting||new URL("telemetry",this.rootUrl).href}get isInitialized(){return this.initializedWith!==void 0}get isEnabled(){return this._enabled??!1}initialize(e){let r=this.ctx;this._enabled=e;let n=this.endpointUrl;if(!(this.initializedWith?.enabled===this._enabled&&this.initializedWith?.endpointUrl===this.endpointUrl)&&(this.shutdownWithoutWaiting(),this.initializedWith={endpointUrl:n,enabled:this._enabled},e)){let o=r.get(G0);if(o.setReporter(new zse(r,this.namespace,{instrumentationKey:QCo,endpointUrl:n})),o.setRestrictedReporter(new zse(r,this.namespace,{instrumentationKey:qCo,endpointUrl:n})),o.setMsftReporter(new zse(r,`copilot/${this.namespace}`,{instrumentationKey:$Co(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new Yqe(r,"ThirdParty.copilot-chat",GCo,!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(G0);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(G0).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=xen(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function VCo(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await qf(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(lf).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return p_.exception(t,n,"signUpLimited failed"),!1}}a(VCo,"apiFetchSignUpLimited");async function jOt(t,e,r){let n=await t.get(Ut).getTokenResult();switch(n.failureKind){case void 0:return"OK";case"HTTP401":case"NotSignedIn":return"NotSignedIn";case"NotAuthorized":return r&&n.canSignUpForLimited&&await VCo(t,e)?jOt(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(jOt,"getTokenWithSignUpLimited");p();p();var wen=de(ri());var Hi=class extends wen.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var WCo={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},Pn=class{constructor(){this.capabilities={...WCo};this.emitter=new Hi;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 VL=require("fs"),Pae=require("os"),kae=de(require("path")),b7=require("process");var zn=class{static{a(this,"PersistenceManager")}},HOt=class extends zn{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 VL.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=kae.dirname(s);c!==this.directory&&await VL.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await j1e.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await VL.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 j1e.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=_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)+` `;l===`{} -`?await VL.promises.rm(o):await VL.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 j1e.acquire(n),await VL.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await VL.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 VL.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},j1e=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 zCo(){if(b7.env.XDG_CONFIG_HOME&&kae.isAbsolute(b7.env.XDG_CONFIG_HOME))return b7.env.XDG_CONFIG_HOME+"/github-copilot";if((0,Pae.platform)()==="win32"){let e=b7.env.USERPROFILE||GOt.homedir();return e?e+"\\AppData\\Local\\github-copilot":Ren()}let t=b7.env.HOME&&b7.env.HOME.length>0?b7.env.HOME:GOt.homedir();return t?t+"/.config/github-copilot":Ren()}a(zCo,"getXdgConfigPath");var GOt={homedir:Pae.homedir,tmpdir:Pae.tmpdir};function Ren(){return kae.join(GOt.tmpdir(),"github-copilot")}a(Ren,"tmpdirConfigPath");function Pen(){return new HOt(zCo())}a(Pen,"makeXdgPersistenceManager");p();var cs=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}}},Kqe=class extends cs{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var ken={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function Den(t,e){yt(t,ken.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(Den,"telemetryAuthPickerListed");function $Ot(t,e){yt(t,ken.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a($Ot,"telemetryAuthPickerUsed");p();var S7={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 Nen(t,e){Zn(t,S7.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs})}a(Nen,"telemetryAuthStoreInitialize");function Men(t,e){Zn(t,S7.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(Men,"telemetryAuthStoreError");function Oen(t,e){Zn(t,S7.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a(Oen,"telemetryAuthStoreMigration");function VOt(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)),yt(t,S7.SessionActivated,r,{durationMs:e.durationMs})}a(VOt,"telemetryAuthSessionActivated");function Ben(t,e){yt(t,S7.SessionDeactivated,{editorId:e.editorId})}a(Ben,"telemetryAuthSessionDeactivated");function Dae(t,e){yt(t,S7.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(Dae,"telemetryAuthTokenRevoked");function Jqe(t,e){Zn(t,S7.EncryptionInitialize,e.diagnostics.error,{writerKind:e.writerKind,available:String(e.diagnostics.available),errorPhase:e.diagnostics.errorPhase??"",masterKeySource:e.diagnostics.masterKeySource??""})}a(Jqe,"telemetryAuthEncryptionInitialize");function WOt(t,e){Zn(t,S7.EncryptionDecryptV1ToV0,e.error,{},e.result?{attempted:e.result.attempted,decrypted:e.result.decrypted,purged:e.result.purged,skipped:e.result.skipped}:void 0)}a(WOt,"telemetryAuthEncryptionDecryptV1ToV0");var YCo="apps",Len="hosts",Wm=new pe("AuthManager"),Fen="legacy_files_migration_done",KCo=5,JCo=6e4,Ur=class{constructor(e,r){this.ctx=e;this.env=r;this.copilotTokenManagerEventSubscribed=!1;this.pendingCascadeRevoke=Promise.resolve()}static{a(this,"AuthManager")}hasTransientSession(){return this.transientSession!==void 0}get _copilotTokenManager(){let e=this.ctx.get(Ut);return this.ensureCopilotTokenSubscription(e),e}getConfiguredUrls(){return this.ctx.get(Fm).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"),Wm.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(cs).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 jOt(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}ensureCopilotTokenSubscription(e){this.copilotTokenManagerEventSubscribed||(this.copilotTokenManagerEventSubscribed=!0,e.onDidInvalidateActiveTokenById(r=>{this.pendingCascadeRevoke=this.revokeTokenById(r,"bad_credentials").catch(n=>{Wm.exception(this.ctx,n,`cascadeRevoke tokenId=${r}`)})}))}async awaitPendingCascadeRevoke(){await this.pendingCascadeRevoke}async resolveSessionWithSource(e){await this.ctx.get(Mo).requireReady();let{session:r,sourceEnvVar:n}=YOt(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),{session:{...r,...By(r)},sourceEnvVar:n};let o=await this.transientSession;return o?o.accessToken===void 0?{session:void 0}:{session:{...o,...By(o)}}:{session:await this.resolvePersistedSession({authAuthority:e})}}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},Zqe=class extends Ur{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(ZI)}async tracked(r,n){try{return await n()}catch(o){throw Wm.exception(this.ctx,o,`authStore.${r}`),Men(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=TU(this.ctx,r.authAuthority)}catch(o){Wm.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:XCo(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(Fen))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(zn),h=this.editorId(),[m,g]=await Promise.all([f.readAll(YCo).catch(()=>({})),f.readAll(Len).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let E=Uen(y);if(!E){c++;continue}let[_,v]=ZCo(A)??["github.com",Nae],b=E.oauth_token||E.access_token,T=E.user||E.login;if(!b||!T){c++;continue}let w=E.authAuthority||_;if(!cDt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:b,authAuthority:w,oauthClientId:E.githubAppId??v,scopes:zOt(E.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let E=Uen(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(!cDt(b)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:_,authAuthority:b,oauthClientId:E.githubAppId??Nae,scopes:zOt(E.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(Fen,String(Date.now())))}catch{}this.ctx.get(zn).deleteSetting(Len).catch(()=>{}),Oen(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),Wm.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(KCo);if(Wm.debug(this.ctx,`tryAutoAdopt: editorId=${n} candidates=${s.length}`),s.length===0)return;let c=this.ctx.get(Sh);for(let l of s){let u=this.tokenRecordToSession(l.record);if(!u){Wm.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{Wm.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${l.tokenId}; aborting walk`);return}if(d.copilotToken||d.failureKind==="NotAuthorized"){Wm.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){Wm.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${l.tokenId} (${f?.message??f}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(l.tokenId),VOt(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:l.sourceEditorId!==n,durationMs:Date.now()-o}),u}if(d.failureKind==="HTTP401"){Wm.info(this.ctx,`tryAutoAdopt: revoking invalid tokenId=${l.tokenId}; continuing walk`);let f=await this.tracked("revoke",()=>r.deleteTokenCascade(l.tokenId));Dae(this.ctx,{editorId:n,trigger:"bad_credentials",affectedEditors:f.affectedEditors});continue}Wm.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${l.tokenId} kind=${d.failureKind}; aborting walk`);return}Wm.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new Ai("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new Ai("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();Wm.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:zOt(r.scopes)}));Wm.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),VOt(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=TU(this.ctx,r.authAuthority);return this.setTransientSession({login:r.user,accessToken:r.accessToken,githubAppId:r.githubAppId,serverUrl:c.serverUrl,apiUrl:c.apiUrl}),this._copilotTokenManager.setActiveTokenId(s.tokenId),await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:r.authAuthority})}async signOutEditor(){let r=this.editorId();return Wm.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),Ben(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){Wm.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return Wm.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),Dae(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 $Ot(this.ctx,{editorId:o,status:"revoked",clearedTombstone:!1,crossEditorReuse:!1,validationMs:0}),{status:"revoked"};let c=s.sourceEditorId!==o,l=await n.hasOptOutTombstone(o);this.setTransientSession(void 0),await n.assignActiveSession(o,r),this._copilotTokenManager.setActiveTokenId(r);let u=performance.now(),d;try{d=(await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:s.record.authAuthority})).status}catch{d="NotSignedIn"}let f;switch(d){case"OK":f="ok";break;case"NotAuthorized":f="not_entitled";break;default:this._copilotTokenManager.getActiveTokenId()===void 0?(await this.awaitPendingCascadeRevoke(),f="revoked"):f="transient";break}return $Ot(this.ctx,{editorId:o,status:f,clearedTombstone:l,crossEditorReuse:c,validationMs:performance.now()-u}),{status:f}}async listAvailableTokens(){await this.ensureSqliteMigration();let r=this.authRepository,n=this.editorId(),o=await r.listAvailableTokens(),s=await r.getActiveSession(n),c=o.map(d=>({tokenId:d.tokenId,authAuthority:d.authAuthority,userLogin:d.userLogin,isCurrent:s?.tokenId===d.tokenId,lastUsedAt:d.lastUsedAt})),l=c.some(d=>d.isCurrent),u=await r.hasOptOutTombstone(n);return Den(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(Pn).getCapabilities().accountPickerEnabled,c=await n.hasOptOutTombstone(o),l=await n.getActiveSession(o);if(!l&&!s&&!c&&(await this.tryAutoAdoptCoalesced(),l=await n.getActiveSession(o)),!l){Wm.debug(this.ctx,`resolvePersistedSession: no active session editorId=${o}`);return}let u=TU(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==u.authAuthority||r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId)return;let d=this.tokenRecordToSession(l.record);if(!d){await this.revokeTokenById(l.tokenId,"corrupt_authority");return}this._copilotTokenManager.setActiveTokenId(l.tokenId);let f=Date.now();return f-this.lastTouchAt>=JCo&&(this.lastTouchAt=f,n.touchActiveSession(o).catch(()=>{})),d}};function ZCo(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(ZCo,"splitAppsKey");function XCo(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(XCo,"normalizeScopes");function zOt(t){return t?typeof t=="string"?t:t.join(" "):""}a(zOt,"scopesToString");function Uen(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(Uen,"asLegacyAuthRecord");function YOt(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...By({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:{...By({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:{...By({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(YOt,"getSessionFromEnv");p();var ebo=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],Qen="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.",qen="https://gh.io/copilot-network-errors",gC=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&ebo.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new pe("certificates").error(e,`${Qen} Please visit ${qen} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(_s).showWarningMessage(Qen,n).then(o=>{if(o?.title===n.title)return e.get(Um).open(qen)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};p();var dA=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 AC(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(AC,"delay");async function gx(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(gx,"mapWithConcurrency");function Mae(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(Mae,"fireAndForget");function jen(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(jen,"createLimiter");function WL(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(WL,"withTimeout");function Oae(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(Oae,"safeInit");var KOt=class extends Ai{constructor(r){super("message"in r?r.message:`${r.failureKind}`);this.result=r}static{a(this,"TokenResultError")}},Ut=class{constructor(e,r=!1){this.ctx=e;this.primed=r;this.lastToken=void 0;this.activeToken=void 0;this.activeTokenId=void 0;this.tokenPromise=void 0;this.tokenPrimingError=void 0;this.refreshTimer=void 0;this.didChangeTokenResult=new Hi;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new Hi;this.onDidResetToken=this.didResetToken.event;this.didInvalidateActiveTokenById=new Hi;this.onDidInvalidateActiveTokenById=this.didInvalidateActiveTokenById.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(Sh).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e,this.scheduleProactiveRefresh(e)}scheduleProactiveRefresh(e){if(this.clearRefreshTimer(),$en(this.ctx).value)return;let r=e.envelope.refresh_in*1e3;r>0&&r<=2147483647&&(this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,!this.tokenPromise&&(Hen(this.ctx,"started",r),this.startTokenRefresh(n=>{Hen(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 p_.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(cs).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(Gen(this.ctx))throw this.tokenPrimingError=r,r;p_.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(cs);switch(e.failureKind){case"NotSignedIn":o.setError("auth",{message:"You are not signed into GitHub.",askToReSignin:!1,result:{status:"NotSignedIn",user:r}});break;case"HTTP401":o.setError("auth",{message:"Your GitHub Copilot session has expired. You have been signed out. Please sign in again to continue using GitHub Copilot.",askToReSignin:!0,result:{status:"NotSignedIn",user:r}},{command:"github.copilot.signIn",title:"Sign In"}),this.invalidateActiveToken();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(gC).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?Zn(this.ctx,"auth.token_reset_complete",e.exception,s,l):yt(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 KOt(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}invalidateActiveToken(){let e=this.activeTokenId;e!==void 0&&(this.activeTokenId=void 0,this.didInvalidateActiveTokenById.fire(e))}resetToken(e,r,n){if(n!==void 0&&this.activeTokenId!==void 0&&n!==this.activeTokenId){p_.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),p_.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):p_.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;yt(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 JI(t){return t.get(Ut).getLastToken()}a(JI,"getLastCopilotToken");function Hen(t,e,r,n,o){let s={status:e,errorCode:n??""},c={delayMs:r};o?Zn(t,"auth.proactive_copilot_token_refresh",o,s,c):yt(t,"auth.proactive_copilot_token_refresh",s,c)}a(Hen,"telemetryProactiveCopilotTokenRefresh");p();var Ax=class{static{a(this,"Clock")}now(){return new Date}};p();var sk=class{static{a(this,"ExpConfigMaker")}},H1e=class extends sk{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 Jv.createFallbackConfig(r,`Error fetching ExP config: ${String(m)}`)}if(!u.ok)return Jv.createFallbackConfig(r,`ExP responded with ${u.status}`);let d;try{d=await u.json()}catch(m){if(m instanceof SyntaxError)return Ua(r,m,"fetchExperiments"),Jv.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 Jv(f.Parameters,d.AssignmentContext,h.join(";"))}},Xqe=class extends sk{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(Jv.createEmptyConfig())}};p();p();var eje=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},JOt=class extends eje{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},Ven=a(t=>new JOt(t),"DEFAULT_GRANULARITY"),tje=class extends eje{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 Wen="X-Copilot-ClientTimeBucket",rje=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=Ven(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 tje(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(Wen,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(Wen,s))}}};p();p();p();p();var ZOt=new Map;async function rbo(t){if(ZOt.has(t))return ZOt.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return ZOt.set(t,e),e}a(rbo,"getCachedHmacKey");async function nbo(t){if(t)try{let e=await rbo(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(nbo,"createRequestHMAC");async function zen(t,e){let r=await nbo(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(zen,"createMsBenchHmacHeaders");p();p();p();p();var ije="4.13.1",jz="04b07795-8ddb-461a-bbee-02f9e1bf7b46",Yen="common",nje;(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"})(nje||(nje={}));var G1e=nje.AzurePublicCloud,Ken="login.microsoftonline.com",Jen=["*"],Zen="cae",Xen="nocae",etn="msal.cache";var XOt;var ibo,oje,rtn;function ntn(){return oje!==void 0&&rtn!==void 0}a(ntn,"hasVSCodePlugin");function obo(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(XOt===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||etn;e.cache.cachePlugin=XOt({name:`${r}.${Xen}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=XOt({name:`${r}.${Zen}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=abo(t.isVSCodeCredential||!1)),e}a(obo,"generatePluginConfiguration");var ttn={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")},sbo={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return rtn}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return ibo}}};function abo(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=sbo[t?"vsCode":"native"];if(o===void 0)throw new Error(ttn.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error(ttn.unavailable(e,r));return o.broker}a(abo,"getBrokerPlugin");var itn={generatePluginConfiguration:obo};p();p();p();function cbo(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(cbo,"isErrorResponse");var stn="CredentialUnavailableError",Mn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=stn}},sje="AuthenticationError",T7=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(cbo(r))o=otn(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=otn(s)}catch{e===400?o={error:"invalid_request",errorDescription:`The service indicated that the request was invalid. +`?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. ${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=sje}},atn="AggregateAuthenticationError",$1e=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=bje}},Vtn="AggregateAuthenticationError",lSe=class extends Error{static{a(this,"AggregateAuthenticationError")}errors;constructor(e,r){let n=e.join(` `);super(`${r} -${n}`),this.errors=e,this.name=atn}};function otn(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(otn,"convertOAuthErrorResponseToErrorResponse");var yx=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 ctn=require("node:os"),ltn=de(require("node:util"),1),utn=de(require("node:process"),1);function dtn(t,...e){utn.stderr.write(`${ltn.default.format(t,...e)}${ctn.EOL}`)}a(dtn,"log");var ftn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,ptn,e5t=[],t5t=[],aje=[];ftn&&r5t(ftn);var htn=Object.assign(t=>mtn(t),{enable:r5t,enabled:n5t,disable:lbo,log:dtn});function r5t(t){ptn=t,e5t=[],t5t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?t5t.push(new RegExp(`^${n.substr(1)}$`)):e5t.push(new RegExp(`^${n}$`));for(let n of aje)n.enabled=n5t(n.namespace)}a(r5t,"enable");function n5t(t){if(t.endsWith("*"))return!0;for(let e of t5t)if(e.test(t))return!1;for(let e of e5t)if(e.test(t))return!0;return!1}a(n5t,"enabled");function lbo(){let t=ptn||"";return r5t(""),t}a(lbo,"disable");function mtn(t){let e=Object.assign(r,{enabled:n5t(t),destroy:ubo,log:htn.log,namespace:t,extend:dbo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),aje.push(e),e}a(mtn,"createDebugger");function ubo(){let t=aje.indexOf(this);return t>=0?(aje.splice(t,1),!0):!1}a(ubo,"destroy");function dbo(t){let e=mtn(`${this.namespace}:${t}`);return e.log=this.log,e}a(dbo,"extend");var Bae=htn;var Atn=new Set,cje=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,uje,i5t=Bae("azure");i5t.log=(...t)=>{Bae.log(...t)};var o5t=["verbose","info","warning","error"];cje&&(_tn(cje)?fbo(cje):console.error(`AZURE_LOG_LEVEL set to unknown log level '${cje}'; logging is not enabled. Acceptable values: ${o5t.join(", ")}.`));function fbo(t){if(t&&!_tn(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${o5t.join(",")}`);uje=t;let e=[];for(let r of Atn)Etn(r)&&e.push(r.namespace);Bae.enable(e.join(","))}a(fbo,"setLogLevel");function dje(){return uje}a(dje,"getLogLevel");var gtn={verbose:400,info:300,warning:200,error:100};function I7(t){let e=i5t.extend(t);return ytn(i5t,e),{error:lje(e,"error"),warning:lje(e,"warning"),info:lje(e,"info"),verbose:lje(e,"verbose")}}a(I7,"createClientLogger");function ytn(t,e){e.log=(...r)=>{t.log(...r)}}a(ytn,"patchLogMethod");function lje(t,e){let r=Object.assign(t.extend(e),{level:e});if(ytn(t,r),Etn(r)){let n=Bae.disable();Bae.enable(n+","+r.namespace)}return Atn.add(r),r}a(lje,"createLogger");function Etn(t){return!!(uje&>n[t.level]<=gtn[uje])}a(Etn,"shouldEnable");function _tn(t){return o5t.includes(t)}a(_tn,"isAzureLogLevel");var aS=I7("identity");function fje(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(fje,"processEnvVars");function zm(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(zm,"formatSuccess");function Bs(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(Bs,"formatError");function vtn(t,e,r=aS){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(vtn,"credentialLoggerInstance");function uo(t,e=aS){let r=vtn(t,void 0,e);return{...r,parent:e,getToken:vtn("=> getToken()",r,e)}}a(uo,"credentialLogger");p();p();p();p();var Lae={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function Ctn(t={}){let e=new s5t(t.parentContext);return t.span&&(e=e.setValue(Lae.span,t.span)),t.namespace&&(e=e.setValue(Lae.namespace,t.namespace)),e}a(Ctn,"createTracingContext");var s5t=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 btn=de(a5t(),1),hje=btn.state;function pbo(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(pbo,"createDefaultTracingSpan");function hbo(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:pbo(),tracingContext:Ctn({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(hbo,"createDefaultInstrumenter");function V1e(){return hje.instrumenterImplementation||(hje.instrumenterImplementation=hbo()),hje.instrumenterImplementation}a(V1e,"getInstrumenter");p();function W1e(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=V1e().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(Lae.namespace)||(A=A.setValue(Lae.namespace,e)),y.setAttribute("az.namespace",A.getValue(Lae.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 V1e().withContext(d,f,...h)}a(c,"withContext");function l(d){return V1e().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return V1e().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(W1e,"createTracingClient");var Dc=W1e({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:ije});var c5t=uo("ChainedTokenCredential"),z1e=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 Dc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new $1e(s,"ChainedTokenCredential authentication failed.");throw c5t.getToken.info(Bs(e,l)),l}if(c5t.getToken.info(`Result for ${o.constructor.name}: ${zm(e)}`),n===null)throw new Mn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var pS={};Ri(pS,{AuthError:()=>Bo,AuthErrorCodes:()=>ice,AzureCloudInstance:()=>JL,ClientAssertion:()=>t3,ClientAuthError:()=>P7,ClientAuthErrorCodes:()=>Qp,ClientConfigurationError:()=>$ae,ClientConfigurationErrorCodes:()=>Wae,ConfidentialClientApplication:()=>vce,CryptoProvider:()=>OM,DistributedCachePlugin:()=>ZHe,InteractionRequiredAuthError:()=>uS,InteractionRequiredAuthErrorCodes:()=>Yje,LogLevel:()=>df,Logger:()=>Km,ManagedIdentityApplication:()=>Cce,ManagedIdentitySourceNames:()=>io,PromptValue:()=>ako,ProtocolMode:()=>Gy,PublicClientApplication:()=>Ece,ResponseMode:()=>cko,ServerError:()=>__,TokenCache:()=>ace,TokenCacheContext:()=>cS,internals:()=>OBt,version:()=>fS});p();var OBt={};Ri(OBt,{Deserializer:()=>e3,Serializer:()=>x7});p();p();var x7=class{static{a(this,"Serializer")}static serializeJSONBlob(e){return JSON.stringify(e)}static serializeAccounts(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,realm:o.realm,local_account_id:o.localAccountId,username:o.username,authority_type:o.authorityType,name:o.name,client_info:o.clientInfo,last_modification_time:o.lastModificationTime,last_modification_app:o.lastModificationApp,tenantProfiles:o.tenantProfiles?.map(s=>JSON.stringify(s))}}),r}static serializeIdTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm}}),r}static serializeAccessTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm,target:o.target,cached_at:o.cachedAt,expires_on:o.expiresOn,extended_expires_on:o.extendedExpiresOn,refresh_on:o.refreshOn,key_id:o.keyId,token_type:o.tokenType,userAssertionHash:o.userAssertionHash,resource:o.resource}}),r}static serializeRefreshTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,family_id:o.familyId,target:o.target,realm:o.realm}}),r}static serializeAppMetadata(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={client_id:o.clientId,environment:o.environment,family_id:o.familyId}}),r}static serializeAllCache(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}}};p();p();p();var sn={};Ri(sn,{addApplicationTelemetry:()=>cSe,addAuthorizationCode:()=>lBt,addBrokerParameters:()=>KL,addCcsOid:()=>zL,addCcsUpn:()=>k7,addClaims:()=>Xz,addCliData:()=>fBt,addClientAssertion:()=>dSe,addClientAssertionType:()=>fSe,addClientCapabilitiesToClaims:()=>wtn,addClientId:()=>Jz,addClientInfo:()=>tY,addClientSecret:()=>uSe,addCodeChallengeParams:()=>_1o,addCodeVerifier:()=>dBt,addCorrelationId:()=>eY,addDeviceCode:()=>v1o,addDomainHint:()=>sBt,addEARParameters:()=>I1o,addExtraParameters:()=>YL,addGrantType:()=>pSe,addIdTokenHint:()=>oBt,addInstanceAware:()=>hSe,addLibraryInfo:()=>aSe,addLoginHint:()=>Yae,addLogoutHint:()=>pBt,addNativeBroker:()=>E1o,addNonce:()=>cBt,addOboAssertion:()=>C1o,addPassword:()=>T1o,addPopToken:()=>mSe,addPostLogoutRedirectUri:()=>iBt,addPrompt:()=>aBt,addRedirectUri:()=>Zz,addRefreshToken:()=>uBt,addRequestTokenUse:()=>b1o,addResource:()=>ESe,addResponseMode:()=>nBt,addResponseType:()=>y1o,addScopes:()=>Kz,addServerTelemetry:()=>ASe,addSid:()=>Fje,addSshJwk:()=>gSe,addState:()=>lSe,addThrottling:()=>ySe,addUsername:()=>S1o,instrumentBrokerParams:()=>Yz});p();var er={};Ri(er,{AADAuthority:()=>ak,AAD_INSTANCE_DISCOVERY_ENDPT:()=>p5t,AAD_TENANT_DOMAIN_SUFFIX:()=>h5t,ADFS:()=>d5t,APP_METADATA:()=>jae,AUTHORITY_METADATA_CACHE_KEY:()=>Hae,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>P5t,AUTHORIZATION_PENDING:()=>ybo,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>y5t,AuthenticationScheme:()=>uf,AuthorityMetadataSource:()=>Hy,CACHE_ACCOUNT_TYPE_ADFS:()=>w5t,CACHE_ACCOUNT_TYPE_GENERIC:()=>Cje,CACHE_ACCOUNT_TYPE_MSAV1:()=>Lbo,CACHE_ACCOUNT_TYPE_MSSTS:()=>x5t,CACHE_KEY_SEPARATOR:()=>Gz,CIAM_AUTH_URL:()=>mje,CLIENT_INFO:()=>R5t,CLIENT_INFO_SEPARATOR:()=>qae,CLIENT_MISMATCH_ERROR:()=>Q5t,CODE_GRANT_TYPE:()=>gbo,CONSUMER_UTID:()=>mbo,CacheOutcome:()=>ck,CacheType:()=>Fbo,ClaimsRequestKeys:()=>Qae,CodeChallengeMethodValues:()=>Obo,CredentialType:()=>Ym,DEFAULT_AUTHORITY:()=>Stn,DEFAULT_AUTHORITY_HOST:()=>u5t,DEFAULT_COMMON_TENANT:()=>Y1e,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>L5t,DEFAULT_THROTTLE_TIME_SECONDS:()=>B5t,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>q5t,DSTS:()=>f5t,EMAIL_SCOPE:()=>xtn,EncodingTypes:()=>jbo,FORWARD_SLASH:()=>Fae,GrantType:()=>Z1e,HTTP_BAD_REQUEST:()=>_je,HTTP_CLIENT_ERROR:()=>bbo,HTTP_CLIENT_ERROR_RANGE_END:()=>b5t,HTTP_CLIENT_ERROR_RANGE_START:()=>C5t,HTTP_GATEWAY_TIMEOUT:()=>kbo,HTTP_GONE:()=>xbo,HTTP_MULTI_SIDED_ERROR:()=>Dbo,HTTP_NOT_FOUND:()=>Tbo,HTTP_REDIRECT:()=>Cbo,HTTP_REQUEST_TIMEOUT:()=>Ibo,HTTP_SERVER_ERROR:()=>Rbo,HTTP_SERVER_ERROR_RANGE_END:()=>T5t,HTTP_SERVER_ERROR_RANGE_START:()=>S5t,HTTP_SERVICE_UNAVAILABLE:()=>Pbo,HTTP_SUCCESS:()=>Eje,HTTP_SUCCESS_RANGE_END:()=>vbo,HTTP_SUCCESS_RANGE_START:()=>_bo,HTTP_TOO_MANY_REQUESTS:()=>wbo,HTTP_UNAUTHORIZED:()=>Sbo,HeaderNames:()=>Up,HttpMethod:()=>Nbo,IMDS_ENDPOINT:()=>yje,IMDS_TIMEOUT:()=>A5t,IMDS_VERSION:()=>g5t,INVALID_GRANT_ERROR:()=>U5t,INVALID_INSTANCE:()=>v5t,JsonWebTokenTypes:()=>Qbo,KNOWN_PUBLIC_CLOUDS:()=>_5t,NOT_APPLICABLE:()=>K1e,NOT_AVAILABLE:()=>Hz,OAuthResponseType:()=>Bbo,OFFLINE_ACCESS_SCOPE:()=>Aje,OIDC_DEFAULT_SCOPES:()=>Uae,OIDC_SCOPES:()=>vje,ONE_DAY_IN_MS:()=>qbo,OPENID_SCOPE:()=>Ttn,PROFILE_SCOPE:()=>Itn,PasswordGrantConstants:()=>Tje,PersistentCacheKeys:()=>Mbo,PromptValue:()=>J1e,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>E5t,RESOURCE_DELIM:()=>gje,RegionDiscoveryOutcomes:()=>tSe,RegionDiscoverySources:()=>R7,ResponseMode:()=>I5t,S256_CODE_CHALLENGE_METHOD:()=>Abo,SERVER_TELEM_CACHE_KEY:()=>X1e,SERVER_TELEM_CATEGORY_SEPARATOR:()=>Sje,SERVER_TELEM_MAX_CACHED_ERRORS:()=>D5t,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>Ubo,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>k5t,SERVER_TELEM_OVERFLOW_FALSE:()=>M5t,SERVER_TELEM_OVERFLOW_TRUE:()=>N5t,SERVER_TELEM_SCHEMA_VERSION:()=>bje,SERVER_TELEM_UNKNOWN_ERROR:()=>O5t,SERVER_TELEM_VALUE_SEPARATOR:()=>w7,SHR_NONCE_VALIDITY:()=>Ebo,SKU:()=>l5t,THE_FAMILY_ID:()=>$z,THROTTLING_PREFIX:()=>eSe,URL_FORM_CONTENT_TYPE:()=>m5t,X_MS_LIB_CAPABILITY_VALUE:()=>F5t});p();var l5t="msal.js.common",Stn="https://login.microsoftonline.com/common/",u5t="login.microsoftonline.com",Y1e="common",d5t="adfs",f5t="dstsv2",p5t=`${Stn}discovery/instance?api-version=1.1&authorization_endpoint=`,mje=".ciamlogin.com",h5t=".onmicrosoft.com",gje="|",mbo="9188040d-6c67-4c5b-b112-36a304b66dad",Ttn="openid",Itn="profile",Aje="offline_access",xtn="email",gbo="authorization_code",Abo="S256",m5t="application/x-www-form-urlencoded;charset=utf-8",ybo="authorization_pending",K1e="N/A",Hz="Not Available",Fae="/",yje="http://169.254.169.254/metadata/instance/compute/location",g5t="2020-06-01",A5t=2e3,y5t="TryAutoDetect",E5t="login.microsoft.com",_5t=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],Ebo=240,v5t="invalid_instance",Eje=200,_bo=200,vbo=299,Cbo=302,bbo=400,C5t=400,_je=400,Sbo=401,Tbo=404,Ibo=408,xbo=410,wbo=429,b5t=499,Rbo=500,S5t=500,Pbo=503,kbo=504,T5t=599,Dbo=600,Nbo={GET:"GET",POST:"POST"},Uae=[Ttn,Itn,Aje],vje=[...Uae,xtn],Up={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"},Mbo={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},ak={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},Qae={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},J1e={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},Obo={PLAIN:"plain",S256:"S256"},Bbo={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},I5t={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},Z1e={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"},x5t="MSSTS",w5t="ADFS",Lbo="MSA",Cje="Generic",Gz="-",qae=".",Ym={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},Fbo={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},jae="appmetadata",R5t="client_info",$z="1",Hae="authority-metadata",P5t=3600*24,Hy={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},bje=5,Ubo=80,k5t=330,D5t=50,X1e="server-telemetry",Sje="|",w7=",",N5t="1",M5t="0",O5t="unknown_error",uf={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},B5t=60,L5t=3600,eSe="throttling",F5t="retry-after, h429",U5t="invalid_grant",Q5t="client_mismatch",Tje={username:"username",password:"password"},R7={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},tSe={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},ck={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},Qbo={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},qbo=864e5,q5t=300,jbo={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var Vz={};Ri(Vz,{ACCESS_TOKEN:()=>$bo,BROKER_CLIENT_ID:()=>rSe,BROKER_REDIRECT_URI:()=>Pje,CCS_HEADER:()=>Xbo,CLAIMS:()=>$5t,CLIENT_ASSERTION:()=>m4t,CLIENT_ASSERTION_TYPE:()=>g4t,CLIENT_ID:()=>kM,CLIENT_INFO:()=>Kbo,CLIENT_REQUEST_ID:()=>t4t,CLIENT_SECRET:()=>h4t,CLI_DATA:()=>x4t,CODE:()=>J5t,CODE_CHALLENGE:()=>Z5t,CODE_CHALLENGE_METHOD:()=>X5t,CODE_VERIFIER:()=>e4t,DEVICE_CODE:()=>p4t,DOMAIN_HINT:()=>b4t,EAR_JWE_CRYPTO:()=>T4t,EAR_JWK:()=>S4t,ERROR:()=>Hbo,ERROR_DESCRIPTION:()=>Gbo,EXPIRES_IN:()=>Wbo,FOCI:()=>Zbo,GRANT_TYPE:()=>G5t,ID_TOKEN:()=>Vbo,ID_TOKEN_HINT:()=>f4t,INSTANCE_AWARE:()=>Gae,LOGIN_HINT:()=>C4t,LOGOUT_HINT:()=>_4t,NATIVE_BROKER:()=>E4t,NONCE:()=>Y5t,OBO_ASSERTION:()=>A4t,ON_BEHALF_OF:()=>Jbo,POST_LOGOUT_URI:()=>d4t,PROMPT:()=>K5t,REDIRECT_URI:()=>Ije,REFRESH_TOKEN:()=>W5t,REFRESH_TOKEN_EXPIRES_IN:()=>zbo,REQUESTED_TOKEN_USE:()=>y4t,REQ_CNF:()=>wje,RESOURCE:()=>I4t,RESPONSE_MODE:()=>H5t,RESPONSE_TYPE:()=>j5t,RETURN_SPA_CODE:()=>Rje,SCOPE:()=>V5t,SESSION_STATE:()=>Ybo,SID:()=>v4t,STATE:()=>z5t,TOKEN_TYPE:()=>xje,X_APP_NAME:()=>l4t,X_APP_VER:()=>u4t,X_CLIENT_CPU:()=>o4t,X_CLIENT_CURR_TELEM:()=>s4t,X_CLIENT_EXTRA_SKU:()=>e1o,X_CLIENT_LAST_TELEM:()=>a4t,X_CLIENT_OS:()=>i4t,X_CLIENT_SKU:()=>r4t,X_CLIENT_VER:()=>n4t,X_MS_LIB_CAPABILITY:()=>c4t});p();var kM="client_id",Ije="redirect_uri",j5t="response_type",H5t="response_mode",G5t="grant_type",$5t="claims",V5t="scope",Hbo="error",Gbo="error_description",$bo="access_token",Vbo="id_token",W5t="refresh_token",Wbo="expires_in",zbo="refresh_token_expires_in",z5t="state",Y5t="nonce",K5t="prompt",Ybo="session_state",Kbo="client_info",J5t="code",Z5t="code_challenge",X5t="code_challenge_method",e4t="code_verifier",t4t="client-request-id",r4t="x-client-SKU",n4t="x-client-VER",i4t="x-client-OS",o4t="x-client-CPU",s4t="x-client-current-telemetry",a4t="x-client-last-telemetry",c4t="x-ms-lib-capability",l4t="x-app-name",u4t="x-app-ver",d4t="post_logout_redirect_uri",f4t="id_token_hint",p4t="device_code",h4t="client_secret",m4t="client_assertion",g4t="client_assertion_type",xje="token_type",wje="req_cnf",A4t="assertion",y4t="requested_token_use",Jbo="on_behalf_of",Zbo="foci",Xbo="X-AnchorMailbox",Rje="return_spa_code",E4t="nativebroker",_4t="logout_hint",v4t="sid",C4t="login_hint",b4t="domain_hint",e1o="x-client-xtra-sku",rSe="brk_client_id",Pje="brk_redirect_uri",Gae="instance_aware",S4t="ear_jwk",T4t="ear_jwe_crypto",I4t="resource",x4t="clidata";p();p();p();function kje(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(kje,"getDefaultErrorMessage");var Bo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?kje(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 Wz(t,e){return new Bo(t,e||kje(t))}a(Wz,"createAuthError");var $ae=class t extends Bo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function gl(t){return new $ae(t)}a(gl,"createClientConfigurationError");p();var au=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 P7=class t extends Bo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function Pt(t,e){return new P7(t,e)}a(Pt,"createClientAuthError");var Wae={};Ri(Wae,{authorityMismatch:()=>c1o,authorityUriInsecure:()=>R4t,cannotAllowPlatformBroker:()=>a1o,cannotSetOIDCOptions:()=>s1o,claimsRequestParsingError:()=>t1o,emptyInputScopesError:()=>k4t,invalidAuthenticationHeader:()=>o1o,invalidAuthorityMetadata:()=>O4t,invalidClaims:()=>Dje,invalidCloudDiscoveryMetadata:()=>Nje,invalidCodeChallengeMethod:()=>r1o,invalidRequestMethodForEAR:()=>l1o,logoutRequestEmpty:()=>N4t,missingNonceAuthenticationHeader:()=>i1o,missingSshJwk:()=>nSe,missingSshKid:()=>n1o,pkceParamsMissing:()=>M4t,redirectUriEmpty:()=>w4t,tokenRequestEmpty:()=>D4t,untrustedAuthority:()=>B4t,urlEmptyError:()=>P4t,urlParseError:()=>Vae});p();var w4t="redirect_uri_empty",t1o="claims_request_parsing_error",R4t="authority_uri_insecure",Vae="url_parse_error",P4t="empty_url_error",k4t="empty_input_scopes_error",Dje="invalid_claims",D4t="token_request_empty",N4t="logout_request_empty",r1o="invalid_code_challenge_method",M4t="pkce_params_missing",Nje="invalid_cloud_discovery_metadata",O4t="invalid_authority_metadata",B4t="untrusted_authority",nSe="missing_ssh_jwk",n1o="missing_ssh_kid",i1o="missing_nonce_authentication_header",o1o="invalid_authentication_header",s1o="cannot_set_OIDCOptions",a1o="cannot_allow_platform_broker",c1o="authority_mismatch",l1o="invalid_request_method_for_EAR";var Qp={};Ri(Qp,{authTimeNotFound:()=>iSe,authorizationCodeMissingFromServerResponse:()=>Z4t,bindingKeyNotRemoved:()=>p1o,cannotAppendScopeSet:()=>z4t,cannotRemoveEmptyScope:()=>W4t,clientInfoDecodingError:()=>Mje,clientInfoEmptyError:()=>L4t,emptyInputScopeSet:()=>Lje,endSessionEndpointNotSupported:()=>X4t,endpointResolutionError:()=>lk,hashNotDeserialized:()=>q4t,invalidCacheEnvironment:()=>sSe,invalidCacheRecord:()=>Y4t,invalidState:()=>zz,keyIdMissing:()=>eBt,maxAgeTranspired:()=>G4t,methodNotImplemented:()=>Cs,misplacedResourceParam:()=>rBt,multipleMatchingAppMetadata:()=>$4t,multipleMatchingTokens:()=>u1o,nestedAppAuthBridgeDisabled:()=>g1o,networkError:()=>U4t,noAccountFound:()=>d1o,noAccountInSilentRequest:()=>oSe,noCryptoObject:()=>K4t,noNetworkConnectivity:()=>h1o,nonceMismatch:()=>H4t,nullOrEmptyToken:()=>F4t,openIdConfigError:()=>Q4t,platformBrokerError:()=>A1o,requestCannotBeMade:()=>V4t,resourceParameterRequired:()=>tBt,stateMismatch:()=>j4t,stateNotFound:()=>Bje,tokenClaimsCnfRequiredForSignedJwt:()=>J4t,tokenParsingError:()=>Oje,tokenRefreshRequired:()=>zae,unexpectedCredentialType:()=>f1o,userCanceled:()=>m1o});p();var Mje="client_info_decoding_error",L4t="client_info_empty_error",Oje="token_parsing_error",F4t="null_or_empty_token",lk="endpoints_resolution_error",U4t="network_error",Q4t="openid_config_error",q4t="hash_not_deserialized",zz="invalid_state",j4t="state_mismatch",Bje="state_not_found",H4t="nonce_mismatch",iSe="auth_time_not_found",G4t="max_age_transpired",u1o="multiple_matching_tokens",$4t="multiple_matching_appMetadata",V4t="request_cannot_be_made",W4t="cannot_remove_empty_scope",z4t="cannot_append_scopeset",Lje="empty_input_scopeset",oSe="no_account_in_silent_request",Y4t="invalid_cache_record",sSe="invalid_cache_environment",d1o="no_account_found",K4t="no_crypto_object",f1o="unexpected_credential_type",zae="token_refresh_required",J4t="token_claims_cnf_required_for_signedjwt",Z4t="authorization_code_missing_from_server_response",p1o="binding_key_not_removed",X4t="end_session_endpoint_not_supported",eBt="key_id_missing",h1o="no_network_connectivity",m1o="user_canceled",Cs="method_not_implemented",g1o="nested_app_auth_bridge_disabled",A1o="platform_broker_error",tBt="resource_parameter_required",rBt="misplaced_resource_parameter";var Mh=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?au.trimArrayEntries([...e]):[],n=r?au.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw gl(k4t);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:[...Uae],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(Aje):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 vje.forEach(r=>{this.containsScope(r)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(r=>this.appendScope(r))}catch{throw Pt(z4t)}}removeScope(e){if(!e)throw Pt(W4t);this.scopes.delete(e.trim())}removeOIDCScopes(){vje.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw Pt(Lje);let r=new Set;return e.scopes.forEach(n=>r.add(n.toLowerCase())),this.scopes.forEach(n=>r.add(n.toLowerCase())),r}intersectingScopeSets(e){if(!e)throw Pt(Lje);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 Yz(t,e,r){if(!e)return;let n=t.get(kM);n&&t.has(rSe)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get(Ije)},e)}a(Yz,"instrumentBrokerParams");function y1o(t,e){t.set(j5t,e)}a(y1o,"addResponseType");function nBt(t,e){t.set(H5t,e||I5t.QUERY)}a(nBt,"addResponseMode");function E1o(t){t.set(E4t,"1")}a(E1o,"addNativeBroker");function Kz(t,e,r=!0,n=Uae){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new Mh(o);t.set(V5t,s.printScopes())}a(Kz,"addScopes");function Jz(t,e){t.set(kM,e)}a(Jz,"addClientId");function Zz(t,e){t.set(Ije,e)}a(Zz,"addRedirectUri");function iBt(t,e){t.set(d4t,e)}a(iBt,"addPostLogoutRedirectUri");function oBt(t,e){t.set(f4t,e)}a(oBt,"addIdTokenHint");function sBt(t,e){t.set(b4t,e)}a(sBt,"addDomainHint");function Yae(t,e){t.set(C4t,e)}a(Yae,"addLoginHint");function k7(t,e){t.set(Up.CCS_HEADER,`UPN:${e}`)}a(k7,"addCcsUpn");function zL(t,e){t.set(Up.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(zL,"addCcsOid");function Fje(t,e){t.set("sid",e)}a(Fje,"addSid");function Xz(t,e,r){let n=wtn(e,r);try{JSON.parse(n)}catch{throw gl(Dje)}t.set($5t,n)}a(Xz,"addClaims");function eY(t,e){t.set(t4t,e)}a(eY,"addCorrelationId");function aSe(t,e){t.set(r4t,e.sku),t.set(n4t,e.version),e.os&&t.set(i4t,e.os),e.cpu&&t.set(o4t,e.cpu)}a(aSe,"addLibraryInfo");function cSe(t,e){e?.appName&&t.set(l4t,e.appName),e?.appVersion&&t.set(u4t,e.appVersion)}a(cSe,"addApplicationTelemetry");function aBt(t,e){t.set(K5t,e)}a(aBt,"addPrompt");function lSe(t,e){e&&t.set(z5t,e)}a(lSe,"addState");function cBt(t,e){t.set(Y5t,e)}a(cBt,"addNonce");function _1o(t,e,r){if(e&&r)t.set(Z5t,e),t.set(X5t,r);else throw gl(M4t)}a(_1o,"addCodeChallengeParams");function lBt(t,e){t.set(J5t,e)}a(lBt,"addAuthorizationCode");function v1o(t,e){t.set(p4t,e)}a(v1o,"addDeviceCode");function uBt(t,e){t.set(W5t,e)}a(uBt,"addRefreshToken");function dBt(t,e){t.set(e4t,e)}a(dBt,"addCodeVerifier");function uSe(t,e){t.set(h4t,e)}a(uSe,"addClientSecret");function dSe(t,e){e&&t.set(m4t,e)}a(dSe,"addClientAssertion");function fSe(t,e){e&&t.set(g4t,e)}a(fSe,"addClientAssertionType");function C1o(t,e){t.set(A4t,e)}a(C1o,"addOboAssertion");function b1o(t,e){t.set(y4t,e)}a(b1o,"addRequestTokenUse");function pSe(t,e){t.set(G5t,e)}a(pSe,"addGrantType");function tY(t){t.set(R5t,"1")}a(tY,"addClientInfo");function fBt(t){t.set(x4t,"1")}a(fBt,"addCliData");function hSe(t){t.has(Gae)||t.set(Gae,"true")}a(hSe,"addInstanceAware");function YL(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(YL,"addExtraParameters");function wtn(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw gl(Dje)}return e&&e.length>0&&(r.hasOwnProperty(Qae.ACCESS_TOKEN)||(r[Qae.ACCESS_TOKEN]={}),r[Qae.ACCESS_TOKEN][Qae.XMS_CC]={values:e}),JSON.stringify(r)}a(wtn,"addClientCapabilitiesToClaims");function S1o(t,e){t.set(Tje.username,e)}a(S1o,"addUsername");function T1o(t,e){t.set(Tje.password,e)}a(T1o,"addPassword");function mSe(t,e){e&&(t.set(xje,uf.POP),t.set(wje,e))}a(mSe,"addPopToken");function gSe(t,e){e&&(t.set(xje,uf.SSH),t.set(wje,e))}a(gSe,"addSshJwk");function ASe(t,e){t.set(s4t,e.generateCurrentRequestHeaderValue()),t.set(a4t,e.generateLastRequestHeaderValue())}a(ASe,"addServerTelemetry");function ySe(t){t.set(c4t,F5t)}a(ySe,"addThrottling");function pBt(t,e){t.set(_4t,e)}a(pBt,"addLogoutHint");function KL(t,e,r){t.has(rSe)||t.set(rSe,e),t.has(Pje)||t.set(Pje,r)}a(KL,"addBrokerParameters");function I1o(t,e){t.set(S4t,encodeURIComponent(e)),t.set(T4t,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(I1o,"addEARParameters");function ESe(t,e){e&&t.set(I4t,e)}a(ESe,"addResource");var fA={};Ri(fA,{getDeserializedResponse:()=>x1o,mapToQueryString:()=>DM,normalizeUrlForComparison:()=>w1o,stripLeadingHashOrQuery:()=>Ptn});p();function Rtn(t){if(!t)return t;let e=t.toLowerCase();return au.endsWith(e,"?")?e=e.slice(0,-1):au.endsWith(e,"?/")&&(e=e.slice(0,-2)),au.endsWith(e,"/")||(e+="/"),e}a(Rtn,"canonicalizeUrl");function Ptn(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(Ptn,"stripLeadingHashOrQuery");function x1o(t){if(!t||t.indexOf("=")<0)return null;try{let e=Ptn(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch{throw Pt(q4t)}return null}a(x1o,"getDeserializedResponse");function DM(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(DM,"mapToQueryString");function w1o(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return Rtn(n)}catch{return Rtn(e)}}a(w1o,"normalizeUrlForComparison");p();p();var Kae={createNewGuid:a(()=>{throw Pt(Cs)},"createNewGuid"),base64Decode:a(()=>{throw Pt(Cs)},"base64Decode"),base64Encode:a(()=>{throw Pt(Cs)},"base64Encode"),base64UrlEncode:a(()=>{throw Pt(Cs)},"base64UrlEncode"),encodeKid:a(()=>{throw Pt(Cs)},"encodeKid"),async getPublicKeyThumbprint(){throw Pt(Cs)},async removeTokenBindingKey(){throw Pt(Cs)},async clearKeystore(){throw Pt(Cs)},async signJwt(){throw Pt(Cs)},async hashString(){throw Pt(Cs)}};p();var df;(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"})(df||(df={}));var R1o=50,P1o=500,rY=new Map;function k1o(t,e){rY.delete(t),rY.set(t,e)}a(k1o,"markAsRecentlyUsed");function D1o(t,e){let r=Date.now(),n=rY.get(t);if(n)k1o(t,n);else if(n={logs:[],firstEventTime:r},rY.set(t,n),rY.size>R1o){let o=rY.keys().next().value;o&&rY.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>P1o&&n.logs.shift()}a(D1o,"addLogToCache");function N1o(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(N1o,"isHashedString");var Km=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=df.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:df.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:df.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(N1o(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};D1o(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${df[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:df.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:df.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:df.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:df.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:df.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:df.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:df.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:df.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:df.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:df.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var D7="@azure/msal-common",NM="16.4.1";p();var JL={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 ktn(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(ktn,"tenantIdMatchesHomeTenant");function nY(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:ktn(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:ktn(r,t)}}a(nY,"buildTenantProfile");function Uje(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=nY(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(Uje,"updateAccountTenantProfileData");var Qje={};Ri(Qje,{checkMaxAge:()=>_Se,extractTokenClaims:()=>ZL,getJWSPayload:()=>Dtn,isKmsi:()=>hBt});p();function ZL(t,e){let r=Dtn(t);try{let n=e(r);return JSON.parse(n)}catch{throw Pt(Oje)}}a(ZL,"extractTokenClaims");function hBt(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(hBt,"isKmsi");function Dtn(t){if(!t)throw Pt(F4t);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw Pt(Oje);return r[2]}a(Dtn,"getJWSPayload");function _Se(t,e){if(e===0||Date.now()-3e5>t+e)throw Pt(G4t)}a(_Se,"checkMaxAge");p();p();var bs=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw gl(P4t);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return au.endsWith(r,"?")?r=r.slice(0,-1):au.endsWith(r,"?/")&&(r=r.slice(0,-2)),au.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw gl(Vae)}if(!e.HostNameAndPort||!e.PathSegments)throw gl(Vae);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw gl(R4t)}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]===ak.COMMON||n[0]===ak.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw gl(Vae);let n={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5],QueryString:r[7]},o=n.AbsolutePath.split("/");return o=o.filter(s=>s&&s.length>0),n.PathSegments=o,n.QueryString&&n.QueryString.endsWith("/")&&(n.QueryString=n.QueryString.substring(0,n.QueryString.length-1)),n}static getDomainFromUrl(e){let r=RegExp("^([^:/?#]+://)?([^/?#]*)"),n=e.match(r);if(!n)throw gl(Vae);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===Fae){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 M1o=[{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 O1o(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(O1o,"buildOpenIdConfig");var B1o=M1o.reduce((t,{host:e,issuerHost:r})=>(t[e]=O1o(e,r||e),t),{}),Mtn={endpointMetadata:B1o,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"]}]}},mBt=Mtn.endpointMetadata,gBt=Mtn.instanceDiscoveryMetadata,ABt=new Set;gBt.metadata.forEach(t=>{t.aliases.forEach(e=>{ABt.add(e)})});function Otn(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new bs(o).getUrlComponents().HostNameAndPort;n=Ntn(e,r,s,t.cloudDiscoveryMetadata?.metadata,Hy.CONFIG)||Ntn(e,r,s,gBt.metadata,Hy.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(Otn,"getAliasesFromStaticSources");function Ntn(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=vSe(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(Ntn,"getAliasesFromMetadata");function Btn(t){return vSe(gBt.metadata,t)}a(Btn,"getCloudDiscoveryMetadataFromHardcodedValues");function vSe(t,e){for(let r=0;ryBt,createAccountEntityFromAccountInfo:()=>U1o,generateAccountId:()=>L1o,generateHomeAccountId:()=>EBt,getAccountInfo:()=>Zae,isAccountEntity:()=>Q1o,isSingleTenant:()=>F1o});p();p();function Jae(t,e){if(!t)throw Pt(L4t);try{let r=e(t);return JSON.parse(r)}catch{throw Pt(Mje)}}a(Jae,"buildClientInfo");function MM(t){if(!t)throw Pt(Mje);let e=t.split(qae,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(MM,"buildClientInfoFromHomeAccountId");p();var Ex={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function qje(t){return t&&(t.tid||t.tfp||t.acr)||null}a(qje,"getTenantIdFromIdTokenClaims");p();var Gy={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function L1o(t){return[t.homeAccountId,t.environment].join(Gz).toLowerCase()}a(L1o,"generateAccountId");function Zae(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(nY(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(Zae,"getAccountInfo");function F1o(t){return!t.tenantProfiles}a(F1o,"isSingleTenant");function yBt(t,e,r){let n;e.authorityType===Ex.Adfs?n=w5t:e.protocolMode===Gy.OIDC?n=Cje:n=x5t;let o,s;t.clientInfo&&r&&(o=Jae(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw Pt(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||qje(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[nY(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(yBt,"createAccountEntity");function U1o(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(nY(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||Cje,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(U1o,"createAccountEntityFromAccountInfo");function EBt(t,e,r,n,o,s){if(!(e===Ex.Adfs||e===Ex.Dsts)){if(t)try{let c=Jae(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(EBt,"generateHomeAccountId");function Q1o(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a(Q1o,"isAccountEntity");var N7=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(D7,NM),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?Zae(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=ZL(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=Uje(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=Zae(e),c=s.tenantProfiles||new Map,l=this.getTokenKeys();if(n){let d=c.get(n);if(d)c=new Map([[n,d]]);else return[]}let u=[];return c.forEach(d=>{let f=this.getTenantedAccountInfoByFilter(s,l,d,r,o);f&&u.push(f)}),u}tenantProfileMatchesFilter(e,r){return!(r.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,r.localAccountId)||r.name&&e.name!==r.name||r.isHomeTenant!==void 0&&e.isHomeTenant!==r.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,r){return!(r&&(r.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,r.localAccountId)||r.loginHint&&!this.matchLoginHintFromTokenClaims(e,r.loginHint)||r.username&&!this.matchUsername(e.preferred_username,r.username)||r.name&&!this.matchName(e,r.name)||r.sid&&!this.matchSid(e,r.sid)))}async saveCacheRecord(e,r,n,o,s){if(!e)throw Pt(Y4t);try{e.account&&await this.setAccount(e.account,r,n,o),e.idToken&&s?.idToken!==!1&&await this.setIdTokenCredential(e.idToken,r,n),e.accessToken&&s?.accessToken!==!1&&await this.saveAccessToken(e.accessToken,r,n),e.refreshToken&&s?.refreshToken!==!1&&await this.setRefreshTokenCredential(e.refreshToken,r,n),e.appMetadata&&this.setAppMetadata(e.appMetadata,r)}catch(c){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed",r),c instanceof Bo?c:Utn(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=Mh.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)&&Mh.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===Ym.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===uf.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()===Ym.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===uf.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:Ym.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=Mh.createSearchScopes(r.scopes),l=r.authenticationScheme||uf.BEARER,u=l&&l.toLowerCase()!==uf.BEARER.toLowerCase()?Ym.ACCESS_TOKEN_WITH_AUTH_SCHEME:Ym.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?$z:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Ym.REFRESH_TOKEN,clientId:this.clientId,familyId:s},l=o&&o.refreshToken||this.getTokenKeys().refreshToken,u=[];l.forEach(f=>{if(this.refreshTokenKeyMatchesFilter(f,c)){let h=this.getRefreshTokenCredential(f,n);h&&this.credentialMatchesFilter(h,c,n)&&u.push(h)}});let d=u.length;return d<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found.",n),null):(d>1&&this.performanceClient.addFields({multiMatchedRT:d},n),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token",n),u[0])}refreshTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.familyId&&n.indexOf(r.familyId.toLowerCase())===-1||!r.familyId&&r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e,r){let n={environment:e,clientId:this.clientId},o=this.getAppMetadataFilteredBy(n,r),s=Object.keys(o).map(l=>o[l]),c=s.length;if(c<1)return null;if(c>1)throw Pt($4t);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===$z)}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=Otn(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!==Ym.ACCESS_TOKEN&&e.credentialType!==Ym.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:Mh.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(jae)!==-1}isAuthorityMetadata(e){return e.indexOf(Hae)!==-1}generateAuthorityMetadataCacheKey(e){return`${Hae}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},bSe=class extends N7{static{a(this,"DefaultStorageClass")}async setAccount(){throw Pt(Cs)}getAccount(){throw Pt(Cs)}async setIdTokenCredential(){throw Pt(Cs)}getIdTokenCredential(){throw Pt(Cs)}async setAccessTokenCredential(){throw Pt(Cs)}getAccessTokenCredential(){throw Pt(Cs)}async setRefreshTokenCredential(){throw Pt(Cs)}getRefreshTokenCredential(){throw Pt(Cs)}setAppMetadata(){throw Pt(Cs)}getAppMetadata(){throw Pt(Cs)}setServerTelemetry(){throw Pt(Cs)}getServerTelemetry(){throw Pt(Cs)}setAuthorityMetadata(){throw Pt(Cs)}getAuthorityMetadata(){throw Pt(Cs)}getAuthorityMetadataKeys(){throw Pt(Cs)}setThrottlingCache(){throw Pt(Cs)}getThrottlingCache(){throw Pt(Cs)}removeItem(){throw Pt(Cs)}getKeys(){throw Pt(Cs)}getAccountKeys(){throw Pt(Cs)}getTokenKeys(){throw Pt(Cs)}generateCredentialKey(){throw Pt(Cs)}generateAccountKey(){throw Pt(Cs)}};p();p();var Qtn={NotStarted:0,InProgress:1,Completed:2};var Oh=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:Qtn.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 qtn={tokenRenewalOffsetSeconds:q5t,preventCorsPreflight:!1},q1o={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:df.Info,correlationId:""},j1o={async sendGetRequestAsync(){throw Pt(Cs)},async sendPostRequestAsync(){throw Pt(Cs)}},H1o={sku:l5t,version:NM,cpu:"",os:""},G1o={clientSecret:"",clientAssertion:void 0},$1o={azureCloudInstance:JL.None,tenant:`${Y1e}`},V1o={application:{appName:"",appVersion:""}};function XL({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={...q1o,...r};return{authOptions:W1o(t),systemOptions:{...qtn,...e},loggerOptions:m,storageInterface:n||new bSe(t.clientId,Kae,new Km(m),new Oh),networkInterface:o||j1o,cryptoInterface:s||Kae,clientCredentials:c||G1o,libraryInfo:{...H1o,...l},telemetry:{...V1o,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a(XL,"buildClientConfiguration");function W1o(t){return{clientCapabilities:[],azureCloudOptions:$1o,instanceAware:!1,isMcp:!1,...t}}a(W1o,"buildAuthOptions");function jje(t){return t.authOptions.authority.options.protocolMode===Gy.OIDC}a(jje,"isOidcProtocolMode");p();p();var cS=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 E_={};Ri(E_,{createAccessTokenEntity:()=>CBt,createIdTokenEntity:()=>vBt,createRefreshTokenEntity:()=>bBt,generateAppMetadataKey:()=>rSo,generateAuthorityMetadataExpiresAt:()=>Gje,isAccessTokenEntity:()=>J1o,isAppMetadataEntity:()=>nSo,isAuthorityMetadataEntity:()=>iSo,isAuthorityMetadataExpired:()=>$je,isCredentialEntity:()=>Hje,isIdTokenEntity:()=>Z1o,isRefreshTokenEntity:()=>X1o,isServerTelemetryEntity:()=>eSo,isThrottlingEntity:()=>tSo,updateAuthorityEndpointMetadata:()=>ece,updateCloudDiscoveryMetadata:()=>TSe});p();var Vu={};Ri(Vu,{delay:()=>K1o,isCacheExpired:()=>Y1o,isTokenExpired:()=>Xae,nowSeconds:()=>lS,toDateFromSeconds:()=>SSe,toSecondsFromDate:()=>z1o,wasClockTurnedBack:()=>_Bt});p();function lS(){return Math.round(new Date().getTime()/1e3)}a(lS,"nowSeconds");function z1o(t){return t.getTime()/1e3}a(z1o,"toSecondsFromDate");function SSe(t){return t?new Date(Number(t)*1e3):new Date}a(SSe,"toDateFromSeconds");function Xae(t,e){let r=Number(t)||0;return lS()+e>r}a(Xae,"isTokenExpired");function Y1o(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(Y1o,"isCacheExpired");function _Bt(t){return Number(t)>lS()}a(_Bt,"wasClockTurnedBack");function K1o(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(K1o,"delay");function vBt(t,e,r,n,o){return{credentialType:Ym.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(vBt,"createIdTokenEntity");function CBt(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:Ym.ACCESS_TOKEN,secret:r,cachedAt:lS().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||uf.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==uf.BEARER.toLowerCase())switch(g.credentialType=Ym.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case uf.POP:let A=ZL(r,u);if(!A?.cnf?.kid)throw Pt(J4t);g.keyId=A.cnf.kid;break;case uf.SSH:g.keyId=m}return g}a(CBt,"createAccessTokenEntity");function bBt(t,e,r,n,o,s,c){let l={credentialType:Ym.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(bBt,"createRefreshTokenEntity");function Hje(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(Hje,"isCredentialEntity");function J1o(t){return t?Hje(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===Ym.ACCESS_TOKEN||t.credentialType===Ym.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(J1o,"isAccessTokenEntity");function Z1o(t){return t?Hje(t)&&t.hasOwnProperty("realm")&&t.credentialType===Ym.ID_TOKEN:!1}a(Z1o,"isIdTokenEntity");function X1o(t){return t?Hje(t)&&t.credentialType===Ym.REFRESH_TOKEN:!1}a(X1o,"isRefreshTokenEntity");function eSo(t,e){let r=t.indexOf(X1e)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(eSo,"isServerTelemetryEntity");function tSo(t,e){let r=!1;t&&(r=t.indexOf(eSe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(tSo,"isThrottlingEntity");function rSo({environment:t,clientId:e}){return[jae,t,e].join(Gz).toLowerCase()}a(rSo,"generateAppMetadataKey");function nSo(t,e){return e?t.indexOf(jae)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(nSo,"isAppMetadataEntity");function iSo(t,e){return e?t.indexOf(Hae)===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(iSo,"isAuthorityMetadataEntity");function Gje(){return lS()+P5t}a(Gje,"generateAuthorityMetadataExpiresAt");function ece(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(ece,"updateAuthorityEndpointMetadata");function TSe(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(TSe,"updateCloudDiscoveryMetadata");function $je(t){return t.expiresAt<=lS()}a($je,"isAuthorityMetadataExpired");p();p();var jtn="networkClientSendPostRequestAsync",Htn="refreshTokenClientExecutePostToTokenEndpoint",Gtn="authorizationCodeClientExecutePostToTokenEndpoint",$tn="refreshTokenClientExecuteTokenRequest",Vtn="refreshTokenClientAcquireToken",Vje="refreshTokenClientAcquireTokenWithCachedRefreshToken",Wtn="refreshTokenClientCreateTokenRequestBody",ztn="silentFlowClientGenerateResultFromCacheRecord";var Ytn="authClientExecuteTokenRequest",Ktn="authClientCreateTokenRequestBody",Jtn="updateTokenEndpointAuthority",tce="popTokenGenerateCnf",Wje="handleServerTokenResponse",Ztn="authorityResolveEndpointsAsync",Xtn="authorityGetCloudDiscoveryMetadataFromNetwork",ern="authorityUpdateCloudDiscoveryMetadata",trn="authorityGetEndpointMetadataFromNetwork",rrn="authorityUpdateEndpointMetadata",SBt="authorityUpdateMetadataWithRegionalInformation",nrn="regionDiscoveryDetectRegion",TBt="regionDiscoveryGetRegionFromIMDS",irn="regionDiscoveryGetCurrentVersion",orn="cacheManagerGetRefreshToken";p();var srn=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"),Ws=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 oSo={SW:"sw"},M7=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await Ws(this.generateKid.bind(this),tce,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:oSo.SW}}async signPopToken(e,r,n){return this.signPayload(e,r,n)}async signPayload(e,r,n,o){let{resourceRequestMethod:s,resourceRequestUri:c,shrClaims:l,shrNonce:u,shrOptions:d}=n,h=(c?new bs(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:lS(),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 Yje={};Ri(Yje,{badToken:()=>ISe,consentRequired:()=>RBt,interactionRequired:()=>wBt,interruptedUser:()=>kBt,loginRequired:()=>PBt,nativeAccountUnavailable:()=>sSo,noTokensFound:()=>zje,refreshTokenExpired:()=>IBt,uxNotAllowed:()=>xBt});p();var zje="no_tokens_found",sSo="native_account_unavailable",IBt="refresh_token_expired",xBt="ux_not_allowed",wBt="interaction_required",RBt="consent_required",PBt="login_required",ISe="bad_token",kBt="interrupted_user";var arn=[wBt,RBt,PBt,ISe,xBt,kBt],aSo=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],uS=class t extends Bo{static{a(this,"InteractionRequiredAuthError")}constructor(e,r,n,o,s,c,l,u){super(e,r,n),Object.setPrototypeOf(this,t.prototype),this.timestamp=o||"",this.traceId=s||"",this.correlationId=c||"",this.claims=l||"",this.name="InteractionRequiredAuthError",this.errorNo=u}};function Kje(t,e,r){let n=!!t&&arn.indexOf(t)>-1,o=!!r&&aSo.indexOf(r)>-1,s=!!e&&arn.some(c=>e.indexOf(c)>-1);return n||s||o}a(Kje,"isInteractionRequiredError");function Jje(t,e){return new uS(t,e)}a(Jje,"createInteractionRequiredAuthError");p();var __=class t extends Bo{static{a(this,"ServerError")}constructor(e,r,n,o,s){super(e,r,n),this.name="ServerError",this.errorNo=o,this.status=s,Object.setPrototypeOf(this,t.prototype)}};p();function crn(t,e){if(!t)throw Pt(K4t);if(!e)throw Pt(zz);try{let r=e.split(gje),n=r[0],o=r.length>1?r.slice(1).join(gje):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw Pt(zz)}}a(crn,"parseRequestState");var qp=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||Hz} - Timestamp: ${e.timestamp||Hz} - Description: ${e.error_description||Hz} - Correlation ID: ${e.correlation_id||Hz} - Trace ID: ${e.trace_id||Hz}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new __(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=S5t&&e.status<=T5t){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>=C5t&&e.status<=b5t){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. -${c}`,r);return}throw Kje(e.error,e.error_description,e.suberror)?new uS(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=ZL(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw Pt(H4t);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw Pt(iSe);_Se(y,o.maxAge)}}this.homeAccountIdentifier=EBt(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=crn(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 cS(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,hBt(h||{}),s,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&A&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess",o.correlationId),await this.persistencePlugin.afterCacheAccess(A))}return t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,e,f)}generateCacheRecord(e,r,n,o,s,c,l){let u=r.getPreferredCache();if(!u)throw Pt(sSe);let d=qje(s),f,h;e.id_token&&s&&(f=vBt(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=lrn(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?Mh.fromString(e.scope):new Mh(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=CBt(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=bBt(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===uf.POP&&!s.popKid){let T=new M7(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw Pt(eBt);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=Mh.fromString(n.accessToken.target).asArray(),g=SSe(n.accessToken.expiresOn),A=SSe(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=SSe(n.accessToken.refreshOn))}n.appMetadata&&(E=n.appMetadata.familyId===$z?$z:"");let _=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let b=n.account?Uje(Zae(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 lrn(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)||yBt({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=nY(r,E.localAccountId,v,s);_.push(b)}return E.tenantProfiles=_,E}a(lrn,"buildAccountToCache");p();var v_={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};p();async function C_(t,e,r){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:r})}a(C_,"getClientAssertion");p();function rce(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(rce,"getRequestThumbprint");var oY={};Ri(oY,{createTokenQueryParameters:()=>RSe,createTokenRequestHeaders:()=>wSe,executePostToTokenEndpoint:()=>PSe,sendPostRequest:()=>urn});p();p();var xSe=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${eSe}.${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(Up.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||B5t),n+L5t)*1e3)}static removeThrottle(e,r,n,o){let s=rce(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var nce=class t extends Bo{static{a(this,"NetworkError")}constructor(e,r,n){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,t.prototype),this.name="NetworkError",this.error=e,this.httpStatus=r,this.responseHeaders=n}};function DBt(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new nce(t,e,r)}a(DBt,"createNetworkError");function wSe(t,e,r){let n={};if(n[Up.CONTENT_TYPE]=m5t,!e&&r)switch(r.type){case v_.HOME_ACCOUNT_ID:try{let o=MM(r.credential);n[Up.CCS_HEADER]=`Oid:${o.uid}@${o.utid}`}catch(o){t.verbose(`Could not parse home account ID for CCS Header: '${o}'`,"")}break;case v_.UPN:n[Up.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(wSe,"createTokenRequestHeaders");function RSe(t,e,r,n){let o=new Map;return t.embeddedClientId&&KL(o,e,r),t.extraQueryParameters&&YL(o,t.extraQueryParameters),eY(o,t.correlationId),Yz(o,t.correlationId,n),DM(o)}a(RSe,"createTokenQueryParameters");async function PSe(t,e,r,n,o,s,c,l,u,d){let f=await urn(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(PSe,"executePostToTokenEndpoint");async function urn(t,e,r,n,o,s,c,l){xSe.preProcess(o,t,n);let u;try{u=await Ws(s.sendPostRequestAsync.bind(s),jtn,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[Up.X_MS_HTTP_VERSION]||"",requestId:d[Up.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof nce){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[Up.X_MS_HTTP_VERSION]||"",requestId:f[Up.X_MS_REQUEST_ID]||"",contentTypeHeader:f[Up.CONTENT_TYPE]||void 0,contentLengthHeader:f[Up.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof Bo?d:Pt(U4t)}return xSe.postProcess(o,t,u,n),u}a(urn,"sendPostRequest");var Xje={};Ri(Xje,{createDiscoveredInstance:()=>MBt});p();p();p();function drn(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(drn,"isOpenIdConfigResponse");p();function frn(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(frn,"isCloudInstanceDiscoveryResponse");p();function prn(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(prn,"isCloudInstanceDiscoveryErrorResponse");p();var kSe=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=R7.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await Ws(this.getRegionFromIMDS.bind(this),TBt,this.logger,this.performanceClient,this.correlationId)(g5t,o);if(s.status===Eje&&(n=s.body,r.region_source=R7.IMDS),s.status===_je){let c=await Ws(this.getCurrentVersion.bind(this),irn,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=R7.FAILED_AUTO_DETECTION,null;let l=await Ws(this.getRegionFromIMDS.bind(this),TBt,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===Eje&&(n=l.body,r.region_source=R7.IMDS)}}catch{return r.region_source=R7.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=R7.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${yje}?api-version=${e}&format=text`,r,A5t)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${yje}?format=json`,e);return r.status===_je&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};kSe.IMDS_OPTIONS={headers:{Metadata:"true"}};var uk=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 kSe(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(mje))return Ex.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case d5t:return Ex.Adfs;case f5t:return Ex.Dsts}return Ex.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new bs(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw Pt(lk)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw Pt(lk)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw Pt(lk)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Pt(X4t);return this.replacePath(this.metadata.end_session_endpoint)}else throw Pt(lk)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw Pt(lk)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw Pt(lk)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Ex.Default&&this.protocolMode!==Gy.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new bs(this.metadata.canonical_authority).getUrlComponents(),s=o.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((l,u)=>{let d=s[u];if(u===0&&this.canReplaceTenant(o)){let f=new bs(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];d!==f&&(this.logger.verbose(`Replacing tenant domain name '${d}' with id '${f}'`,this.correlationId),d=f)}l!==d&&(r=r.replace(`/${d}/`,`/${l}/`))}),this.replaceTenant(r)}get defaultOpenIdConfigurationEndpoint(){let e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Ex.Adfs||this.protocolMode===Gy.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 Ws(this.updateCloudDiscoveryMetadata.bind(this),ern,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await Ws(this.updateEndpointMetadata.bind(this),rrn,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:Gje(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==Hy.CACHE&&n?.source!==Hy.CACHE&&(e.expiresAt=Gje(),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===Hy.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await Ws(this.updateMetadataWithRegionalInformation.bind(this),SBt,this.logger,this.performanceClient,this.correlationId)(r.metadata);ece(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await Ws(this.getEndpointMetadataFromNetwork.bind(this),trn,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await Ws(this.updateMetadataWithRegionalInformation.bind(this),SBt,this.logger,this.performanceClient,this.correlationId)(n)),ece(e,n,!0),Hy.NETWORK;throw Pt(Q4t,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),ece(e,r,!1),{source:Hy.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 ece(e,n,!1),{source:Hy.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=$je(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:Hy.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new bs(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw gl(O4t)}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 drn(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 mBt?mBt[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==y5t)return this.regionDiscoveryMetadata.region_outcome=tSe.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await Ws(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),nrn,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=tSe.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=tSe.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await Ws(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Xtn,this.logger,this.performanceClient,this.correlationId)();if(n)return TSe(e,n,!0),Hy.NETWORK;throw gl(B4t)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||K1e}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||K1e}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||K1e}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),TSe(e,r,!1),Hy.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=Btn(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),TSe(e,n,!1),Hy.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=$je(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),Hy.CACHE):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Ex.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=vSe(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata.",""),r)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata.",this.correlationId),r;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.",this.correlationId)}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.",this.correlationId),gl(Nje)}}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=`${p5t}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(frn(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(prn(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===v5t)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=vSe(c,this.hostnameAndPort)}catch(o){if(o instanceof Bo)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. +${n}`),this.errors=e,this.name=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. Error: '${o.errorCode}' Error Description: '${o.errorMessage}'`,this.correlationId);else{let s=o;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata. Error: '${s.name}' -Error Description: '${s.message}'`,this.correlationId)}return null}return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),this.logger.verbose("Creating custom Authority for custom domain scenario.",this.correlationId),n=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),n}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(r=>r&&bs.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==JL.None){let o=r.tenant?r.tenant:Y1e;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return u5t;if(this.discoveryComplete())return this.metadata.preferred_cache;throw Pt(lk)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return ABt.has(e)}static isPublicCloudAuthority(e){return _5t.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new bs(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${E5t}`);let l=bs.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:c}).urlString;return n?`${l}?${n}`:l}static replaceWithRegionalInformation(e,r){let n={...e};return n.authorization_endpoint=t.buildRegionalAuthorityString(n.authorization_endpoint,r),n.token_endpoint=t.buildRegionalAuthorityString(n.token_endpoint,r),n.end_session_endpoint&&(n.end_session_endpoint=t.buildRegionalAuthorityString(n.end_session_endpoint,r)),n}static transformCIAMAuthority(e){let r=e,o=new bs(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(mje)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${h5t}`}return r}};uk.reservedTenantDomains=new Set(["{tenant}","{tenantid}",ak.COMMON,ak.CONSUMERS,ak.ORGANIZATIONS]);function hrn(t){let n=new bs(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case ak.COMMON:case ak.ORGANIZATIONS:case ak.CONSUMERS:return;default:return n}}a(hrn,"getTenantFromAuthorityString");function Zje(t){return t.endsWith(Fae)?t:`${t}${Fae}`}a(Zje,"formatAuthorityUri");function NBt(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw gl(Nje)}return{canonicalAuthority:t.authority?Zje(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(NBt,"buildStaticAuthorityOptions");async function MBt(t,e,r,n,o,s,c){let l=uk.transformCIAMAuthority(Zje(t)),u=new uk(l,e,r,n,o,s,c);try{return await Ws(u.resolveEndpointsAsync.bind(u),Ztn,o,c,s)(),u}catch{throw Pt(lk)}}a(MBt,"createDiscoveredInstance");var DSe=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=XL(e),this.logger=new Km(this.config.loggerOptions,D7,NM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async acquireToken(e,r,n){if(!e.code)throw Pt(V4t);n&&n.cloud_instance_host_name&&await Ws(this.updateTokenEndpointAuthority.bind(this),Jtn,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=lS(),s=await Ws(this.executeTokenRequest.bind(this),Ytn,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[Up.X_MS_REQUEST_ID],l=new qp(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),Ws(l.handleServerTokenResponse.bind(l),Wje,this.logger,this.performanceClient,e.correlationId)(s.body,this.authority,o,e,r,n,void 0,void 0,void 0,c)}getLogoutUri(e){if(!e)throw gl(N4t);let r=this.createLogoutUrlQueryString(e);return bs.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=RSe(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=bs.appendQueryString(e.tokenEndpoint,o),c=await Ws(this.createTokenRequestBody.bind(this),Ktn,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=Jae(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${qae}${f.utid}`,type:v_.HOME_ACCOUNT_ID}}catch(f){this.logger.verbose(`Could not parse client info for CCS Header: '${f}'`,r.correlationId)}let u=wSe(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=rce(this.config.authOptions.clientId,r);return Ws(PSe,Gtn,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(Jz(r,e.embeddedClientId||e.extraParameters?.[kM]||this.config.authOptions.clientId),this.includeRedirectUri)Zz(r,e.redirectUri);else if(!e.redirectUri)throw gl(w4t);if(Kz(r,e.scopes,!0,this.oidcDefaultScopes),ESe(r,e.resource),lBt(r,e.code),aSe(r,this.config.libraryInfo),cSe(r,this.config.telemetry.application),ySe(r),this.serverTelemetryManager&&!jje(this.config)&&ASe(r,this.serverTelemetryManager),e.codeVerifier&&dBt(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&uSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;dSe(r,await C_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),fSe(r,o.assertionType)}if(pSe(r,Z1e.AUTHORIZATION_CODE_GRANT),tY(r),e.authenticationScheme===uf.POP){let o=new M7(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await Ws(o.generateCnf.bind(o),tce,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,mSe(r,s)}else if(e.authenticationScheme===uf.SSH)if(e.sshJwk)gSe(r,e.sshJwk);else throw gl(nSe);(!au.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Xz(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=Jae(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${qae}${o.utid}`,type:v_.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 v_.HOME_ACCOUNT_ID:try{let o=MM(n.credential);zL(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case v_.UPN:k7(r,n.credential);break}return e.embeddedClientId&&KL(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&YL(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[Rje])&&YL(r,{[Rje]:"1"}),Yz(r,e.correlationId,this.performanceClient),DM(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&iBt(r,e.postLogoutRedirectUri),e.correlationId&&eY(r,e.correlationId),e.idTokenHint&&oBt(r,e.idTokenHint),e.state&&lSe(r,e.state),e.logoutHint&&pBt(r,e.logoutHint),e.extraQueryParameters&&YL(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&hSe(r),DM(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await MBt(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var cSo=300,sY=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=XL(e),this.logger=new Km(this.config.loggerOptions,D7,NM),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=lS(),o=await Ws(this.executeTokenRequest.bind(this),$tn,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[Up.X_MS_REQUEST_ID],c=new qp(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),Ws(c.handleServerTokenResponse.bind(c),Wje,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,n,e,r,void 0,void 0,!0,e.forceCache,s)}async acquireTokenByRefreshToken(e,r){if(!e)throw gl(D4t);if(!e.account)throw Pt(oSe);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Ws(this.acquireTokenWithCachedRefreshToken.bind(this),Vje,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof uS&&o.errorCode===zje,c=o instanceof __&&o.errorCode===U5t&&o.subError===Q5t;if(s||c)return Ws(this.acquireTokenWithCachedRefreshToken.bind(this),Vje,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return Ws(this.acquireTokenWithCachedRefreshToken.bind(this),Vje,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=srn(this.cacheManager.getRefreshToken.bind(this.cacheManager),orn,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw Jje(zje);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||cSo;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),Xae(o.expiresOn,c))throw Jje(IBt)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||uf.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:v_.HOME_ACCOUNT_ID}};try{return await Ws(this.acquireToken.bind(this),Vtn,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof uS&&c.subError===ISe){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=RSe(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=bs.appendQueryString(r.tokenEndpoint,n),s=await Ws(this.createTokenRequestBody.bind(this),Wtn,this.logger,this.performanceClient,e.correlationId)(e),c=wSe(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=rce(this.config.authOptions.clientId,e);return Ws(PSe,Htn,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(Jz(r,e.embeddedClientId||e.extraParameters?.[kM]||this.config.authOptions.clientId),e.redirectUri&&Zz(r,e.redirectUri),Kz(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),pSe(r,Z1e.REFRESH_TOKEN_GRANT),tY(r),aSe(r,this.config.libraryInfo),cSe(r,this.config.telemetry.application),ySe(r),this.serverTelemetryManager&&!jje(this.config)&&ASe(r,this.serverTelemetryManager),uBt(r,e.refreshToken),this.config.clientCredentials.clientSecret&&uSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;dSe(r,await C_(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),fSe(r,n.assertionType)}if(e.authenticationScheme===uf.POP){let n=new M7(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Ws(n.generateCnf.bind(n),tce,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,mSe(r,o)}else if(e.authenticationScheme===uf.SSH)if(e.sshJwk)gSe(r,e.sshJwk);else throw gl(nSe);if((!au.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Xz(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case v_.HOME_ACCOUNT_ID:try{let n=MM(e.ccsCredential.credential);zL(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case v_.UPN:k7(r,e.ccsCredential.credential);break}return e.embeddedClientId&&KL(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&YL(r,{...e.extraParameters}),Yz(r,e.correlationId,this.performanceClient),DM(r)}};p();var NSe=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=XL(e),this.logger=new Km(this.config.loggerOptions,D7,NM),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=ck.NOT_APPLICABLE;if(e.forceRefresh||!au.isEmptyObj(e.claims))throw this.setCacheOutcome(ck.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Pt(zae);if(!e.account)throw Pt(oSe);let n=e.account.tenantId||hrn(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(_Bt(s.cachedAt)||Xae(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(ck.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Pt(zae);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(ck.NO_CACHED_ACCESS_TOKEN,e.correlationId),Pt(zae)}else s.refreshOn&&Xae(s.refreshOn,0)&&(r=ck.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(ck.NO_CACHED_ACCESS_TOKEN,e.correlationId),Pt(zae);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 Ws(this.generateResultFromCacheRecord.bind(this),ztn,this.logger,this.performanceClient,e.correlationId)(l,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==ck.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=ZL(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw Pt(iSe);_Se(o,r.maxAge)}return qp.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var MSe={};Ri(MSe,{getAuthorizationCodePayload:()=>dSo,getAuthorizeUrl:()=>uSo,getStandardAuthorizeRequestParameters:()=>lSo,validateAuthorizationResponse:()=>mrn});p();function lSo(t,e,r,n){let o=e.correlationId,s=new Map;Jz(s,e.embeddedClientId||e.extraQueryParameters?.[kM]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(Kz(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),ESe(s,e.resource),Zz(s,e.redirectUri),eY(s,o),nBt(s,e.responseMode),tY(s),fBt(s),e.prompt&&(aBt(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(sBt(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==J1e.SELECT_ACCOUNT)if(e.sid&&e.prompt===J1e.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),Fje(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=pSo(e.account),u=hSo(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),Yae(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=MM(e.account.homeAccountId);zL(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===J1e.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),Fje(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=MM(e.account.homeAccountId);zL(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),Yae(s,e.loginHint),k7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),Yae(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=MM(e.account.homeAccountId);zL(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),Yae(s,e.loginHint),k7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&cBt(s,e.nonce),e.state&&lSe(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&Xz(s,e.claims,t.clientCapabilities),e.embeddedClientId&&KL(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(Gae))&&hSe(s),s}a(lSo,"getStandardAuthorizeRequestParameters");function uSo(t,e){let r=DM(e);return bs.appendQueryString(t.authorizationEndpoint,r)}a(uSo,"getAuthorizeUrl");function dSo(t,e){if(mrn(t,e),!t.code)throw Pt(Z4t);return t}a(dSo,"getAuthorizationCodePayload");function mrn(t,e){if(!t.state||!e)throw t.state?Pt(Bje,"Cached State"):Pt(Bje,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw Pt(zz,t.state)}try{n=decodeURIComponent(e)}catch{throw Pt(zz,t.state)}if(r!==n)throw Pt(j4t);if(t.error||t.error_description||t.suberror){let o=fSo(t);throw Kje(t.error,t.error_description,t.suberror)?new uS(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new __(t.error||"",t.error_description,t.suberror,o)}}a(mrn,"validateAuthorizationResponse");function fSo(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(fSo,"parseServerErrorNo");function pSo(t){return t.idTokenClaims?.sid||null}a(pSo,"extractAccountSid");function hSo(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(hSo,"extractLoginHint");p();function aY(t,e){if(t){if(e.resource&&(grn(e.extraParameters)||grn(e.extraQueryParameters)))throw Pt(rBt);if(!e.resource)throw Pt(tBt)}}a(aY,"enforceResourceParameter");function grn(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(grn,"containsResourceParam");var ice={};Ri(ice,{postRequestFailed:()=>gSo,unexpectedError:()=>mSo});p();var mSo="unexpected_error",gSo="post_request_failed";p();var Arn=",",yrn="|";function ASo(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(Arn),l.length<4)return e}else l=Array.from({length:4},()=>yrn);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&ySo({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(Arn)}a(ASo,"makeExtraSkuString");function ySo(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(yrn))}a(ySo,"setSku");var cY=class t{static{a(this,"ServerTelemetryManager")}constructor(e,r){this.cacheOutcome=ck.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=X1e+Gz+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${w7}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(w7),s=this.getRegionDiscoveryFields(),c=[e,s].join(w7);return[bje,c,o].join(Sje)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(w7),o=e.errors.slice(0,r).join(w7),s=e.errors.length,c=r=D5t&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Bo?e.subError?r.errors.push(e.subError):e.errorCode?r.errors.push(e.errorCode):r.errors.push(e.toString()):r.errors.push(e.toString()):r.errors.push(O5t),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r,this.correlationId)}incrementCacheHits(){let e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){let e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey,this.correlationId)||e}clearTelemetryCache(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.errors.length;if(r===n)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{let o={failedRequests:e.failedRequests.slice(r*2),errors:e.errors.slice(r),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let r,n=0,o=0,s=e.errors.length;for(r=0;rJSON.parse(l)),lastUpdatedAt:Date.now().toString()},c={};N7.toObject(c,s),r[n]=c}),r}static deserializeIdTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAccessTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,target:o.target,cachedAt:o.cached_at,expiresOn:o.expires_on,extendedExpiresOn:o.extended_expires_on,refreshOn:o.refresh_on,keyId:o.key_id,tokenType:o.token_type,userAssertionHash:o.userAssertionHash,resource:o.resource,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeRefreshTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,familyId:o.family_id,target:o.target,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAppMetadata(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n];r[n]={clientId:o.client_id,environment:o.environment,familyId:o.family_id}}),r}static deserializeAllCache(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}}};p();p();var Ern="system_assigned_managed_identity",ESo="managed_identity",BBt=`https://login.microsoftonline.com/${ESo}/`,yC={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},Bh={API_VERSION:"api-version",RESOURCE:"resource",SHA256_TOKEN_TO_REFRESH:"token_sha256_to_refresh",XMS_CC:"xms_cc"},zi={AZURE_POD_IDENTITY_AUTHORITY_HOST:"AZURE_POD_IDENTITY_AUTHORITY_HOST",DEFAULT_IDENTITY_CLIENT_ID:"DEFAULT_IDENTITY_CLIENT_ID",IDENTITY_ENDPOINT:"IDENTITY_ENDPOINT",IDENTITY_HEADER:"IDENTITY_HEADER",IDENTITY_SERVER_THUMBPRINT:"IDENTITY_SERVER_THUMBPRINT",IMDS_ENDPOINT:"IMDS_ENDPOINT",MSI_ENDPOINT:"MSI_ENDPOINT",MSI_SECRET:"MSI_SECRET"},io={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},ff={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"},Wf={GET:"GET",POST:"POST"},_rn="REGION_NAME",vrn="MSAL_FORCE_REGION",Crn=32,brn={SHA256:"sha256"},eHe={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},LBt={KEY_SEPARATOR:"-"},_x={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},pf={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByOBO:772,acquireTokenWithManagedIdentity:773,acquireTokenByCode:871,acquireTokenByRefreshToken:872},vx={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"},tHe={INTERVAL_MS:100,TIMEOUT_MS:5e3},Srn=4096;p();p();p();var oce=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,Wf.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,Wf.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:vSo(n),signal:s.signal};r===Wf.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 Wz(Qp.networkError,"Request timeout");let f=Wz(Qp.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw DBt(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:_So(u.headers),body:await u.json(),status:u.status}}catch(d){throw Wz(Qp.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function _So(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(_So,"getHeaderDict");function vSo(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(vSo,"getFetchHeaders");p();p();p();var rHe="invalid_file_extension",nHe="invalid_file_path",O7="invalid_managed_identity_id_type",iHe="invalid_secret",Trn="missing_client_id",Irn="network_unavailable",oHe="platform_not_supported",sHe="unable_to_create_azure_arc",aHe="unable_to_create_cloud_shell",cHe="unable_to_create_source",OSe="unable_to_read_secret_file",xrn="user_assigned_not_available_at_runtime",lHe="www_authenticate_header_missing",uHe="www_authenticate_header_unsupported_format",lY={[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 CSo={[rHe]:"The file path in the WWW-Authenticate header does not contain a .key file.",[nHe]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[O7]:"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.",[oHe]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[Trn]:"A ManagedIdentityId id was not provided.",[lY.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[lY.IDENTITY_ENDPOINT]:`The Managed Identity's '${zi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[lY.IMDS_ENDPOINT]:`The Managed Identity's '${zi.IMDS_ENDPOINT}' environment variable is malformed.`,[lY.MSI_ENDPOINT]:`The Managed Identity's '${zi.MSI_ENDPOINT}' environment variable is malformed.`,[Irn]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[sHe]:"Azure Arc Managed Identities can only be system assigned.",[aHe]:"Cloud Shell Managed Identities can only be system assigned.",[cHe]:"Unable to create a Managed Identity source based on environment variables.",[OSe]:"Unable to read the secret file.",[xrn]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[lHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[uHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},FBt=class t extends Bo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,CSo[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function jp(t){return new FBt(t)}a(jp,"createManagedIdentityError");var dHe=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 jp(O7);this.id=r,this.idType=ff.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw jp(O7);this.id=n,this.idType=ff.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw jp(O7);this.id=o,this.idType=ff.USER_ASSIGNED_OBJECT_ID}else this.id=Ern,this.idType=ff.SYSTEM_ASSIGNED}};p();var Lh={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."}},$y=class t extends Bo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(Lh.invalidLoopbackAddressType.code,`${Lh.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(Lh.unableToLoadRedirectUri.code,`${Lh.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(Lh.noAuthCodeInResponse.code,`${Lh.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(Lh.noLoopbackServerExists.code,`${Lh.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(Lh.loopbackServerAlreadyExists.code,`${Lh.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(Lh.loopbackServerTimeout.code,`${Lh.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(Lh.stateNotFoundError.code,Lh.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(Lh.thumbprintMissing.code,Lh.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(Lh.redirectUriNotSupported.code,Lh.redirectUriNotSupported.desc)}};var bSo={clientId:"",authority:er.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:JL.None,tenant:""},isMcp:!1},UBt={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:df.Info},SSo={loggerOptions:UBt,networkClient:new oce,disableInternalRetries:!1,protocolMode:Gy.AAD},TSo={application:{appName:"",appVersion:""}};function wrn({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...SSo,networkClient:new oce,loggerOptions:n?.loggerOptions||UBt,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw $y.createStateNotFoundError();return{auth:{...bSo,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...TSo,...o}}}a(wrn,"buildAppConfiguration");function Rrn({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new dHe(e),o=r?.loggerOptions||UBt,s;return r?.networkClient?s=r.networkClient:s=new oce,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(Rrn,"buildManagedIdentityConfiguration");p();p();jo();var sce=class{static{a(this,"GuidGenerator")}generateGuid(){return Gt()}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 dS=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 Prn=de(require("crypto"),1);var B7=class{static{a(this,"HashUtils")}sha256(e){return Prn.default.createHash(brn.SHA256).update(e).digest()}};var krn=de(require("crypto"),1);var fHe=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new B7}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%eHe.CV_CHARSET.length;for(;e.length<=Crn;){let o=krn.default.randomBytes(1)[0];if(o>=r)continue;let s=o%eHe.CV_CHARSET.length;e.push(eHe.CV_CHARSET[s])}let n=e.join("");return dS.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return dS.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};var OM=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new fHe,this.guidGenerator=new sce,this.hashUtils=new B7}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return dS.base64Encode(e)}base64Decode(e){return dS.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 dS.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};p();p();function Drn(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(LBt.KEY_SEPARATOR).toLowerCase()}a(Drn,"generateCredentialKey");function Nrn(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(LBt.KEY_SEPARATOR).toLowerCase()}a(Nrn,"generateAccountKey");var L7=class extends N7{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new Oh,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(iY.isAccountEntity(o))r.accounts[n]=o;else if(E_.isIdTokenEntity(o))r.idTokens[n]=o;else if(E_.isAccessTokenEntity(o))r.accessTokens[n]=o;else if(E_.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if(E_.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 Drn(e)}generateAccountKey(e){return Nrn(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(iY.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return E_.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return E_.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return E_.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return E_.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=E_.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&E_.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&E_.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&&E_.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 e3.deserializeAllCache(e3.deserializeJSONBlob(e))}static generateJsonCache(e){return x7.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 BSe={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},ace=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=x7.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=e3.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=L7.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new OM().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new cS(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 cS(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 cS(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:{...BSe.Account,...e.Account},IdToken:{...BSe.IdToken,...e.IdToken},AccessToken:{...BSe.AccessToken,...e.AccessToken},RefreshToken:{...BSe.RefreshToken,...e.RefreshToken},AppMetadata:{...BSe.AppMetadata,...e.AppMetadata}}}};p();var Asn=de(usn(),1);p();var dsn="missing_tenant_id_error",fsn="user_timeout_reached",psn="invalid_assertion",PLt="invalid_client_credential",hsn="device_code_polling_cancelled",msn="device_code_expired",gsn="device_code_unknown_error";var t3=class t{static{a(this,"ClientAssertion")}static fromAssertion(e){let r=new t;return r.jwt=e,r}static fromCertificate(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!1,n&&(o.publicCertificate=this.parseCertificate(n)),o}static fromCertificateWithSha256Thumbprint(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!0,n&&(o.publicCertificate=this.parseCertificate(n)),o}getJwt(e,r,n){if(this.privateKey&&this.thumbprint)return this.jwt&&!this.isExpired()&&r===this.issuer&&n===this.jwtAudience?this.jwt:this.createJwt(e,r,n);if(this.jwt)return this.jwt;throw Pt(psn)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=Vu.nowSeconds();this.expirationTime=o+600;let c={alg:this.useSha256?vx.PSS_256:vx.RSA_256},l=this.useSha256?vx.X5T_256:vx.X5T;Object.assign(c,{[l]:dS.base64EncodeUrl(this.thumbprint,er.EncodingTypes.HEX)}),this.publicCertificate&&Object.assign(c,{[vx.X5C]:this.publicCertificate});let u={[vx.AUDIENCE]:this.jwtAudience,[vx.EXPIRATION_TIME]:this.expirationTime,[vx.ISSUER]:this.issuer,[vx.SUBJECT]:this.issuer,[vx.NOT_BEFORE]:o,[vx.JWT_ID]:e.createNewGuid()};return this.jwt=Asn.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&sn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&sn.addCcsUpn(r,e.username),fA.mapToQueryString(r)}};p();function ysn(t,e,r,n){let o=MSe.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return sn.addLibraryInfo(o,{sku:_x.MSAL_SKU,version:fS,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==Gy.OIDC&&sn.addApplicationTelemetry(o,t.telemetry.application),sn.addResponseType(o,er.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&sn.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),sn.addExtraParameters(o,r.extraQueryParameters||{}),MSe.getAuthorizeUrl(e,o)}a(ysn,"getAuthCodeRequestUrl");var yce=class{static{a(this,"ClientApplication")}constructor(e){this.config=wrn(e),this.cryptoProvider=new OM,this.logger=new Km(this.config.system.loggerOptions,Ace,fS),this.storage=new L7(this.logger,this.config.auth.clientId,this.cryptoProvider,NBt(this.config.auth)),this.tokenCache=new ace(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 ysn(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(pf.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 DSe(c,new Oh);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,pf.acquireTokenByCode,r)}catch(s){throw s instanceof Bo&&s.setCorrelationId(n.correlationId),o.cacheFailedRequest(s),s}}async acquireTokenByRefreshToken(e){this.logger.info("acquireTokenByRefreshToken called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),authenticationScheme:er.AuthenticationScheme.BEARER},n=this.initializeServerTelemetryManager(pf.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 sY(s,new Oh);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,pf.acquireTokenByRefreshToken)}catch(o){throw o instanceof Bo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenSilent(e){let r={...e,...await this.initializeBaseRequest(e),forceRefresh:e.forceRefresh||!1},n=this.initializeServerTelemetryManager(pf.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 NSe(s,new Oh);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 P7&&l.errorCode===Qp.tokenRefreshRequired)return new sY(s,new Oh).acquireTokenByRefreshToken(r,pf.acquireTokenSilent);throw l}}catch(o){throw o instanceof Bo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireCachedTokenSilent(e,r,n){let[o,s]=await r.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...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 sY(n,new Oh);try{await c.acquireTokenByRefreshToken(e,pf.acquireTokenSilent)}catch{}}return o}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)},n=this.initializeServerTelemetryManager(pf.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 jHe(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Bo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw $y.createStateNotFoundError();if(e!==r)throw Pt(Qp.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:_x.MSAL_SKU,version:fS,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=t3.fromAssertion(await C_(this.developerProvidedClientAssertion,this.config.auth.clientId,e.tokenEndpoint))),this.clientAssertion&&{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:_x.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 cY(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=uk.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 Xje.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new Oh)}clearCache(){this.storage.clear()}};p();var Esn=de(require("http"),1);var HHe=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw $y.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=Esn.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($y.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=fA.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 $y.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),$y.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${_x.HTTP_PROTOCOL}${_x.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 GHe=class extends FM{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=Vu.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new qp(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,pf.acquireTokenByDeviceCode)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),n=bs.appendQueryString(this.authority.deviceCodeEndpoint,r),o=this.createQueryString(e),s=this.createTokenRequestHeaders(),c={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return this.executePostRequestToDeviceCodeEndpoint(n,o,s,c,e.correlationId)}createExtraQueryParameters(e){let r=new Map;return e.extraQueryParameters&&sn.addExtraParameters(r,e.extraQueryParameters),fA.mapToQueryString(r)}async executePostRequestToDeviceCodeEndpoint(e,r,n,o,s){let{body:{user_code:c,device_code:l,verification_uri:u,expires_in:d,interval:f,message:h}}=await this.sendPostRequest(o,e,{body:r,headers:n},s);return{userCode:c,deviceCode:l,verificationUri:u,expiresIn:d,interval:f,message:h}}createQueryString(e){let r=new Map;return sn.addScopes(r,e.scopes),sn.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&sn.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),fA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),Pt(hsn);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),Pt(fsn);if(Vu.nowSeconds()>e)throw r&&this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${r}`,""),this.logger.error(`Device code expired. Expiration time of device code was ${e}`,""),Pt(msn);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=bs.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?Vu.nowSeconds()+e.timeout:void 0,u=Vu.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 Vu.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),Wz(ice.postRequestFailed,h.body.error);else return this.logger.verbose("Authorization completed successfully. Polling stopped.",e.correlationId),h.body}throw this.logger.error("Polling stopped for unknown reasons.",e.correlationId),Pt(gsn)}createTokenRequestBody(e,r){let n=new Map;sn.addScopes(n,e.scopes),sn.addClientId(n,this.config.authOptions.clientId),sn.addGrantType(n,er.GrantType.DEVICE_CODE_GRANT),sn.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return sn.addCorrelationId(n,o),sn.addClientInfo(n),sn.addLibraryInfo(n,this.config.libraryInfo),sn.addApplicationTelemetry(n,this.config.telemetry.application),sn.addThrottling(n),this.serverTelemetryManager&&sn.addServerTelemetry(n,this.serverTelemetryManager),(!au.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sn.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),fA.mapToQueryString(n)}};var Ece=class extends yce{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=cY.makeExtraSkuString({libraryName:_x.MSAL_SKU,libraryVersion:fS})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),aY(this.config.auth.isMcp,e);let r=Object.assign(e,await this.initializeBaseRequest(e)),n=this.initializeServerTelemetryManager(pf.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 GHe(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Bo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),aY(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,[Vz.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 $y.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new HHe,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 __(m.error,m.error_description,m.suberror);if(!m.code)throw $y.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),aY(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,[Vz.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 $y.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return aY(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return aY(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(tHe.TIMEOUT_MS/tHe.INTERVAL_MS1)throw Pt(Qp.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=Vu.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=bs.appendQueryString(r.tokenEndpoint,u),f=await this.createTokenRequestBody(e),h=this.createTokenRequestHeaders(),m={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};this.logger.info("Sending token request to endpoint: "+r.tokenEndpoint,e.correlationId),s=Vu.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new qp(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,pf.acquireTokenByClientCredential)}async createTokenRequestBody(e){let r=new Map;sn.addClientId(r,this.config.authOptions.clientId),sn.addScopes(r,e.scopes,!1),sn.addGrantType(r,er.GrantType.CLIENT_CREDENTIALS_GRANT),sn.addLibraryInfo(r,this.config.libraryInfo),sn.addApplicationTelemetry(r,this.config.telemetry.application),sn.addThrottling(r),this.serverTelemetryManager&&sn.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();sn.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&sn.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(sn.addClientAssertion(r,await C_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),sn.addClientAssertionType(r,o.assertionType)),(!au.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),fA.mapToQueryString(r)}};p();var $He=class extends FM{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new Mh(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(Vu.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),Pt(Qp.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),Pt(Qp.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=Qje.extractTokenClaims(n.secret,dS.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(),qp.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:Mh.createSearchScopes(this.scopeSet.asArray()),tokenType:n,keyId:r.sshKid,userAssertionHash:this.userAssertionHash},c=this.cacheManager.getAccessTokensByFilter(s,r.correlationId),l=c.length;if(l<1)return null;if(l>1)throw Pt(Qp.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=bs.appendQueryString(r.tokenEndpoint,o),c=await this.createTokenRequestBody(e),l=this.createTokenRequestHeaders(),u={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},d=Vu.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new qp(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,pf.acquireTokenByOBO,void 0,n)}async createTokenRequestBody(e){let r=new Map;sn.addClientId(r,this.config.authOptions.clientId),sn.addScopes(r,e.scopes),sn.addGrantType(r,er.GrantType.JWT_BEARER),sn.addClientInfo(r),sn.addLibraryInfo(r,this.config.libraryInfo),sn.addApplicationTelemetry(r,this.config.telemetry.application),sn.addThrottling(r),this.serverTelemetryManager&&sn.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();sn.addCorrelationId(r,n),sn.addRequestTokenUse(r,Vz.ON_BEHALF_OF),sn.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&sn.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(sn.addClientAssertion(r,await C_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),sn.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),fA.mapToQueryString(r)}};var vce=class extends yce{static{a(this,"ConfidentialClientApplication")}constructor(e){super(e);let r=!!this.config.auth.clientSecret,n=!!this.config.auth.clientAssertion,o=(!!this.config.auth.clientCertificate?.thumbprint||!!this.config.auth.clientCertificate?.thumbprintSha256)&&!!this.config.auth.clientCertificate?.privateKey;if(!this.appTokenProvider){if(r&&n||n&&o||r&&o)throw Pt(PLt);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?t3.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):t3.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw Pt(PLt);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 C_(e.clientAssertion,this.config.auth.clientId),assertionType:_x.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 bs(s.authority).getUrlComponents().PathSegments[0];if(Object.values(er.AADAuthority).includes(l))throw Pt(dsn);let u=process.env[vrn],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[_rn]},h=this.initializeServerTelemetryManager(pf.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 _ce(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof Bo&&m.setCorrelationId(s.correlationId),h.cacheFailedRequest(m),m}}async acquireTokenOnBehalfOf(e){this.logger.info("acquireTokenOnBehalfOf called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)};try{let n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),o=await this.buildOauthClientConfiguration(n,r.correlationId,"",void 0),s=new $He(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof Bo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function _sn(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(_sn,"isIso8601");p();var VHe=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===Wf.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(Wf.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(Wf.POST,e,r)}};var fY={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"},S_=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&&(_sn(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-Vu.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[Bh.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[Bh.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 VHe(this.networkClient,s.retryPolicy,this.logger),d=Vu.nowSeconds(),f;try{s.httpMethod===Wf.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof Bo?g:Pt(Qp.networkError)}let h=new qp(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new Oh,null,null),m=await this.getServerTokenResponseAsync(f,u,s,l);return h.validateTokenResponse(m,m.correlation_id||"",o),h.handleServerTokenResponse(m,n,d,e,pf.acquireTokenWithManagedIdentity)}getManagedIdentityUserAssignedIdQueryParameterKey(e,r,n){switch(e){case ff.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?fY.MANAGED_IDENTITY_CLIENT_ID_2017:fY.MANAGED_IDENTITY_CLIENT_ID;case ff.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?fY.MANAGED_IDENTITY_RESOURCE_ID_IMDS:fY.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case ff.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),fY.MANAGED_IDENTITY_OBJECT_ID;default:throw jp(O7)}}};S_.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new bs(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),jp(lY[t])}};p();p();p();var WHe=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 jPo=3,HPo=1e3,GPo=[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],zHe=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new WHe}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return HPo}async pauseForRetry(e,r,n,o){if(GPo.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var EC=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 zHe}computeUri(){let e=new Map;this.queryParameters&&sn.addExtraParameters(e,this.queryParameters);let r=fA.mapToQueryString(e);return bs.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&sn.addExtraParameters(e,this.bodyParameters),fA.mapToQueryString(e)}};var $Po="2019-08-01",VSe=class t extends S_{static{a(this,"AppService")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[zi.IDENTITY_ENDPOINT],r=process.env[zi.IDENTITY_HEADER];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${io.APP_SERVICE} managed identity is unavailable because one or both of the '${zi.IDENTITY_HEADER}' and '${zi.IDENTITY_ENDPOINT}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,c,io.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${io.APP_SERVICE} managed identity. Endpoint URI: ${u}. Creating ${io.APP_SERVICE} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new EC(Wf.GET,this.identityEndpoint);return n.headers[yC.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[Bh.API_VERSION]=$Po,n.queryParameters[Bh.RESOURCE]=e,r.idType!==ff.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var r3=require("fs"),Ssn=de(require("path"),1);var VPo="2019-11-01",vsn="http://127.0.0.1:40342/metadata/identity/oauth2/token",Csn="N/A: himds executable exists",bsn={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},WPo={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},WSe=class t extends S_{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=WPo[process.platform];try{(0,r3.accessSync)(n,r3.constants.F_OK|r3.constants.R_OK),e=vsn,r=Csn}catch{}}return[e,r]}static tryCreate(e,r,n,o,s,c){let[l,u]=t.getEnvironmentVariables();if(!l||!u)return e.info(`[Managed Identity] ${io.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${zi.IDENTITY_ENDPOINT}' and '${zi.IMDS_ENDPOINT}' are not defined. ${io.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===Csn)e.info(`[Managed Identity] ${io.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${io.AZURE_ARC} endpoint: ${vsn}. Creating ${io.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,l,io.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(zi.IMDS_ENDPOINT,u,io.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${io.AZURE_ARC} managed identity. Endpoint URI: ${d}. Creating ${io.AZURE_ARC} managed identity.`,"")}if(c.idType!==ff.SYSTEM_ASSIGNED)throw jp(sHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new EC(Wf.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[yC.METADATA_HEADER_NAME]="true",r.queryParameters[Bh.API_VERSION]=VPo,r.queryParameters[Bh.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 jp(lHe);if(!c.includes("Basic realm="))throw jp(uHe);let l=c.split("Basic realm=")[1];if(!bsn.hasOwnProperty(process.platform))throw jp(oHe);let u=bsn[process.platform],d=Ssn.default.basename(l);if(!d.endsWith(".key"))throw jp(rHe);if(u+d!==l)throw jp(nHe);let f;try{f=await(0,r3.statSync)(l).size}catch{throw jp(OSe)}if(f>Srn)throw jp(iHe);let h;try{h=(0,r3.readFileSync)(l,er.EncodingTypes.UTF8)}catch{throw jp(OSe)}let m=`Basic ${h}`;this.logger.info("[Managed Identity] Adding authorization header to the request.",""),n.headers[yC.AUTHORIZATION_HEADER_NAME]=m;try{s=await r.sendGetRequestAsync(n.computeUri(),o)}catch(g){throw g instanceof Bo?g:Pt(Qp.networkError)}}return this.getServerTokenResponse(s||e)}};p();var zSe=class t extends S_{static{a(this,"CloudShell")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.msiEndpoint=c}static getEnvironmentVariables(){return[process.env[zi.MSI_ENDPOINT]]}static tryCreate(e,r,n,o,s,c){let[l]=t.getEnvironmentVariables();if(!l)return e.info(`[Managed Identity] ${io.CLOUD_SHELL} managed identity is unavailable because the '${zi.MSI_ENDPOINT} environment variable is not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(zi.MSI_ENDPOINT,l,io.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${io.CLOUD_SHELL} managed identity. Endpoint URI: ${u}. Creating ${io.CLOUD_SHELL} managed identity.`,""),c.idType!==ff.SYSTEM_ASSIGNED)throw jp(aHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new EC(Wf.POST,this.msiEndpoint);return r.headers[yC.METADATA_HEADER_NAME]="true",r.bodyParameters[Bh.RESOURCE]=e,r}};p();p();p();var YHe=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 zPo=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_GONE,er.HTTP_TOO_MANY_REQUESTS],YPo=3,KPo=7,JPo=1e3,ZPo=4e3,XPo=2e3,eko=10*1e3,KHe=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new YHe(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return JPo}static get MAX_EXPONENTIAL_BACKOFF_MS(){return ZPo}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return XPo}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return eko}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===er.HTTP_GONE?KPo:YPo),(zPo.includes(e)||e>=er.HTTP_SERVER_ERROR_RANGE_START&&e<=er.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var Tsn="/metadata/identity/oauth2/token",tko=`http://169.254.169.254${Tsn}`,rko="2018-02-01",JHe=class t extends S_{static{a(this,"Imds")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static tryCreate(e,r,n,o,s){let c;return process.env[zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]?(e.info(`[Managed Identity] Environment variable ${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} for ${io.IMDS} returned endpoint: ${process.env[zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}`,""),c=t.getValidatedEnvVariableUrlString(zi.AZURE_POD_IDENTITY_AUTHORITY_HOST,`${process.env[zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}${Tsn}`,io.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${io.IMDS}, using the default endpoint.`,""),c=tko),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new EC(Wf.GET,this.identityEndpoint);return n.headers[yC.METADATA_HEADER_NAME]="true",n.queryParameters[Bh.API_VERSION]=rko,n.queryParameters[Bh.RESOURCE]=e,r.idType!==ff.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new KHe,n}};p();var nko="2019-07-01-preview",YSe=class t extends S_{static{a(this,"ServiceFabric")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[zi.IDENTITY_ENDPOINT],r=process.env[zi.IDENTITY_HEADER],n=process.env[zi.IDENTITY_SERVER_THUMBPRINT];return[e,r,n]}static tryCreate(e,r,n,o,s,c){let[l,u,d]=t.getEnvironmentVariables();if(!l||!u||!d)return e.info(`[Managed Identity] ${io.SERVICE_FABRIC} managed identity is unavailable because one or all of the '${zi.IDENTITY_HEADER}', '${zi.IDENTITY_ENDPOINT}' or '${zi.IDENTITY_SERVER_THUMBPRINT}' environment variables are not defined.`,""),null;let f=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,l,io.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${io.SERVICE_FABRIC} managed identity. Endpoint URI: ${f}. Creating ${io.SERVICE_FABRIC} managed identity.`,""),c.idType!==ff.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${io.SERVICE_FABRIC} user assigned managed identity is configured in the cluster, not during runtime. See also: https://learn.microsoft.com/en-us/azure/service-fabric/configure-existing-cluster-enable-managed-identity-token-service.`,""),new t(e,r,n,o,s,l,u)}createRequest(e,r){let n=new EC(Wf.GET,this.identityEndpoint);return n.headers[yC.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[Bh.API_VERSION]=nko,n.queryParameters[Bh.RESOURCE]=e,r.idType!==ff.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var iko="2017-09-01",oko=`Only client id is supported for user-assigned managed identity in ${io.MACHINE_LEARNING}.`,KSe=class t extends S_{static{a(this,"MachineLearning")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.msiEndpoint=c,this.secret=l}static getEnvironmentVariables(){let e=process.env[zi.MSI_ENDPOINT],r=process.env[zi.MSI_SECRET];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${io.MACHINE_LEARNING} managed identity is unavailable because one or both of the '${zi.MSI_ENDPOINT}' and '${zi.MSI_SECRET}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(zi.MSI_ENDPOINT,c,io.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${io.MACHINE_LEARNING} managed identity. Endpoint URI: ${u}. Creating ${io.MACHINE_LEARNING} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new EC(Wf.GET,this.msiEndpoint);if(n.headers[yC.METADATA_HEADER_NAME]="true",n.headers[yC.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[Bh.API_VERSION]=iko,n.queryParameters[Bh.RESOURCE]=e,r.idType===ff.SYSTEM_ASSIGNED)n.queryParameters[fY.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[zi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===ff.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(oko);return n}};var JSe=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(YSe.getEnvironmentVariables())?io.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(VSe.getEnvironmentVariables())?io.APP_SERVICE:this.allEnvironmentVariablesAreDefined(KSe.getEnvironmentVariables())?io.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(zSe.getEnvironmentVariables())?io.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(WSe.getEnvironmentVariables())?io.AZURE_ARC:io.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=YSe.tryCreate(e,r,n,o,s,c)||VSe.tryCreate(e,r,n,o,s)||KSe.tryCreate(e,r,n,o,s)||zSe.tryCreate(e,r,n,o,s,c)||WSe.tryCreate(e,r,n,o,s,c)||JHe.tryCreate(e,r,n,o,s);if(!l)throw jp(cHe);return l}};var sko=[io.SERVICE_FABRIC],Cce=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=Rrn(e||{}),this.logger=new Km(this.config.system.loggerOptions,Ace,fS);let r={canonicalAuthority:er.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new L7(this.logger,this.config.managedIdentityId.id,Kae,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new OM;let n={protocolMode:Gy.AAD,knownAuthorities:[BBt],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new uk(BBt,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new Oh,!0),this.fakeClientCredentialClient=new _ce({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new JSe(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new B7}async acquireToken(e){if(!e.resource)throw gl(Wae.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&&sko.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 JSe.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var ZHe=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=>iY.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 ako=er.PromptValue,cko=er.ResponseMode;p();p();p();p();p();function ZSe(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(ZSe,"getRandomIntegerInclusive");function XSe(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+ZSe(0,n/2)}}a(XSe,"calculateRetryDelay");p();function bce(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(bce,"isObject");p();function pY(t){if(bce(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(pY,"isError");p();p();var Isn=require("node:crypto");var kLt,lko=typeof((kLt=globalThis?.crypto)===null||kLt===void 0?void 0:kLt.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):Isn.randomUUID;function Sce(){return lko()}a(Sce,"randomUUID");p();var DLt,NLt,MLt,OLt,xsn=typeof window<"u"&&typeof window.document<"u",wsn=typeof self=="object"&&typeof self?.importScripts=="function"&&(((DLt=self.constructor)===null||DLt===void 0?void 0:DLt.name)==="DedicatedWorkerGlobalScope"||((NLt=self.constructor)===null||NLt===void 0?void 0:NLt.name)==="ServiceWorkerGlobalScope"||((MLt=self.constructor)===null||MLt===void 0?void 0:MLt.name)==="SharedWorkerGlobalScope"),Rsn=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Psn=typeof Bun<"u"&&typeof Bun.version<"u",q7=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((OLt=globalThis.process.versions)===null||OLt===void 0)&&OLt.node);var ksn=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function _C(t,e){return Buffer.from(t,e)}a(_C,"stringToUint8Array");p();var BLt="REDACTED",uko=["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"],dko=["api-version"],pk=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=uko.concat(e),r=dko.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)||bce(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,BLt);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]=BLt;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]=BLt;return r}};p();p();p();p();var hY=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function FLt(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new hY(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(FLt,"createAbortablePromise");p();var gko="The delay was aborted.";function ULt(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return FLt(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??gko})}a(ULt,"delay");p();function Tce(t){if(pY(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(Tce,"getErrorMessage");p();function Dsn(t,e){return XSe(t,e)}a(Dsn,"calculateRetryDelay");function XHe(t){return pY(t)}a(XHe,"isError");var eGe=q7,Ice=q7;p();var eTe=uo("IdentityUtils"),Nsn="1.0";function mY(t,e,r){let n=a(o=>(eTe.getToken.info(o),new yx({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(mY,"ensureValidMsalToken");function QLt(t){let e=t?.authorityHost;return!e&&Ice&&(e=process.env.AZURE_AUTHORITY_HOST),e??G1e}a(QLt,"getAuthorityHost");function qLt(t,e){return e||(e=G1e),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(qLt,"getAuthority");function Msn(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(Msn,"getKnownAuthorities");var tGe=a((t,e=eGe?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case pS.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case pS.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case pS.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case pS.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function rGe(t){switch(t){case"error":return pS.LogLevel.Error;case"info":return pS.LogLevel.Info;case"verbose":return pS.LogLevel.Verbose;case"warning":return pS.LogLevel.Warning;default:return pS.LogLevel.Info}}a(rGe,"getMSALLogLevel");function gY(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return eTe.info(Bs(t,e.message)),new Mn(e.message);case"device_code_polling_cancelled":return new hY("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":eTe.info(Bs(t,`Authentication returned errorCode ${n.errorCode}`));break;default:eTe.info(Bs(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"?(eTe.info(Bs(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new yx({scopes:t,getTokenOptions:r,message:e.message})}a(gY,"handleMsalError");function Osn(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(Osn,"publicToMsal");function Bsn(t,e){return{authority:e.environment??Ken,homeAccountId:e.homeAccountId,tenantId:e.tenantId||Yen,username:e.username,clientId:t,version:Nsn}}a(Bsn,"msalToPublic");function jLt(t){let e=JSON.parse(t);if(e.version&&e.version!==Nsn)throw Error("Unsupported AuthenticationRecord version");return e}a(jLt,"deserializeAuthenticationRecord");p();p();p();p();p();p();function yko(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(yko,"isPrimitiveBody");function Eko(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(Eko,"handleNullableResponseAndWrappableBody");function HLt(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 Eko({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:yko(t.parsedBody,l)})}a(HLt,"flattenResponse");var UM={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 QM=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var Lsn=require("node:os"),Fsn=de(require("node:util"),1),Usn=de(require("node:process"),1);function Qsn(t,...e){Usn.stderr.write(`${Fsn.default.format(t,...e)}${Lsn.EOL}`)}a(Qsn,"log");var qsn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,jsn,GLt=[],$Lt=[],iGe=[];qsn&&VLt(qsn);var Hsn=Object.assign(t=>Gsn(t),{enable:VLt,enabled:WLt,disable:_ko,log:Qsn});function VLt(t){jsn=t,GLt=[],$Lt=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?$Lt.push(new RegExp(`^${n.substr(1)}$`)):GLt.push(new RegExp(`^${n}$`));for(let n of iGe)n.enabled=WLt(n.namespace)}a(VLt,"enable");function WLt(t){if(t.endsWith("*"))return!0;for(let e of $Lt)if(e.test(t))return!1;for(let e of GLt)if(e.test(t))return!0;return!1}a(WLt,"enabled");function _ko(){let t=jsn||"";return VLt(""),t}a(_ko,"disable");function Gsn(t){let e=Object.assign(r,{enabled:WLt(t),destroy:vko,log:Hsn.log,namespace:t,extend:Cko});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(Gsn,"createDebugger");function vko(){let t=iGe.indexOf(this);return t>=0?(iGe.splice(t,1),!0):!1}a(vko,"destroy");function Cko(t){let e=Gsn(`${this.namespace}:${t}`);return e.log=this.log,e}a(Cko,"extend");var xce=Hsn;var zLt=["verbose","info","warning","error"],$sn={verbose:400,info:300,warning:200,error:100};function Vsn(t,e){e.log=(...r)=>{t.log(...r)}}a(Vsn,"patchLogMethod");function Wsn(t){return zLt.includes(t)}a(Wsn,"isTypeSpecRuntimeLogLevel");function bko(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=xce(t.namespace);o.log=(...f)=>{xce.log(...f)};function s(f){if(f&&!Wsn(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${zLt.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);xce.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(Wsn(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${zLt.join(", ")}.`));function c(f){return!!(n&&$sn[f.level]<=$sn[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(Vsn(f,m),c(m)){let g=xce.disable();xce.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 Vsn(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(bko,"createLoggerContext");var zsn=bko({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),Sko=zsn.logger;function rTe(t){return zsn.createClientLogger(t)}a(rTe,"createClientLogger");p();function oGe(t){return t.toLowerCase()}a(oGe,"normalizeName");function*Tko(t){for(let e of t.values())yield[e.name,e.value]}a(Tko,"headerIterator");var YLt=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(oGe(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(oGe(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(oGe(e))}delete(e){this._headersMap.delete(oGe(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 Tko(this._headersMap)}};function hS(t){return new YLt(t)}a(hS,"createHttpHeaders");p();p();p();var KLt=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:hS(),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||Sce(),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 sGe(t){return new KLt(t)}a(sGe,"createPipelineRequest");p();var Ysn=new Set(["Deserialize","Serialize","Retry","Sign"]),JLt=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&&!Ysn.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!Ysn.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 aGe(){return JLt.create()}a(aGe,"createEmptyPipeline");p();p();var Ksn=require("node:util"),Jsn=Ksn.inspect.custom;var Iko=new pk,mA=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,Jsn,{value:a(()=>`RestError: ${this.message} - ${Iko.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};mA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";mA.PARSE_ERROR="PARSE_ERROR";function cGe(t){return t instanceof mA?!0:pY(t)&&t.name==="RestError"}a(cGe,"isRestError");p();p();var wce=de(require("node:http"),1),Rce=de(require("node:https"),1),uGe=de(require("node:zlib"),1),Xsn=require("node:stream");p();var Tx=rTe("ts-http-runtime");var xko={};function nTe(t){return t&&typeof t.pipe=="function"}a(nTe,"isReadableStream");function Zsn(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(Zsn,"isStreamComplete");function ean(t){return t&&typeof t.byteLength=="number"}a(ean,"isArrayBuffer");var lGe=class extends Xsn.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}},ZLt=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 QM("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 pk;Tx.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=kko(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let _=e.onUploadProgress,v=new lGe(_);v.on("error",b=>{Tx.error("Error in upload progress",b)}),nTe(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=wko(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?Rko(m,g):m;let E=e.onDownloadProgress;if(E){let _=new lGe(E);_.on("error",v=>{Tx.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 Pko(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();nTe(f)&&(m=Zsn(f));let g=Promise.resolve();nTe(h)&&(g=Zsn(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{Tx.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?wce.request(u,d):Rce.request(u,d);h.once("error",m=>{var g;f(new mA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:mA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new QM("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&nTe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):ean(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(Tx.error("Unrecognized body type",n),f(new mA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?wce.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new wce.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return Rce.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:xko,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(Tx.info("No cached TLS Agent exist, creating a new Agent"),c=new Rce.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function wko(t){let e=hS();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(wko,"getResponseHeaders");function Rko(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=uGe.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=uGe.createInflate();return t.pipe(n),n}return t}a(Rko,"getDecodedResponseStream");function Pko(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 mA(`Error reading response as text: ${o.message}`,{code:mA.PARSE_ERROR}))})})}a(Pko,"streamToText");function kko(t){return t?Buffer.isBuffer(t)?t.length:nTe(t)?null:ean(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(kko,"getBodyLength");function tan(){return new ZLt}a(tan,"createNodeHttpClient");function dGe(){return tan()}a(dGe,"createDefaultHttpClient");p();p();p();p();var XLt="logPolicy";function fGe(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:Tx.info,n=new pk({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:XLt,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(fGe,"logPolicy");p();var e3t="redirectPolicy",ran=["GET","HEAD"];function pGe(t={}){let{maxRetries:e=20}=t;return{name:e3t,async sendRequest(r,n){let o=await n(r);return nan(n,o,e)}}}a(pGe,"redirectPolicy");async function nan(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&ran.includes(o.method)||s===302&&ran.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new QM(r?.abortErrorMsg?r?.abortErrorMsg:Dko)),"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(san,"delay");function aan(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(aan,"parseHeaderValueAsNumber");var r3t="Retry-After",Nko=["retry-after-ms","x-ms-retry-after-ms",r3t];function can(t){if(t&&[429,503].includes(t.status))try{for(let o of Nko){let s=aan(t,o);if(s===0||s)return s*(o===r3t?1e3:1)}let e=t.headers.get(r3t);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(can,"getRetryAfterInMs");function lan(t){return Number.isFinite(can(t))}a(lan,"isThrottlingRetryResponse");function n3t(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=can(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(n3t,"throttlingRetryStrategy");var Mko=1e3,Oko=1e3*64;function mGe(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:Mko,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:Oko;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=Lko(l),d=u&&t.ignoreSystemErrors,f=Bko(c),h=f&&t.ignoreHttpStatusCodes;return c&&(lan(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:XSe(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(mGe,"exponentialRetryStrategy");function Bko(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(Bko,"isExponentialRetryResponse");function Lko(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(Lko,"isSystemError");p();var Fko=rTe("ts-http-runtime retryPolicy"),Uko="retryPolicy";function j7(t,e={maxRetries:3}){let r=e.logger||Fko;return{name:Uko,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 QM;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 san(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(j7,"retryPolicy");var i3t="defaultRetryPolicy";function gGe(t={}){var e;return{name:i3t,sendRequest:j7([n3t(),mGe(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(gGe,"defaultRetryPolicy");p();var o3t="formDataPolicy";function Qko(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(Qko,"formDataToFormDataMap");function AGe(){return{name:o3t,async sendRequest(t,e){if(q7&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=Qko(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=qko(t.formData):await jko(t.formData,t),t.formData=void 0}return e(t)}}}a(AGe,"formDataPolicy");function qko(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(qko,"wwwFormUrlEncode");async function jko(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:hS({"Content-Disposition":`form-data; name="${o}"`}),body:_C(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=hS();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(jko,"prepareFormData");p();var Man=de(p3t(),1),Oan=de(h3t(),1);var B2o="HTTPS_PROXY",L2o="HTTP_PROXY",F2o="ALL_PROXY",U2o="NO_PROXY",m3t="proxyPolicy",kan=[],Ban=!1,Q2o=new Map;function TGe(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(TGe,"getEnvironmentValue");function q2o(){if(!process)return;let t=TGe(B2o),e=TGe(F2o),r=TGe(L2o);return t||e||r}a(q2o,"loadEnvironmentProxyValue");function j2o(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(j2o,"isBypassed");function H2o(){let t=TGe(U2o);return Ban=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(H2o,"loadNoProxy");function G2o(){let t=q2o();return t?new URL(t):void 0}a(G2o,"getDefaultProxySettingsInternal");function Dan(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(Dan,"getUrlFromProxySettings");function Nan(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&Tx.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 Oan.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new Man.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(Nan,"setProxyAgentOnRequest");function IGe(t,e){Ban||kan.push(...H2o());let r=t?Dan(t):G2o(),n={};return{name:m3t,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!j2o(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:kan,e?.customNoProxyList?void 0:Q2o)?Nan(o,n,r):o.proxySettings&&Nan(o,n,Dan(o.proxySettings)),s(o)}}}a(IGe,"proxyPolicy");p();var g3t="agentPolicy";function xGe(t){return{name:g3t,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(xGe,"agentPolicy");p();var A3t="tlsPolicy";function wGe(t){return{name:A3t,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(wGe,"tlsPolicy");p();p();function RGe(t){return typeof t.stream=="function"}a(RGe,"isBlob");p();n3();var MGe=require("stream");function ccn(){return oTe(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield AS(e.read());if(r)return yield AS(void 0);yield yield AS(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(ccn,"streamAsyncIterator");function z2o(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=ccn.bind(t)),t.values||(t.values=ccn.bind(t))}a(z2o,"makeAsyncIterable");function lcn(t){return t instanceof ReadableStream?(z2o(t),MGe.Readable.fromWeb(t)):t}a(lcn,"ensureNodeStream");function Y2o(t){return t instanceof Uint8Array?MGe.Readable.from(Buffer.from(t)):RGe(t)?lcn(t.stream()):lcn(t)}a(Y2o,"toStream");async function ucn(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(Y2o);return MGe.Readable.from((function(){return oTe(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,NGe(d)),u;u=yield AS(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield AS(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield AS(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(ucn,"concat");function K2o(){return`----AzSDKFormBoundary${Sce()}`}a(K2o,"generateBoundary");function J2o(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(J2o,"encodeHeaders");function Z2o(t){return t instanceof Uint8Array?t.byteLength:RGe(t)?t.size===-1?void 0:t.size:void 0}a(Z2o,"getLength");function X2o(t){let e=0;for(let r of t){let n=Z2o(r);if(n===void 0)return;e+=n}return e}a(X2o,"getTotalLength");async function eDo(t,e,r){let n=[_C(`--${r}`,"utf-8"),...e.flatMap(s=>[_C(`\r -`,"utf-8"),_C(J2o(s.headers),"utf-8"),_C(`\r -`,"utf-8"),s.body,_C(`\r ---${r}`,"utf-8")]),_C(`--\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!==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 \r -`,"utf-8")],o=X2o(n);o&&t.headers.set("Content-Length",o),t.body=await ucn(n)}a(eDo,"buildRequestBody");var sTe="multipartPolicy",tDo=70,rDo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function nDo(t){if(t.length>tDo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!rDo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(nDo,"assertValidBoundary");function OGe(){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?nDo(n):n=K2o(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await eDo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(OGe,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function BGe(){return aGe()}a(BGe,"createEmptyPipeline");p();p();p();var jM=I7("core-rest-pipeline");p();p();p();p();function C3t(t={}){return fGe(Object.assign({logger:jM.info},t))}a(C3t,"logPolicy");p();function b3t(t={}){return pGe(t)}a(b3t,"redirectPolicy");p();p();p();var Dce=de(require("node:os"),1),LGe=de(require("node:process"),1);function dcn(){return"User-Agent"}a(dcn,"getHeaderName");async function fcn(t){if(LGe&&LGe.versions){let e=LGe.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",`(${Dce.arch()}-${Dce.type()}-${Dce.release()})`)}a(fcn,"setPlatformSpecificData");p();var FGe="1.22.0";function fDo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(fDo,"getUserAgentString");function pcn(){return dcn()}a(pcn,"getUserAgentHeaderName");async function UGe(t){let e=new Map;e.set("core-rest-pipeline",FGe),await fcn(e);let r=fDo(e);return t?`${t} ${r}`:r}a(UGe,"getUserAgentValue");var hcn=pcn(),mcn="userAgentPolicy";function S3t(t={}){let e=UGe(t.userAgentPrefix);return{name:mcn,async sendRequest(r,n){return r.headers.has(hcn)||r.headers.set(hcn,await e),n(r)}}}a(S3t,"userAgentPolicy");p();p();var gcn=Symbol("rawContent");function T3t(t){return typeof t[gcn]=="function"}a(T3t,"hasRawContent");function Acn(t){return T3t(t)?t[gcn]():t}a(Acn,"getRawContent");var QGe=sTe;function I3t(){let t=OGe();return{name:QGe,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)T3t(n.body)&&(n.body=Acn(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(I3t,"multipartPolicy");p();function x3t(){return hGe()}a(x3t,"decompressResponsePolicy");p();function w3t(t={}){return gGe(t)}a(w3t,"defaultRetryPolicy");p();function R3t(){return AGe()}a(R3t,"formDataPolicy");p();function P3t(t,e){return IGe(t,e)}a(P3t,"proxyPolicy");p();var ycn="setClientRequestIdPolicy";function k3t(t="x-ms-client-request-id"){return{name:ycn,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(k3t,"setClientRequestIdPolicy");p();function D3t(t){return xGe(t)}a(D3t,"agentPolicy");p();function N3t(t){return wGe(t)}a(N3t,"tlsPolicy");p();p();var Nce=mA;function aTe(t){return cGe(t)}a(aTe,"isRestError");var Ecn="tracingPolicy";function M3t(t={}){let e=UGe(t.userAgentPrefix),r=new pk({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=pDo();return{name:Ecn,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=hDo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return gDo(d,h),h}catch(h){throw mDo(d,h),h}}}}a(M3t,"tracingPolicy");function pDo(){try{return W1e({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:FGe})}catch(t){jM.warning(`Error when creating the TracingClient: ${Tce(t)}`);return}}a(pDo,"tryCreateTracingClient");function hDo(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){jM.warning(`Skipping creating a tracing span due to an error: ${Tce(n)}`);return}}a(hDo,"tryCreateSpan");function mDo(t,e){try{t.setStatus({status:"error",error:XHe(e)?e:void 0}),aTe(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){jM.warning(`Skipping tracing span processing due to an error: ${Tce(r)}`)}}a(mDo,"tryProcessError");function gDo(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){jM.warning(`Skipping tracing span processing due to an error: ${Tce(r)}`)}}a(gDo,"tryProcessResponse");p();p();function qGe(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(qGe,"wrapAbortSignalLike");var ADo="wrapAbortSignalLikePolicy";function _cn(){return{name:ADo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=qGe(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(_cn,"wrapAbortSignalLikePolicy");function O3t(t){var e;let r=BGe();return Ice&&(t.agent&&r.addPolicy(D3t(t.agent)),t.tlsOptions&&r.addPolicy(N3t(t.tlsOptions)),r.addPolicy(P3t(t.proxyOptions)),r.addPolicy(x3t())),r.addPolicy(_cn()),r.addPolicy(R3t(),{beforePolicies:[QGe]}),r.addPolicy(S3t(t.userAgentOptions)),r.addPolicy(k3t((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(I3t(),{afterPhase:"Deserialize"}),r.addPolicy(w3t(t.retryOptions),{phase:"Retry"}),r.addPolicy(M3t(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),Ice&&r.addPolicy(b3t(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(C3t(t.loggingOptions),{afterPhase:"Sign"}),r}a(O3t,"createPipelineFromOptions");p();function B3t(){let t=dGe();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?qGe(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a(B3t,"createDefaultHttpClient");p();function $7(t){return hS(t)}a($7,"createHttpHeaders");p();function mk(t){return sGe(t)}a(mk,"createPipelineRequest");p();p();p();p();var EDo=I7("core-rest-pipeline retryPolicy");function L3t(t,e={maxRetries:3}){return j7(t,Object.assign({logger:EDo},e))}a(L3t,"retryPolicy");p();p();var _Do={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function vDo(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(F3t,"createTokenCycler");var Scn="bearerTokenAuthenticationPolicy";async function jGe(t,e){try{return[await e(t),void 0]}catch(r){if(aTe(r)&&r.response)return[r.response,r];throw r}}a(jGe,"trySendRequest");async function CDo(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(CDo,"defaultAuthorizeRequest");function vcn(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(vcn,"isChallengeResponse");async function Ccn(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(Ccn,"authorizeRequestOnCaeChallenge");function HGe(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||jM,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:CDo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?F3t(o):()=>Promise.resolve(null);return{name:Scn,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 jGe(f,h),vcn(m)){let y=bcn(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 Ccn({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await jGe(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 jGe(f,h)),vcn(m)&&(y=bcn(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 Ccn({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await jGe(f,h))}}if(g)throw g;return m}}}a(HGe,"bearerTokenAuthenticationPolicy");function bDo(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(bDo,"parseChallenges");function bcn(t){var e;return t?(e=bDo(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(bcn,"getCaeChallengeClaims");p();p();p();p();p();p();var Icn=de(Tcn(),1),U3t=Icn.state;function V7(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=xcn(t,n);!c.propertyFound&&r&&(c=xcn(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=V7(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(V7,"getOperationArgumentValueFromParameter");function xcn(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(RDo,"deserializeResponseBody");function PDo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(PDo,"isOperationSpecEmpty");function kDo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(PDo(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 Nce(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===UM.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(kDo,"handleErrorResponse");async function DDo(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||Nce.PARSE_ERROR;throw new Nce(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a(DDo,"parse");p();p();function Pcn(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===UM.Stream&&e.add(Number(r))}return e}a(Pcn,"getStreamingResponseStatusCodes");function HM(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(HM,"getPathStringFromParameter");var kcn="serializationPolicy";function q3t(t={}){let e=t.stringifyXML;return{name:kcn,async sendRequest(r,n){let o=i3(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&(NDo(r,c,s),MDo(r,c,s,e)),n(r)}}}a(q3t,"serializationPolicy");function NDo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=V7(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,HM(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||HM(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(NDo,"serializeHeaders");function MDo(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=V7(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=HM(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===UM.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",P=ODo(_,x,T,t.body,f);T===UM.Sequence?t.body=n(BDo(P,E||y||A,x,_),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(P,{rootName:y||A,xmlCharKey:h}))}else{if(T===UM.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=V7(e,m);if(g!=null){let A=m.mapper.serializedName||HM(m);t.formData[A]=r.serializer.serialize(m.mapper,g,HM(m),f)}}}}a(MDo,"serializeRequestBody");function ODo(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(ODo,"getXmlValueWithNamespace");function BDo(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(BDo,"prepareXMLRootList");function j3t(t={}){let e=O3t(t??{});return t.credentialOptions&&e.addPolicy(HGe({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(q3t(t.serializationOptions),{phase:"Serialize"}),e.addPolicy(Q3t(t.deserializationOptions),{phase:"Deserialize"}),e}a(j3t,"createClientPipeline");p();var H3t;function Dcn(){return H3t||(H3t=B3t()),H3t}a(Dcn,"getCachedDefaultHttpClient");p();var LDo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function Mcn(t,e,r,n){let o=FDo(e,r,n),s=!1,c=Ncn(t,o);if(e.path){let d=Ncn(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),UDo(d)?(c=d,s=!0):c=QDo(c,d)}let{queryParams:l,sequenceParams:u}=qDo(e,r,n);return c=HDo(c,l,u,s),c}a(Mcn,"getRequestUrl");function Ncn(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(Ncn,"replaceAll");function FDo(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=V7(e,s,r),l=HM(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(FDo,"calculateUrlReplacements");function UDo(t){return t.includes("://")}a(UDo,"isAbsoluteUrl");function QDo(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(QDo,"appendPath");function qDo(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=V7(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,HM(c));let u=c.collectionFormat?LDo[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||HM(c),l)}}return{queryParams:o,sequenceParams:s}}a(qDo,"calculateQueryParameters");function jDo(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(jDo,"simpleParseQueryParams");function HDo(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=jDo(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(HDo,"appendQueryParams");p();var G3t=I7("core-client");var cTe=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&&G3t.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||Dcn(),this.pipeline=e.pipeline||GDo(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=Mcn(n,r,e,this),s=mk({url:o});s.method=r.httpMethod;let c=i3(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=Pcn(r));try{let d=await this.sendRequest(s),f=HLt(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=HLt(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function GDo(t){let e=$Do(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return j3t(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(GDo,"createDefaultPipeline");function $Do(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($Do,"getCredentialScopes");p();p();p();function Ocn(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(Ocn,"getIdentityTokenEndpointSuffix");p();var Bcn="/.default",Lcn="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 lTe(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(Bcn)?e.substr(0,e.lastIndexOf(Bcn)):e}a(lTe,"mapScopesToResource");function Fcn(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(Fcn,"parseExpirationTimestamp");function Ucn(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(Ucn,"parseRefreshTimestamp");var uTe="noCorrelationId";function VDo(t){let e=t?.authorityHost;return eGe&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??G1e}a(VDo,"getIdentityClientAuthorityHost");var W7=class extends cTe{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=VDo(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){aS.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:Fcn(n),refreshAfterTimestamp:Ucn(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return aS.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new T7(r.status,r.bodyAsText);throw aS.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;aS.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 Dc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=Ocn(e),h=mk({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:$7({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return aS.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===sje&&f.errorResponse.error==="interaction_required")return aS.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw aS.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||uTe,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(uTe)||[]];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]||uTe}async sendGetRequestAsync(e,r){let n=mk({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:$7(r?.headers),abortSignal:this.generateAbortSignal(uTe)}),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=mk({url:e,method:"POST",body:r?.body,headers:$7(r?.headers),allowInsecureConnection:this.allowInsecureConnection,abortSignal:this.generateAbortSignal(this.getCorrelationId(r))}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}getTokenCredentialOptions(){return this.tokenCredentialOptions}logIdentifiers(e){if(!this.allowLoggingAccountIdentifiers||!e.bodyAsText)return;let r="No User Principal Name available";try{let o=(e.parsedBody||JSON.parse(e.bodyAsText)).access_token;if(!o)return;let s=o.split(".")[1],{appid:c,upn:l,tid:u,oid:d}=JSON.parse(Buffer.from(s,"base64").toString("utf8"));aS.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){aS.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var $3t;(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"})($3t||($3t={}));function $Ge(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===$3t.AutoDiscoverRegion?"AUTO_DISCOVER":e}a($Ge,"calculateRegionalAuthority");p();p();function WDo(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(WDo,"createConfigurationErrorMessage");function hf(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=WDo(o);throw n?.info(s),new Mn(s)}return o}a(hf,"processMultiTenantRequest");function J0(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(Bs("",r)),r}}a(J0,"checkTenantId");function Mce(t,e,r){return e?(J0(t,e),e):(r||(r=jz),r!==jz?"common":"organizations")}a(Mce,"resolveTenantId");function zf(t){return!t||t.length===0?[]:t.includes("*")?Jen:t}a(zf,"resolveAdditionallyAllowedTenantIds");var T_=uo("MsalClient");function lNo(t,e,r={}){let n=Mce(r.logger??T_,e,t),o=qLt(n,QLt(r)),s=new W7({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:Msn(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:tGe(r.logger??T_),logLevel:rGe(dje()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(lNo,"generateMsalConfiguration");function Vy(t,e,r={}){let n={msalConfig:lNo(t,e,r),cachedAccount:r.authenticationRecord?Osn(r.authenticationRecord):null,pluginConfiguration:itn.generatePluginConfiguration(r),logger:r.logger??T_},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 Ece({...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 vce({...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 yx({scopes:P});D.claims&&(n.cachedClaims=D.claims);let N={account:n.cachedAccount,scopes:P,claims:n.cachedClaims};n.pluginConfiguration.broker.isEnabled&&(N.extraQueryParameters||={},n.pluginConfiguration.broker.enableMsaPassthrough&&(N.extraQueryParameters.msal_request_type="consumer_passthrough")),D.proofOfPossessionOptions&&(N.shrNonce=D.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl),n.logger.getToken.info("Attempting to acquire token silently");try{return await x.acquireTokenSilent(N)}catch(B){throw gY(P,B,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?qLt(x.tenantId,QLt(r)):n.msalConfig.auth.authority}a(d,"calculateRequestAuthority");async function f(x,P,D,N){let B=null;try{B=await u(x,P,D)}catch(L){if(L.name!=="AuthenticationRequiredError")throw L;if(D.disableAutomaticAuthentication)throw new yx({scopes:P,getTokenOptions:D,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(B===null)try{B=await N()}catch(L){throw gY(P,L,D)}return mY(P,B,D),n.cachedAccount=B?.account??null,n.logger.getToken.info(zm(P)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}a(f,"withSilentAuthentication");async function h(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client secret"),n.msalConfig.auth.clientSecret=P;let N=await l(D);try{let B=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:$Ge(),claims:D?.claims});return mY(x,B,D),n.logger.getToken.info(zm(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw gY(x,B,D)}}a(h,"getTokenByClientSecret");async function m(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client assertion"),n.msalConfig.auth.clientAssertion=P;let N=await l(D);try{let B=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:$Ge(),claims:D?.claims,clientAssertion:P});return mY(x,B,D),n.logger.getToken.info(zm(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw gY(x,B,D)}}a(m,"getTokenByClientAssertion");async function g(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client certificate"),n.msalConfig.auth.clientCertificate=P;let N=await l(D);try{let B=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:$Ge(),claims:D?.claims});return mY(x,B,D),n.logger.getToken.info(zm(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw gY(x,B,D)}}a(g,"getTokenByClientCertificate");async function A(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using device code");let N=await s(D);return f(N,x,D,()=>{let B={scopes:x,cancel:D?.abortSignal?.aborted??!1,deviceCodeCallback:P,authority:d(D),claims:D?.claims},L=N.acquireTokenByDeviceCode(B);return D.abortSignal&&D.abortSignal.addEventListener("abort",()=>{B.cancel=!0}),L})}a(A,"getTokenByDeviceCode");async function y(x,P,D,N={}){n.logger.getToken.info("Attempting to acquire token using username and password");let B=await s(N);return f(B,x,N,()=>{let L={scopes:x,username:P,password:D,authority:d(N),claims:N?.claims};return B.acquireTokenByUsernamePassword(L)})}a(y,"getTokenByUsernamePassword");function E(){if(n.cachedAccount)return Bsn(t,n.cachedAccount)}a(E,"getActiveAccount");async function _(x,P,D,N,B={}){n.logger.getToken.info("Attempting to acquire token using authorization code");let L;return N?(n.msalConfig.auth.clientSecret=N,L=await l(B)):L=await s(B),f(L,x,B,()=>L.acquireTokenByCode({scopes:x,redirectUri:P,code:D,authority:d(B),claims:B?.claims}))}a(_,"getTokenByAuthorizationCode");async function v(x,P,D,N={}){T_.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(T_.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(T_.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(T_.getToken.info("Using client certificate for on behalf of flow"),n.msalConfig.auth.clientCertificate=D);let B=await l(N);try{let L=await B.acquireTokenOnBehalfOf({scopes:x,authority:d(N),claims:N.claims,oboAssertion:P});return mY(x,L,N),T_.getToken.info(zm(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw gY(x,L,N)}}a(v,"getTokenOnBehalfOf");function b(x,P){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(KGe(),hln))).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={}){T_.verbose("Authentication will resume through the broker");let N=await s(D),B=b(x,D);n.pluginConfiguration.broker.parentWindowHandle?B.windowHandle=Buffer.from(n.pluginConfiguration.broker.parentWindowHandle):T_.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle."),n.pluginConfiguration.broker.enableMsaPassthrough&&((B.extraQueryParameters??={}).msal_request_type="consumer_passthrough"),P?(B.prompt="none",T_.verbose("Attempting broker authentication using the default broker account")):T_.verbose("Attempting broker authentication without the default broker account"),D.proofOfPossessionOptions&&(B.shrNonce=D.proofOfPossessionOptions.nonce,B.authenticationScheme="pop",B.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,B.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl);try{return await N.acquireTokenInteractive(B)}catch(L){if(T_.verbose(`Failed to authenticate through the broker: ${L.message}`),D.disableAutomaticAuthentication)throw new yx({scopes:x,getTokenOptions:D,message:"Cannot silently authenticate with default broker account."});if(P)return T(x,!1,D);throw L}}a(T,"getBrokeredTokenInternal");async function w(x,P,D={}){T_.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${P}`);let N=await T(x,P,D);return mY(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(zm(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,P={}){T_.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(Vy,"createMsalClient");var mTe=require("node:crypto");var gln=require("node:fs/promises");var hTe="ClientCertificateCredential",mln=uo(hTe),gTe=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${hTe}: tenantId and clientId are required parameters.`);this.tenantId=e,this.additionallyAllowedTenantIds=zf(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(`${hTe}: 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(`${hTe}: 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=Vy(r,e,{...o,logger:mln,tokenCredentialOptions:o})}async getToken(e,r={}){return Dc.withSpan(`${hTe}.getToken`,r,async n=>{n.tenantId=hf(this.tenantId,n,this.additionallyAllowedTenantIds,mln);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await uNo(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,mTe.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 uNo(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,gln.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,mTe.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,mTe.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(uNo,"parseCertificate");p();p();function Rx(t){return Array.isArray(t)?t:[t]}a(Rx,"ensureScopes");function Lce(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(Bs(t,r)),r}}a(Lce,"ensureValidScopeForDevTimeCreds");function JGe(t){return t.replace(/\/.default$/,"")}a(JGe,"getScopeResource");var Aln=uo("ClientSecretCredential"),ATe=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=zf(o?.additionallyAllowedTenants),this.msalClient=Vy(r,e,{...o,logger:Aln,tokenCredentialOptions:o})}async getToken(e,r={}){return Dc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=hf(this.tenantId,n,this.additionallyAllowedTenantIds,Aln);let o=Rx(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var dNo=uo("UsernamePasswordCredential"),yTe=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=zf(s?.additionallyAllowedTenants),this.username=n,this.password=o,this.msalClient=Vy(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return Dc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=hf(this.tenantId,n,this.additionallyAllowedTenantIds,dNo);let o=Rx(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var fNo=["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 pNo(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(pNo,"getAdditionallyAllowedTenants");var ZGe="EnvironmentCredential",o3=uo(ZGe);function hNo(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return o3.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(hNo,"getSendCertificateChain");var ETe=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=fje(fNo).assigned.join(", ");o3.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=pNo(),l=hNo(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&J0(o3,n),n&&o&&s){o3.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new ATe(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){o3.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new gTe(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(o3.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),o3.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 yTe(n,o,h,m,u))}async getToken(e,r={}){return Dc.withSpan(`${ZGe}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return o3.getToken.info(zm(e)),o}catch(o){let s=new T7(400,{error:`${ZGe} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw o3.getToken.info(Bs(e,s)),s}throw new Mn(`${ZGe} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var mNo=1e3*64,gNo=3e3;function yln(t){return L3t([{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(gNo,t.startDelayInMs):t.startDelayInMs;return Dsn(e,{retryDelayInMs:n,maxRetryDelayInMs:mNo})},"retry")}],{maxRetries:t.maxRetries})}a(yln,"imdsRetryPolicy");p();var s3="ManagedIdentityCredential - IMDS",yY=uo(s3),ANo="http://169.254.169.254",yNo="/metadata/identity/oauth2/token";function ENo(t){if(!lTe(t))throw new Error(`${s3}: Multiple scopes are not supported.`);let r=new URL(yNo,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??ANo),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:$7(n)}}a(ENo,"prepareInvalidRequestOptions");var Eln={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=lTe(e);if(!o)return yY.info(`${s3}: 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=ENo(o);return Dc.withSpan("ManagedIdentityCredential-pingImdsEndpoint",n??{},async c=>{s.tracingOptions=c.tracingOptions;let l=mk(s);l.timeout=c.requestOptions?.timeout||1e3,l.allowInsecureConnection=!0;let u;try{yY.info(`${s3}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return XHe(d)&&yY.verbose(`${s3}: Caught error ${d.name}: ${d.message}`),yY.info(`${s3}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(yY.info(`${s3}: The Azure IMDS endpoint is unavailable`),yY.info(`${s3}: ${u.bodyAsText}`),!1):(yY.info(`${s3}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var _ln=uo("ClientAssertionCredential"),Fce=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=zf(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=Vy(r,e,{...o,logger:_ln,tokenCredentialOptions:this.options})}async getToken(e,r={}){return Dc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=hf(this.tenantId,n,this.additionallyAllowedTenantIds,_ln);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var vln=require("node:fs/promises");var EY="WorkloadIdentityCredential",_No=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],_Te=uo(EY),a3=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=fje(_No).assigned.join(", ");_Te.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&&J0(_Te,o),!s)throw new Mn(`${EY}: 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(`${EY}: 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(`${EY}: 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`);_Te.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new Fce(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${EY}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters. +`,"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. 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 _Te.info(n),new Mn(n)}return _Te.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(`${EY}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,vln.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Mn(`${EY}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var Cln="ManagedIdentityCredential - Token Exchange",vNo=uo(Cln),dFt={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||vNo.info(`${Cln}: 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 a3({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var yS=uo("ManagedIdentityCredential"),J7=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 W7({...n,additionalPolicies:[{policy:yln(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Cce({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:rGe(dje()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:tGe(yS)}}}),this.isAvailableIdentityClient=new W7({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw yS.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 yS.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: ${Lcn}`);if(yS.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];yS.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){yS.getToken.info("Using the MSAL provider for Managed Identity.");let n=lTe(e);if(!n)throw new Mn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return Dc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await dFt.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(yS.getToken.info(`MSAL Identity source: ${s}`),o){yS.getToken.info("Using the token exchange managed identity.");let u=await dFt.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&&(yS.getToken.info("Using the IMDS endpoint to probe for availability."),!await Eln.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.");yS.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),yS.getToken.info(zm(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw yS.getToken.error(Bs(e,o)),o.name==="AuthenticationRequiredError"?o:CNo(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=>(yS.getToken.info(s),new yx({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 CNo(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(CNo,"isNetworkError");p();var bln=de(require("child_process"),1);var GM=uo("AzureDeveloperCliCredential"),XGe={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:"},Sln={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(GM.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(" ");bln.default.exec(d,{cwd:Sln.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},vTe=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(J0(GM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=zf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=hf(this.tenantId,r,this.additionallyAllowedTenantIds);n&&J0(GM,n);let o;return typeof e=="string"?o=[e]:o=e,GM.getToken.info(`Using the scopes ${e}`),Dc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{Lce(d,GM)});let s=await Sln.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(XGe.notInstalled);throw GM.getToken.info(Bs(e,d)),d}if(l){let d=new Mn(XGe.login);throw GM.getToken.info(Bs(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Mn(`${XGe.claim} ${f}`);throw GM.getToken.info(Bs(e,h)),h}try{let d=JSON.parse(s.stdout);return GM.getToken.info(zm(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||XGe.unknown);throw GM.getToken.info(Bs(e,c)),c}})}};p();var Tln=de(require("child_process"),1);p();function fFt(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(Bs("",r)),r}}a(fFt,"checkSubscription");var ES=uo("AzureCliCredential"),CTe={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:'},Iln={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(ES.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(" ");Tln.default.exec(d,{cwd:Iln.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},bTe=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&(J0(ES,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(fFt(ES,e?.subscription),this.subscription=e?.subscription),this.additionallyAllowedTenantIds=zf(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(`${CTe.claim} ${l}`);throw ES.getToken.info(Bs(n,d)),d}let s=hf(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&J0(ES,s),this.subscription&&fFt(ES,this.subscription),ES.getToken.info(`Using the scope ${n}`),Dc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{Lce(n,ES);let c=JGe(n),l=await Iln.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(CTe.notInstalled);throw ES.getToken.info(Bs(e,h)),h}if(d){let h=new Mn(CTe.login);throw ES.getToken.info(Bs(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return ES.getToken.info(zm(e)),m}catch(h){throw l.stderr?new Mn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Mn(c.message||CTe.unknown);throw ES.getToken.info(Bs(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 ES.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(`${CTe.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var xln=de(require("node:child_process"),1),wln={execFile(t,e,r){return new Promise((n,o)=>{xln.default.execFile(t,e,r,(s,c,l)=>{Buffer.isBuffer(c)&&(c=c.toString("utf8")),Buffer.isBuffer(l)&&(l=l.toString("utf8")),l||s?o(l?new Error(l):s):n(c)})})}};var $M=uo("AzurePowerShellCredential"),Pln=process.platform==="win32";function kln(t){return Pln?`${t}.exe`:t}a(kln,"formatCommand");async function Rln(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await wln.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(Rln,"runCommands");var Dln={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"},e$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."},bNo=a(t=>t.message.match(`(.*)${Dln.login}(.*)`),"isLoginError"),SNo=a(t=>t.message.match(Dln.installed),"isNotInstalledError"),pFt=[kln("pwsh")];Pln&&pFt.push(kln("powershell"));var STe=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(J0($M,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=zf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...pFt]){try{await Rln([[o,"/?"]],n)}catch{pFt.shift();continue}let c=(await Rln([[o,"-NoProfile","-NonInteractive","-Command",` + "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",` $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' @@ -1750,26 +1755,26 @@ Error Description: '${s.message}'`,this.correlationId)}return null}return n||(th } Write-Output (ConvertTo-Json $result) - `]]))[0];return TNo(c)}throw new Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(e,r={}){return Dc.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(`${e$e.claim} ${l}`);throw $M.getToken.info(Bs(n,d)),d}let s=hf(this.tenantId,r,this.additionallyAllowedTenantIds);s&&J0($M,s);try{Lce(n,$M),$M.getToken.info(`Using the scope ${n}`);let c=JGe(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return $M.getToken.info(zm(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(SNo(c)){let u=new Mn(e$e.installed);throw $M.getToken.info(Bs(n,u)),u}else if(bNo(c)){let u=new Mn(e$e.login);throw $M.getToken.info(Bs(n,u)),u}let l=new Mn(`${c}. ${e$e.troubleshoot}`);throw $M.getToken.info(Bs(n,l)),l}})}};async function TNo(t){let e=/{[^{}]*}/g,r=t.match(e),n=t;if(r)try{for(let o of r)try{let s=JSON.parse(o);if(s?.Token)return n=n.replace(o,""),n&&$M.getToken.warning(n),s}catch{continue}}catch{throw new Error(`Unable to parse the output of PowerShell. Received output: ${t}`)}throw new Error(`No access token found in the output. Received output: ${t}`)}a(TNo,"parseJsonToken");p();var Nln=require("node:fs/promises");var INo="common",xNo="aebc6443-996d-45c2-90f0-388ff96faa56",hFt=uo("VisualStudioCodeCredential"),wNo={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function RNo(t){let e=wNo[t];if(e)throw new Mn(e)}a(RNo,"checkUnsupportedTenant");var TTe=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?(J0(hFt,e.tenantId),this.tenantId=e.tenantId):this.tenantId=INo,this.additionallyAllowedTenantIds=zf(e?.additionallyAllowedTenants),RNo(this.tenantId)}async prepare(e){let r=hf(this.tenantId,this.options,this.additionallyAllowedTenantIds,hFt)||this.tenantId;if(!ntn()||!oje)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(oje,e);this.msalClient=Vy(xNo,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=Rx(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,Nln.readFile)(e,{encoding:"utf8"});return jLt(n)}catch(n){throw hFt.getToken.info(Bs(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 t$e=uo("BrokerCredential"),r$e=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=Mce(t$e,e.tenantId),this.brokerAdditionallyAllowedTenantIds=zf(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:t$e,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=Vy(jz,this.brokerTenantId,r)}async getToken(e,r={}){return Dc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=hf(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,t$e);let o=Rx(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw t$e.getToken.info(Bs(o,s)),new Mn("Failed to acquire token using broker authentication",{cause:s})}})}};function Mln(t={}){return new r$e(t)}a(Mln,"createDefaultBrokerCredential");function mFt(t={}){return new TTe(t)}a(mFt,"createDefaultVisualStudioCodeCredential");function gFt(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 J7(c)}if(o&&r){let c={...t,tenantId:s};return new J7(r,c)}if(e){let c={...t,clientId:e};return new J7(c)}return new J7(t)}a(gFt,"createDefaultManagedIdentityCredential");function AFt(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 a3(s)}if(o){let s={...t,tenantId:o};return new a3(s)}return new a3(t)}a(AFt,"createDefaultWorkloadIdentityCredential");function yFt(t={}){return new vTe(t)}a(yFt,"createDefaultAzureDeveloperCliCredential");function EFt(t={}){return new bTe(t)}a(EFt,"createDefaultAzureCliCredential");function _Ft(t={}){return new STe(t)}a(_Ft,"createDefaultAzurePowershellCredential");function vFt(t={}){return new ETe(t)}a(vFt,"createDefaultEnvironmentCredential");var n$e=uo("DefaultAzureCredential"),CFt=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return n$e.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},Uce=class extends z1e{static{a(this,"DefaultAzureCredential")}constructor(e){PNo(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[mFt,EFt,_Ft,yFt,Mln],o=[vFt,AFt,gFt],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=[vFt];break;case"workloadidentitycredential":s=[AFt];break;case"managedidentitycredential":s=[()=>gFt({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[mFt];break;case"azureclicredential":s=[EFt];break;case"azurepowershellcredential":s=[_Ft];break;case"azuredeveloperclicredential":s=[yFt];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 n$e.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return n$e.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new CFt(u.name,d.message)}});super(...l)}};function PNo(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 n$e.warning(n),new Error(n)}}}a(PNo,"validateRequiredEnvVars");p();var A_u=uo("InteractiveBrowserCredential");p();var x_u=uo("DeviceCodeCredential");p();var kNo="AzurePipelinesCredential",L_u=uo(kNo);p();var W_u=uo("AuthorizationCodeCredential");p();var DNo="OnBehalfOfCredential",nvu=uo(DNo);p();var i$e=new pe("capiFetchUtilities");function Zm(t){let e={...Oy(t),"X-GitHub-Api-Version":"2026-06-01"},r=a$e(t.get(Ir));return r&&(e["Copilot-Integration-Id"]=r),e}a(Zm,"getCapiHeaders");function Oln(t,e){return i$e.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":OW.api,"Copilot-Integration-Id":"autodev-test"}}a(Oln,"addMsBenchCesProxyHeaders");async function Bln(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 zen(process.env.HMAC_SECRET,r);return{...e,...n}}a(Bln,"addMsBenchHmacHeaders");function NNo(){return uL()&&!!process.env.HMAC_SECRET}a(NNo,"isMsBenchHmacModeEnabled");function bFt(){return uL()&&!process.env.HMAC_SECRET}a(bFt,"isMsBenchCesProxyModeEnabled");async function o$e(t,e){return process.env.HMAC_SECRET?await Bln(t,e):Oln(t,e)}a(o$e,"addMsBenchHeaders");async function Qce(t,e,r){let n=r;bFt()&&(n=await MNo());let o={...e,Authorization:`Bearer ${n}`};return{headers:NNo()?await Bln(t,o):bFt()?Oln(t,o):o,token:n}}a(Qce,"applyMsBenchAuth");function qce(t,e,...r){if(bFt()){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 KI(t,e,"api",...r)}a(qce,"getCapiUrl");function jce(t,e,r){(e.status===401||e.status===403)&&(i$e.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Ut).resetToken("capi_fetch",e.status))}a(jce,"handleCapiAuthError");async function _Y(t,e,r){r??=await t.get(Ut).getToken();let n=qce(t,r,e),{headers:o}=await Qce(t,Zm(t),r.token),s=await t.get(tr).fetch(new URL(n).href,{method:"GET",headers:o});return jce(t,s,e),s}a(_Y,"fetchCapiUrl");async function s$e(t,e,r){let n=await t.get(Ut).getToken(),o=qce(t,n,e),{headers:s}=await Qce(t,Zm(t),n.token),c=await t.get(tr).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return jce(t,c,e),c}a(s$e,"postCapiUrl");async function MNo(){let e=await new Uce().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(MNo,"getMsBenchToken");p();var Fln=600*1e3,In={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"},u$e={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},Hce=new Set([In.O1Ga,In.O3Mini,In.O1Mini,In.Gemini20Pro,In.Gemini20Flash]);function d$e(t){return t.startsWith("claude")}a(d$e,"isClaudeFamily");function _S(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[In.Gpt4o]:r=[In.Gpt4o,In.Gpt4turbo,In.Gpt4,In.O1Mini,In.O1Ga,In.Claude35Sonnet,In.O3Mini,In.Gemini20Flash,In.Claude37Sonnet,In.Claude37SonnetThought,In.Gpt45,In.Gpt41,In.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[In.Gpt4oMini]:r=[In.Gpt4oMini,In.Gpt4o,In.Gpt35turbo,In.Gpt41,In.CopilotBase];break;case"gitCommit":e?r=[In.Gpt4oMini]:r=[In.Gpt4oMini,In.Gpt4o,In.Gpt4,In.Gpt41,In.CopilotBase];break;case"nesStubs":e?r=[In.Gpt4oMini]:r=[In.Gpt4oMini,In.Gpt4o,In.Gpt41,In.CopilotBase];break;case"codeMapper":r=[In.Gpt41]}return r}a(_S,"getSupportedModelFamiliesForPrompt");var Uln={textEmbedding3Small:"text-embedding-3-small"},ONo=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())}))}),Lln=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())}),BNo=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:ONo,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(Lln),long_context:S.Optional(Lln)}))})),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()})))}),Qln=S.Object({data:S.Array(BNo)});function qln(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(qln,"getDegradationReason");var Ss=class{static{a(this,"ModelMetadataProvider")}},c$e=class extends Ss{constructor(r){super();this.ctx=r;this._metadata=[];this._lastFetchTime=0;this._xGithubRequestId=void 0;this.allowTokenRefresh=a(()=>{this._lastFetchTime=0},"allowTokenRefresh");r.get(Ut).onDidResetToken(this.allowTokenRefresh)}static{a(this,"CapiModelMetadataProvider")}async getMetadata(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 _Y(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 eM(r)}await this.processModels(r)}async fetchModel(r){let n=await _Y(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 s$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>Fln}},l$e=class extends Ss{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(jln,"getUserSelectedModelConfiguration");p();p();p();var Z7=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();p();var Hln=de(require("node:fs/promises")),f$e=de(require("node:path"));async function p$e(t){return await Hln.readFile(ITe(t))}a(p$e,"readFile");function ITe(t){return f$e.default.resolve(f$e.default.extname(__filename)!==".ts"?__dirname:f$e.default.resolve(__dirname,"../../dist"),t)}a(ITe,"locateFile");var SFt=de(require("node:fs")),xTe=de(require("node:path"));function $ln(){let t=xTe.join("compiled",process.platform,process.arch,"copilot-tokenizer.node"),e=[xTe.join(__dirname,t),xTe.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 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: ${r.join(` -`)}`)}}a($ln,"loadNativeTokenizer");var Gln=new Set;function LNo(t){return[ITe(`resources/${t}.tiktoken.noindex`),xTe.join(__dirname,"resources",`${t}.tiktoken.noindex`)]}a(LNo,"vocabularyCandidates");async function Vln(t,e){if(!Gln.has(e)){if(!t.tokenEncoderInitialized(e)){let r=await SFt.promises.readFile(await FNo(e));t.tokenInitEncoder(e,r)}Gln.add(e)}}a(Vln,"initializeEncoderAsync");async function FNo(t){let e=LNo(t);for(let r of e)try{return await SFt.promises.access(r),r}catch{}throw new Error(`vocabulary for "${t}" not found at ${e.join(" or ")}`)}a(FNo,"firstExistingVocabulary");var wTe=new Map;function Ts(t="o200k_base"){xFt(t);let e=wTe.get(t);return e!==void 0?e:UNo(t)}a(Ts,"getTokenizer");var Wln=new Map;function UNo(t){let e=Wln.get(t);if(!e){let r=new Gce(t),n=a(()=>wTe.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")},Wln.set(t,e)}return e}a(UNo,"getUpgradingTokenizer");async function X7(t="o200k_base"){return await xFt(t),Ts(t)}a(X7,"getTokenizerAsync");var h$e=$ln(),m$e=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 Z7("Could not load tokenizer",new Error(`unsupported encoder ${e}`));if(h$e.error)throw new Z7("Could not load tokenizer",h$e.error);try{return await Vln(h$e.binding,e),new t(h$e.binding,e)}catch(r){throw r instanceof Error?new Z7("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.lengthD$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.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)}},a8t=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)}},QNo={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}},TFt=4,Gce=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(-TFt),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-TFt)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?QNo[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)}},$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;let o=n.indexOf(` -`);return n.substring(o+1)}};async function qNo(t){try{let e=await m$e.create(t);wTe.set(t,e)}catch(e){console.error(`[tokenizer] failed to load ${t}, using approximate token counts: ${String(e)}`)}}a(qNo,"setTokenizer");var zln=new Map,Yln=!1;function xFt(t="o200k_base"){if(Yln||(Yln=!0,wTe.set("mock",new IFt)),t==="mock")return Promise.resolve();let e=zln.get(t);return e||(e=qNo(t).catch(()=>{}),zln.set(t,e)),e}a(xFt,"_ensureLoaded");async function wFt(t){let e=t==="cl100k_base"?"cl100k_base":t==="o200k_base"||t===void 0?"o200k_base":void 0;e&&await xFt(e)}a(wFt,"ensureNativeTokenizersLoaded");function Kln(t){let e=t==="cl100k_base"?"cl100k_base":t==="o200k_base"?"o200k_base":void 0;if(!e)return;let r=wTe.get(e);if(r instanceof m$e)return{encode:a((n,o)=>r.encode(n,o),"encode")}}a(Kln,"getNativeEncoder");p();p();var jNo=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},Zln=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)},RFt,g$e,Xln,PFt=class extends qi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),RFt.add(this),g$e.set(this,void 0),jNo(this,g$e,e,"f"),this.error=r}Errors(){return new uU(Zln(this,RFt,"m",Xln).call(this))}};g$e=new WeakMap,RFt=new WeakSet,Xln=a(function*(){this.error&&(yield this.error),yield*Zln(this,g$e,"f")},"_AssertError_Iterator");function Jln(t,e,r){if(!Jo(t,e,r))throw new PFt(KN(t,e,r))}a(Jln,"AssertValue");function A$e(...t){return t.length===3?Jln(t[0],t[1],t[2]):Jln(t[0],[],t[1])}a(A$e,"Assert");p();p();p();function HNo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Qa(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Qa(t[r]);return e}a(HNo,"FromObject");function GNo(t){return t.map(e=>Qa(e))}a(GNo,"FromArray");function $No(t){return t.slice()}a($No,"FromTypedArray");function VNo(t){return new Map(Qa([...t.entries()]))}a(VNo,"FromMap");function WNo(t){return new Set(Qa([...t.entries()]))}a(WNo,"FromSet");function zNo(t){return new Date(t.toISOString())}a(zNo,"FromDate");function Qa(t){if(Pi(t))return GNo(t);if(u_(t))return zNo(t);if(BI(t))return $No(t);if(QHr(t))return VNo(t);if(qHr(t))return WNo(t);if(bo(t))return HNo(t);if(P1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(Qa,"Clone");var vS=class extends qi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function qa(t){return X9(t)?t():Qa(t)}a(qa,"FromDefault");function YNo(t,e){return Qi(t,"default")?qa(t.default):{}}a(YNo,"FromAny");function KNo(t,e){return{}}a(KNo,"FromArgument");function JNo(t,e){if(t.uniqueItems===!0&&!Qi(t,"default"))throw new vS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Qi(t,"default"))throw new vS(t,"Array with the contains constraint requires a default value");return"default"in t?qa(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>CS(t.items,e)):[]}a(JNo,"FromArray");function ZNo(t,e){return Qi(t,"default")?qa(t.default):(async function*(){})()}a(ZNo,"FromAsyncIterator");function XNo(t,e){return Qi(t,"default")?qa(t.default):BigInt(0)}a(XNo,"FromBigInt");function eMo(t,e){return Qi(t,"default")?qa(t.default):!1}a(eMo,"FromBoolean");function tMo(t,e){if(Qi(t,"default"))return qa(t.default);{let r=CS(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(tMo,"FromConstructor");function rMo(t,e){return Qi(t,"default")?qa(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(rMo,"FromDate");function nMo(t,e){return Qi(t,"default")?qa(t.default):()=>CS(t.returns,e)}a(nMo,"FromFunction");function iMo(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return CS(n,[...e,...r])}a(iMo,"FromImport");function oMo(t,e){return Qi(t,"default")?qa(t.default):t.minimum!==void 0?t.minimum:0}a(oMo,"FromInteger");function sMo(t,e){if(Qi(t,"default"))return qa(t.default);{let r=t.allOf.reduce((n,o)=>{let s=CS(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!Jo(t,e,r))throw new vS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(sMo,"FromIntersect");function aMo(t,e){return Qi(t,"default")?qa(t.default):(function*(){})()}a(aMo,"FromIterator");function cMo(t,e){return Qi(t,"default")?qa(t.default):t.const}a(cMo,"FromLiteral");function lMo(t,e){if(Qi(t,"default"))return qa(t.default);throw new vS(t,"Never types cannot be created. Consider using a default value.")}a(lMo,"FromNever");function uMo(t,e){if(Qi(t,"default"))return qa(t.default);throw new vS(t,"Not types must have a default value")}a(uMo,"FromNot");function dMo(t,e){return Qi(t,"default")?qa(t.default):null}a(dMo,"FromNull");function fMo(t,e){return Qi(t,"default")?qa(t.default):t.minimum!==void 0?t.minimum:0}a(fMo,"FromNumber");function pMo(t,e){if(Qi(t,"default"))return qa(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=CS(s,e));return n}}a(pMo,"FromObject");function hMo(t,e){return Qi(t,"default")?qa(t.default):Promise.resolve(CS(t.item,e))}a(hMo,"FromPromise");function mMo(t,e){return Qi(t,"default")?qa(t.default):{}}a(mMo,"FromRecord");function gMo(t,e){return Qi(t,"default")?qa(t.default):CS(ba(t,e),e)}a(gMo,"FromRef");function AMo(t,e){if(Qi(t,"default"))return qa(t.default);throw new vS(t,"RegExp types cannot be created. Consider using a default value.")}a(AMo,"FromRegExp");function yMo(t,e){if(t.pattern!==void 0){if(Qi(t,"default"))return qa(t.default);throw new vS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Qi(t,"default"))return qa(t.default);throw new vS(t,"String types with formats must specify a default value")}else return Qi(t,"default")?qa(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(yMo,"FromString");function EMo(t,e){return Qi(t,"default")?qa(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(EMo,"FromSymbol");function _Mo(t,e){if(Qi(t,"default"))return qa(t.default);if(!N9e(t))throw new vS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return yoe(t)[0]}a(_Mo,"FromTemplateLiteral");function vMo(t,e){if(eun++>RMo)throw new vS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Qi(t,"default")?qa(t.default):CS(ba(t,e),e)}a(vMo,"FromThis");function CMo(t,e){return Qi(t,"default")?qa(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>CS(t.items[n],e))}a(CMo,"FromTuple");function bMo(t,e){if(Qi(t,"default"))return qa(t.default)}a(bMo,"FromUndefined");function SMo(t,e){if(Qi(t,"default"))return qa(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return CS(t.anyOf[0],e)}a(SMo,"FromUnion");function TMo(t,e){return Qi(t,"default")?qa(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(TMo,"FromUint8Array");function IMo(t,e){return Qi(t,"default")?qa(t.default):{}}a(IMo,"FromUnknown");function xMo(t,e){if(Qi(t,"default"))return qa(t.default)}a(xMo,"FromVoid");function wMo(t,e){if(Qi(t,"default"))return qa(t.default);throw new Error("User defined types must specify a default value")}a(wMo,"FromKind");function CS(t,e){let r=Q0(t,e),n=t;switch(n[Tt]){case"Any":return YNo(n,r);case"Argument":return KNo(n,r);case"Array":return JNo(n,r);case"AsyncIterator":return ZNo(n,r);case"BigInt":return XNo(n,r);case"Boolean":return eMo(n,r);case"Constructor":return tMo(n,r);case"Date":return rMo(n,r);case"Function":return nMo(n,r);case"Import":return iMo(n,r);case"Integer":return oMo(n,r);case"Intersect":return sMo(n,r);case"Iterator":return aMo(n,r);case"Literal":return cMo(n,r);case"Never":return lMo(n,r);case"Not":return uMo(n,r);case"Null":return dMo(n,r);case"Number":return fMo(n,r);case"Object":return pMo(n,r);case"Promise":return hMo(n,r);case"Record":return mMo(n,r);case"Ref":return gMo(n,r);case"RegExp":return AMo(n,r);case"String":return yMo(n,r);case"Symbol":return EMo(n,r);case"TemplateLiteral":return _Mo(n,r);case"This":return vMo(n,r);case"Tuple":return CMo(n,r);case"Undefined":return bMo(n,r);case"Union":return SMo(n,r);case"Uint8Array":return TMo(n,r);case"Unknown":return IMo(n,r);case"Void":return xMo(n,r);default:if(!d_.Has(n[Tt]))throw new vS(n,"Unknown type");return wMo(n,r)}}a(CS,"Visit");var RMo=512,eun=0;function gk(...t){return eun=0,t.length===2?CS(t[0],t[1]):CS(t[0],[])}a(gk,"Create");var y$e=class extends qi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function tun(t,e,r){if(t[Tt]==="Object"&&typeof r=="object"&&!KB(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=Jo(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=>ba(s,e)).map(s=>tun(s,e,r));return Math.max(...o)}else return Jo(t,e,r)?1:0}a(tun,"ScoreUnion");function PMo(t,e,r){let n=t.anyOf.map(c=>ba(c,e)),[o,s]=[n[0],0];for(let c of n){let l=tun(c,e,r);l>s&&(o=c,s=l)}return o}a(PMo,"SelectUnion");function kMo(t,e,r){if("default"in t)return typeof r=="function"?t.default:Qa(t.default);{let n=PMo(t,e,r);return RTe(n,e,r)}}a(kMo,"CastUnion");function DMo(t,e,r){return Jo(t,e,r)?Qa(r):gk(t,e)}a(DMo,"DefaultClone");function NMo(t,e,r){return Jo(t,e,r)?r:gk(t,e)}a(NMo,"Default");function MMo(t,e,r){if(Jo(t,e,r))return Qa(r);let n=Pi(r)?Qa(r):gk(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=>Ak(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!Jo(t,e,l))throw new y$e(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(MMo,"FromArray");function OMo(t,e,r){if(Jo(t,e,r))return gk(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]=Ak(c,e,r.prototype[s]));return o}a(OMo,"FromConstructor");function BMo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Ak(o,[...e,...n],r)}a(BMo,"FromImport");function nun(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?nun(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(nun,"IntersectAssign");function LMo(t,e,r){if(Jo(t,e,r))return r;let n=gk(t,e),o=nun(n,r);return Jo(t,e,o)?o:n}a(LMo,"FromIntersect");function FMo(t,e,r){throw new y$e(t,"Never types cannot be cast")}a(FMo,"FromNever");function UMo(t,e,r){if(Jo(t,e,r))return r;if(r===null||typeof r!="object")return gk(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]=Ak(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]=Ak(t.additionalProperties,e,r[c]))}return o}a(UMo,"FromObject");function QMo(t,e,r){if(Jo(t,e,r))return Qa(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return gk(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=Ak(o,e,l);return s}a(QMo,"FromRecord");function qMo(t,e,r){return Ak(ba(t,e),e,r)}a(qMo,"FromRef");function jMo(t,e,r){return Ak(ba(t,e),e,r)}a(jMo,"FromThis");function HMo(t,e,r){return Jo(t,e,r)?Qa(r):Pi(r)?t.items===void 0?[]:t.items.map((n,o)=>Ak(n,e,r[o])):gk(t,e)}a(HMo,"FromTuple");function GMo(t,e,r){return Jo(t,e,r)?Qa(r):kMo(t,e,r)}a(GMo,"FromUnion");function Ak(t,e,r){let n=va(t.$id)?Q0(t,e):e,o=t;switch(t[Tt]){case"Array":return MMo(o,n,r);case"Constructor":return OMo(o,n,r);case"Import":return BMo(o,n,r);case"Intersect":return LMo(o,n,r);case"Never":return FMo(o,n,r);case"Object":return UMo(o,n,r);case"Record":return QMo(o,n,r);case"Ref":return qMo(o,n,r);case"This":return jMo(o,n,r);case"Tuple":return HMo(o,n,r);case"Union":return GMo(o,n,r);case"Date":case"Symbol":case"Uint8Array":return DMo(t,e,r);default:return NMo(o,n,r)}}a(Ak,"Visit");function RTe(...t){return t.length===3?Ak(t[0],t[1],t[2]):Ak(t[0],[],t[1])}a(RTe,"Cast");p();function $Mo(t){return tU(t)&&t[Tt]!=="Unsafe"}a($Mo,"IsCheckable");function VMo(t,e,r){return Pi(r)?r.map(n=>CC(t.items,e,n)):r}a(VMo,"FromArray");function WMo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return CC(o,[...e,...n],r)}a(WMo,"FromImport");function zMo(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>CC(l,e,Qa(r))).reduce((l,u)=>bo(u)?{...l,...u}:u,{});if(!bo(r)||!bo(s)||!tU(n))return s;let c=tC(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||Jo(n,e,r[l])&&(s[l]=CC(n,e,r[l]));return s}a(zMo,"FromIntersect");function YMo(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]=CC(t.properties[o],e,r[o]);continue}if(tU(n)&&Jo(n,e,r[o])){r[o]=CC(n,e,r[o]);continue}delete r[o]}return r}a(YMo,"FromObject");function KMo(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]=CC(c,e,r[u]);continue}if(tU(n)&&Jo(n,e,r[u])){r[u]=CC(n,e,r[u]);continue}delete r[u]}return r}a(KMo,"FromRecord");function JMo(t,e,r){return CC(ba(t,e),e,r)}a(JMo,"FromRef");function ZMo(t,e,r){return CC(ba(t,e),e,r)}a(ZMo,"FromThis");function XMo(t,e,r){if(!Pi(r))return r;if(Ou(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(XMo,"FromTuple");function eOo(t,e,r){for(let n of t.anyOf)if($Mo(n)&&Jo(n,e,r))return CC(n,e,r);return r}a(eOo,"FromUnion");function CC(t,e,r){let n=va(t.$id)?Q0(t,e):e,o=t;switch(o[Tt]){case"Array":return VMo(o,n,r);case"Import":return WMo(o,n,r);case"Intersect":return zMo(o,n,r);case"Object":return YMo(o,n,r);case"Record":return KMo(o,n,r);case"Ref":return JMo(o,n,r);case"This":return ZMo(o,n,r);case"Tuple":return XMo(o,n,r);case"Union":return eOo(o,n,r);default:return r}}a(CC,"Visit");function E$e(...t){return t.length===3?CC(t[0],t[1],t[2]):CC(t[0],[],t[1])}a(E$e,"Clean");p();function _$e(t){return va(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(_$e,"IsStringNumeric");function tOo(t){return nA(t)||WN(t)||ai(t)}a(tOo,"IsValueToString");function PTe(t){return t===!0||ai(t)&&t===1||nA(t)&&t===BigInt("1")||va(t)&&(t.toLowerCase()==="true"||t==="1")}a(PTe,"IsValueTrue");function kTe(t){return t===!1||ai(t)&&(t===0||Object.is(t,-0))||nA(t)&&t===BigInt("0")||va(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(kTe,"IsValueFalse");function rOo(t){return va(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(rOo,"IsTimeStringWithTimeZone");function nOo(t){return va(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(nOo,"IsTimeStringWithoutTimeZone");function iOo(t){return va(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(iOo,"IsDateTimeStringWithTimeZone");function oOo(t){return va(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(oOo,"IsDateTimeStringWithoutTimeZone");function sOo(t){return va(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(sOo,"IsDateString");function aOo(t,e){let r=oun(t);return r===e?r:t}a(aOo,"TryConvertLiteralString");function cOo(t,e){let r=sun(t);return r===e?r:t}a(cOo,"TryConvertLiteralNumber");function lOo(t,e){let r=iun(t);return r===e?r:t}a(lOo,"TryConvertLiteralBoolean");function uOo(t,e){return va(t.const)?aOo(e,t.const):ai(t.const)?cOo(e,t.const):WN(t.const)?lOo(e,t.const):e}a(uOo,"TryConvertLiteral");function iun(t){return PTe(t)?!0:kTe(t)?!1:t}a(iun,"TryConvertBoolean");function dOo(t){let e=a(r=>r.split(".")[0],"truncateInteger");return _$e(t)?BigInt(e(t)):ai(t)?BigInt(Math.trunc(t)):kTe(t)?BigInt(0):PTe(t)?BigInt(1):t}a(dOo,"TryConvertBigInt");function oun(t){return JB(t)&&t.description!==void 0?t.description.toString():tOo(t)?t.toString():t}a(oun,"TryConvertString");function sun(t){return _$e(t)?parseFloat(t):PTe(t)?1:kTe(t)?0:t}a(sun,"TryConvertNumber");function fOo(t){return _$e(t)?parseInt(t):ai(t)?Math.trunc(t):PTe(t)?1:kTe(t)?0:t}a(fOo,"TryConvertInteger");function pOo(t){return va(t)&&t.toLowerCase()==="null"?null:t}a(pOo,"TryConvertNull");function hOo(t){return va(t)&&t==="undefined"?void 0:t}a(hOo,"TryConvertUndefined");function mOo(t){return u_(t)?t:ai(t)?new Date(t):PTe(t)?new Date(1):kTe(t)?new Date(0):_$e(t)?new Date(parseInt(t)):nOo(t)?new Date(`1970-01-01T${t}.000Z`):rOo(t)?new Date(`1970-01-01T${t}`):oOo(t)?new Date(`${t}.000Z`):iOo(t)?new Date(t):sOo(t)?new Date(`${t}T00:00:00.000Z`):t}a(mOo,"TryConvertDate");function gOo(t,e,r){return(Pi(r)?r:[r]).map(o=>yk(t.items,e,o))}a(gOo,"FromArray");function AOo(t,e,r){return dOo(r)}a(AOo,"FromBigInt");function yOo(t,e,r){return iun(r)}a(yOo,"FromBoolean");function EOo(t,e,r){return mOo(r)}a(EOo,"FromDate");function _Oo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return yk(o,[...e,...n],r)}a(_Oo,"FromImport");function vOo(t,e,r){return fOo(r)}a(vOo,"FromInteger");function COo(t,e,r){return t.allOf.reduce((n,o)=>yk(o,e,n),r)}a(COo,"FromIntersect");function bOo(t,e,r){return uOo(t,r)}a(bOo,"FromLiteral");function SOo(t,e,r){return pOo(r)}a(SOo,"FromNull");function TOo(t,e,r){return sun(r)}a(TOo,"FromNumber");function IOo(t,e,r){if(!bo(r)||Pi(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Qi(r,n)&&(r[n]=yk(t.properties[n],e,r[n]));return r}a(IOo,"FromObject");function xOo(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]=yk(s,e,l);return r}a(xOo,"FromRecord");function wOo(t,e,r){return yk(ba(t,e),e,r)}a(wOo,"FromRef");function ROo(t,e,r){return oun(r)}a(ROo,"FromString");function POo(t,e,r){return va(r)||ai(r)?Symbol(r):r}a(POo,"FromSymbol");function kOo(t,e,r){return yk(ba(t,e),e,r)}a(kOo,"FromThis");function DOo(t,e,r){return Pi(r)&&!Ou(t.items)?r.map((o,s)=>s{let c=I_(s,e,n);return bo(c)?{...o,...c}:c},{})}a(FOo,"FromIntersect");function UOo(t,e,r){let n=c3(t,r);if(!bo(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=I_(t.properties[s],e,n[s]);Ou(c)||(n[s]=I_(t.properties[s],e,n[s]))}if(!kFt(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=I_(t.additionalProperties,e,n[s]));return n}a(UOo,"FromObject");function QOo(t,e,r){let n=c3(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)&&kFt(c)&&(n[u]=I_(c,e,n[u]));if(!kFt(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=I_(o,e,n[u]));return n}a(QOo,"FromRecord");function qOo(t,e,r){return I_(ba(t,e),e,c3(t,r))}a(qOo,"FromRef");function jOo(t,e,r){return I_(ba(t,e),e,r)}a(jOo,"FromThis");function HOo(t,e,r){let n=c3(t,r);if(!Pi(n)||Ou(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;cVOo,Format:()=>DTe,Get:()=>zOo,Has:()=>WOo,Set:()=>$Oo,ValuePointerRootDeleteError:()=>S$e,ValuePointerRootSetError:()=>b$e});p();var b$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}},S$e=class extends qi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function cun(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(cun,"Escape");function*DTe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nvY(t[o],e[o]))}a(YOo,"ObjectType");function KOo(t,e){return u_(e)&&t.getTime()===e.getTime()}a(KOo,"DateType");function JOo(t,e){return!Pi(e)||t.length!==e.length?!1:t.every((r,n)=>vY(r,e[n]))}a(JOo,"ArrayType");function ZOo(t,e){return!BI(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>vY(r,e[n]))}a(ZOo,"TypedArrayType");function XOo(t,e){return t===e}a(XOo,"ValueType");function vY(t,e){if(u_(t))return KOo(t,e);if(BI(t))return ZOo(t,e);if(Pi(t))return JOo(t,e);if(bo(t))return YOo(t,e);if(P1(t))return XOo(t,e);throw new Error("ValueEquals: Unable to compare value")}a(vY,"Equal");var e5o=ec({type:oa("insert"),path:f_(),value:OP()}),t5o=ec({type:oa("update"),path:f_(),value:OP()}),r5o=ec({type:oa("delete"),path:f_()}),uun=Xa([e5o,t5o,r5o]),T$e=class extends qi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function I$e(t,e){return{type:"update",path:t,value:e}}a(I$e,"CreateUpdate");function dun(t,e){return{type:"insert",path:t,value:e}}a(dun,"CreateInsert");function fun(t){return{type:"delete",path:t}}a(fun,"CreateDelete");function lun(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new T$e(t,"Cannot diff objects with symbols")}a(lun,"AssertDiffable");function*n5o(t,e,r){if(lun(e),lun(r),!UPt(r))return yield I$e(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Qi(e,s)||(yield dun(`${t}/${s}`,r[s]));for(let s of n)Qi(r,s)&&(vY(e,r)||(yield*x$e(`${t}/${s}`,e[s],r[s])));for(let s of n)Qi(r,s)||(yield fun(`${t}/${s}`))}a(n5o,"ObjectType");function*i5o(t,e,r){if(!Pi(r))return yield I$e(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(a5o,"IsRootUpdate");function c5o(t){return t.length===0}a(c5o,"IsIdentity");function hun(t,e){if(a5o(e))return Qa(e[0].value);if(c5o(e))return Qa(t);let r=Qa(t);for(let n of e)switch(n.type){case"insert":{Ek.Set(r,n.path,n.value);break}case"update":{Ek.Set(r,n.path,n.value);break}case"delete":{Ek.Delete(r,n.path);break}}return r}a(hun,"Patch");p();function mun(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=sL(e,r)?Moe(e,r,n):n;if(!Jo(e,r,o))throw new Noe(e,o,KN(e,r,o).First());return o}a(mun,"Encode");p();function w$e(t){return bo(t)&&!Pi(t)}a(w$e,"IsStandardObject");var R$e=class extends qi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function l5o(t,e,r,n){if(!w$e(r))Ek.Set(t,e,Qa(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)DFt(t,`${e}/${c}`,r[c],n[c])}}a(l5o,"ObjectType");function u5o(t,e,r,n){if(!Pi(r))Ek.Set(t,e,Qa(n));else{for(let o=0;o(A$e(s,c,l),l)],["Cast",(s,c,l)=>RTe(s,c,l)],["Clean",(s,c,l)=>E$e(s,c,l)],["Clone",(s,c,l)=>Qa(l)],["Convert",(s,c,l)=>v$e(s,c,l)],["Decode",(s,c,l)=>sL(s,c)?Doe(s,c,l):l],["Default",(s,c,l)=>C$e(s,c,l)],["Encode",(s,c,l)=>sL(s,c)?Moe(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})(NFt||(NFt={}));var yun=["Clone","Clean","Default","Convert","Assert","Decode"];function h5o(t,e,r,n){return t.reduce((o,s)=>{let c=NFt.Get(s);if(Ou(c))throw new P$e(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(h5o,"ParseValue");function Eun(...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]]:[yun,t[0],t[1],t[2]]:t.length===2?[yun,t[0],[],t[1]]:(()=>{throw new P$e("Invalid Arguments")})();return h5o(e,r,n,o)}a(Eun,"Parse");p();var VM={};Ri(VM,{Assert:()=>A$e,Cast:()=>RTe,Check:()=>Jo,Clean:()=>E$e,Clone:()=>Qa,Convert:()=>v$e,Create:()=>gk,Decode:()=>aun,Default:()=>C$e,Diff:()=>pun,Edit:()=>uun,Encode:()=>mun,Equal:()=>vY,Errors:()=>KN,Hash:()=>lU,Mutate:()=>Aun,Parse:()=>Eun,Patch:()=>hun,ValueErrorIterator:()=>uU});p();var m5o="gpt-41-copilot",Px=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&Es(this._ctx,n=>this.refreshAvailableModels(n))}static{a(this,"AvailableModelsManager")}async refreshAvailableModels(e){await this.refreshModels(e);for(let r of this.onModelsFetchedCallbacks)r()}addHandler(e){this.onModelsFetchedCallbacks.push(e)}getDefaultModelId(){if(this.fetchedModelData){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return m5o}parseModelsResponse(e){try{return VM.Parse(Qln,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 _Y(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=jln(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,Ke.DebugOverrideEngine)||Ft(this._ctx,Ke.DebugOverrideEngineLegacy);if(o)return new CY(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 CY(s,"exp"):new CY(n,"modelpicker"):s?new CY(s,"exp"):new CY(r,"default")}},CY=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function eQ(t,e=void 0){let r=t.get(Px),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(eQ,"getEngineRequestInfo");p();p();var $o=class{static{a(this,"FileSystem")}};var Fun=de(Lun());function Uun(t){return t!==void 0&&t!==0}a(Uun,"isRepoInfo");function Qun(t){if(t===void 0||t===0)return"";let e=bY(t);if(e==="github/github")return e;let r=q5o(t)?.toLowerCase();return r!==void 0?r:""}a(Qun,"getDogFood");function bY(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(bY,"tryGetGitHubNWO");function q5o(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(q5o,"tryGetADONWO");function tQ(t,e){let r=sf(e);return j5o(t,r)}a(tQ,"extractRepoInfoInBackground");var j5o=V5o(H5o,1e4);async function H5o(t,e){let r=GYr(e);if(!r)return;let n=await G5o(t,r);if(!n)return;let o=t.get($o),s=Ia(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=$5o(c)??"",u=LFt(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(H5o,"extractRepoInfo");function LFt(t){let e;try{if(e=(0,Fun.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(LFt,"parseRepoUrl");async function G5o(t,e){let r=e+"_add_to_make_longer",n=t.get($o);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 BFt(d)),n.delete(c)}),0}}a(V5o,"computeInBackgroundAndMemoize");p();var NTe=500,qun=8192-NTe,jun=4,k$e=10,Hun=1e3*5,D$e={prefix:35,suffix:15,stableContext:35,volatileContext:15},W5o={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function MTe(t){return t=t.toLowerCase(),W5o[t]??t}a(MTe,"normalizeLanguageId");var FFt=class{constructor(e){this.ctx=e;this.cache=new En(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 UFt(()=>this.ctx.get(sk).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()}},UFt=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 z5o(t){return"uri"in t}a(z5o,"isCompletionsFiltersInfo");var Zt=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new FFt(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 VI)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&z5o(r)?tQ(this.ctx,r.uri):void 0,s=bY(o)??"",c=Qun(o)??"",l=r?.languageId??"",u=eQ(this.ctx).modelId,d=L7r(e),f=e.getTokenValue("ol")??"",h=e.getTokenValue("tid")??"",g=this.ctx.get(Pp).getProperties(),A=e.endpoints,y={"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":g.sku||""},E=this.getGranularityDirectory(),_=this.makeFilterSettings(y),v=E.extendFilters(_),b=await this.getExpConfig(v.newFilterSettings,A);E.update(_,+(b.variables.copilotbycallbuckets??NaN),+(b.variables.copilottimeperiodsizeinh??NaN));let T=E.extendFilters(_),w=T.newFilterSettings,R=await this.getExpConfig(w,A),x=new Promise(P=>setTimeout(P,t.upcomingDynamicFilterCheckDelayMs));for(let P of T.otherFilterSettingsToPrefetch)x=x.then(async()=>{await new Promise(D=>setTimeout(D,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(P,A)});return this.prepareForUpcomingFilters(w,A),new VI(n.properties,n.measurements,n.issuedTime,{filters:w,exp:R})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){let n=await this.ctx.get(Ut).getToken();return await this.updateExPValuesAndAssignments(n,e,r)}getGranularityDirectory(){if(!this.granularityDirectory){let e=this.ctx.get(La).machineId;this.granularityDirectory=new rje(e,this.ctx.get(Ax))}return this.granularityDirectory}makeFilterSettings(e){return new VB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return Jv.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 VB({}));return JSON.stringify(e?.variables??{})}async getFallbackExpAndFilters(){let e=this.makeFilterSettings({}),r=dL(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??D$e.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??k$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??qun+NTe}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??Hun}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??D$e.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??D$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}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 N$e(t){let e=Ft(t,Ke.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(N$e,"isSearchAgentEnabled");function $un(t,e){let r=Ft(t,Ke.EnableCopilotNesNonFree);return r==="true"?!0:r==="false"?!1:t.get(Zt).ideEnableCopilotNesNonFreeEnabled(e)}a($un,"isIdeEnableCopilotNesNonFreeEnabled");p();p();p();var M$e=de($ce());var qFt={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 bS(t){return t in qFt&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(bS,"isSupportedLanguageId");function O$e(t){if(!(t in qFt))throw new Error(`Unrecognized language: ${t}`);return qFt[t]}a(O$e,"languageIdToWasmLanguage");var QFt=new Map;async function Y5o(t){let e;try{e=await p$e(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new Z7(`Could not load tree-sitter-${t}.wasm`,r):r}return M$e.default.Language.load(e)}a(Y5o,"loadWasmLanguage");function HFt(t){let e=O$e(t);if(!QFt.has(e)){let r=Y5o(e);QFt.set(e,r)}return QFt.get(e)}a(HFt,"getLanguage");var jFt=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function rQ(t,e){return(await GFt(t,e))[0]}a(rQ,"parseTreeSitter");async function GFt(t,e){await M$e.default.init({locateFile:a(s=>ITe(s),"locateFile")});let r;try{r=new M$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 jFt(`Could not init Parse for language <${t}>`,s):s}let n=await HFt(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(GFt,"parseTreeSitterIncludingVersion");function Vun(t){switch(O$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(Vun,"getBlockCloseToken");function K5o(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(K5o,"innerQuery");var J5o=[`[ +`);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=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function Wun(t){return K5o([J5o],t).length==1}a(Wun,"queryPythonIsDocstring");var WM=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 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(` `)}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}}},Z0=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 Vce.languageIds.has(e)||Wce.languageIds.has(e)||OTe.languageIds.has(e)||zce.languageIds.has(e)||BTe.languageIds.has(e)||LTe.languageIds.has(e)||FTe.languageIds.has(e)||UTe.languageIds.has(e)||QTe.languageIds.has(e)}static isTrimmedByDefault(e){return Vce.languageIds.has(e)||Wce.languageIds.has(e)||zce.languageIds.has(e)}static create(e,r,n,o){if(Vce.languageIds.has(e))return new Vce(e,r,n,o);if(Wce.languageIds.has(e))return new Wce(e,r,n,o);if(OTe.languageIds.has(e))return new OTe(e,r,n,o);if(zce.languageIds.has(e))return new zce(e,r,n,o);if(FTe.languageIds.has(e))return new FTe(e,r,n,o);if(BTe.languageIds.has(e))return new BTe(e,r,n,o);if(LTe.languageIds.has(e))return new LTe(e,r,n,o);if(UTe.languageIds.has(e))return new UTe(e,r,n,o);if(QTe.languageIds.has(e))return new QTe(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 rQ(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}}},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(` `),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(` -`)}},B$e=class t extends WM{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"}},Vce=class extends Z0{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new B$e(e)}getStatementQueryText(){return`[ +`)}},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`[ (export_statement) (import_statement) (debugger_statement) @@ -1792,7 +1797,7 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (field_definition) - ] @statement`}},Wce=class extends Z0{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new B$e(e)}getStatementQueryText(){return`[ + ] @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`[ (export_statement) (import_statement) (debugger_statement) @@ -1815,7 +1820,7 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},$Ft=class t extends WM{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}},OTe=class extends Z0{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new $Ft(e)}getStatementQueryText(){return`[ + ] @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`[ (future_import_statement) (import_statement) (import_from_statement) @@ -1841,24 +1846,24 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la (decorated_definition) (match_statement) (block) - ] @statement`}},VFt=class t extends WM{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)}},zce=class extends Z0{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new VFt(e)}getStatementQueryText(){return`[ + ] @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`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},WFt=class t extends WM{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)}},BTe=class extends Z0{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new WFt(e)}getStatementQueryText(){return`[ + ] @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) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},zFt=class t extends WM{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)}},LTe=class extends Z0{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new zFt(e)}getStatementQueryText(){return`[ + ] @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) (when) - ] @statement`}},YFt=class t extends WM{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"}},FTe=class extends Z0{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new YFt(e)}getStatementQueryText(){return`[ + ] @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) (field_declaration) (record_declaration) @@ -1871,7 +1876,7 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la (block) (static_initializer) (constructor_declaration) - ] @statement`}},KFt=class t extends WM{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"}},UTe=class extends Z0{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new KFt(e)}getStatementQueryText(){return`[ + ] @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`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -1883,7 +1888,7 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la (declaration) (accessor_declaration) (block) - ] @statement`}},JFt=class t extends WM{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)}},QTe=class extends Z0{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new JFt(e)}getStatementQueryText(){return`[ + ] @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`[ (declaration) (function_definition) (type_definition) @@ -1920,7 +1925,7 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}};var zM=class{constructor(e,r,n){this.languageId=e;this.prefix=r;this.completion=n}static{a(this,"BlockTrimmer")}static isSupported(e){return Z0.isSupported(e)}static isTrimmedByDefault(e){return Z0.isTrimmedByDefault(e)}async withParsedStatementTree(e){var n=[];try{let r=YRt(n,Z0.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{KRt(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 L$e=class extends zM{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.endIndexc4o,build:()=>o4o,buildType:()=>s4o,default:()=>h4o,dependencies:()=>d4o,description:()=>n4o,devDependencies:()=>u4o,displayName:()=>r4o,engines:()=>a4o,name:()=>t4o,overrides:()=>f4o,overridesComments:()=>p4o,scripts:()=>l4o,version:()=>i4o});var t4o="copilot",r4o="GitHub Copilot",n4o="Your AI pair programmer",i4o="1.515.0",o4o="62",s4o="prod",a4o={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},c4o={cliPackageVersion:"2.1.159"},l4o={postinstall:"tsx script/copyCopilotSdkFiles.ts && tsx script/chatLibPatch/patchChatLib.ts",build:"tsx esbuild.ts && tsx script/chatLibPatch/verifyChatLibPatch.ts",clean:"./script/build/clean.sh",compress:"tsx ./script/compressTokenizer.ts",generate_languages:"tsx script/generateLanguages.ts && prettier --write lib/src/language/generatedLanguages.ts",get_token:"tsx script/deviceFlow.ts --save-as-test-token",lint:'run-p --aggregate-output "lint:*"',"lint:deps":"depcruise -c .dependency-cruiser.js .","lint:eslint":"eslint -f visualstudio --quiet --cache .","lint:overrides":"tsx script/checkOverridesDocumented.ts","lint:prettier":"prettier --check . 2>&1","lint:types":"tsc --noEmit",inspect_auth_db:"tsx script/inspectAuthDb.ts",prebuild:"npm install",pretest:"npm run build","pretest:headless":"npm run build","pretest:lsp-client":"npm run build","pretest:lib-e2e":"npm run build",prewatch:"npm run build","prewatch:esbuild":"npm run build",start:"npm run watch",test:'npm-run-all "test:headless --ignore-scripts" lint',"test:headless":'npm-run-all test:lib test:agent "test:lib-e2e --ignore-scripts" test:prompt "test:lsp-client --ignore-scripts" lint',"test:agent":'mocha "agent/src/**/*.test.{ts,tsx}"',"test:lib":'mocha "lib/src/**/*.test.{ts,tsx}" "script/**/*.test.{ts,tsx}" --exclude "lib/src/**/*.int.test.ts"',"test:lib-int":'mocha "lib/src/**/*.int.test.ts"',"test:lib-e2e":'mocha "lib/e2e/src/**/*.test.{ts,tsx}" --exclude "lib/e2e/src/prompt/**/*.test.ts"',"test:lib-e2e-no-ci":'mocha "lib/e2e/no-ci/**/*.test.{ts,tsx}"',"test:lib-prompt-e2e":'mocha "lib/e2e/src/prompt/prompt.test.ts"',"test:lib-prompt-e2e-perf":"INCLUDE_PERFORMANCE=true npm run test:lib-prompt-e2e","test:lsp-client":'mocha "lsp-client/test/*.test.{ts,tsx}"',"test:prompt":'mocha "prompt/test/**/*.test.{ts,tsx}"',"test:prepare-msbench":"tsx script/setupMsbench.ts","test:run-msbench":"tsx lsp-client/test/msbench/agent/index.ts",watch:'run-p "watch:esbuild --ignore-scripts" "watch:types -- --preserveWatchOutput"',"watch:esbuild":"tsx esbuild.ts --watch","watch:types":"tsc --noEmit --watch"},u4o={"@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.6.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.44.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"},d4o={"@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.51.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"},f4o={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"},p4o={"//":"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'."},h4o={name:t4o,displayName:r4o,description:n4o,version:i4o,build:o4o,buildType:s4o,engines:a4o,anthropicClaude:c4o,scripts:l4o,devDependencies:u4o,dependencies:d4o,overrides:f4o,overridesComments:p4o};var Ke={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",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 Jun(t){return["server","parsingandserver"].includes(t)}a(Jun,"shouldDoServerTrimming");var vk=class{static{a(this,"BlockModeConfig")}},Yce=class extends vk{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Zt).overrideBlockMode(n);if(o)return ZFt(o,r);let s=e.get(Zt).enableProgressiveReveal(n);return(Ft(e,Ke.AlwaysRequestMultiline)??s)||zM.isTrimmedByDefault(r)?ZFt("moremultiline",r):r=="ruby"?"parsing":bS(r)?"parsingandserver":"server"}};function m4o(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(m4o,"blockModeRequiresTreeSitter");function ZFt(t,e){return t==="moremultiline"&&Z0.isSupported(e)?t:m4o(t)&&!bS(e)?"server":t}a(ZFt,"toApplicableBlockMode");var Mo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},Kce=class extends Mo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return g4o(r)}getOptionalConfig(r){return A4o(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},SY=class extends Mo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new Hi;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new Hi;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=qTe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[Ke.ShowEditorCompletions,Ke.EnableAutoCompletions,Ke.DelayCompletions,Ke.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function Zun(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(Zun,"getConfigKeyRecursively");function g4o(t){if(F$e.has(t))return F$e.get(t);throw new Error(`Missing config default value: ${XRt}.${t}`)}a(g4o,"getConfigDefaultForKey");function A4o(t){return F$e.get(t)}a(A4o,"getOptionalConfigDefaultForKey");function Jce(t){return t.get(Mo).getExplicitlySetConfigs()}a(Jce,"getExplicitlySetConfigs");var y4o={[Ke.DebugOverrideCppHeadersEnableSwitch]:!1,[Ke.RelatedFilesVSCodeCSharp]:!1,[Ke.RelatedFilesVSCodeTypeScript]:!1,[Ke.RelatedFilesVSCode]:!1,[Ke.IncludeNeighboringFiles]:!1,[Ke.ExcludeRelatedFiles]:!1,[Ke.ContextProviders]:[],[Ke.DebugUseEditorFetcher]:null,[Ke.DebugUseElectronFetcher]:null,[Ke.DebugOverrideLogLevels]:{},[Ke.DebugSnippyOverrideUrl]:"",[Ke.AgentDebugLogsDirectory]:void 0,[Ke.ClaudeCliPath]:void 0,[Ke.CodexCliPath]:void 0,[Ke.FetchStrategy]:"auto",[Ke.ToolConfirmAutoApprove]:!1,[Ke.AutoApproveUnmatchedTerminal]:void 0,[Ke.AutoApproveUnmatchedFileOp]:void 0,[Ke.TrustToolAnnotations]:!1,[Ke.AutoApproveYoloMode]:!1,[Ke.EditorHandlesAllConfirmation]:!1,[Ke.MaxToolCallingLoop]:25,[Ke.AutoCompress]:!1,[Ke.AnthropicThinkingBudgetToken]:1024,[Ke.EnableSkills]:!1,[Ke.EnableHooks]:!1,[Ke.EnableSandbox]:!1,[Ke.EnablePlugins]:!1,[Ke.EnableCustomAgents]:!0,[Ke.EnableOrgCustomAgents]:!0,[Ke.UseAgentsMd]:!1,[Ke.UseNestedAgentsMd]:!1,[Ke.UseClaudeMd]:!1,[Ke.UseNestedClaudeMd]:!1,[Ke.UseSubsetMatching]:null,[Ke.ContextProviderTimeBudget]:void 0,[Ke.DebugOverrideCapiUrl]:"",[Ke.DebugTestOverrideCapiUrl]:"",[Ke.DebugOverrideProxyUrl]:"",[Ke.DebugTestOverrideProxyUrl]:"",[Ke.DebugOverrideEngine]:"",[Ke.AlwaysRequestMultiline]:void 0,[Ke.ModelAlwaysTerminatesSingleline]:void 0,[Ke.TrimCompletionsAggressively]:void 0,[Ke.CompletionsDebounce]:void 0,[Ke.NESXTab]:void 0,[Ke.UseWorkspaceContextCoordinator]:void 0,[Ke.ShowWorkspaceContextDebugger]:!1,[Ke.CompletionsDelay]:void 0,[Ke.UseSplitContextPrompt]:void 0,[Ke.UseCompletionsComparisonPanel]:void 0,[Ke.ComparisonPanelModelIds]:void 0,[Ke.ComparisonPanelRandomizedMode]:void 0,[Ke.UseFetchFetcher]:void 0,[Ke.UseChatLibCompletions]:void 0,[Ke.TranscriptDirectory]:void 0,[Ke.EnableThinking]:!0,[Ke.ShowEditorCompletions]:void 0,[Ke.EnableAutoCompletions]:void 0,[Ke.DelayCompletions]:void 0,[Ke.FilterCompletions]:void 0,[Ke.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[Ke.UserSelectedCompletionModel]:"",[Ke.DebugFilterLogCategories]:[],[Ke.DebugOverrideEngineLegacy]:"",[Ke.DebugTestOverrideProxyUrlLegacy]:"",[Ke.DebugOverrideProxyUrlLegacy]:"",[Ke.DebugTestOverrideCapiUrlLegacy]:"",[Ke.DebugOverrideCapiUrlLegacy]:"",[Ke.HookErrorOccurredStackTrace]:!1,[Ke.NESUseExplicitRejection]:!1,[Ke.AppendPromptTokenCache]:"",[Ke.PromptPersistBasePath]:void 0,[Ke.AnthropicMessagesEndpoint]:"",[Ke.EnableCopilotNesNonFree]:"",[Ke.UseHelixFetcher]:"",[Ke.EnableMapCodeFallback]:"enabled",[Ke.SearchAgent]:"",[Ke.PerfEnabled]:"",[Ke.NESExtendedRange]:!1,[Ke.TransparentTokenRefresh]:"",[Ke.AuthTokenEncryption]:"",[Ke.DisableWorkspaceIndex]:""},F$e=new Map(Object.entries(y4o));for(let t of Object.values(Ke))if(!F$e.has(t))throw new Error(`Missing config default value ${XRt}.${t}`);function Ft(t,e){return t.get(Mo).getConfig(e)}a(Ft,"getConfig");function Ck(t){return Ft(t,Ke.DisableWorkspaceIndex)==="true"}a(Ck,"isWorkspaceIndexDisabled");function LYr(t){return t.get(Mo).dumpForTelemetry()}a(LYr,"dumpForTelemetry");var as=class{constructor(){this.packageJson=jTe}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 oDt(t){return t.get(as).isProduction()}a(oDt,"isProduction");function Gen(t){return t.get(as).getBuildType()==="dev"}a(Gen,"isDevBuild");function _U(t){return t.get(as).getBuildType()}a(_U,"getBuildType");function FYr(t){return t.get(as).getBuild()}a(FYr,"getBuild");function U1(t){return t.get(as).getVersion()}a(U1,"getVersion");var La=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 x1({name:t,version:e}){return`${t}/${e}`}a(x1,"formatNameAndVersion");var Ir=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return B7r({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}isEditorPluginInfoKnown(){return!0}};function a$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(a$e,"getIntegrationId");function Oy(t){let e=t.get(Ir);return{"Editor-Version":x1(e.getEditorInfo()),"Editor-Plugin-Version":x1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":U1(t)}}a(Oy,"editorVersionHeaders");var Xun="Iv1.b507a08c87ecfe98",E4o="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Nae="Ov23liV9UpD7Rnfnskm3",_4o="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",v4o={[Xun]:E4o,[Nae]:_4o},Hp=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??Xun}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=v4o[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};p();var C4o=new pe("expConfigManager"),b4o=3600*1e3,YM=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){C4o.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};function $en(t){let e=Ft(t,Ke.TransparentTokenRefresh);if(e==="true")return{value:!0,source:"config"};if(e==="false")return{value:!1,source:"config"};let r=t.get(YM).getBoolean("copilottransparenttokenrefresh");return typeof r=="boolean"?{value:r,source:"exp"}:{value:!1,source:"default"}}a($en,"resolveTransparentTokenRefresh");function edn(t){return Ft(t,Ke.AuthTokenEncryption)==="false"}a(edn,"isAuthTokenEncryptionDisabled");p();var adn=de(require("node:crypto"));var XFt=new pe("KeytarMasterKey"),ndn="copilot-language-server",idn="oauth-token-key",odn=5e3,cdn=32,e8t;function I4o(t){return e8t??=x4o(t).finally(()=>{e8t=void 0}),e8t}a(I4o,"resolveMasterKey");async function x4o(t){let e;try{e=await r8t.loadKeytar()}catch(n){return XFt.warn(t,"keytar-master-key: @github/keytar failed to load",n),{diagnostics:t8t("loadModule",n)}}let r;try{r=await R4o(e)}catch(n){return n instanceof U$e?(XFt.error(t,"keytar-master-key: existing entry is corrupt; refusing to overwrite",n),{diagnostics:t8t("corruptExistingEntry",n)}):(XFt.warn(t,"keytar-master-key: master-key resolution failed",n),{diagnostics:t8t("getOrCreateMasterKey",n)})}return{masterKey:r.key,diagnostics:{available:!0,masterKeySource:r.source}}}a(x4o,"doResolveMasterKey");function w4o(){return Promise.resolve().then(()=>de(rdn()))}a(w4o,"loadKeytar");var r8t={resolveMasterKey:I4o,loadKeytar:w4o};async function R4o(t){let e=await sdn(t.getPassword(ndn,idn),odn,"getMasterKey");if(e){let n=P4o(e);if(n)return{key:n,source:"useExisting"};throw new U$e}let r=adn.randomBytes(cdn);return await sdn(t.setPassword(ndn,idn,r.toString("base64")),odn,"setMasterKey"),{key:r,source:"createNew"}}a(R4o,"getOrCreateMasterKey");function sdn(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(sdn,"withTimeout");var U$e=class extends Error{static{a(this,"CorruptMasterKeyError")}constructor(){super("keytar master-key entry present but undecodable"),this.name="CorruptMasterKeyError"}};function t8t(t,e){return{available:!1,errorPhase:t,error:e}}a(t8t,"unavailable");function P4o(t){let e=Buffer.from(t,"base64");return e.length===cdn?e:void 0}a(P4o,"decodeMasterKey");p();var Zce=de(require("node:crypto"));var o8t=0,H$e=1,nQ=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")}},q$e=class{static{a(this,"SecretCodec")}},i8t=class extends q$e{constructor(){super(...arguments);this.schemaVersion=o8t}static{a(this,"PlaintextCodec")}encode(r){return Buffer.from(r,"utf8")}decode(r){return Buffer.from(r).toString("utf8")}},Q$e=12,n8t=16,ldn=32,j$e=class extends q$e{constructor(r){super();this.key=r;this.schemaVersion=H$e;if(r.length!==ldn)throw new Error(`AesGcmCodec requires a ${ldn}-byte key, got ${r.length}`)}static{a(this,"AesGcmCodec")}encode(r){let n=Zce.randomBytes(Q$e),o=Zce.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 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.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();q9(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();q9(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 q9(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();q9(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:o8t,ciphertext:c.token_ciphertext});l=this.secretStorage.wrap(d)}catch{o++;continue}let u=q9(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:H$e,ciphertext:c.token_ciphertext})}catch(d){if(d instanceof nQ){let{affectedEditors:f,tokenDeleted:h}=await this.deleteTokenCascade(c.token_id);h?(o++,Dae(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=q9(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===H$e){let o=r.token_id,s=n;setImmediate(()=>{try{this.writePlaintextRow(o,s)}catch(c){s8t.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 nQ&&n.kind==="tagMismatch"&&this.deleteTokenCascade(r.token_id).then(({affectedEditors:o,tokenDeleted:s})=>{s&&(s8t.warn(this.ctx,`purged token after AES unwrap failure (tagMismatch) tokenId=${r.token_id} affectedEditors=${o}`),Dae(this.ctx,{editorId:r.source_editor_id,trigger:"unwrap_failure",affectedEditors:o}))}).catch(o=>s8t.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 fdn=de(require("fs")),a8t=de(require("node:sqlite")),pdn=de(require("path"));var iQ=new pe("AuthRepoInit");function Xce(){return typeof performance<"u"?performance.now():Date.now()}a(Xce,"nowMs");function ddn(t){try{t.close()}catch{}}a(ddn,"safeClose");function k4o(t){let e=Xce(),r={durationMs:0};try{fdn.mkdirSync(pdn.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=Xce()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new a8t.default.DatabaseSync(t)}catch(o){return r.durationMs=Xce()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{JRt(n)}catch(o){return r.durationMs=Xce()-e,r.errorPhase="applyPragmas",r.error=o,ddn(n),{db:void 0,diagnostics:r}}try{ZRt(n)}catch(o){return r.durationMs=Xce()-e,r.errorPhase="applySchema",r.error=o,ddn(n),{db:void 0,diagnostics:r}}return r.durationMs=Xce()-e,{db:n,diagnostics:r}}a(k4o,"tryOpenAuthDb");function D4o(t,e){let r=new a8t.default.DatabaseSync(":memory:");return JRt(r),ZRt(r),new HTe(t,r,e)}a(D4o,"openInMemoryAuthRepo");function hdn(t,e,r){let{db:n,diagnostics:o}=k4o(e);return n?{repo:new HTe(t,n,r),diagnostics:{...o,repoKind:"sqlite"}}:{repo:D4o(t,r),diagnostics:{...o,repoKind:"memory"}}}a(hdn,"buildAuthRepository");function mdn(t,e){if(e.repoKind==="memory"){iQ.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(_s).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=>{iQ.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){iQ.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(mdn,"reportAuthRepoFallbackNotice");function gdn(t,e){Nen(t,e)}a(gdn,"reportAuthRepoTelemetry");async function c8t(t){let e=t.get(l3),r=t.get(lf);if(edn(t)){iQ.info(t,"secret-store: encryption disabled by config; pinning writes to plaintext v0");let c={available:!1,errorPhase:"disabledByConfig"};return r.onInitialized(()=>Jqe(t,{writerKind:"plaintext",diagnostics:c})),{diagnostics:c}}let{masterKey:n,diagnostics:o}=await r8t.resolveMasterKey(t);if(!n)return M4o(t,o),r.onInitialized(()=>Jqe(t,{writerKind:"plaintext",diagnostics:o})),{diagnostics:o};let s=new j$e(n);return e.addReader(s),r.onInitialized(()=>Jqe(t,{writerKind:"plaintext",diagnostics:o})),N4o(t),{diagnostics:o}}a(c8t,"initializeSecretStorage");function N4o(t){let e=t.get(lf);setImmediate(()=>{t.get(ZI).decryptOauthTokensFromV1ToV0().then(r=>{r.attempted!==0&&e.onInitialized(()=>WOt(t,{result:r}))}).catch(r=>{iQ.error(t,"secret-store: v1->v0 decrypt pass failed",r),e.onInitialized(()=>WOt(t,{error:r}))})})}a(N4o,"scheduleDecryptOauthTokensFromV1ToV0");function M4o(t,e){iQ.info(t,`secret-store fallback: tokens stored in plaintext on disk (no OS keychain available; phase=${e.errorPhase??"n/a"})`);try{t.get(_s).showWarningMessageOnlyOnce("auth.secretStorage.plaintextFallback","GitHub Copilot could not access the OS keychain. OAuth tokens are stored in plaintext on disk.").catch(r=>{iQ.info(t,"reportSecretStorageFallbackNotice: notification failed",r)})}catch(r){iQ.info(t,"reportSecretStorageFallbackNotice: notification skipped",r)}}a(M4o,"reportSecretStorageFallbackNotice");p();p();var O4o=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function B4o(t){return O4o.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(B4o,"isOomError");function TY(t,e,r,n=Nr){if(!Lm(e)){if(e instanceof Error){let o=e;B4o(o)?t.get(cs).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(cs).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(cs).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(cs).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(cs).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a(TY,"handleException");function Adn(t){process.addListener("uncaughtException",r=>{TY(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,TY(t,r,"unhandledRejection")}finally{e=!1}})}a(Adn,"registerDefaultHandlers");var mmn=new pe("chatLibTokenizers"),gmn=!1;function Amn(t){if(gmn)return;gmn=!0;let e=a(n=>t?mmn.info(t,n):console.error(`[chat-lib-tokenizer] ${n}`),"logInfo"),r=a(n=>t?mmn.warn(t,n):console.error(`[chat-lib-tokenizer] ${n}`),"logWarn");try{let n=g6t();typeof n.setExternalTokenizerProvider=="function"?(n.setExternalTokenizerProvider({getTokenizer:Ts,ensureLoaded:wFt}),e("Successfully injected CLS getTokenizer into chat-lib (vendored)")):r("chat-lib vendored tokenizer loaded but setExternalTokenizerProvider missing")}catch(n){r(`Could not require chat-lib vendored tokenizer: ${String(n)}`)}try{let n=PQ();typeof n.setExternalNativeTokenizerProvider=="function"?(n.setExternalNativeTokenizerProvider({ensureLoaded:wFt,getEncoder:Kln}),e("Successfully injected CLS native encoder provider into chat-lib (native)")):r("chat-lib native tokenizer loaded but setExternalNativeTokenizerProvider missing")}catch(n){r(`Could not require chat-lib native tokenizer: ${String(n)}`)}}a(Amn,"wireChatLibTokenizers");function ymn(){X7("o200k_base").catch(()=>{})}a(ymn,"prewarmTokenizers");p();p();p();var I3={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 Emn=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],_mn={".php":[".blade"]},kQ=Object.keys(I3).flatMap(t=>I3[t].extensions);var LUt=de(require("node:path"));var Tle=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},IIe=class{static{a(this,"LanguageDetection")}},FUt=new Map,Sle=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(I3)){for(let n of e)FUt.set(n,[...FUt.get(n)??[],t]);for(let n of r??[])Sle.set(n,[...Sle.get(n)??[],t])}var UUt=class extends IIe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=Ji(e.uri),n=LUt.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new Tle(s.languageId,s.isGuess,c):new Tle(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(Emn.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=LUt.extname(n).toLowerCase();if(o.length>0&&kQ.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=_mn[e];return!n||n.includes(r)}detectLanguageId(e,r){if(Sle.has(e))return{languageId:Sle.get(e)[0],isGuess:!1};let n=FUt.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),Sle.has(e))return{languageId:Sle.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},QUt=class extends IIe{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 Tle("cpp",n.isGuess,n.fileExtension):n}},qUt=class extends IIe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new Tle(r.languageId,!0,""):this.delegate.detectLanguage(r)}},MUo=new QUt(new qUt(new UUt));function aO({uri:t,languageId:e}){let r=MUo.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(aO,"detectLanguage");p();p();p();p();function jh(t){if(t.isCancellationRequested)throw new MWe}a(jh,"throwIfCancellationRequested");function Dk(t){return t instanceof MWe?!0:t instanceof Error&&t.name===jUt&&t.message===jUt}a(Dk,"isCancellationError");var MWe=class extends Error{static{a(this,"CancellationError")}constructor(){super(jUt),this.name=this.message}},jUt="Canceled",OWe=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 VY(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(VY,"isTypeDefinition");var uu=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=Cmn(e,e.length,o),vmn(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();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);o0||u>0||d>0||f>0?new Ox(r,"","",uu.fromBounds(s,c),uu.fromBounds(d,f),uu.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 Ox(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 BWe=class extends Hh{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,OUo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},LWe=class extends Hh{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,LUo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,FUo),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}},FWe=class extends Hh{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,BUo),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 uu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new uu(f,h-f),g=new uu(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=uu.empty,y=uu.empty,E=d.substring(d.lastIndexOf("/")+1);o.add(new Ox(e,d,E,A,m,y,g,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},OUo=` +`),o=afn(e,e.length,++o),sfn(n,r)):o++;return n.join("")}};function sfn(t,e){for(let r=0;r0||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=` ( ((comment)* @comment) . @@ -2008,7 +2013,7 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la . (field_declaration name: (_) @name) @definition.field ) -`,BUo=` +`,GLo=` (import_declaration (import_spec name: (package_identifier)? @alias @@ -2019,15 +2024,15 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la (import_spec name: (package_identifier)? @alias path: (interpreted_string_literal) @import.name))+) @import -`,LUo=` +`,$Lo=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`,FUo=` +`,VLo=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`;p();var QWe=class extends Hh{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,UUo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},qWe=class extends Hh{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,qUo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,jUo),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}},jWe=class extends Hh{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,QUo)).filter(o=>o.kind===0)}},UUo=` +`;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=` ( [ (block_comment) @comment @@ -2090,7 +2095,7 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la . (enum_constant name: (identifier) @name) @definition.enum_variant ) -`,QUo=` +`,zLo=` ( [ ((line_comment)* @comment) @@ -2102,19 +2107,19 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la (asterisk)? @wildcard ) @definition.class ) -`,qUo=` +`,YLo=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`,jUo=` +`,KLo=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`;p();var HUo=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),HWe=class extends Hh{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,GUo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},GWe=class extends Hh{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,$Uo)).filter(o=>!HUo.has(o.unqualifiedName))}};var GUo=` +`;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=` ( ((comment)* @comment) . @@ -2124,9 +2129,9 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la (export_statement declaration: (lexical_declaration (variable_declarator name: (identifier) @name value: (_) @body))) @definition.function ] ) -`,$Uo=` +`,XLo=` (call_expression function: (_) @name) @reference -`;p();var VUo=new Set(["int","str","float","bool","list","dict","tuple","set"]),$We=class extends Hh{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,WUo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},VWe=class extends Hh{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,zUo)).filter(o=>!VUo.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,KUo),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}},WWe=class extends Hh{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,YUo),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 uu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new uu(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new uu(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=uu.empty,A=uu.empty,y=f.node.text,E=y.split(".").pop()||y,_;c?_=`${u.node.text}.${c.node.text}`:_=u.node.text,o.add(new Ox(e,_,E,g,h,A,m,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},WUo=` +`;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=` ( ((comment)* @comment) . @@ -2138,7 +2143,7 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la . (function_definition name: (_) @name body: (_) @body) @definition.method ) -`,zUo=` +`,rBo=` (call function: (_) @name) @reference (type [ @@ -2147,7 +2152,7 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`,YUo=` +`,nBo=` (import_statement name: (dotted_name) @import.module) @import (import_from_statement @@ -2162,7 +2167,7 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la (aliased_import name: ((dotted_name) @import.name) alias: (identifier) @alias)) @import -`,KUo=` +`,iBo=` (call function: (_) @name) @reference (type [ @@ -2171,7 +2176,7 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`;p();var JUo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),Ile=class extends Hh{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,ZUo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},xle=class extends Hh{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,XUo)).filter(o=>!JUo.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var ZUo=` +`;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=` ( ((comment)* @comment) . @@ -2196,13 +2201,13 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la (variable_declarator name: (identifier) @name type: (type_annotation (type_identifier))) ] ) -`,XUo=` +`,aBo=` (call_expression function: (_) @name) @reference (type_identifier) @name @reference (new_expression constructor: (identifier) @name) @reference -`;p();var e7o=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),zWe=class extends Ile{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,t7o),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},YWe=class extends xle{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,r7o),super.extractReferences(e,r)]);return[...n.filter(s=>!e7o.has(s.unqualifiedName)),...o]}},t7o=` +`;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=` ( ((comment)* @comment) . @@ -2215,58 +2220,58 @@ ${r}+- `:"";return e+this.description+o}}},Z0=class{constructor(e,r,n,o){this.la body: (_) @body))) @definition.function ] ) -`,r7o=` +`,uBo=` (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 xIe=[{symbolExtractor:new QWe,referenceExtractor:new qWe,importExtractor:new jWe,languageId:"java"},{symbolExtractor:new BWe,referenceExtractor:new LWe,importExtractor:new FWe,languageId:"go"},{symbolExtractor:new $We,referenceExtractor:new VWe,importExtractor:new WWe,languageId:"python"},{symbolExtractor:new Ile,referenceExtractor:new xle,languageId:"typescript"},{symbolExtractor:new zWe,referenceExtractor:new YWe,languageId:"typescriptreact"},{symbolExtractor:new HWe,referenceExtractor:new GWe,languageId:"javascript"}];function bmn(t){let e=aO({uri:t});if(e&&xIe.some(r=>e===r.languageId))return e}a(bmn,"getSupportedLanguageIdForMultiLanguageProvider");var Smn=new Map(xIe.map(t=>[t.languageId,t.referenceExtractor])),Tmn=new Map(xIe.map(t=>[t.languageId,t.symbolExtractor])),Imn=new Map(xIe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),HUt=xIe.map(t=>I3[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function GUt(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(GUt,"virtualNode");function xmn(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(xmn,"lineNode");function $Ut(t){return{type:"blank",lineNumber:t,subs:[]}}a($Ut,"blankNode");function KWe(t){return{type:"top",indentation:-1,subs:t??[]}}a(KWe,"topNode");function vA(t){return t.type==="blank"}a(vA,"isBlank");function WY(t){return t.type==="line"}a(WY,"isLine");function zY(t){return t.type==="virtual"}a(zY,"isVirtual");p();function wmn(t,e){return Yy(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(wmn,"clearLabelsIf");function YY(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>YY(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=>YY(r,e)),label:t.label?e(t.label):void 0}}}a(YY,"mapLabels");function Yy(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(Yy,"visitTree");function VUt(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),Yy(t,s,n),o}a(VUt,"foldTree");function JWe(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:KWe()}a(JWe,"rebuildTree");p();function i7o(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[xmn(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"),Yy(t,r,"bottomUp")}a(wIe,"labelLines");function ZWe(t){function e(r){if(zY(r)&&r.label===void 0){let n=r.subs.filter(o=>!vA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),Yy(t,e,"bottomUp")}a(ZWe,"labelVirtualInherited");function RIe(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(RIe,"buildLabelRules");function WUt(t){let r=JWe(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&&(WY(l)||zY(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&vA(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?[GUt(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),vA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return wmn(t,n=>n==="newVirtual"),r}a(WUt,"combineClosersAndOpeners");function Rmn(t,e=vA,r){return JWe(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=GUt(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)!vA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(kmn,"processJava");p();var l7o={heading:/^# /,subheading:/^## /,subsubheading:/### /},u7o=RIe(l7o);function Dmn(t){let e=t;if(wIe(e,u7o),vA(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||vA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=Rmn(e),e=KY(e),ZWe(e),e}a(Dmn,"processMarkdown");p();function Nmn(t){return" ".repeat(t.indentation)+t.sourceLine+` -`}a(Nmn,"deparseLine");zUt("markdown",Dmn);zUt("java",kmn);var d7o={worthUp:.9,worthSibling:.88,worthDown:.8};function YUt(t,e,r=Ts(),n=d7o){let o=YY(t,s=>s?1:void 0);return Yy(o,s=>{if(vA(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"),Yy(o,s=>{if(vA(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"),f7o(o,e,r)}a(YUt,"fromTreeWithFocussedLines");function f7o(t,e,r=Ts()){let n=VUt(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[Nmn(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new yr(n,e,r)}a(f7o,"fromTreeWithValuedLines");function xS(t,e=!0,r=!0,n,o=Ts()){let s=typeof t=="string"?JY(t):JY(t.source,t.languageId);KY(s);let c=YY(s,l=>e&&l!=="closer");return Yy(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&Yy(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&&Yy(c,l=>{l.label||=(WY(l)||vA(l))&&l.lineNumber==0},"topDown"),YUt(c,n,o)}a(xS,"elidableTextForSourceCode");p();var PIe=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=>Ts().tokenLength(r+` -`)){return this._cost=e(this.text),this}copy(){let e=new t(this.text,this.value,this.cost,"none",this.metadata);return e.markedForRemoval=this.markedForRemoval,e}};var yr=class t{constructor(e,r,n=Ts()){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 PIe(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&&xS(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=>Ts().tokenLength(r+` +`;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(` +`)&&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+` `)){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}=h7o(this.lines,o);if(u<=e)return KUt(l);m7o(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?g7o(l,m):"",y=Mmn(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let E=m+1;if(E=0){let v=l[_];XWe(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return KUt([Mmn("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)XWe(h[m],r)&&XWe(h[m-1],r)&&h.splice(m,1);return KUt(h)}};function p7o(t){return t?.text.match(/^\s*/)?.[0]??""}a(p7o,"getIndentation");function XWe(t,e){return t?.text.trim()===e.trim()}a(XWe,"isEllipsis");function KUt(t){return{getText:a(()=>t.map(e=>e.text).join(` -`),"getText"),getLines:a(()=>t,"getLines")}}a(KUt,"produceElidedText");function h7o(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(h7o,"initializeElisionContext");function m7o(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(m7o,"sortPriorityQueue");function g7o(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=p7o(o);break}}return r}a(g7o,"getClosestIndentation");function Mmn(t,e,r,n){let o=t+e;return new PIe(o,1/0,r.tokenLength(o+` -`),"loose",n?.metadata)}a(Mmn,"getNewEllipsis");p();var Omn=require("fs");async function Bmn(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;jh(o);let E=y.node.extentRange.length/A,_=Math.min(l,E*u),v=(await A7o([y])).elide(_).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(Bmn,"symbolRangesToCodeSnippets");async function A7o(t){if(t.length===0)return new yr([]);let e=t[0].node.fileName,r=[],n="";try{let o=Zo(e);o&&(n=(await Omn.promises.readFile(o)).toString())}catch{}for(let o of t)Lmn(o,n).forEach(s=>r.push(s));return new yr(r)}a(A7o,"sameFileSymbolRangeToElidableText");function Lmn(t,e){let n=[],o=t.node,s=e.substring(JUt(e,o.commentRange.start),o.commentRange.end);n.push([ZUt(s),1-3e-4]);let c=JUt(e,o.bodyRange.start),l=JUt(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(VY(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([ZUt(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...Lmn(d,e));else{let d=1-(VY(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([ZUt(f),d])}return VY(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(Lmn,"prepareForElidableText");function JUt(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(JUt,"shiftLeftToNearestLineEndingOrAlphanumeric");function ZUt(t){let e=0;for(;ee)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(;e=0&&(t[r]==="\r"||t[r]===` -`||t[r]===" "||t[r]===" ");)r--;return t.substring(e,r+1)}a(ZUt,"trimLineEndingsAndTrailingWhitespace");var XUt=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},DQ=class extends XUt{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[];jh(c);let u=await l.extractReferences(e,r);jh(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=>VY(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(jh(r),VY(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}},eze=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new DQ(e,r,!0,!0)),this.strategies.set("java",new DQ(e,r,!0,!0)),this.strategies.set("python",new DQ(e,r,!0,!1)),this.strategies.set("typescript",new DQ(e,r,!0,!0)),this.strategies.set("typescriptreact",new DQ(e,r,!0,!0)),this.strategies.set("javascript",new DQ(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);jh(l);let d=Ts();return Bmn(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 ZY={Id:"id"},wS={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},aa={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 tze=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new e7t(ZY.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(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(`, `)}`,")"].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(", ")})`}}},kIe=class t extends tze{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${wS.FilePath}');`]);this.fields=[new MIe(wS.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new kC(wS.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},DIe=class t extends tze{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${aa.DocumentId}', '${aa.ExtentStart}', '${aa.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${aa.UnqualifiedName}');`],`FOREIGN KEY(${aa.DocumentId}) REFERENCES Document(${ZY.Id}) ON DELETE CASCADE`);this.fields=[new kC(aa.DocumentId),new MIe(aa.FullyQualifiedName,{notNull:!0}),new MIe(aa.UnqualifiedName,{notNull:!0}),new kC(aa.CommentStart,{notNull:!0}),new kC(aa.CommentLength,{notNull:!0}),new kC(aa.NameStart,{notNull:!0}),new kC(aa.NameLength,{notNull:!0}),new kC(aa.BodyStart,{notNull:!0}),new kC(aa.BodyLength,{notNull:!0}),new kC(aa.ExtentStart,{notNull:!0}),new kC(aa.ExtentLength,{notNull:!0}),new kC(aa.SymbolKind,{notNull:!0}),new kC(aa.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},NIe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},MIe=class extends NIe{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 NIe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},e7t=class extends NIe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var rze=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?ize(e,`SELECT * FROM ${this.queryGenerator.tableName}`,[]):[]}async deleteRow(e){let r=await this.init;r&&nze(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${ZY.Id} = ?`,[e])}},x3=class t extends rze{static{a(this,"DocumentTable")}static{this.tableName=kIe.tableName}createQueryGenerator(){return new kIe}async updateTimestamp(e,r){let n=await this.init;n&&nze(n,`UPDATE ${t.tableName} SET ${wS.LastWriteTimeUtc} = ? WHERE ${wS.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&nze(r,`DELETE FROM ${t.tableName} WHERE ${wS.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?ize(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${wS.FilePath} = ?`,[e]):[]}},Gh=class t extends rze{static{a(this,"SymbolTable")}static{this.tableName=DIe.tableName}createQueryGenerator(){return new DIe}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&nze(r,`DELETE FROM ${t.tableName} WHERE ${aa.DocumentId} = ?`,[e])}};function ize(t,e,r){let o=Array.isArray(r)?r:[r];return o.length>0?t.prepare(e).all(...o):t.prepare(e).all()}a(ize,"runDBQuery");function nze(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(nze,"runDBCommand");var Fmn=de(require("node:sqlite"));var oze=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${x3.tableName} ON ${Gh.tableName}.${aa.DocumentId} = ${x3.tableName}.${ZY.Id}`;this.db=this.initDb(e),this.documentTable=new x3(this.db),this.symbolTable=new Gh(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new Fmn.default.DatabaseSync(e,{open:!0});return r.exec(` +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(` 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 ${Gh.tableName}`,this.innerJoinStatement,`WHERE ${aa.UnqualifiedName} BETWEEN ? AND (? || '~')`,`ORDER BY ${aa.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 ${Gh.tableName}`,this.innerJoinStatement,`WHERE ${aa.UnqualifiedName} ${o}IN (${n})`].join(` -`),e)}async querySymbolsUsingFullyQualifiedName(e){return this.query([`SELECT * FROM ${Gh.tableName}`,this.innerJoinStatement,`WHERE ${aa.FullyQualifiedName} = ?`].join(` -`),[e])}async querySymbolsContainingPosition(e,r){return this.query([`SELECT * FROM ${Gh.tableName}`,this.innerJoinStatement,`WHERE ${x3.tableName}.${wS.FilePath} = ? AND ${Gh.tableName}.${aa.ExtentStart} <= ? AND (${Gh.tableName}.${aa.ExtentStart} + ${Gh.tableName}.${aa.ExtentLength}) >= ?`].join(` -`),[e,r,r])}async querySymbolsContainedByRange(e,r,n){return this.query([`SELECT * FROM ${Gh.tableName}`,this.innerJoinStatement,`WHERE ${x3.tableName}.${wS.FilePath} = ? AND ${Gh.tableName}.${aa.ExtentStart} >= ? AND (${Gh.tableName}.${aa.ExtentStart} + ${Gh.tableName}.${aa.ExtentLength}) <= ?`,`ORDER BY ${Gh.tableName}.${aa.ExtentStart}`].join(` -`),[e,r,n])}async querySymbolsByQualifiedNamePrefix(e,r){return this.query([`SELECT * FROM ${Gh.tableName}`,this.innerJoinStatement,`WHERE ${x3.tableName}.${wS.FilePath} = ? AND ${Gh.tableName}.${aa.FullyQualifiedName} LIKE ?`,`ORDER BY ${Gh.tableName}.${aa.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,ize(n,e,r)):[]}};var sze=class{static{a(this,"SQLStorageReaderWriter")}constructor(e){this.database=new oze(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 wle(await this.database.querySymbolsFuzzilyUsingUnqualifiedName(e,r))}async findPotentialDefinitionsAsync(e,r,n){let o=[],c=0;for(;cnew Ox(e.filePath,e.fullyQualifiedName,e.unqualifiedName,new uu(e.commentStart,e.commentLength),new uu(e.nameStart,e.nameLength),new uu(e.bodyStart,e.bodyLength),new uu(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(wle,"symbolsToSymbolRanges");var cze=de(require("fs/promises"));var aze=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new sze(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=Zo(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await cze.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 cze.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 t7t(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>y7o(r))}a(t7t,"isIndexWorkerData");var OIe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},NQ=class extends OIe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},lze=class extends OIe{constructor(r){super(Ky.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},Ky={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},uze=class extends NQ{constructor(r,n,o){super(r,Ky.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},dze=class extends NQ{constructor(r,n){super(r,Ky.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},fze=class extends NQ{constructor(r,n,o){super(r,Ky.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},pze=class extends NQ{constructor(r,n){super(r,Ky.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},hze=class extends NQ{constructor(r,n,o,s,c,l){super(r,Ky.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},mze=class extends NQ{static{a(this,"ExitRequest")}constructor(e){super(e,Ky.Exit)}},Nk=class extends OIe{constructor(r,n,o){super(Ky.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 y7o(t){return"databaseFilePath"in t&&"rootPath"in t}a(y7o,"isIndexableWorkspaceFolder");var Umn=de(ri()),MQ=require("worker_threads");var gze=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new aze(e,Tmn,Imn,r),this.contextRetreival=new eze(this.index.reader,Smn)}},r7t=class t{constructor(e,r,n){this.indices=new Map;this.cancellationTokens=new Map;this.params=n;for(let o of r){let s=gn(o.rootPath);this.indices.set(s,new gze(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 Umn.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case Ky.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case Ky.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case Ky.Cancel:n.get(e.id)?.cancel(),s=new Nk(e.id,void 0,void 0);break;case Ky.Exit:s=await this.dispatchExit(e,r,o.token);break;case Ky.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case Ky.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case Ky.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 Nk(e.id,o,void 0))}}static async GetAllDocumentsInWorkspaceRequest(e,r,n){let o=gn(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 Nk(e.id,s,c)}static async dispatchAddOrInvalidate(e,r,n){let o=gn(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 Nk(e.id,c,void 0)}static async dispatchGetContext(e,r,n){let o=gn(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 Nk(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 Nk(e.id,void 0,void 0)),this.port?.close()}static dispatchCreateIndex(e,r,n){let o=gn(e.baseWorkspaceFolderUri);return r.has(o)||r.set(o,new gze(e.databaseFilePath)),new Nk(e.id,void 0,void 0)}static async dispatchRemoveIndex(e,r,n){let o=gn(e.baseWorkspaceFolderUri);if(r.has(o)){let s=r.get(o);s&&await s.index.dispose(),r.delete(o)}return new Nk(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function Qmn(){return t7t(MQ.workerData)}a(Qmn,"isIndexWorker");function qmn(){let t=MQ.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!t7t(MQ.workerData))throw new Error("Worker data must provide a valid database path.");let e=MQ.workerData.cwd;process.cwd=()=>e,new r7t(t,MQ.workerData.indexWorkspaceRoots,MQ.workerData.params)}a(qmn,"runIndexWorker");p();p();var BIe=require("fs"),jmn=require("path");var OQ=class extends $o{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await BIe.promises.readFile(gn(e),r)}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink(gn(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=gn(e),n=await BIe.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,jmn.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await BIe.promises.lstat(e);if(r.isSymbolicLink())try{let n=await BIe.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 E7o(t){if(t.isCancellationRequested)return;let e=new dA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(E7o,"cancellationTokenToPromise");async function Hmn(t,e){if(e){let r=E7o(e);await Promise.race([t,r])}else await t}a(Hmn,"raceCancellation");function n7t(t){return Array.isArray(t)}a(n7t,"isArrayOfT");async function Gmn(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await i7t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(Gmn,"resolveAll");async function i7t(t,e){let r;return t instanceof Promise?r=await _7o(t,e):r=await v7o(t,e),r}a(i7t,"resolve");async function _7o(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:n7t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await Hmn(o,e),n.resolutionTime=performance.now()-r,n}a(_7o,"resolvePromise");async function v7o(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 Hmn(o,e),n.resolutionTime=performance.now()-r,n}a(v7o,"resolveIterable");p();p();var Aze="[...]",C7o=0,DC=-1;function gf(){return C7o++}a(gf,"getAvailableNodeId");function b7o(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(b7o,"elideChildren");function $mn(t,e=Aze){return r=>t.tokenLength(b7o(r,e))}a($mn,"getTokenizerCostFunction");p();var LQ=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 S7o(t){let e={id:t.id??gf(),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??Aze,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(S7o,"createRenderNode");function T7o(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a(T7o,"isRenderedChildRequired");function Vmn(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(Vmn,"rectifiedValue");function LIe(t,e){let r=Wmn(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(LIe,"rectifyWeights");function Wmn(t,e){let r=t.children.map(s=>Wmn(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 LQ([]);let n=new LQ(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(Wmn,"recursivelyRectifyWeights");function zmn(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(s7t(t,m,h,g),m.length===0)return o7t(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 LQ([{item:t,priority:Vmn(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,Vmn(m))}}for(;l.size>0;){let h=[],m=a(E=>!l.has(E.id),"elider"),g=new Map;if(s7t(t,h,m,g),h.length===0)return o7t(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 o7t(t,o)}a(zmn,"render");function o7t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(o7t,"renderEmpty");function s7t(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=T7o(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=s7t(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(s7t,"recursivelyRender");function FIe(t,e,r=Aze){let n=t.children.map(c=>FIe(c,e,r));r=t.elisionMarker??r;let o=e(t);return S7o({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(FIe,"snapshot");var FQ={id:gf(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var Mk=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var Eze={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function I7o(t,e,r=Eze,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=Ia(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(I7o,"getDirectoryChildren");function x7o(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=sf(e);for(;o.startsWith(r);){n.push(o);let s=sf(o);if(s.length>=o.length)break;o=s}return n}a(x7o,"getAncestors");function w7o(t,e,r=Eze.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=x7o(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(w7o,"getAncestorWeights");async function*a7t(t,e,r,n,o,s){let c={...Eze,...r},l=c.MaxResults,u=c.Decay,d=w7o(t,e,u),f=new LQ([...d.entries()].map(([m,g])=>({item:m,priority:g}))),h=0;for(;f.size>0;){let{item:m,priority:g}=f.pop(),A=await I7o(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(a7t,"getNearbyDocuments");var yze=class extends Mk{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=Eze;this.cache=new IP(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of a7t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function e0(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(e0,"setDefault");var R7o={MaxActiveSymbols:500,SymbolCacheSize:1e6},_ze=class extends Mk{constructor(){super(...arguments);this.config=R7o;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new En(this.config.SymbolCacheSize);this.textSymbols=new En(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=e0(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 c7t(l)){let d=e0(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())e0(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&&Ymn(o))}},P7o=/^[a-zA-Z_]{2,}\w+$/;function Ymn(t){return P7o.test(t)}a(Ymn,"isSymbol");function k7o(t){return t.toLowerCase()}a(k7o,"normalizeWord");function*c7t(t){for(let e of t.split(/\W/))Ymn(e)&&(yield k7o(e))}a(c7t,"getTextSymbols");var D7o={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},vze=class extends _ze{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=D7o;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new IP(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 c7t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=e0(this.textSymbols,l,()=>this.createSymbol(!1));e0(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 a7t(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 Kmn(t){return t.nodeId!==void 0}a(Kmn,"isNodeLocation");var Jmn={"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}},Cze=class extends Mk{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=Jmn[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)Kmn(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(Kmn(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=Jmn[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};e0(this.eventsByType,r,()=>new En(s.maxEventCount)).set(++this.nextId,c)}};p();var bze=class extends Mk{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 N7o(t){return t.id!==void 0}a(N7o,"isNodeItem");function M7o(t){return!("uri"in t)&&!("id"in t)}a(M7o,"isNullItem");var Zmn={"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 Xmn(t){return t in Zmn}a(Xmn,"isSourceId");var UQ="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",Rle=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}},Sze=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=Zmn;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new Rle([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new Rle(r.items):new Rle([])}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 Rle(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(M7o(r))return{weight:r.weight,uri:UQ,id:DC};let n=N7o(r)?r.id:DC,o=r.uri??this.activeContext.getUri(n)??UQ;return o===UQ&&(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=e0(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!==UQ?this.activeContext.normalizeUri(u)??UQ:UQ;for(let[h,m]of d.entries())u===UQ||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(UQ),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 l7t=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*e0n(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=B7o(e,this.document),o=new l7t(gf(),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;mO7o}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function B7o(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(B7o,"buildText");function*e0n(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*e0n(r,e))}a(e0n,"walk");p();p();p();var Ize=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 u7t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:u7t(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=u7t(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 Ize(gf(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(u7t,"recursivelyBuildNode");function t0n(t){let e=JY(t.getText(),t.detectedLanguageId);return u7t(e,t.lineCount,t)??new Ize(gf(),e,[],0,t.lineCount-1,t)}a(t0n,"parse");var xze={source:"indentation",parse:t0n,update(t,e){return{root:t0n(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var n0n=de($ce());function r0n(t){return{line:t.row,character:t.column}}a(r0n,"asPosition");var cO=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)}},QQ=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 n0n.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return xze.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:r0n(e.startPosition),end:r0n(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var L7o=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),F7o=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),U7o=new Set(["identifier"]),Q7o=new Set(["string","comment"]),i0n=new cO(L7o,F7o,U7o,Q7o);p();var q7o=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),j7o=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),H7o=new Set(["identifier"]),G7o=new Set(["string_literal","line_comment","block_comment"]),o0n=new cO(q7o,j7o,H7o,G7o);p();var $7o=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),V7o=new Set(["module","block","parameters","dictionary","list"]),W7o=new Set(["identifier"]),z7o=new Set(["string","comment"]),s0n=new cO($7o,V7o,W7o,z7o);p();var Y7o=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),K7o=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),J7o=new Set(["identifier"]),Z7o=new Set(["string","comment"]),a0n=new cO(Y7o,K7o,J7o,Z7o);var c0n=de($ce());async function l0n(t){await c0n.default.init();try{let e=await HFt(t);switch(t){case"python":return new QQ(e,"tree-sitter-python",s0n);case"typescript":return new QQ(e,"tree-sitter-typescript",a0n);case"java":return new QQ(e,"tree-sitter-java",o0n);case"cpp":return new QQ(e,"tree-sitter-cpp",i0n);default:return new QQ(e,"tree-sitter-generic")}}catch{return xze}}a(l0n,"getParser");var d7t=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}))}},wze=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},u0n=500,Rze=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 En(u0n);this.allowedExtensions=new Set(kQ);this.invalidDocumentCache=new IP(u0n,this.config.InvalidCacheTime),this.cachedDocuments=new v9e(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=>I3[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(GUe(e),r=Os(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(VYr(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 d7t(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 wze(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new dA;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 wze(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 Tze(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=e0(this.createdNodes,e,()=>new Set),o=e0(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 l0n(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 X7o="WorkspaceContextWorker";function f7t(t){let e=t;return e?.workerId===X7o&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(f7t,"isContextWorkerData");var eQo=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function d0n(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return eQo.includes(e)?e:void 0}a(d0n,"getContextMessageType");var qQ=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();h7t();p();var g0n;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(g0n||(g0n={}));var m7t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(m7t||(m7t={}));var A0n;(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})(A0n||(A0n={}));var kze;(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})(kze||(kze={}));var Jy;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=kze.MAX_VALUE),o===Number.MAX_VALUE&&(o=kze.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})(Jy||(Jy={}));var du;(function(t){function e(n,o,s,c){if(mt.uinteger(n)&&mt.uinteger(o)&&mt.uinteger(s)&&mt.uinteger(c))return{start:Jy.create(n,o),end:Jy.create(s,c)};if(Jy.is(n)&&Jy.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)&&Jy.is(o.start)&&Jy.is(o.end)}a(r,"is"),t.is=r})(du||(du={}));var Dze;(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)&&du.is(o.range)&&(mt.string(o.uri)||mt.undefined(o.uri))}a(r,"is"),t.is=r})(Dze||(Dze={}));var y0n;(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)&&du.is(o.targetRange)&&mt.string(o.targetUri)&&du.is(o.targetSelectionRange)&&(du.is(o.originSelectionRange)||mt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(y0n||(y0n={}));var g7t;(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})(g7t||(g7t={}));var E0n;(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)&&du.is(o.range)&&g7t.is(o.color)}a(r,"is"),t.is=r})(E0n||(E0n={}));var _0n;(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)||kle.is(o))&&(mt.undefined(o.additionalTextEdits)||mt.typedArray(o.additionalTextEdits,kle.is))}a(r,"is"),t.is=r})(_0n||(_0n={}));var v0n;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(v0n||(v0n={}));var C0n;(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})(C0n||(C0n={}));var A7t;(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)&&Dze.is(o.location)&&mt.string(o.message)}a(r,"is"),t.is=r})(A7t||(A7t={}));var b0n;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(b0n||(b0n={}));var S0n;(function(t){t.Unnecessary=1,t.Deprecated=2})(S0n||(S0n={}));var T0n;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&mt.string(n.href)}a(e,"is"),t.is=e})(T0n||(T0n={}));var Nze;(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)&&du.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,A7t.is))}a(r,"is"),t.is=r})(Nze||(Nze={}));var Ple;(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})(Ple||(Ple={}));var kle;(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)&&du.is(c.range)}a(o,"is"),t.is=o})(kle||(kle={}));var y7t;(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})(y7t||(y7t={}));var Dle;(function(t){function e(r){let n=r;return mt.string(n)}a(e,"is"),t.is=e})(Dle||(Dle={}));var I0n;(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 kle.is(c)&&(y7t.is(c.annotationId)||Dle.is(c.annotationId))}a(o,"is"),t.is=o})(I0n||(I0n={}));var E7t;(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)&&S7t.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(E7t||(E7t={}));var _7t;(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||Dle.is(o.annotationId))}a(r,"is"),t.is=r})(_7t||(_7t={}));var v7t;(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||Dle.is(o.annotationId))}a(r,"is"),t.is=r})(v7t||(v7t={}));var C7t;(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||Dle.is(o.annotationId))}a(r,"is"),t.is=r})(C7t||(C7t={}));var b7t;(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)?_7t.is(o)||v7t.is(o)||C7t.is(o):E7t.is(o)))}a(e,"is"),t.is=e})(b7t||(b7t={}));var x0n;(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})(x0n||(x0n={}));var w0n;(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})(w0n||(w0n={}));var S7t;(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})(S7t||(S7t={}));var R0n;(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})(R0n||(R0n={}));var T7t;(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})(T7t||(T7t={}));var UIe;(function(t){function e(r){let n=r;return mt.objectLiteral(r)&&T7t.is(n.kind)&&mt.string(n.value)}a(e,"is"),t.is=e})(UIe||(UIe={}));var P0n;(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})(P0n||(P0n={}));var k0n;(function(t){t.PlainText=1,t.Snippet=2})(k0n||(k0n={}));var D0n;(function(t){t.Deprecated=1})(D0n||(D0n={}));var N0n;(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)&&du.is(o.insert)&&du.is(o.replace)}a(r,"is"),t.is=r})(N0n||(N0n={}));var M0n;(function(t){t.asIs=1,t.adjustIndentation=2})(M0n||(M0n={}));var O0n;(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})(O0n||(O0n={}));var B0n;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(B0n||(B0n={}));var L0n;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(L0n||(L0n={}));var Mze;(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})(Mze||(Mze={}));var F0n;(function(t){function e(r){let n=r;return!!n&&mt.objectLiteral(n)&&(UIe.is(n.contents)||Mze.is(n.contents)||mt.typedArray(n.contents,Mze.is))&&(r.range===void 0||du.is(r.range))}a(e,"is"),t.is=e})(F0n||(F0n={}));var U0n;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})(U0n||(U0n={}));var Q0n;(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})(Q0n||(Q0n={}));var q0n;(function(t){t.Text=1,t.Read=2,t.Write=3})(q0n||(q0n={}));var j0n;(function(t){function e(r,n){let o={range:r};return mt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(j0n||(j0n={}));var H0n;(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})(H0n||(H0n={}));var G0n;(function(t){t.Deprecated=1})(G0n||(G0n={}));var $0n;(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})($0n||($0n={}));var V0n;(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})(V0n||(V0n={}));var W0n;(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)&&du.is(o.range)&&du.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})(W0n||(W0n={}));var z0n;(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"})(z0n||(z0n={}));var Oze;(function(t){t.Invoked=1,t.Automatic=2})(Oze||(Oze={}));var Y0n;(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,Nze.is)&&(o.only===void 0||mt.typedArray(o.only,mt.string))&&(o.triggerKind===void 0||o.triggerKind===Oze.Invoked||o.triggerKind===Oze.Automatic)}a(r,"is"),t.is=r})(Y0n||(Y0n={}));var K0n;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):Ple.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,Nze.is))&&(o.kind===void 0||mt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Ple.is(o.command))&&(o.isPreferred===void 0||mt.boolean(o.isPreferred))&&(o.edit===void 0||b7t.is(o.edit))}a(r,"is"),t.is=r})(K0n||(K0n={}));var J0n;(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)&&du.is(o.range)&&(mt.undefined(o.command)||Ple.is(o.command))}a(r,"is"),t.is=r})(J0n||(J0n={}));var Z0n;(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})(Z0n||(Z0n={}));var X0n;(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)&&du.is(o.range)&&(mt.undefined(o.target)||mt.string(o.target))}a(r,"is"),t.is=r})(X0n||(X0n={}));var egn;(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)&&du.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})(egn||(egn={}));var tgn;(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"})(tgn||(tgn={}));var rgn;(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"})(rgn||(rgn={}));var ngn;(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})(ngn||(ngn={}));var ign;(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&&du.is(o.range)&&mt.string(o.text)}a(r,"is"),t.is=r})(ign||(ign={}));var ogn;(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&&du.is(o.range)&&mt.boolean(o.caseSensitiveLookup)&&(mt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})(ogn||(ogn={}));var sgn;(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&&du.is(o.range)&&(mt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})(sgn||(sgn={}));var agn;(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)&&du.is(n.stoppedLocation)}a(r,"is"),t.is=r})(agn||(agn={}));var I7t;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(I7t||(I7t={}));var x7t;(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)||UIe.is(o.tooltip))&&(o.location===void 0||Dze.is(o.location))&&(o.command===void 0||Ple.is(o.command))}a(r,"is"),t.is=r})(x7t||(x7t={}));var cgn;(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)&&Jy.is(o.position)&&(mt.string(o.label)||mt.typedArray(o.label,x7t.is))&&(o.kind===void 0||I7t.is(o.kind))&&o.textEdits===void 0||mt.typedArray(o.textEdits,kle.is)&&(o.tooltip===void 0||mt.string(o.tooltip)||UIe.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})(cgn||(cgn={}));var lgn;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(lgn||(lgn={}));var ugn;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(ugn||(ugn={}));var dgn;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(dgn||(dgn={}));var fgn;(function(t){t.Invoked=0,t.Automatic=1})(fgn||(fgn={}));var pgn;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(pgn||(pgn={}));var hgn;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(hgn||(hgn={}));var mgn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&m7t.is(n.uri)&&mt.string(n.name)}a(e,"is"),t.is=e})(mgn||(mgn={}));var ggn;(function(t){function e(s,c,l,u){return new w7t(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 ${$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(;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 Jy.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return Jy.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 fu=class{static{a(this,"LocationFactory")}static{this.range=du.create.bind(du)}static{this.position=Jy.create.bind(Jy)}},RS=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=w3.create(e.clientUri,e.clientLanguageId,n,e.getText());return w3.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=w3.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return w3.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=aO({uri:e,languageId:r})){return new t(Os(e),w3.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=du.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=du.create(Jy.create(r,0),Jy.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var lO=require("worker_threads");var rQo=5,Agn=3e4,R7t=class extends OQ{constructor(r){super();this.worker=r;this.didChangeEmitter=new Hi;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>Os(n))}getWorkspaceFolder(r){let n=Os(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:RS.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},P7t=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new R7t(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 Rze(this.fileSystem,n),this.coordinator=new Sze(this.documentManager,n),this.recentActivityProvider=new Cze,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(!d0n(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 qQ(n.id,"Error",o))}}async handleMessageUnsafe(e){switch(e.messageType){case"Exit":this.exit(),this.port.postMessage(new qQ(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 ${Agn}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},Agn);r=new dA,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 qQ(e.id,"UpdateResponse",{documents:c}));let l=[];for(let d of this.providers)l.push(i7t(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 qQ(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 k7t(){return lO.parentPort!==null&&f7t(lO.workerData)}a(k7t,"isContextWorker");function ygn(){if(!k7t())throw new Error("This must be run in a worker thread.");if(!f7t(lO.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(lO.workerData)}`);let t=lO.workerData.cwd;process.cwd=()=>t;let e=new P7t(lO.parentPort,lO.workerData.workspaceRoots,lO.workerData.config);e.addLocalProvider(new yze(e.fileSystem,e.documentManager)),e.addLocalProvider(new vze(e.fileSystem,e.documentManager)),e.addLocalProvider(new bze)}a(ygn,"runContextWorker");p();var QIe=de(require("util"));function Egn(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(_U(t)==="dev")return t.get(Ff).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:",QIe.format(...o)))},e.dir=(n,o)=>r(4,QIe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(QIe.format(...n));o.name="Trace",e.log(o)},e}a(Egn,"createConsole");p();p();var Lze=de(require("path")),_gn=require("worker_threads");var Fze=new Map,nQo=0;function qIe(t,e){let r=nQo++;Fze.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,Fze.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(qIe,"registerWorker");function vgn(t,e){let r=new _gn.Worker(Lze.default.resolve(iQo(),t),{workerData:e});return qIe(r,t),r}a(vgn,"createWorker");function iQo(){return Lze.default.extname(__filename)!==".ts"?__dirname:Lze.default.resolve(__dirname,"../../dist")}a(iQo,"workerBundleDir");function Cgn(){return Fze.size}a(Cgn,"getActiveWorkerCount");async function bgn(){let t=[],e=[];for(let[r,{worker:n,name:o}]of Fze)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(bgn,"collectWorkerPerfStats");var Uze=de(require("os")),Sgn=de(require("v8"));function oQo(t){let e=Ft(t,Ke.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(oQo,"getPerfState");var XY=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=oQo(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=Sgn.getHeapStatistics(),o=this.cpuDelta(),s=Cgn(),c=0,l="";try{let u=await bgn();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(yt(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:Uze.freemem(),systemTotalMemBytes:Uze.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:Ck(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 bP=de(Bk()),Wso=require("worker_threads");p();p();var IYe=require("assert");p();p();var yqo={right:bqo,center:Sqo},Eqo=0,gYe=1,_qo=2,AYe=3,nQt=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&&PS.stringWidth(o[0])>n&&(n=Math.min(Math.floor(this.width*.5),PS.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=PS.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>PS.stringWidth(c)&&(f+=" ".repeat(d-PS.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=yqo[e[l].align];f=m(f,d),PS.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=PS.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=PS.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 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=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[Eqo]||0).fill("")),o.push(...new Array(s.padding[_qo]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||PS.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,vqo(e[l])):c)}};function yAn(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(yAn,"addBorder");function vqo(t){let e=t.padding||[],r=1+(e[AYe]||0)+(e[gYe]||0);return t.border?r+4:r}a(vqo,"_minWidth");function Cqo(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(Cqo,"getWindowWidth");function bqo(t,e){t=t.trim();let r=PS.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(Sqo,"alignCenter");var PS;function EAn(t,e){return PS=e,new nQt({width:t?.width||Cqo(),wrap:t?.wrap})}a(EAn,"cliui");p();p();p();function iQt({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(iQt,"ansiRegex");var Tqo=iQt();function nK(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(Tqo,"")}a(nK,"stripAnsi");p();p();function _An(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(_An,"isAmbiguous");function vAn(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}a(vAn,"isFullWidth");function CAn(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(CAn,"isWide");function Iqo(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(Iqo,"validate");function yYe(t,{ambiguousAsWide:e=!1}={}){return Iqo(t),vAn(t)||CAn(t)||e&&_An(t)?2:1}a(yYe,"eastAsianWidth");p();var bAn=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 xqo=new Intl.Segmenter,wqo=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function R3(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=nK(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of xqo.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)&&!wqo.test(c)){if(bAn().test(c)){o+=2;continue}o+=yYe(l,s)}}return o}a(R3,"stringWidth");p();p();var SAn=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),TAn=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),IAn=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),Md={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]}},aFu=Object.keys(Md.modifier),Rqo=Object.keys(Md.color),Pqo=Object.keys(Md.bgColor),cFu=[...Rqo,...Pqo];function kqo(){let t=new Map;for(let[e,r]of Object.entries(Md)){for(let[n,o]of Object.entries(r))Md[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Md[n],t.set(o[0],o[1]);Object.defineProperty(Md,e,{value:r,enumerable:!1})}return Object.defineProperty(Md,"codes",{value:t,enumerable:!1}),Md.color.close="\x1B[39m",Md.bgColor.close="\x1B[49m",Md.color.ansi=SAn(),Md.color.ansi256=TAn(),Md.color.ansi16m=IAn(),Md.bgColor.ansi=SAn(10),Md.bgColor.ansi256=TAn(10),Md.bgColor.ansi16m=IAn(10),Object.defineProperties(Md,{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=>Md.rgbToAnsi256(...Md.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)=>Md.ansi256ToAnsi(Md.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>Md.ansi256ToAnsi(Md.hexToAnsi256(e)),"value"),enumerable:!1}}),Md}a(kqo,"assembleStyles");var Dqo=kqo(),xAn=Dqo;var _Ye=new Set(["\x1B","\x9B"]),Nqo=39,sQt="\x07",PAn="[",Mqo="]",kAn="m",EYe=`${Mqo}8;;`,wAn=a(t=>`${_Ye.values().next().value}${PAn}${t}${kAn}`,"wrapAnsiCode"),RAn=a(t=>`${_Ye.values().next().value}${EYe}${t}${sQt}`,"wrapAnsiHyperlink"),Oqo=a(t=>t.split(" ").map(e=>R3(e)),"wordLengths"),oQt=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=R3(nK(t.at(-1)));for(let[l,u]of n.entries()){let d=R3(u);if(c+d<=r?t[t.length-1]+=u:(t.push(u),c=0),_Ye.has(u)&&(o=!0,s=n.slice(l+1,l+1+EYe.length).join("")===EYe),o){s?u===sQt&&(o=!1,s=!1):u===kAn&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),Bqo=a(t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(R3(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),Lqo=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=Oqo(t),l=[""];for(let[h,m]of t.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l.at(-1).trimStart());let g=R3(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){oQt(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>Bqo(h)));let u=l.join(` -`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,_Ye.has(m)){let{groups:A}=new RegExp(`(?:\\${PAn}(?\\d+)m|\\${EYe}(?.*)${sQt})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===Nqo?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=xAn.codes.get(Number(o));d[h+1]===` -`?(s&&(n+=RAn("")),o&&g&&(n+=wAn(g))):m===` -`&&(o&&g&&(n+=wAn(o)),s&&(n+=RAn(s))),f+=m.length}return n},"exec");function aQt(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[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 `,` `).split(` -`).map(n=>Lqo(n,e,r)).join(` -`)}a(aQt,"wrapAnsi");function cQt(t){return EAn(t,{stringWidth:R3,stripAnsi:nK,wrap:aQt})}a(cQt,"ui");p();var Ble=require("path"),vYe=require("fs");function lQt(t,e){let r=(0,Ble.resolve)(".",t),n;for((0,vYe.statSync)(r).isDirectory()||(r=(0,Ble.dirname)(r));;){if(n=e(r,(0,vYe.readdirSync)(r)),n)return(0,Ble.resolve)(r,n);if(r=(0,Ble.dirname)(n=r),n===r)break}}a(lQt,"default");var KAn=require("util"),_Qt=require("url");p();var LAn=require("util"),TYe=require("path");p();function iK(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(CYe,"decamelize");function bYe(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(bYe,"looksLikeNumber");p();p();function DAn(t){if(Array.isArray(t))return t.map(c=>typeof c!="string"?c+"":c);t=t.trim();let e=0,r=null,n=null,o=null,s=[];for(let c=0;c{typeof ue=="number"&&(E.nargs[X]=ue,E.keys.push(X))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([X,ue])=>{typeof ue=="function"&&(E.coercions[X]=ue,E.keys.push(X))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(X){E.configs[X]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([X,ue])=>{(typeof ue=="boolean"||typeof ue=="function")&&(E.configs[X]=ue)})),ne(n.key,c,n.default,E.arrays),Object.keys(u).forEach(function(X){(E.aliases[X]||[]).forEach(function(ue){u[ue]=u[X]})});let b=null;he();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let X=0;X=3&&(H(we[1],E.arrays)?X=D(X,we[1],o,we[2]):H(we[1],E.nargs)!==!1?X=P(X,we[1],o,we[2]):N(we[1],we[2],!0));else if(ue.match(v)&&l["boolean-negation"])we=ue.match(v),we!==null&&Array.isArray(we)&&we.length>=2&&(le=we[1],N(le,H(le,E.arrays)?[!1]:!1));else if(ue.match(/^--.+/)||!l["short-option-groups"]&&ue.match(/^-[^-]+/))we=ue.match(/^--?(.+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(le=we[1],H(le,E.arrays)?X=D(X,le,o):H(le,E.nargs)!==!1?X=P(X,le,o):(Le=o[X+1],Le!==void 0&&(!Le.match(/^-/)||Le.match(_))&&!H(le,E.bools)&&!H(le,E.counts)||/^(true|false)$/.test(Le)?(N(le,Le),X++):N(le,Pe(le))));else if(ue.match(/^-.\..+=/))we=ue.match(/^-([^=]+)=([\s\S]*)$/),we!==null&&Array.isArray(we)&&we.length>=3&&N(we[1],we[2]);else if(ue.match(/^-.\..+/)&&!ue.match(_))Le=o[X+1],we=ue.match(/^-(.\..+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(le=we[1],Le!==void 0&&!Le.match(/^-/)&&!H(le,E.bools)&&!H(le,E.counts)?(N(le,Le),X++):N(le,Pe(le)));else if(ue.match(/^-[^-]+/)&&!ue.match(_)){Ne=ue.slice(1,-1).split(""),ie=!1;for(let st=0;stX!=="--"&&X.includes("-")).forEach(X=>{delete w[X]}),l["strip-aliased"]&&[].concat(...Object.keys(c).map(X=>c[X])).forEach(X=>{l["camel-case-expansion"]&&X.includes("-")&&delete w[X.split(".").map(ue=>iK(ue)).join(".")],delete w[X]});function x(X){let ue=j("_",X);(typeof ue=="string"||typeof ue=="number")&&w._.push(ue)}a(x,"pushPositional");function P(X,ue,je,ie){let le,Ne=H(ue,E.nargs);if(Ne=typeof Ne!="number"||isNaN(Ne)?1:Ne,Ne===0)return K(ie)||(b=Error(y("Argument unexpected for: %s",ue))),N(ue,Pe(ue)),X;let we=K(ie)?0:1;if(l["nargs-eats-options"])je.length-(X+1)+we0&&(N(ue,ie),Le--),le=X+1;le0||we&&typeof we=="number"&&le.length>=we||(Ne=je[Le],/^-/.test(Ne)&&!_.test(Ne)&&!ve(Ne)));Le++)X=Le,le.push(L(ue,Ne,s))}return typeof we=="number"&&(we&&le.length1&&l["dot-notation"]&&(E.aliases[le[0]]||[]).forEach(function(Ne){let we=Ne.split("."),Le=[].concat(le);Le.shift(),we=we.concat(Le),(E.aliases[X]||[]).includes(we.join("."))||J(w,we,ie)}),H(X,E.normalize)&&!H(X,E.arrays)&&[X].concat(E.aliases[X]||[]).forEach(function(we){Object.defineProperty(R,we,{enumerable:!0,get(){return ue},set(Le){ue=typeof Le=="string"?P3.normalize(Le):Le}})})}a(N,"setArg");function B(X,ue){E.aliases[X]&&E.aliases[X].length||(E.aliases[X]=[ue],g[ue]=!0),E.aliases[ue]&&E.aliases[ue].length||B(ue,X)}a(B,"addNewAlias");function L(X,ue,je){je&&(ue=Uqo(ue)),(H(X,E.bools)||H(X,E.counts))&&typeof ue=="string"&&(ue=ue==="true");let ie=Array.isArray(ue)?ue.map(function(le){return j(X,le)}):j(X,ue);return H(X,E.counts)&&(K(ie)||typeof ie=="boolean")&&(ie=uQt()),H(X,E.normalize)&&H(X,E.arrays)&&(Array.isArray(ue)?ie=ue.map(le=>P3.normalize(le)):ie=P3.normalize(ue)),ie}a(L,"processValue");function j(X,ue){return!l["parse-positional-numbers"]&&X==="_"||!H(X,E.strings)&&!H(X,E.bools)&&!Array.isArray(ue)&&(bYe(ue)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${ue}`)))||!K(ue)&&H(X,E.numbers))&&(ue=Number(ue)),ue}a(j,"maybeCoerceNumber");function M(X){let ue=Object.create(null);$(ue,E.aliases,u),Object.keys(E.configs).forEach(function(je){let ie=X[je]||ue[je];if(ie)try{let le=null,Ne=P3.resolve(P3.cwd(),ie),we=E.configs[je];if(typeof we=="function"){try{le=we(Ne)}catch(Le){le=Le}if(le instanceof Error){b=le;return}}else le=P3.require(Ne);O(le)}catch(le){le.name==="PermissionDenied"?b=le:X[je]&&(b=Error(y("Invalid JSON config file: %s",ie)))}})}a(M,"setConfig");function O(X,ue){Object.keys(X).forEach(function(je){let ie=X[je],le=ue?ue+"."+je:je;typeof ie=="object"&&ie!==null&&!Array.isArray(ie)&&l["dot-notation"]?O(ie,le):(!W(w,le.split("."))||H(le,E.arrays)&&l["combine-arrays"])&&N(le,ie)})}a(O,"setConfigObject");function q(){typeof d<"u"&&d.forEach(function(X){O(X)})}a(q,"setConfigObjects");function Q(X,ue){if(typeof f>"u")return;let je=typeof f=="string"?f:"",ie=P3.env();Object.keys(ie).forEach(function(le){if(je===""||le.lastIndexOf(je,0)===0){let Ne=le.split("__").map(function(we,Le){return Le===0&&(we=we.substring(je.length)),iK(we)});(ue&&E.configs[Ne.join(".")]||!ue)&&!W(X,Ne)&&N(Ne.join("."),ie[le])}})}a(Q,"applyEnvVars");function U(X){let ue,je=new Set;Object.keys(X).forEach(function(ie){if(!je.has(ie)&&(ue=H(ie,E.coercions),typeof ue=="function"))try{let le=j(ie,ue(X[ie]));[].concat(E.aliases[ie]||[],ie).forEach(Ne=>{je.add(Ne),X[Ne]=le})}catch(le){b=le}})}a(U,"applyCoercions");function z(X){return E.keys.forEach(ue=>{~ue.indexOf(".")||typeof X[ue]>"u"&&(X[ue]=void 0)}),X}a(z,"setPlaceholderKeys");function $(X,ue,je,ie=!1){Object.keys(je).forEach(function(le){W(X,le.split("."))||(J(X,le.split("."),je[le]),ie&&(A[le]=!0),(ue[le]||[]).forEach(function(Ne){W(X,Ne.split("."))||J(X,Ne.split("."),je[le])}))})}a($,"applyDefaultsAndAliases");function W(X,ue){let je=X;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(le){je=je[le]||{}});let ie=ue[ue.length-1];return typeof je!="object"?!1:ie in je}a(W,"hasKey");function J(X,ue,je){let ie=X;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(rt){rt=NAn(rt),typeof ie=="object"&&ie[rt]===void 0&&(ie[rt]={}),typeof ie[rt]!="object"||Array.isArray(ie[rt])?(Array.isArray(ie[rt])?ie[rt].push({}):ie[rt]=[ie[rt],{}],ie=ie[rt][ie[rt].length-1]):ie=ie[rt]});let le=NAn(ue[ue.length-1]),Ne=H(ue.join("."),E.arrays),we=Array.isArray(je),Le=l["duplicate-arguments-array"];!Le&&H(le,E.nargs)&&(Le=!0,(!K(ie[le])&&E.nargs[le]===1||Array.isArray(ie[le])&&ie[le].length===E.nargs[le])&&(ie[le]=void 0)),je===uQt()?ie[le]=uQt(ie[le]):Array.isArray(ie[le])?Le&&Ne&&we?ie[le]=l["flatten-duplicate-arrays"]?ie[le].concat(je):(Array.isArray(ie[le][0])?ie[le]:[ie[le]]).concat([je]):!Le&&!!Ne==!!we?ie[le]=je:ie[le]=ie[le].concat([je]):ie[le]===void 0&&Ne?ie[le]=we?je:[je]:Le&&!(ie[le]===void 0||H(le,E.counts)||H(le,E.bools))?ie[le]=[ie[le],je]:ie[le]=je}a(J,"setKey");function ne(...X){X.forEach(function(ue){Object.keys(ue||{}).forEach(function(je){E.aliases[je]||(E.aliases[je]=[].concat(c[je]||[]),E.aliases[je].concat(je).forEach(function(ie){if(/-/.test(ie)&&l["camel-case-expansion"]){let le=iK(ie);le!==je&&E.aliases[je].indexOf(le)===-1&&(E.aliases[je].push(le),g[le]=!0)}}),E.aliases[je].concat(je).forEach(function(ie){if(ie.length>1&&/[A-Z]/.test(ie)&&l["camel-case-expansion"]){let le=CYe(ie,"-");le!==je&&E.aliases[je].indexOf(le)===-1&&(E.aliases[je].push(le),g[le]=!0)}}),E.aliases[je].forEach(function(ie){E.aliases[ie]=[je].concat(E.aliases[je].filter(function(le){return ie!==le}))}))})})}a(ne,"extendAliases");function H(X,ue){let je=[].concat(E.aliases[X]||[],X),ie=Object.keys(ue),le=je.find(Ne=>ie.includes(Ne));return le?ue[le]:!1}a(H,"checkAllAliases");function re(X){let ue=Object.keys(E);return[].concat(ue.map(ie=>E[ie])).some(function(ie){return Array.isArray(ie)?ie.includes(X):ie[X]})}a(re,"hasAnyFlag");function ae(X,...ue){return[].concat(...ue).some(function(ie){let le=X.match(ie);return le&&re(le[1])})}a(ae,"hasFlagsMatching");function Be(X){if(X.match(_)||!X.match(/^-[^-]+/))return!1;let ue=!0,je,ie=X.slice(1).split("");for(let le=0;leH(X,E.arrays)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",X)),!0):H(X,E.nargs)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",X)),!0):!1)}return a(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 Fqo(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;oQqo,"env"),format:LAn.format,normalize:TYe.normalize,resolve:TYe.resolve,require:a(t=>{if(typeof BAn<"u")return BAn(t);if(t.match(/\.json$/))return JSON.parse((0,FAn.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),zIe=a(function(e,r){return UAn.parse(e.slice(),r).argv},"Parser");zIe.detailed=function(t,e){return UAn.parse(t.slice(),e)};zIe.camelCase=iK;zIe.decamelize=CYe;zIe.looksLikeNumber=bYe;var QAn=zIe;var kS=require("path");p();function qqo(){return jqo()?0:1}a(qqo,"getProcessArgvBinIndex");function jqo(){return Hqo()&&!process.defaultApp}a(jqo,"isBundledElectronApp");function Hqo(){return!!process.versions.electron}a(Hqo,"isElectronApp");function qAn(){return process.argv[qqo()]}a(qAn,"getProcessArgvBin");p();p();p();function mQt({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(mQt,"ansiRegex");var Gqo=mQt();function gQt(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(Gqo,"")}a(gQt,"stripAnsi");p();var jAn=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 $qo=new Intl.Segmenter,Vqo=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function AQt(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=gQt(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of $qo.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)&&!Vqo.test(c)){if(jAn().test(c)){o+=2;continue}o+=yYe(l,s)}}return o}a(AQt,"stringWidth");p();p();var Lle=require("fs"),HAn=require("util"),GAn=require("path");var $An={fs:{readFileSync:Lle.readFileSync,writeFile:Lle.writeFile},format:HAn.format,resolve:GAn.resolve,exists:a(t=>{try{return(0,Lle.statSync)(t).isFile()}catch{return!1}},"exists")};p();var Lk,yQt=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(),Lk.format.apply(Lk.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),Lk.format.apply(Lk.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);Lk.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{Lk.fs.readFileSync&&(e=JSON.parse(Lk.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=Lk.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=Lk.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return Lk.exists(e)}};function VAn(t,e){Lk=e;let r=new yQt(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(VAn,"y18n");var Wqo=a(t=>VAn(t,$An),"y18n"),WAn=Wqo;var JAn=require("node:module"),ZAn=de(YAn(),1),xYe=require("node:fs");var EQt=(0,_Qt.fileURLToPath)(importMetaUrlShim),zqo=EQt.substring(0,EQt.lastIndexOf("node_modules")),Yqo=(0,JAn.createRequire)(importMetaUrlShim),XAn={assert:{notStrictEqual:IYe.notStrictEqual,strictEqual:IYe.strictEqual},cliui:cQt,findUp:lQt,getEnv:a(t=>process.env[t],"getEnv"),inspect:KAn.inspect,getProcessArgvBin:qAn,mainFilename:zqo||process.cwd(),Parser:QAn,path:{basename:kS.basename,dirname:kS.dirname,extname:kS.extname,relative:kS.relative,resolve:kS.resolve,join:kS.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:xYe.readFileSync,readdirSync:xYe.readdirSync,require:Yqo,getCallerFile:a(()=>{let t=(0,ZAn.default)(3);return t.match(/^file:\/\//)?(0,_Qt.fileURLToPath)(t):t},"getCallerFile"),stringWidth:AQt,y18n:WAn({directory:(0,kS.resolve)(EQt,"../../../locales"),updateFiles:!1})};p();p();p();function P_(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(P_,"assertNotStrictEqual");function vQt(t,e){e.assert.strictEqual(typeof t,"string")}a(vQt,"assertSingleKey");function Fle(t){return Object.keys(t)}a(Fle,"objectKeys");p();function Ju(t){return!!t&&!!t.then&&typeof t.then=="function"}a(Ju,"isPromise");p();p();p();var Gp=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 $Q(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($Q,"parseCommand");var Kqo=["first","second","third","fourth","fifth","sixth"];function Bn(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[$Q(`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 Gp(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=eyn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&tyn(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=eyn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&tyn(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(Bn,"argsert");function eyn(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a(eyn,"guessType");function tyn(t,e,r){throw new Gp(`Invalid ${Kqo[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a(tyn,"argumentTypeError");var wYe=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(Bn(" [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let s=0;s{let s=[...n[r]||[],r];return o.option?!s.includes(o.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function ryn(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(ryn,"commandMiddlewareFactory");function oK(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(oK,"applyMiddleware");p();function sK(t,e,r=n=>{throw n}){try{let n=Jqo(t)?t():t;return Ju(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(sK,"maybeAsyncResult");function Jqo(t){return typeof t=="function"}a(Jqo,"isFunction");var Ule=/(^\*)|(^\$0)/,CQt=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=ryn(s);if(o=o||(()=>{}),Array.isArray(e))if(Zqo(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(ejo(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(nyn(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=$Q(e);l=l.map(m=>$Q(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>Ule.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(Ule,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(RYe(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if(Ju(h))return h.then(m=>(f=oyn(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else Xqo(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=Ule.test(r.original)?r.original.replace(Ule,"").trim():r.original,o=e.filter(s=>!Ule.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=sK(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=oK(n,c,l,!1),n=sK(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=oK(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=$Q(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=Ule.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(RYe(r))return r(e,!0);nyn(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;P_(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();P_(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 iyn(t,e,r,n){return new CQt(t,e,r,n)}a(iyn,"command");function nyn(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(nyn,"isCommandBuilderDefinition");function Zqo(t){return t.every(e=>typeof e=="string")}a(Zqo,"isCommandAndAliases");function RYe(t){return typeof t=="function"}a(RYe,"isCommandBuilderCallback");function Xqo(t){return typeof t=="object"}a(Xqo,"isCommandBuilderOptionDefinitions");function ejo(t){return typeof t=="object"&&!Array.isArray(t)}a(ejo,"isCommandHandlerDefinition");p();p();function VQ(t={},e=()=>!0){let r={};return Fle(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(VQ,"objFilter");p();function WQ(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(WQ,"setBlocking");function tjo(t){return typeof t=="boolean"}a(tjo,"isBoolean");function ayn(t,e){let r=e.y18n.__,n={},o=[];n.failFn=a(function(L){o.push(L)},"failFn");let s=null,c=null,l=!0;n.showHelpOnFail=a(function(L=!0,j){let[M,O]=typeof L=="string"?[!0,L]:[L,j];return t.getInternalMethods().isGlobalContext()&&(c=O),s=O,l=M,n},"showHelpOnFailFn");let u=!1;n.fail=a(function(L,j){let M=t.getInternalMethods().getLoggerInstance();if(o.length)for(let O=o.length-1;O>=0;--O){let q=o[O];if(tjo(q)){if(j)throw j;if(L)throw Error(L)}else q(L,j,n)}else{if(t.getExitProcess()&&WQ(!0),!u){u=!0,l&&(t.showHelp("error"),M.error()),(L||j)&&M.error(L||j);let O=s||c;O&&((L||j)&&M.error(""),M.error(O))}if(j=j||new Gp(L),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,j);throw j}},"fail");let d=[],f=!1;n.usage=(B,L)=>B===null?(f=!0,d=[],n):(f=!1,d.push([B,L||""]),n),n.getUsage=()=>d,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>r("Positionals:");let h=[];n.example=(B,L)=>{h.push([B,L||""])};let m=[];n.command=a(function(L,j,M,O,q=!1){M&&(m=m.map(Q=>(Q[2]=!1,Q))),m.push([L,j||"",M,O,q])},"command"),n.getCommands=()=>m;let g={};n.describe=a(function(L,j){Array.isArray(L)?L.forEach(M=>{n.describe(M,j)}):typeof L=="object"?Object.keys(L).forEach(M=>{n.describe(M,L[M])}):g[L]=j},"describe"),n.getDescriptions=()=>g;let A=[];n.epilog=B=>{A.push(B)};let y=!1,E;n.wrap=B=>{y=!0,E=B},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(E=P(),y=!0),E);let _="__yargsString__:";n.deferY18nLookup=B=>_+B,n.help=a(function(){if(T)return T;b();let L=t.customScriptName?t.$0:e.path.basename(t.$0),j=t.getDemandedOptions(),M=t.getDemandedCommands(),O=t.getDeprecatedOptions(),q=t.getGroups(),Q=t.getOptions(),U=[];U=U.concat(Object.keys(g)),U=U.concat(Object.keys(j)),U=U.concat(Object.keys(M)),U=U.concat(Object.keys(Q.default)),U=U.filter(R),U=Object.keys(U.reduce((ae,Be)=>(Be!=="_"&&(ae[Be]=!0),ae),{}));let z=n.getWrap(),$=e.cliui({width:z,wrap:!!z});if(!f){if(d.length)d.forEach(ae=>{$.div({text:`${ae[0].replace(/\$0/g,L)}`}),ae[1]&&$.div({text:`${ae[1]}`,padding:[1,0,0,0]})}),$.div();else if(m.length){let ae=null;M._?ae=`${L} <${r("command")}> -`:ae=`${L} [${r("command")}] -`,$.div(`${ae}`)}}if(m.length>1||m.length===1&&!m[0][2]){$.div(r("Commands:"));let ae=t.getInternalMethods().getContext(),Be=ae.commands.length?`${ae.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((Ue,Pe)=>Ue[0].localeCompare(Pe[0])));let ve=L?`${L} `:"";m.forEach(Ue=>{let Pe=`${ve}${Be}${Ue[0].replace(/^\$0 ?/,"")}`;$.span({text:Pe,padding:[0,2,0,2],width:v(m,z,`${L}${Be}`)+4},{text:Ue[1]});let Z=[];Ue[2]&&Z.push(`[${r("default")}]`),Ue[3]&&Ue[3].length&&Z.push(`[${r("aliases:")} ${Ue[3].join(", ")}]`),Ue[4]&&(typeof Ue[4]=="string"?Z.push(`[${r("deprecated: %s",Ue[4])}]`):Z.push(`[${r("deprecated")}]`)),Z.length?$.div({text:Z.join(" "),padding:[0,0,0,2],align:"right"}):$.div()}),$.div()}let W=(Object.keys(Q.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);U=U.filter(ae=>!t.parsed.newAliases[ae]&&W.every(Be=>(Q.alias[Be]||[]).indexOf(ae)===-1));let J=r("Options:");q[J]||(q[J]=[]),w(U,Q.alias,q,J);let ne=a(ae=>/^--/.test(PYe(ae)),"isLongSwitch"),H=Object.keys(q).filter(ae=>q[ae].length>0).map(ae=>{let Be=q[ae].filter(R).map(ve=>{if(W.includes(ve))return ve;for(let Ue=0,Pe;(Pe=W[Ue])!==void 0;Ue++)if((Q.alias[Pe]||[]).includes(ve))return Pe;return ve});return{groupName:ae,normalizedKeys:Be}}).filter(({normalizedKeys:ae})=>ae.length>0).map(({groupName:ae,normalizedKeys:Be})=>{let ve=Be.reduce((Ue,Pe)=>(Ue[Pe]=[Pe].concat(Q.alias[Pe]||[]).map(Z=>ae===n.getPositionalGroupName()?Z:(/^[0-9]$/.test(Z)?Q.boolean.includes(Pe)?"-":"--":Z.length>1?"--":"-")+Z).sort((Z,ee)=>ne(Z)===ne(ee)?0:ne(Z)?1:-1).join(", "),Ue),{});return{groupName:ae,normalizedKeys:Be,switches:ve}});if(H.filter(({groupName:ae})=>ae!==n.getPositionalGroupName()).some(({normalizedKeys:ae,switches:Be})=>!ae.every(ve=>ne(Be[ve])))&&H.filter(({groupName:ae})=>ae!==n.getPositionalGroupName()).forEach(({normalizedKeys:ae,switches:Be})=>{ae.forEach(ve=>{ne(Be[ve])&&(Be[ve]=rjo(Be[ve],4))})}),H.forEach(({groupName:ae,normalizedKeys:Be,switches:ve})=>{$.div(ae),Be.forEach(Ue=>{let Pe=ve[Ue],Z=g[Ue]||"",ee=null;Z.includes(_)&&(Z=r(Z.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 j?`[${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(" ");$.span({text:PYe(Pe),padding:[0,2,0,2+syn(Pe)],width:v(ve,z)+4},Z);let X=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;he&&!X?$.div({text:he,padding:[0,0,0,2],align:"right"}):$.div()}),$.div()}),h.length&&($.div(r("Examples:")),h.forEach(ae=>{ae[0]=ae[0].replace(/\$0/g,L)}),h.forEach(ae=>{ae[1]===""?$.div({text:ae[0],padding:[0,2,0,2]}):$.div({text:ae[0],padding:[0,2,0,2],width:v(h,z)+4},{text:ae[1]})}),$.div()),A.length>0){let ae=A.map(Be=>Be.replace(/\$0/g,L)).join(` -`);$.div(`${ae} -`)}return $.toString().replace(/\s*$/,"")},"help");function v(B,L,j){let M=0;return Array.isArray(B)||(B=Object.values(B).map(O=>[O])),B.forEach(O=>{M=Math.max(e.stringWidth(j?`${j} ${PYe(O[0])}`:PYe(O[0]))+syn(O[0]),M)}),L&&(M=Math.min(M,parseInt((L*.5).toString(),10))),M}a(v,"maxWidth");function b(){let B=t.getDemandedOptions(),L=t.getOptions();(Object.keys(L.alias)||[]).forEach(j=>{L.alias[j].forEach(M=>{g[M]&&n.describe(j,g[M]),M in B&&t.demandOption(j,B[M]),L.boolean.includes(M)&&t.boolean(j),L.count.includes(M)&&t.count(j),L.string.includes(M)&&t.string(j),L.normalize.includes(M)&&t.normalize(j),L.array.includes(M)&&t.array(j),L.number.includes(M)&&t.number(j)})})}a(b,"normalizeAliases");let T;n.cacheHelpMessage=function(){T=this.help()},n.clearCachedHelpMessage=function(){T=void 0},n.hasCachedHelpMessage=function(){return!!T};function w(B,L,j,M){let O=[],q=null;return Object.keys(j).forEach(Q=>{O=O.concat(j[Q])}),B.forEach(Q=>{q=[Q].concat(L[Q]),q.some(U=>O.indexOf(U)!==-1)||j[M].push(Q)}),O}a(w,"addUngroupedKeys");function R(B){return t.getOptions().hiddenOptions.indexOf(B)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}a(R,"filterHiddenOptions"),n.showHelp=B=>{let L=t.getInternalMethods().getLoggerInstance();B||(B="error"),(typeof B=="function"?B:L[B])(n.help())},n.functionDescription=B=>["(",B.name?e.Parser.decamelize(B.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=a(function(L,j){let M="",O=j||", ",q=[].concat(L);return!L||!q.length||q.forEach(Q=>{M.length&&(M+=O),M+=JSON.stringify(Q)}),M},"stringifiedValues");function x(B,L){let j=`[${r("default:")} `;if(B===void 0&&!L)return null;if(L)j+=L;else switch(typeof B){case"string":j+=`"${B}"`;break;case"object":j+=JSON.stringify(B);break;default:j+=B}return`${j}]`}a(x,"defaultString");function P(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}a(P,"windowWidth");let D=null;n.version=B=>{D=B},n.showVersion=B=>{let L=t.getInternalMethods().getLoggerInstance();B||(B="error"),(typeof B=="function"?B:L[B])(D)},n.reset=a(function(L){return s=null,u=!1,d=[],f=!1,A=[],h=[],m=[],g=VQ(g,j=>!L[j]),n},"reset");let N=[];return n.freeze=a(function(){N.push({failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g})},"freeze"),n.unfreeze=a(function(L=!1){let j=N.pop();j&&(L?(g={...j.descriptions,...g},m=[...j.commands,...m],d=[...j.usages,...d],h=[...j.examples,...h],A=[...j.epilogs,...A]):{failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g}=j)},"unfreeze"),n}a(ayn,"usage");function bQt(t){return typeof t=="object"}a(bQt,"isIndentedText");function rjo(t,e){return bQt(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(rjo,"addIndentation");function syn(t){return bQt(t)?t.indentation:0}a(syn,"getIndentation");function PYe(t){return bQt(t)?t.text:t}a(PYe,"getText");p();p();var cyn=`###-begin-{{app_name}}-completions-### +`).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")}> +`: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} +`)}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-### # # yargs command completion script # @@ -2295,7 +2300,7 @@ _{{app_name}}_yargs_completions() } complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}} ###-end-{{app_name}}-completions-### -`,lyn=`#compdef {{app_name}} +`,zmn=`#compdef {{app_name}} ###-begin-{{app_name}}-completions-### # # yargs command completion script @@ -2322,64 +2327,102 @@ else compdef _{{app_name}}_yargs_completions {{app_name}} fi ###-end-{{app_name}}-completions-### -`;var SQt=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=$Q(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(P_(this.customCompletionFunction,null,this.shim),ijo(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 ojo(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?lyn:cyn,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 uyn(t,e,r,n){return new SQt(t,e,r,n)}a(uyn,"completion");function ijo(t){return t.length<3}a(ijo,"isSyncCompletionFunction");function ojo(t){return t.length>3}a(ojo,"isFallbackCompletionFunction");p();p();function dyn(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(dyn,"levenshtein");var fyn=["$0","--","_"];function pyn(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 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?` ${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=>{!fyn.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=>{fyn.indexOf(E)===-1&&Object.prototype.hasOwnProperty.call(m.choices,E)&&[].concat(h[E]).forEach(_=>{m.choices[E].indexOf(_)===-1&&_!==void 0&&(g[E]=(g[E]||[]).concat(_))})});let A=Object.keys(g);if(!A.length)return;let y=n("Invalid values:");A.forEach(E=>{y+=` - ${n("Argument: %s, Given: %s, Choices: %s",E,e.stringifiedValues(g[E]),e.stringifiedValues(m.choices[E]))}`}),e.fail(y)},"limitedChoices");let c={};s.implies=a(function(h,m){Bn(" [array|number|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.implies(g,h[g])}):(t.global(h),c[h]||(c[h]=[]),Array.isArray(m)?m.forEach(g=>s.implies(h,g)):(P_(m,void 0,r),c[h].push(m)))},"implies"),s.getImplied=a(function(){return c},"getImplied");function l(f,h){let m=Number(h);return h=isNaN(m)?h:m,typeof h=="number"?h=f._.length>=h:h.match(/^--no-.+/)?(h=h.match(/^--no-(.+)/)[1],h=!Object.prototype.hasOwnProperty.call(f,h)):h=Object.prototype.hasOwnProperty.call(f,h),h}a(l,"keyExists"),s.implications=a(function(h){let m=[];if(Object.keys(c).forEach(g=>{let A=g;(c[g]||[]).forEach(y=>{let E=A,_=y;E=l(h,E),y=l(h,y),E&&!y&&m.push(` ${A} -> ${_}`)})}),m.length){let g=`${n("Implications failed:")} -`;m.forEach(A=>{g+=A}),e.fail(g)}},"implications");let u={};s.conflicts=a(function(h,m){Bn(" [array|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.conflicts(g,h[g])}):(t.global(h),u[h]||(u[h]=[]),Array.isArray(m)?m.forEach(g=>s.conflicts(h,g)):u[h].push(m))},"conflicts"),s.getConflicting=()=>u,s.conflicting=a(function(h){Object.keys(h).forEach(m=>{u[m]&&u[m].forEach(g=>{g&&h[m]!==void 0&&h[g]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(m=>{u[m].forEach(g=>{g&&h[r.Parser.camelCase(m)]!==void 0&&h[r.Parser.camelCase(g)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})})},"conflictingFn"),s.recommendCommands=a(function(h,m){m=m.sort((E,_)=>_.length-E.length);let A=null,y=1/0;for(let E=0,_;(_=m[E])!==void 0;E++){let v=dyn(h,_);v<=3&&v!h[m]),u=VQ(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();P_(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(pyn,"validation");p();var cjo={};var TQt=[],YIe;function kYe(t,e,r,n){YIe=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=ajo(e,t.extends);else try{c=cjo.resolve(t.extends)}catch{return t}sjo(c),TQt.push(c),o=s?JSON.parse(YIe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=kYe(o,YIe.path.dirname(c),r,YIe)}return TQt=[],r?hyn(o,t):Object.assign({},o,t)}a(kYe,"applyExtends");function sjo(t){if(TQt.indexOf(t)>-1)throw new Gp(`Circular extended configurations: '${t}'.`)}a(sjo,"checkForCircularExtends");function ajo(t,e){return YIe.path.resolve(t,e)}a(ajo,"getPathToDefaultConfig");function hyn(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]=hyn(t[o],e[o]):r[o]=e[o];return r}a(hyn,"mergeDeep");var Ln=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},ke=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$p,aK,KIe,MC,DS,DYe,zQ,cK,NYe,qx,MYe,jx,uO,NS,Hx,OYe,lK,ng,ni,BYe,LYe,MS,uK,Qle,dK,YQ,FYe,Yi,fK,pK,hK,go,UYe,dO,Jf;function Myn(t){return(e=[],r=t.process.cwd(),n)=>{let o=new BQt(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(Myn,"YargsFactory");var myn=Symbol("copyDoubleDash"),gyn=Symbol("copyDoubleDash"),IQt=Symbol("deleteFromParserHintObject"),Ayn=Symbol("emitWarning"),yyn=Symbol("freeze"),Eyn=Symbol("getDollarZero"),mK=Symbol("getParserConfiguration"),_yn=Symbol("getUsageConfiguration"),xQt=Symbol("guessLocale"),vyn=Symbol("guessVersion"),Cyn=Symbol("parsePositionalNumbers"),wQt=Symbol("pkgUp"),KQ=Symbol("populateParserHintArray"),qle=Symbol("populateParserHintSingleValueDictionary"),RQt=Symbol("populateParserHintArrayDictionary"),PQt=Symbol("populateParserHintDictionary"),kQt=Symbol("sanitizeKey"),DQt=Symbol("setKey"),NQt=Symbol("unfreeze"),byn=Symbol("validateAsync"),Syn=Symbol("getCommandInstance"),Tyn=Symbol("getContext"),Iyn=Symbol("getHasOutput"),xyn=Symbol("getLoggerInstance"),wyn=Symbol("getParseContext"),Ryn=Symbol("getUsageInstance"),Pyn=Symbol("getValidationInstance"),QYe=Symbol("hasParseCallback"),kyn=Symbol("isGlobalContext"),gK=Symbol("postProcess"),Dyn=Symbol("rebase"),MQt=Symbol("reset"),JIe=Symbol("runYargsParserAndExecuteCommands"),OQt=Symbol("runValidation"),Nyn=Symbol("setHasOutput"),AK=Symbol("kTrackManuallySetKeys"),ljo="en_US",BQt=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,$p.set(this,void 0),aK.set(this,void 0),KIe.set(this,{commands:[],fullCommands:[]}),MC.set(this,null),DS.set(this,null),DYe.set(this,"show-hidden"),zQ.set(this,null),cK.set(this,!0),NYe.set(this,{}),qx.set(this,!0),MYe.set(this,[]),jx.set(this,void 0),uO.set(this,{}),NS.set(this,!1),Hx.set(this,null),OYe.set(this,!0),lK.set(this,void 0),ng.set(this,""),ni.set(this,void 0),BYe.set(this,void 0),LYe.set(this,{}),MS.set(this,null),uK.set(this,null),Qle.set(this,{}),dK.set(this,{}),YQ.set(this,void 0),FYe.set(this,!1),Yi.set(this,void 0),fK.set(this,!1),pK.set(this,!1),hK.set(this,!1),go.set(this,void 0),UYe.set(this,{}),dO.set(this,null),Jf.set(this,void 0),Ln(this,Yi,o,"f"),Ln(this,YQ,e,"f"),Ln(this,aK,r,"f"),Ln(this,BYe,n,"f"),Ln(this,jx,new wYe(this),"f"),this.$0=this[Eyn](),this[MQt](),Ln(this,$p,ke(this,$p,"f"),"f"),Ln(this,go,ke(this,go,"f"),"f"),Ln(this,Jf,ke(this,Jf,"f"),"f"),Ln(this,ni,ke(this,ni,"f"),"f"),ke(this,ni,"f").showHiddenOpt=ke(this,DYe,"f"),Ln(this,lK,this[gyn](),"f"),ke(this,Yi,"f").y18n.setLocale(ljo)}addHelpOpt(e,r){let n="help";return Bn("[string|boolean] [string]",[e,r],arguments.length),ke(this,Hx,"f")&&(this[IQt](ke(this,Hx,"f")),Ln(this,Hx,null,"f")),e===!1&&r===void 0?this:(Ln(this,Hx,typeof e=="string"?e:n,"f"),this.boolean(ke(this,Hx,"f")),this.describe(ke(this,Hx,"f"),r||ke(this,go,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(Bn("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:ke(this,DYe,"f");return this.boolean(n),this.describe(n,r||ke(this,go,"f").deferY18nLookup("Show hidden options")),ke(this,ni,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return Bn(" [string|array]",[e,r],arguments.length),this[RQt](this.alias.bind(this),"alias",e,r),this}array(e){return Bn("",[e],arguments.length),this[KQ]("array",e),this[AK](e),this}boolean(e){return Bn("",[e],arguments.length),this[KQ]("boolean",e),this[AK](e),this}check(e,r){return Bn(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>sK(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&ke(this,go,"f").fail(s.toString(),s):ke(this,go,"f").fail(ke(this,Yi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(ke(this,go,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return Bn(" [string|array]",[e,r],arguments.length),this[RQt](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(Bn(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Gp("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 Gp("coerce callback must be provided");let n=e;return ke(this,ni,"f").key[n]=!0,ke(this,jx,"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:sK(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new Gp(d.message)})},n),this}conflicts(e,r){return Bn(" [string|array]",[e,r],arguments.length),ke(this,Jf,"f").conflicts(e,r),this}config(e="config",r,n){return Bn("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=kYe(e,ke(this,aK,"f"),this[mK]()["deep-merge-config"]||!1,ke(this,Yi,"f")),ke(this,ni,"f").configObjects=(ke(this,ni,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||ke(this,go,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(o=>{ke(this,ni,"f").config[o]=n||!0}),this)}completion(e,r,n){return Bn("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Ln(this,DS,e||ke(this,DS,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(ke(this,DS,"f"),r),n&&ke(this,MC,"f").registerFunction(n),this}command(e,r,n,o,s,c){return Bn(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),ke(this,$p,"f").addHandler(e,r,n,o,s,c),this}commands(e,r,n,o,s,c){return this.command(e,r,n,o,s,c)}commandDir(e,r){Bn(" [object]",[e,r],arguments.length);let n=ke(this,BYe,"f")||ke(this,Yi,"f").require;return ke(this,$p,"f").addDirectory(e,n,ke(this,Yi,"f").getCallerFile(),r),this}count(e){return Bn("",[e],arguments.length),this[KQ]("count",e),this[AK](e),this}default(e,r,n){return Bn(" [*] [string]",[e,r,n],arguments.length),n&&(vQt(e,ke(this,Yi,"f")),ke(this,ni,"f").defaultDescription[e]=n),typeof r=="function"&&(vQt(e,ke(this,Yi,"f")),ke(this,ni,"f").defaultDescription[e]||(ke(this,ni,"f").defaultDescription[e]=ke(this,go,"f").functionDescription(r)),r=r.call()),this[qle](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,o){return Bn("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,o],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),ke(this,ni,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:o},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(o=>{P_(n,!0,ke(this,Yi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(P_(n,!0,ke(this,Yi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{P_(n,!0,ke(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 Bn(" [string]",[e,r],arguments.length),this[qle](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return Bn(" [string|boolean]",[e,r],arguments.length),ke(this,ni,"f").deprecatedOptions[e]=r,this}describe(e,r){return Bn(" [string]",[e,r],arguments.length),this[DQt](e,!0),ke(this,go,"f").describe(e,r),this}detectLocale(e){return Bn("",[e],arguments.length),Ln(this,cK,e,"f"),this}env(e){return Bn("[string|boolean]",[e],arguments.length),e===!1?delete ke(this,ni,"f").envPrefix:ke(this,ni,"f").envPrefix=e||"",this}epilogue(e){return Bn("",[e],arguments.length),ke(this,go,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return Bn(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):ke(this,go,"f").example(e,r),this}exit(e,r){Ln(this,NS,!0,"f"),Ln(this,zQ,r,"f"),ke(this,qx,"f")&&ke(this,Yi,"f").process.exit(e)}exitProcess(e=!0){return Bn("[boolean]",[e],arguments.length),Ln(this,qx,e,"f"),this}fail(e){if(Bn("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Gp("Invalid first argument. Expected function or boolean 'false'");return ke(this,go,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return Bn(" [function]",[e,r],arguments.length),r?ke(this,MC,"f").getCompletion(e,r):new Promise((n,o)=>{ke(this,MC,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return Bn([],0),ke(this,ni,"f").demandedOptions}getDemandedCommands(){return Bn([],0),ke(this,ni,"f").demandedCommands}getDeprecatedOptions(){return Bn([],0),ke(this,ni,"f").deprecatedOptions}getDetectLocale(){return ke(this,cK,"f")}getExitProcess(){return ke(this,qx,"f")}getGroups(){return Object.assign({},ke(this,uO,"f"),ke(this,dK,"f"))}getHelp(){if(Ln(this,NS,!0,"f"),!ke(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[JIe](ke(this,YQ,"f"),void 0,void 0,0,!0);if(Ju(r))return r.then(()=>ke(this,go,"f").help())}let e=ke(this,$p,"f").runDefaultBuilderOn(this);if(Ju(e))return e.then(()=>ke(this,go,"f").help())}return Promise.resolve(ke(this,go,"f").help())}getOptions(){return ke(this,ni,"f")}getStrict(){return ke(this,fK,"f")}getStrictCommands(){return ke(this,pK,"f")}getStrictOptions(){return ke(this,hK,"f")}global(e,r){return Bn(" [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?ke(this,ni,"f").local=ke(this,ni,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{ke(this,ni,"f").local.includes(n)||ke(this,ni,"f").local.push(n)}),this}group(e,r){Bn(" ",[e,r],arguments.length);let n=ke(this,dK,"f")[r]||ke(this,uO,"f")[r];ke(this,dK,"f")[r]&&delete ke(this,dK,"f")[r];let o={};return ke(this,uO,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return Bn("",[e],arguments.length),ke(this,ni,"f").hiddenOptions.push(e),this}implies(e,r){return Bn(" [number|string|array]",[e,r],arguments.length),ke(this,Jf,"f").implies(e,r),this}locale(e){return Bn("[string]",[e],arguments.length),e===void 0?(this[xQt](),ke(this,Yi,"f").y18n.getLocale()):(Ln(this,cK,!1,"f"),ke(this,Yi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return ke(this,jx,"f").addMiddleware(e,!!r,n)}nargs(e,r){return Bn(" [number]",[e,r],arguments.length),this[qle](this.nargs.bind(this),"narg",e,r),this}normalize(e){return Bn("",[e],arguments.length),this[KQ]("normalize",e),this}number(e){return Bn("",[e],arguments.length),this[KQ]("number",e),this[AK](e),this}option(e,r){if(Bn(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[AK](e),ke(this,dO,"f")&&(e==="version"||r?.alias==="version")&&this[Ayn](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(` -`),void 0,"versionWarning"),ke(this,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&&(ke(this,ni,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let s=r.describe||r.description||r.desc,c=ke(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){Bn("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[yyn](),typeof e>"u"&&(e=ke(this,YQ,"f")),typeof r=="object"&&(Ln(this,uK,r,"f"),r=n),typeof r=="function"&&(Ln(this,MS,r,"f"),r=!1),r||Ln(this,YQ,e,"f"),ke(this,MS,"f")&&Ln(this,qx,!1,"f");let o=this[JIe](e,!!r),s=this.parsed;return ke(this,MC,"f").setParsed(this.parsed),Ju(o)?o.then(c=>(ke(this,MS,"f")&&ke(this,MS,"f").call(this,ke(this,zQ,"f"),c,ke(this,ng,"f")),c)).catch(c=>{throw ke(this,MS,"f")&&ke(this,MS,"f")(c,this.parsed.argv,ke(this,ng,"f")),c}).finally(()=>{this[NQt](),this.parsed=s}):(ke(this,MS,"f")&&ke(this,MS,"f").call(this,ke(this,zQ,"f"),o,ke(this,ng,"f")),this[NQt](),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 Gp(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return Bn("",[e],arguments.length),Ln(this,LYe,e,"f"),this}pkgConf(e,r){Bn(" [string]",[e,r],arguments.length);let n=null,o=this[wQt](r||ke(this,aK,"f"));return o[e]&&typeof o[e]=="object"&&(n=kYe(o[e],r||ke(this,aK,"f"),this[mK]()["deep-merge-config"]||!1,ke(this,Yi,"f")),ke(this,ni,"f").configObjects=(ke(this,ni,"f").configObjects||[]).concat(n)),this}positional(e,r){Bn(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=VQ(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=ke(this,KIe,"f").fullCommands[ke(this,KIe,"f").fullCommands.length-1],s=o?ke(this,$p,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return Fle(s).forEach(c=>{let l=s[c];Array.isArray(l)?l.indexOf(e)!==-1&&(r[c]=!0):l[e]&&!(c in r)&&(r[c]=l[e])}),this.group(e,ke(this,go,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return Bn("[boolean]",[e],arguments.length),Ln(this,FYe,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return Bn(" [number]",[e],arguments.length),typeof e=="string"&&ke(this,ni,"f").narg[e]?this:(this[qle](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return Bn("[string] [string]",[e,r],arguments.length),e=e||this.$0,ke(this,lK,"f").log(ke(this,MC,"f").generateCompletionScript(e,r||ke(this,DS,"f")||"completion")),this}showHelp(e){if(Bn("[string|function]",[e],arguments.length),Ln(this,NS,!0,"f"),!ke(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[JIe](ke(this,YQ,"f"),void 0,void 0,0,!0);if(Ju(n))return n.then(()=>{ke(this,go,"f").showHelp(e)}),this}let r=ke(this,$p,"f").runDefaultBuilderOn(this);if(Ju(r))return r.then(()=>{ke(this,go,"f").showHelp(e)}),this}return ke(this,go,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return Bn("[boolean|string] [string]",[e,r],arguments.length),ke(this,go,"f").showHelpOnFail(e,r),this}showVersion(e){return Bn("[string|function]",[e],arguments.length),ke(this,go,"f").showVersion(e),this}skipValidation(e){return Bn("",[e],arguments.length),this[KQ]("skipValidation",e),this}strict(e){return Bn("[boolean]",[e],arguments.length),Ln(this,fK,e!==!1,"f"),this}strictCommands(e){return Bn("[boolean]",[e],arguments.length),Ln(this,pK,e!==!1,"f"),this}strictOptions(e){return Bn("[boolean]",[e],arguments.length),Ln(this,hK,e!==!1,"f"),this}string(e){return Bn("",[e],arguments.length),this[KQ]("string",e),this[AK](e),this}terminalWidth(){return Bn([],0),ke(this,Yi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return Bn("",[e],arguments.length),Ln(this,cK,!1,"f"),ke(this,Yi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(Bn(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(P_(e,null,ke(this,Yi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new Gp(".usage() description must start with $0 if being used as alias for .command()")}else return ke(this,go,"f").usage(e),this}usageConfiguration(e){return Bn("",[e],arguments.length),Ln(this,UYe,e,"f"),this}version(e,r,n){let o="version";if(Bn("[boolean|string] [string] [string]",[e,r,n],arguments.length),ke(this,dO,"f")&&(this[IQt](ke(this,dO,"f")),ke(this,go,"f").version(void 0),Ln(this,dO,null,"f")),arguments.length===0)n=this[vyn](),e=o;else if(arguments.length===1){if(e===!1)return this;n=e,e=o}else arguments.length===2&&(n=r,r=void 0);return Ln(this,dO,typeof e=="string"?e:o,"f"),r=r||ke(this,go,"f").deferY18nLookup("Show version number"),ke(this,go,"f").version(n||void 0),this.boolean(ke(this,dO,"f")),this.describe(ke(this,dO,"f"),r),this}wrap(e){return Bn("",[e],arguments.length),ke(this,go,"f").wrap(e),this}[($p=new WeakMap,aK=new WeakMap,KIe=new WeakMap,MC=new WeakMap,DS=new WeakMap,DYe=new WeakMap,zQ=new WeakMap,cK=new WeakMap,NYe=new WeakMap,qx=new WeakMap,MYe=new WeakMap,jx=new WeakMap,uO=new WeakMap,NS=new WeakMap,Hx=new WeakMap,OYe=new WeakMap,lK=new WeakMap,ng=new WeakMap,ni=new WeakMap,BYe=new WeakMap,LYe=new WeakMap,MS=new WeakMap,uK=new WeakMap,Qle=new WeakMap,dK=new WeakMap,YQ=new WeakMap,FYe=new WeakMap,Yi=new WeakMap,fK=new WeakMap,pK=new WeakMap,hK=new WeakMap,go=new WeakMap,UYe=new WeakMap,dO=new WeakMap,Jf=new WeakMap,myn)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[gyn](){return{log:a((...e)=>{this[QYe]()||console.log(...e),Ln(this,NS,!0,"f"),ke(this,ng,"f").length&&Ln(this,ng,ke(this,ng,"f")+` -`,"f"),Ln(this,ng,ke(this,ng,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[QYe]()||console.error(...e),Ln(this,NS,!0,"f"),ke(this,ng,"f").length&&Ln(this,ng,ke(this,ng,"f")+` -`,"f"),Ln(this,ng,ke(this,ng,"f")+e.join(" "),"f")},"error")}}[IQt](e){Fle(ke(this,ni,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=ke(this,ni,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete ke(this,go,"f").getDescriptions()[e]}[Ayn](e,r,n){ke(this,NYe,"f")[n]||(ke(this,Yi,"f").process.emitWarning(e,r),ke(this,NYe,"f")[n]=!0)}[yyn](){ke(this,MYe,"f").push({options:ke(this,ni,"f"),configObjects:ke(this,ni,"f").configObjects.slice(0),exitProcess:ke(this,qx,"f"),groups:ke(this,uO,"f"),strict:ke(this,fK,"f"),strictCommands:ke(this,pK,"f"),strictOptions:ke(this,hK,"f"),completionCommand:ke(this,DS,"f"),output:ke(this,ng,"f"),exitError:ke(this,zQ,"f"),hasOutput:ke(this,NS,"f"),parsed:this.parsed,parseFn:ke(this,MS,"f"),parseContext:ke(this,uK,"f")}),ke(this,go,"f").freeze(),ke(this,Jf,"f").freeze(),ke(this,$p,"f").freeze(),ke(this,jx,"f").freeze()}[Eyn](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(ke(this,Yi,"f").process.argv()[0])?r=ke(this,Yi,"f").process.argv().slice(1,2):r=ke(this,Yi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[Dyn](ke(this,aK,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});P_(s,void 0,ke(this,Yi,"f")),n=JSON.parse(ke(this,Yi,"f").readFileSync(s,"utf8"))}catch{}return ke(this,Qle,"f")[r]=n||{},ke(this,Qle,"f")[r]}[KQ](e,r){r=[].concat(r),r.forEach(n=>{n=this[kQt](n),ke(this,ni,"f")[e].push(n)})}[qle](e,r,n,o){this[PQt](e,r,n,o,(s,c,l)=>{ke(this,ni,"f")[s][c]=l})}[RQt](e,r,n,o){this[PQt](e,r,n,o,(s,c,l)=>{ke(this,ni,"f")[s][c]=(ke(this,ni,"f")[s][c]||[]).concat(l)})}[PQt](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 Fle(n))e(c,n[c]);else s(r,this[kQt](n),o)}[kQt](e){return e==="__proto__"?"___proto___":e}[DQt](e,r){return this[qle](this[DQt].bind(this),"key",e,r),this}[NQt](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=ke(this,MYe,"f").pop();P_(g,void 0,ke(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){Ln(e,ni,y,"f")}}.value,configObjects:A,exitProcess:{set value(y){Ln(r,qx,y,"f")}}.value,groups:{set value(y){Ln(n,uO,y,"f")}}.value,output:{set value(y){Ln(o,ng,y,"f")}}.value,exitError:{set value(y){Ln(s,zQ,y,"f")}}.value,hasOutput:{set value(y){Ln(c,NS,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Ln(l,fK,y,"f")}}.value,strictCommands:{set value(y){Ln(u,pK,y,"f")}}.value,strictOptions:{set value(y){Ln(d,hK,y,"f")}}.value,completionCommand:{set value(y){Ln(f,DS,y,"f")}}.value,parseFn:{set value(y){Ln(h,MS,y,"f")}}.value,parseContext:{set value(y){Ln(m,uK,y,"f")}}.value}=g,ke(this,ni,"f").configObjects=A,ke(this,go,"f").unfreeze(),ke(this,Jf,"f").unfreeze(),ke(this,$p,"f").unfreeze(),ke(this,jx,"f").unfreeze()}[byn](e,r){return sK(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[Syn].bind(this),getContext:this[Tyn].bind(this),getHasOutput:this[Iyn].bind(this),getLoggerInstance:this[xyn].bind(this),getParseContext:this[wyn].bind(this),getParserConfiguration:this[mK].bind(this),getUsageConfiguration:this[_yn].bind(this),getUsageInstance:this[Ryn].bind(this),getValidationInstance:this[Pyn].bind(this),hasParseCallback:this[QYe].bind(this),isGlobalContext:this[kyn].bind(this),postProcess:this[gK].bind(this),reset:this[MQt].bind(this),runValidation:this[OQt].bind(this),runYargsParserAndExecuteCommands:this[JIe].bind(this),setHasOutput:this[Nyn].bind(this)}}[Syn](){return ke(this,$p,"f")}[Tyn](){return ke(this,KIe,"f")}[Iyn](){return ke(this,NS,"f")}[xyn](){return ke(this,lK,"f")}[wyn](){return ke(this,uK,"f")||{}}[Ryn](){return ke(this,go,"f")}[Pyn](){return ke(this,Jf,"f")}[QYe](){return!!ke(this,MS,"f")}[kyn](){return ke(this,OYe,"f")}[gK](e,r,n,o){return n||Ju(e)||(r||(e=this[myn](e)),(this[mK]()["parse-positional-numbers"]||this[mK]()["parse-positional-numbers"]===void 0)&&(e=this[Cyn](e)),o&&(e=oK(e,this,ke(this,jx,"f").getMiddleware(),!1))),e}[MQt](e={}){Ln(this,ni,ke(this,ni,"f")||{},"f");let r={};r.local=ke(this,ni,"f").local||[],r.configObjects=ke(this,ni,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(e[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(ke(this,dK,"f"),Object.keys(ke(this,uO,"f")).reduce((c,l)=>{let u=ke(this,uO,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),Ln(this,uO,{},"f");let o=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return o.forEach(c=>{r[c]=(ke(this,ni,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=VQ(ke(this,ni,"f")[c],l=>!n[l])}),r.envPrefix=ke(this,ni,"f").envPrefix,Ln(this,ni,r,"f"),Ln(this,go,ke(this,go,"f")?ke(this,go,"f").reset(n):ayn(this,ke(this,Yi,"f")),"f"),Ln(this,Jf,ke(this,Jf,"f")?ke(this,Jf,"f").reset(n):pyn(this,ke(this,go,"f"),ke(this,Yi,"f")),"f"),Ln(this,$p,ke(this,$p,"f")?ke(this,$p,"f").reset():iyn(ke(this,go,"f"),ke(this,Jf,"f"),ke(this,jx,"f"),ke(this,Yi,"f")),"f"),ke(this,MC,"f")||Ln(this,MC,uyn(this,ke(this,go,"f"),ke(this,$p,"f"),ke(this,Yi,"f")),"f"),ke(this,jx,"f").reset(),Ln(this,DS,null,"f"),Ln(this,ng,"","f"),Ln(this,zQ,null,"f"),Ln(this,NS,!1,"f"),this.parsed=!1,this}[Dyn](e,r){return ke(this,Yi,"f").path.relative(e,r)}[JIe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||ke(this,YQ,"f"),ke(this,ni,"f").__=ke(this,Yi,"f").y18n.__,ke(this,ni,"f").configuration=this[mK]();let h=!!ke(this,ni,"f").configuration["populate--"],m=Object.assign({},ke(this,ni,"f").configuration,{"populate--":!0}),g=ke(this,Yi,"f").Parser.detailed(e,Object.assign({},ke(this,ni,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,ke(this,uK,"f")),y,E=g.aliases,_=!1,v=!1;Object.keys(A).forEach(b=>{b===ke(this,Hx,"f")&&A[b]?_=!0:b===ke(this,dO,"f")&&A[b]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&ke(this,go,"f").clearCachedHelpMessage();try{if(this[xQt](),r)return this[gK](A,h,!!n,!1);ke(this,Hx,"f")&&[ke(this,Hx,"f")].concat(E[ke(this,Hx,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),_=!0),Ln(this,OYe,!1,"f");let b=ke(this,$p,"f").getCommands(),T=!((c=ke(this,MC,"f"))===null||c===void 0)&&c.completionKey?[(l=ke(this,MC,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=ke(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!==ke(this,DS,"f")){let D=ke(this,$p,"f").runCommand(P,this,g,x+1,s,_||v||s);return this[gK](D,h,!!n,!1)}else if(!R&&P!==ke(this,DS,"f")){R=P;break}!ke(this,$p,"f").hasDefaultCommand()&&ke(this,FYe,"f")&&R&&!w&&ke(this,Jf,"f").recommendCommands(R,b)}ke(this,DS,"f")&&A._.includes(ke(this,DS,"f"))&&!T&&(ke(this,qx,"f")&&WQ(!0),this.showCompletionScript(),this.exit(0))}if(ke(this,$p,"f").hasDefaultCommand()&&!w){let R=ke(this,$p,"f").runCommand(null,this,g,0,s,_||v||s);return this[gK](R,h,!!n,!1)}if(T){ke(this,qx,"f")&&WQ(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${ke(this,MC,"f").completionKey}`)+1);return ke(this,MC,"f").getCompletion(R,(x,P)=>{if(x)throw new Gp(x.message);(P||[]).forEach(D=>{ke(this,lK,"f").log(D)}),this.exit(0)}),this[gK](A,!h,!!n,!1)}if(ke(this,NS,"f")||(_?(ke(this,qx,"f")&&WQ(!0),f=!0,this.showHelp(R=>{ke(this,lK,"f").log(R),this.exit(0)})):v&&(ke(this,qx,"f")&&WQ(!0),f=!0,ke(this,go,"f").showVersion("log"),this.exit(0))),!f&&ke(this,ni,"f").skipValidation.length>0&&(f=Object.keys(A).some(R=>ke(this,ni,"f").skipValidation.indexOf(R)>=0&&A[R]===!0)),!f){if(g.error)throw new Gp(g.error.message);if(!T){let R=this[OQt](E,{},g.error);n||(y=oK(A,this,ke(this,jx,"f").getMiddleware(),!0)),y=this[byn](R,y??A),Ju(y)&&!n&&(y=y.then(()=>oK(A,this,ke(this,jx,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Gp)ke(this,go,"f").fail(b.message,b);else throw b}return this[gK](y??A,h,!!n,!0)}[OQt](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Gp(n.message);ke(this,Jf,"f").nonOptionCount(c),ke(this,Jf,"f").requiredArguments(c,s);let l=!1;ke(this,pK,"f")&&(l=ke(this,Jf,"f").unknownCommands(c)),ke(this,fK,"f")&&!l?ke(this,Jf,"f").unknownArguments(c,e,r,!!o):ke(this,hK,"f")&&ke(this,Jf,"f").unknownArguments(c,e,{},!1,!1),ke(this,Jf,"f").limitedChoices(c),ke(this,Jf,"f").implications(c),ke(this,Jf,"f").conflicting(c)}}[Nyn](){Ln(this,NS,!0,"f")}[AK](e){if(typeof e=="string")ke(this,ni,"f").key[e]=!0;else for(let r of e)ke(this,ni,"f").key[r]=!0}};function oyn(t){return!!t&&typeof t.getInternalMethods=="function"}a(oyn,"isYargsInstance");var ujo=Myn(XAn),Oyn=ujo;p();p();var Fyn=require("node:child_process"),Uyn=require("node:util");var djo=(0,Uyn.promisify)(Fyn.execFile),JQ="1.0.60",Byn="COPILOT_CLI_PATH",fjo="GITHUB_COPILOT_ACP_USE_CLI",jle="@github/copilot",pjo=3e4,hjo=1e4,Lyn=6e4,Hle=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function Qyn(){return process.env[fjo]!=="0"}a(Qyn,"isCLIIntegrationEnabled");var LQt=process.platform==="win32";async function qyn(){if(process.env[Byn]){let l=process.env[Byn],u=await ZIe(l,["--version"]);if(u)return gjo(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new Hle("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await ZIe("copilot",["--version"]);if(t&&XIe(t,JQ))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await ZIe(e,["--offline",jle,"--version"],!1,hjo);if(r&&XIe(r,JQ))return{path:e,args:[jle],version:r,source:"npx"};let n=`${jle}@${JQ}`,o=await ZIe(e,[n,"--version"],!1,Lyn);if(o&&XIe(o,JQ))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${jle}@latest`,c=await ZIe(e,[s,"--version"],!0,Lyn);if(c){if(XIe(c,JQ))return{path:e,args:[s],version:c,source:"npx-latest"};throw new Hle(`Latest published Copilot CLI version ${c} is below the minimum required ${JQ}.`)}throw new Hle(`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 ${jle}`)}a(qyn,"discoverCLI");function mjo(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(mjo,"parseVersion");async function ZIe(t,e,r=!1,n=pjo){try{let{stdout:o}=await djo(t,e,{timeout:n,shell:LQt});return mjo(o)}catch(o){if(r)throw o;return null}}a(ZIe,"tryGetVersion");function gjo(t,e){if(!XIe(t,JQ))throw new Hle(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${JQ}. Update with: npm install -g ${jle}@latest`)}a(gjo,"validateVersion");function XIe(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!==""}},yK=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=Gt();this._timestamp=Date.now();this.uriSchemeCache=new qYe;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 Gx=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 exe=(n=>(n.Local="LOCAL",n.Background="BACKGROUND",n.Claude="CLAUDE",n))(exe||{}),Ajo=Object.values(exe);function k3(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"]:Ajo.filter(r=>e.has(r))}a(k3,"unionProviders");function fO(t,e){return t?["BACKGROUND"]:e?.length?[...e]:["LOCAL","BACKGROUND"]}a(fO,"providersForListRow");p();p();p();var EK=de(require("child_process")),UQt=de(require("path")),iEn=de(nEn());function oEn(t){return t.replace(/^git version /,"")}a(oEn,"parseVersion");function QQt(t){return new Promise((e,r)=>{let n=[],o=EK.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:oEn(Buffer.concat(n).toString("utf8").trim())}))})}a(QQt,"findSpecificGit");function Pjo(){return new Promise((t,e)=>{EK.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){EK.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:oEn(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);EK.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(Pjo,"findGitDarwin");function jYe(t){return t?QQt(UQt.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(jYe,"findSystemGitWin32");async function kjo(){let t=await(0,iEn.default)("git.exe");return QQt(t)}a(kjo,"findGitWin32InPath");function Djo(){return jYe(process.env.ProgramW6432).then(void 0,()=>jYe(process.env["ProgramFiles(x86)"])).then(void 0,()=>jYe(process.env.ProgramFiles)).then(void 0,()=>jYe(UQt.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>kjo())}a(Djo,"findGitWin32");async function pO(){try{switch(process.platform){case"darwin":return await Pjo();case"win32":return await Djo();default:return await QQt("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(pO,"findGit");var sEn=require("node:child_process"),aEn=require("node:util");var Njo=(0,aEn.promisify)(sEn.execFile);async function cEn(t){return qQt(t,["github.com"])}a(cEn,"resolveGitHubNwo");async function qQt(t,e){let r;try{r=(await pO()).path}catch{return}let n;try{n=(await Njo(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return Mjo(n,e)}a(qQt,"resolveGitHubNwoForHosts");function Mjo(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(Mjo,"parseGitRemoteUrl");async function lEn(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(lEn,"resolveRepoIds");p();var Ojo=3e4,HYe=class{constructor(e,r=Ojo){this.ctx=e;this.timeoutMs=r;this.logger=new pe("OrgCustomAgentClient")}static{a(this,"OrgCustomAgentClient")}async listCustomAgents(e,r){let n=this.ctx,o=await this.tryGetAccessToken();if(!o)return;let s=dL(n).api,c=`${uEn(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",...Zm(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=dL(s).api,u=new URL(`${uEn(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",...Zm(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 uEn(t){return t.endsWith("/")?t.slice(0,-1):t}a(uEn,"trimTrailingSlash");p();p();var Bjo=Object.create,dEn=Object.defineProperty,Ljo=Object.getOwnPropertyDescriptor,Fjo=Object.getOwnPropertyNames,Ujo=Object.getPrototypeOf,Qjo=Object.prototype.hasOwnProperty,Zu=a((t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),"__commonJSMin"),qjo=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(var o=Fjo(e),s=0,c=o.length,l;se[u]).bind(null,l),enumerable:!(n=Ljo(e,l))||n.enumerable});return t},"__copyProps"),jjo=a((t,e,r)=>(r=t!=null?Bjo(Ujo(t)):{},qjo(e||!t||!t.__esModule?dEn(r,"default",{value:t,enumerable:!0}):r,t)),"__toESM"),txe=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})),Hjo=Zu(((t,e)=>{var r=txe();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=>{!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+` `+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})),D_=Zu(((t,e)=>{var r=rxe(),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})),fEn=Zu(((t,e)=>{var r=rxe(),n=D_();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(D_())("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(r){return r!==null?r:""},"construct")})})),hEn=Zu(((t,e)=>{e.exports=new(D_())("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(r){return r!==null?r:[]},"construct")})})),mEn=Zu(((t,e)=>{e.exports=new(D_())("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(r){return r!==null?r:{}},"construct")})})),gEn=Zu(((t,e)=>{e.exports=new(fEn())({explicit:[pEn(),hEn(),mEn()]})})),AEn=Zu(((t,e)=>{var r=D_();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"})})),yEn=Zu(((t,e)=>{var r=D_();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"})})),EEn=Zu(((t,e)=>{var r=txe(),n=D_();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"]}})})),_En=Zu(((t,e)=>{var r=txe(),n=D_(),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"})})),vEn=Zu(((t,e)=>{e.exports=gEn().extend({implicit:[AEn(),yEn(),EEn(),_En()]})})),CEn=Zu(((t,e)=>{e.exports=vEn()})),bEn=Zu(((t,e)=>{var r=D_(),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})})),SEn=Zu(((t,e)=>{var r=D_();function n(o){return o==="<<"||o===null}a(n,"resolveYamlMerge"),e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})})),TEn=Zu(((t,e)=>{var r=D_(),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})})),IEn=Zu(((t,e)=>{var r=D_(),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=D_(),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=D_(),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})})),jQt=Zu(((t,e)=>{e.exports=CEn().extend({implicit:[bEn(),SEn()],explicit:[TEn(),IEn(),xEn(),wEn()]})})),Gjo=Zu(((t,e)=>{var r=txe(),n=rxe(),o=Hjo(),s=jQt(),c=Object.prototype.hasOwnProperty,l=1,u=2,d=3,f=4,h=1,m=2,g=3,A=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/[\x85\u2028\u2029]/,E=/[,\[\]{}]/,_=/^(?:!|!!|![0-9A-Za-z-]+!)$/,v=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function b(F){return Object.prototype.toString.call(F)}a(b,"_class");function T(F){return F===10||F===13}a(T,"isEol");function w(F){return F===9||F===32}a(w,"isWhiteSpace");function R(F){return F===9||F===32||F===10||F===13}a(R,"isWsOrEol");function x(F){return F===44||F===91||F===93||F===123||F===125}a(x,"isFlowIndicator");function P(F){if(F>=48&&F<=57)return F-48;let be=F|32;return be>=97&&be<=102?be-97+10:-1}a(P,"fromHexCode");function D(F){return F===120?2:F===117?4:F===85?8:0}a(D,"escapedHexLen");function N(F){return F>=48&&F<=57?F-48:-1}a(N,"fromDecimalCode");function B(F){switch(F){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return` -`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}a(B,"simpleEscapeSequence");function L(F){return F<=65535?String.fromCharCode(F):String.fromCharCode((F-65536>>10)+55296,(F-65536&1023)+56320)}a(L,"charFromCodepoint");function j(F,be,Qe){be==="__proto__"?Object.defineProperty(F,be,{configurable:!0,enumerable:!0,writable:!0,value:Qe}):F[be]=Qe}a(j,"setProperty");var M=new Array(256),O=new Array(256);for(let F=0;F<256;F++)M[F]=B(F)?1:0,O[F]=B(F);function q(F,be){this.input=F,this.filename=be.filename||null,this.schema=be.schema||s,this.onWarning=be.onWarning||null,this.legacy=be.legacy||!1,this.json=be.json||!1,this.listener=be.listener||null,this.maxDepth=typeof be.maxDepth=="number"?be.maxDepth:100,this.maxMergeSeqLength=typeof be.maxMergeSeqLength=="number"?be.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=F.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}a(q,"State");function Q(F,be){let 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 z(F,be){F.onWarning&&F.onWarning.call(null,Q(F,be))}a(z,"throwWarning");function $(F,be,Qe){let fe=F.anchorMapTransactions;if(fe.length!==0){let Se=fe[fe.length-1];c.call(Se,be)||(Se[be]={existed:c.call(F.anchorMap,be),value:F.anchorMap[be]})}F.anchorMap[be]=Qe}a($,"storeAnchor");function W(F){F.anchorMapTransactions.push(Object.create(null))}a(W,"beginAnchorTransaction");function J(F){let be=F.anchorMapTransactions.pop(),Qe=F.anchorMapTransactions;if(Qe.length===0)return;let fe=Qe[Qe.length-1],Se=Object.keys(be);for(let Fe=0,te=Se.length;Fe=0;fe-=1){let Se=be[Qe[fe]];Se.existed?F.anchorMap[Qe[fe]]=Se.value:delete F.anchorMap[Qe[fe]]}}a(ne,"rollbackAnchorTransaction");function H(F){return{position:F.position,line:F.line,lineStart:F.lineStart,lineIndent:F.lineIndent,firstTabInLine:F.firstTabInLine,tag:F.tag,anchor:F.anchor,kind:F.kind,result:F.result}}a(H,"snapshotState");function re(F,be){F.position=be.position,F.line=be.line,F.lineStart=be.lineStart,F.lineIndent=be.lineIndent,F.firstTabInLine=be.firstTabInLine,F.tag=be.tag,F.anchor=be.anchor,F.kind=be.kind,F.result=be.result}a(re,"restoreState");var ae={YAML:a(function(be,Qe,fe){be.version!==null&&U(be,"duplication of %YAML directive"),fe.length!==1&&U(be,"YAML directive accepts exactly one argument");let Se=/^([0-9]+)\.([0-9]+)$/.exec(fe[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=fe[0],be.checkLineBreaks=te<2,te!==1&&te!==2&&z(be,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(be,Qe,fe){let Se;fe.length!==2&&U(be,"TAG directive accepts exactly two arguments");let Fe=fe[0];Se=fe[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 Be(F,be,Qe,fe){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(Be,"captureSegment");function ve(F,be,Qe,fe){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 Y=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 fe,Se,Fe,te,Te,Ge,Y=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="",fe=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,Z(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&&(Be(F,fe,Se,!1),K(F,F.line-te),fe=Se=F.position,Fe=!1),w(me)||(Se=F.position+1),me=F.input.charCodeAt(++F.position)}return Be(F,fe,Se,!1),F.result?!0:(F.kind=Y,F.result=se,!1)}a(he,"readPlainScalar");function X(F,be){let Qe,fe,Se=F.input.charCodeAt(F.position);if(Se!==39)return!1;for(F.kind="scalar",F.result="",F.position++,Qe=fe=F.position;(Se=F.input.charCodeAt(F.position))!==0;)if(Se===39)if(Be(F,Qe,F.position,!0),Se=F.input.charCodeAt(++F.position),Se===39)Qe=F.position,F.position++,fe=F.position;else return!0;else T(Se)?(Be(F,Qe,fe,!0),K(F,Z(F,!1,be)),Qe=fe=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a single quoted scalar"):(F.position++,w(Se)||(fe=F.position));U(F,"unexpected end of the stream within a single quoted scalar")}a(X,"readSingleQuotedScalar");function ue(F,be){let Qe,fe,Se,Fe=F.input.charCodeAt(F.position);if(Fe!==34)return!1;for(F.kind="scalar",F.result="",F.position++,Qe=fe=F.position;(Fe=F.input.charCodeAt(F.position))!==0;){if(Fe===34)return Be(F,Qe,F.position,!0),F.position++,!0;if(Fe===92){if(Be(F,Qe,F.position,!0),Fe=F.input.charCodeAt(++F.position),T(Fe))Z(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+=L(Te),F.position++}else U(F,"unknown escape sequence");Qe=fe=F.position}else T(Fe)?(Be(F,Qe,fe,!0),K(F,Z(F,!1,be)),Qe=fe=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a double quoted scalar"):(F.position++,w(Fe)||(fe=F.position))}U(F,"unexpected end of the stream within a double quoted scalar")}a(ue,"readDoubleQuotedScalar");function je(F,be){let Qe=!0,fe,Se,Fe,te=F.tag,Te,Ge=F.anchor,Y,se,me,Ce,He=Object.create(null),$e,et,ct,bt=F.input.charCodeAt(F.position);if(bt===91)Y=93,Ce=!1,Te=[];else if(bt===123)Y=125,Ce=!0,Te={};else return!1;for(F.anchor!==null&&$(F,F.anchor,Te),bt=F.input.charCodeAt(++F.position);bt!==0;){if(Z(F,!0,be),bt=F.input.charCodeAt(F.position),bt===Y)return F.position++,F.tag=te,F.anchor=Ge,F.kind=Ce?"mapping":"sequence",F.result=Te,!0;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++,Z(F,!0,be)),fe=F.line,Se=F.lineStart,Fe=F.position,_t(F,be,l,!1,!0),et=F.tag,$e=F.result,Z(F,!0,be),bt=F.input.charCodeAt(F.position),(me||F.line===fe)&&bt===58&&(se=!0,bt=F.input.charCodeAt(++F.position),Z(F,!0,be),_t(F,be,l,!1,!0),ct=F.result),Ce?Ue(F,Te,He,et,$e,ct,fe,Se,Fe):se?Te.push(Ue(F,null,He,et,$e,ct,fe,Se,Fe)):Te.push($e),Z(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(je,"readFlowCollection");function ie(F,be){let Qe,fe=h,Se=!1,Fe=!1,te=be,Te=0,Ge=!1,Y,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===fe?fe=se===43?g:m:U(F,"repeat of a chomping mode identifier");else if((Y=N(se))>=0)Y===0?U(F,"bad explicit indentation width of a block scalar; it cannot be less than one"):Fe?U(F,"repeat of an indentation width identifier"):(te=be+Y-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(Pe(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{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` +`;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.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,fe)&&($e?Ce=F.result:He=F.result),$e||(Ue(F,Y,se,me,Ce,He,Se,Fe,te),me=Ce=He=null),Z(F,!0,-1),ct=F.input.charCodeAt(F.position)),(F.line===ht||F.lineIndent>be)&&ct!==0)U(F,"bad indentation of a mapping entry");else if(F.lineIndent=F.maxDepth&&U(F,"nesting exceeded maxDepth ("+F.maxDepth+")"),F.depth+=1,F.listener!==null&&F.listener("open",F),F.tag=null,F.anchor=null,F.kind=null,F.result=null;let $e=Fe=te=f===Qe||d===Qe;if(fe&&Z(F,!0,-1)&&(Ge=!0,F.lineIndent>be?Te=1:F.lineIndent===be?Te=0:F.lineIndentbe?Te=1:F.lineIndent===be?Te=0:F.lineIndent tag; it should be "scalar", not "'+F.kind+'"');for(let 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&&$(F,F.anchor,F.result)):U(F,"cannot resolve a node with !<"+F.tag+"> explicit tag")}return F.listener!==null&&F.listener("close",F),F.depth-=1,F.tag!==null||F.anchor!==null||Y}a(_t,"composeNode");function kt(F){let be=F.position,Qe=!1,fe;for(F.version=null,F.checkLineBreaks=F.legacy,F.tagMap=Object.create(null),F.anchorMap=Object.create(null);(fe=F.input.charCodeAt(F.position))!==0&&(Z(F,!0,-1),fe=F.input.charCodeAt(F.position),!(F.lineIndent>0||fe!==37));){Qe=!0,fe=F.input.charCodeAt(++F.position);let Se=F.position;for(;fe!==0&&!R(fe);)fe=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");fe!==0;){for(;w(fe);)fe=F.input.charCodeAt(++F.position);if(fe===35){do fe=F.input.charCodeAt(++F.position);while(fe!==0&&!T(fe));break}if(T(fe))break;for(Se=F.position;fe!==0&&!R(fe);)fe=F.input.charCodeAt(++F.position);te.push(F.input.slice(Se,F.position))}fe!==0&&Pe(F),c.call(ae,Fe)?ae[Fe](F,Fe,te):z(F,'unknown document directive "'+Fe+'"')}if(Z(F,!0,-1),F.lineIndent===0&&F.input.charCodeAt(F.position)===45&&F.input.charCodeAt(F.position+1)===45&&F.input.charCodeAt(F.position+2)===45?(F.position+=3,Z(F,!0,-1)):Qe&&U(F,"directives end mark is expected"),_t(F,F.lineIndent-1,f,!1,!0),Z(F,!0,-1),F.checkLineBreaks&&y.test(F.input.slice(be,F.position))&&z(F,"non-ASCII line breaks are interpreted as content"),F.documents.push(F.result),F.position===F.lineStart&&ee(F)){F.input.charCodeAt(F.position)===46&&(F.position+=3,Z(F,!0,-1));return}F.position"u"&&(Qe=be,be=null);let fe=$t(F,Qe);if(typeof be!="function")return fe;for(let Se=0,Fe=fe.length;Se{var r=txe(),n=rxe(),o=jQt(),s=Object.prototype.toString,c=Object.prototype.hasOwnProperty,l=65279,u=9,d=10,f=13,h=32,m=33,g=34,A=35,y=37,E=38,_=39,v=42,b=44,T=45,w=58,R=61,x=62,P=63,D=64,N=91,B=93,L=96,j=123,M=124,O=125,q={};q[0]="\\0",q[7]="\\a",q[8]="\\b",q[9]="\\t",q[10]="\\n",q[11]="\\v",q[12]="\\f",q[13]="\\r",q[27]="\\e",q[34]='\\"',q[92]="\\\\",q[133]="\\N",q[160]="\\_",q[8232]="\\L",q[8233]="\\P";var Q=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],U=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function z(te,Te){if(Te===null)return{};let Ge={},Y=Object.keys(Te);for(let se=0,me=Y.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),_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;se=32&&te<=126||te>=161&&te<=55295&&te!==8232&&te!==8233||te>=57344&&te<=65533&&te!==l||te>=65536&&te<=1114111}a(ve,"isPrintable");function Ue(te){return ve(te)&&te!==l&&te!==f&&te!==d}a(Ue,"isNsCharOrWhitespace");function Pe(te,Te,Ge){let Y=Ue(te),se=Y&&!Be(te);return(Ge?Y:Y&&te!==b&&te!==N&&te!==B&&te!==j&&te!==O)&&te!==A&&!(Te===w&&!se)||Ue(Te)&&!Be(Te)&&te===A||Te===w&&se}a(Pe,"isPlainSafe");function Z(te){return ve(te)&&te!==l&&!Be(te)&&te!==T&&te!==P&&te!==w&&te!==b&&te!==N&&te!==B&&te!==j&&te!==O&&te!==A&&te!==E&&te!==v&&te!==m&&te!==M&&te!==R&&te!==x&&te!==_&&te!==g&&te!==y&&te!==D&&te!==L}a(Z,"isPlainSafeFirst");function ee(te){return!Be(te)&&te!==w}a(ee,"isPlainSafeLast");function K(te,Te){let Ge=te.charCodeAt(Te),Y;return Ge>=55296&&Ge<=56319&&Te+1=56320&&Y<=57343)?(Ge-55296)*1024+Y-56320+65536:Ge}a(K,"codePointAt");function he(te){return/^\n* /.test(te)}a(he,"needIndentIndicator");var X=1,ue=2,je=3,ie=4,le=5;function Ne(te,Te,Ge,Y,se,me,Ce,He){let $e,et=0,ct=null,bt=!1,ht=!1,We=Y!==-1,ce=-1,Re=Z(K(te,0))&&ee(K(te,te.length-1));if(Te||Ce)for($e=0;$e=65536?$e+=2:$e++){if(et=K(te,$e),!ve(et))return le;Re=Re&&Pe(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-ce-1>Y&&te[ce+1]!==" ",ce=$e);else if(!ve(et))return le;Re=Re&&Pe(et,ct,He),ct=et}ht=ht||We&&$e-ce-1>Y&&te[ce+1]!==" "}return!bt&&!ht?Re&&!Ce&&!se(te)?X:me===J?le:ue:Ge>9&&he(te)?le:Ce?me===J?le:ue:ht?ie:je}a(Ne,"chooseScalarStyle");function we(te,Te,Ge,Y,se){te.dump=(function(){if(Te.length===0)return te.quotingType===J?'""':"''";if(!te.noCompatMode&&(Q.indexOf(Te)!==-1||U.test(Te)))return te.quotingType===J?'"'+Te+'"':"'"+Te+"'";let me=te.indent*Math.max(1,Ge),Ce=te.lineWidth===-1?-1:Math.max(Math.min(te.lineWidth,40),te.lineWidth-me),He=Y||te.flowLevel>-1&&Ge>=te.flowLevel;function $e(et){return ae(te,et)}switch(a($e,"testAmbiguity"),Ne(Te,He,te.indent,Ce,$e,te.quotingType,te.forceQuotes&&!Y,se)){case X:return Te;case ue:return"'"+Te.replace(/'/g,"''")+"'";case je:return"|"+Le(Te,te.indent)+rt(H(Te,me));case ie:return">"+Le(Te,te.indent)+rt(H(st(Te,Ce),me));case le:return'"'+kt(Te,Ce)+'"';default:throw new n("impossible error: invalid scalar style")}})()}a(we,"writeScalar");function Le(te,Te){let Ge=he(te)?String(Te):"",Y=te[te.length-1]===` -`;return Ge+(Y&&(te[te.length-2]===` +`+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 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]===` +`;return Ge+(J&&(te[te.length-2]===` `||te===` -`)?"+":Y?"":"-")+` -`}a(Le,"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,Y=(function(){let He=te.indexOf(` +`)?"+":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]===` -`||te[0]===" ",me,Ce;for(;Ce=Ge.exec(te);){let He=Ce[1],$e=Ce[2];me=$e[0]===" ",Y+=He+(!se&&!me&&$e!==""?` -`:"")+_t($e,Te),se=me}return Y}a(st,"foldString");function _t(te,Te){if(te===""||te[0]===" ")return te;let Ge=/ [^ ]/g,Y,se=0,me,Ce=0,He=0,$e="";for(;Y=Ge.exec(te);)He=Y.index,He-se>Te&&(me=Ce>se?Ce:He,$e+=` +`||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+=` `+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 kt(te){let Te="",Ge=0;for(let Y=0;Y=65536?Y+=2:Y++){Ge=K(te,Y);let se=q[Ge];!se&&ve(Ge)?(Te+=te[Y],Ge>=65536&&(Te+=te[Y+1])):Te+=se||$(Ge)}return Te}a(kt,"escapeString");function $t(te,Te,Ge){let Y="",se=te.tag;for(let me=0,Ce=Ge.length;me"u"&&Qe(te,Te,null,!1,!1))&&(Y!==""&&(Y+=","+(te.condenseFlow?"":" ")),Y+=te.dump)}te.tag=se,te.dump="["+Y+"]"}a($t,"writeFlowSequence");function Ht(te,Te,Ge,Y){let se="",me=te.tag;for(let Ce=0,He=Ge.length;Ce"u"&&Qe(te,Te+1,null,!0,!0,!1,!0))&&((!Y||se!=="")&&(se+=re(te,Te)),te.dump&&d===te.dump.charCodeAt(0)?se+="-":se+="- ",se+=te.dump)}te.tag=me,te.dump=se||"[]"}a(Ht,"writeBlockSequence");function Ie(te,Te,Ge){let Y="",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,Y+=$e))}te.tag=se,te.dump="{"+Y+"}"}a(Ie,"writeFlowMapping");function F(te,Te,Ge,Y){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="";(!Y||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 Y=Ge?te.explicitTypes:te.implicitTypes;for(let se=0,me=Y.length;se tag resolver accepts not "'+He+'" style');te.dump=$e}return!0}}return!1}a(be,"detectType");function Qe(te,Te,Ge,Y,se,me,Ce){te.tag=null,te.dump=Ge,be(te,Ge,!1)||be(te,Ge,!0);let He=s.call(te.dump),$e=Y;Y&&(Y=te.flowLevel<0||te.flowLevel>Te);let 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]")Y&&Object.keys(te.dump).length!==0?(F(te,Te,te.dump,se),bt&&(te.dump="&ref_"+ct+te.dump)):(Ie(te,Te,te.dump),bt&&(te.dump="&ref_"+ct+" "+te.dump));else if(He==="[object Array]")Y&&te.dump.length!==0?(te.noArrayIndent&&!Ce&&Te>0?Ht(te,Te-1,te.dump,se):Ht(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 fe(te,Te){let Ge=[],Y=[];Se(te,Ge,Y);let se=Y.length;for(let me=0;me{var r=Gjo(),n=$jo();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=D_(),e.exports.Schema=fEn(),e.exports.FAILSAFE_SCHEMA=gEn(),e.exports.JSON_SCHEMA=vEn(),e.exports.CORE_SCHEMA=CEn(),e.exports.DEFAULT_SCHEMA=jQt(),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.dump=n.dump,e.exports.YAMLException=rxe(),e.exports.types={binary:TEn(),float:_En(),map:mEn(),null:AEn(),pairs:xEn(),set:wEn(),timestamp:bEn(),bool:yEn(),int:EEn(),merge:SEn(),omap:IEn(),seq:hEn(),str:pEn()},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")}))(),1),{Type:oUu,Schema:sUu,FAILSAFE_SCHEMA:aUu,JSON_SCHEMA:cUu,CORE_SCHEMA:lUu,DEFAULT_SCHEMA:uUu,load:dUu,loadAll:fUu,dump:_K,YAMLException:pUu,types:hUu,safeLoad:mUu,safeLoadAll:gUu,safeDump:AUu}=REn.default,yUu=REn.default;function kEn(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=_K(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(_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`--- ${n} --- ${o} -`}a(kEn,"generateAgentMarkdown");p();p();p();p();p();p();var nxe={isBlocked:!1,reason:"VALID_FILE"},GYe={isBlocked:!1,reason:"NO_MATCHING_POLICY"},DEn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},vK={all:"all",repo:"repo"},XQ=new pe("contentExclusion");p();p();var $Ye=class{static{a(this,"PolicyEvaluator")}};p();p();p();var HQt=new pe("repository"),CK=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(".")}},Fk=class{static{a(this,"GitConfigLoader")}},VYe=class extends Fk{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 NEn=require("os");var WYe=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 CU.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=CU.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,NEn.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 zYe=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(Fk).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 WYe(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 Vjo=100,GQt=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])}}},r0=class t{constructor(e){this.ctx=e;this.remoteResolver=new zYe;this.cache=new En(Vjo)}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=sf(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 GQt(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($o),o=Ia(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=Ia(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=MW(r,s[1]),l=Ia(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=Ia(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=Ia(c,"commondir");c=MW(c,(await e.readFileString(d)).trimEnd());let f=Ia(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var bK=a((t,e)=>{if(VM.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...VM.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");p();p();p();var YYe=new WeakMap;function KYe(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]"&&YYe.has(t))return YYe.get(t);switch(YYe.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(Wjo,"n");function BEn(t,e){return function(r,n){return Wjo(t,e,r,n)}}a(BEn,"o");p();p();p();var VQt=a((t,e,r)=>{let n=t instanceof RegExp?LEn(t,r):t,o=e instanceof RegExp?LEn(e,r):e,s=n!==null&&o!=null&&zjo(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"),LEn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),zjo=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 FEn="\0SLASH"+Math.random()+"\0",UEn="\0OPEN"+Math.random()+"\0",zQt="\0CLOSE"+Math.random()+"\0",QEn="\0COMMA"+Math.random()+"\0",qEn="\0PERIOD"+Math.random()+"\0",Yjo=new RegExp(FEn,"g"),Kjo=new RegExp(UEn,"g"),Jjo=new RegExp(zQt,"g"),Zjo=new RegExp(QEn,"g"),Xjo=new RegExp(qEn,"g"),eHo=/\\\\/g,tHo=/\\{/g,rHo=/\\}/g,nHo=/\\,/g,iHo=/\\\./g,oHo=1e5;function WQt(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a(WQt,"numeric");function sHo(t){return t.replace(eHo,FEn).replace(tHo,UEn).replace(rHo,zQt).replace(nHo,QEn).replace(iHo,qEn)}a(sHo,"escapeBraces");function aHo(t){return t.replace(Yjo,"\\").replace(Kjo,"{").replace(Jjo,"}").replace(Zjo,",").replace(Xjo,".")}a(aHo,"unescapeBraces");function jEn(t){if(!t)return[""];let e=[],r=VQt("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=jEn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(jEn,"parseCommaParts");function HEn(t,e={}){if(!t)return[];let{max:r=oHo}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),ixe(sHo(t),r,!0).map(aHo)}a(HEn,"expand");function cHo(t){return"{"+t+"}"}a(cHo,"embrace");function lHo(t){return/^-?0\d/.test(t)}a(lHo,"isPadded");function uHo(t,e){return t<=e}a(uHo,"lte");function dHo(t,e){return t>=e}a(dHo,"gte");function ixe(t,e,r){let n=[],o=VQt("{","}",t);if(!o)return[t];let s=o.pre,c=o.post.length?ixe(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+zQt+o.post,ixe(t,e,!0)):[t];let h;if(d)h=o.body.split(/\.\./);else if(h=jEn(o.body),h.length===1&&h[0]!==void 0&&(h=ixe(h[0],e,!1).map(cHo),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=WQt(h[0]),A=WQt(h[1]),y=Math.max(h[0].length,h[1].length),E=h.length===3&&h[2]!==void 0?Math.max(Math.abs(WQt(h[2])),1):1,_=uHo;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 fHo={"[: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]},sxe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),pHo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),GEn=a(t=>t.join(""),"rangesToString"),$En=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(sxe(h)+"-"+sxe(y)):y===h&&n.push(sxe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(sxe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(sxe(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,hHo=new Set(["!","?","+","*","@"]),YQt=a(t=>hHo.has(t),"isExtglobType"),VEn=a(t=>YQt(t.type),"isExtglobAST"),mHo=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),gHo=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),AHo=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),WEn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),yHo="(?!(?:^|/)\\.\\.?(?:$|/))",ZYe="(?!\\.)",EHo=new Set(["[","."]),_Ho=new Set(["..","."]),vHo=new Set("().*{}+?[]^$\\!"),CHo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),KQt="[^/]",zEn=KQt+"*?",YEn=KQt+"+?",bHo=0,SK=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++bHo;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.#P(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||E,this.#r=this.#r||_,A}).join(""),f="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&_Ho.has(this.#n[0]))){let A=EHo,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?yHo:E?ZYe:""}let h="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(h="(?:$|\\/)"),[f+d+h,Uk(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,Uk(this.toString()),!1,!1]}let c=!n||e||r||!ZYe?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?ZYe:"")+YEn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?ZYe:"")+zEn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`;l=o+s+u}return[l,Uk(s),this.#t=!!this.#t,this.#r]}#S(){if(VEn(this)){let e=0,r=!1;do{r=!0;for(let n=0;n{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,o,s,c]=r.toRegExpSource(e);return this.#r=this.#r||c,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#P(e,r,n=!1){let o=!1,s="",c=!1,l=!1;for(let u=0;ur?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Af=a((t,e,r={})=>(oxe(e),!r.nocomment&&e.charAt(0)==="#"?!1:new N_(e,r).match(t)),"minimatch"),SHo=/^\*+([^+@!?*[(]*)$/,THo=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),IHo=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),xHo=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),wHo=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),RHo=/^\*+\.\*+$/,PHo=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),kHo=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),DHo=/^\.\*+$/,NHo=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),MHo=/^\*+$/,OHo=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),BHo=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),LHo=/^\?+([^+@!?*[(]*)?$/,FHo=a(([t,e=""])=>{let r=ZEn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),UHo=a(([t,e=""])=>{let r=XEn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),QHo=a(([t,e=""])=>{let r=XEn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),qHo=a(([t,e=""])=>{let r=ZEn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),ZEn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),XEn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),e_n=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",KEn={win32:{sep:"\\"},posix:{sep:"/"}},jHo=e_n==="win32"?KEn.win32.sep:KEn.posix.sep;Af.sep=jHo;var Vp=Symbol("globstar **");Af.GLOBSTAR=Vp;var HHo="[^/]",GHo=HHo+"*?",$Ho="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",VHo="(?:(?!(?:\\/|^)\\.).)*?",WHo=a((t,e={})=>r=>Af(r,t,e),"filter");Af.filter=WHo;var $x=a((t,e={})=>Object.assign({},t,e),"ext"),zHo=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Af;let e=Af;return Object.assign(a((n,o,s={})=>e(n,o,$x(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,$x(t,s))}static defaults(o){return e.defaults($x(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,$x(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,$x(t,s))}},unescape:a((n,o={})=>e.unescape(n,$x(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,$x(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,$x(t,o)),"filter"),defaults:a(n=>e.defaults($x(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,$x(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,$x(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,$x(t,s)),"match"),sep:e.sep,GLOBSTAR:Vp})},"defaults");Af.defaults=zHo;var t_n=a((t,e={})=>(oxe(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:HEn(t,{max:e.braceExpandMax})),"braceExpand");Af.braceExpand=t_n;var YHo=a((t,e={})=>new N_(t,e).makeRe(),"makeRe");Af.makeRe=YHo;var KHo=a((t,e,r={})=>{let n=new N_(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");Af.match=KHo;var JEn=/[?*]|[+@!]\(.*?\)|\[|\]/,JHo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),N_=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={}){oxe(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||e_n,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]==="?"||!JEn.test(s[2]))&&!JEn.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(Vp)?this.#e(e,r,n,o,s):this.#r(e,r,n,o,s)}#e(e,r,n,o,s){let c=r.indexOf(Vp,s),l=r.lastIndexOf(Vp),[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"?JHo(h):h===Vp?Vp:h._src});d.forEach((h,m)=>{let g=d[m+1],A=d[m-1];h!==Vp||A===Vp||(A===void 0?g!==void 0&&g!==Vp?d[m+1]="(?:\\/|"+n+"\\/)?"+g:d[m]=n:g===void 0?d[m-1]=A+"(?:\\/|\\/"+n+")?":g!==Vp&&(d[m-1]=A+"(?:\\/|\\/"+n+"\\/)"+g,d[m+1]=Vp))});let f=d.filter(h=>h!==Vp);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 Af.defaults(e).Minimatch}};Af.AST=SK;Af.Minimatch=N_;Af.escape=Gle;Af.unescape=Uk;var JQt="contentExclusion",XYe=class extends $Ye{static{a(this,"CopilotContentExclusion")}#e;#t=new En(1e4);#r=new En(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=MW(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??vK.all);if(!o)return GYe;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 XQ.exception(this.#e,n,`${JQt}.evaluate`),DEn}return nxe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=nxe,c,l=nDt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(Af(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=ZQt(u,"FILE_BLOCKED_PATH"),c=d;break e}return XQ.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 nxe;let c=this.evaluateFileContent(o,s,n);return XQ.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=>r_n(c)).some(c=>c.test(n)))return ZQt(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>r_n(c)).some(c=>c.test(n)))return ZQt(o,"FILE_BLOCKED_TEXT_BASED");return nxe}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,`${JQt}.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=BEn(async e=>{let r=await this.#e.get(Ut).getGitHubSession();if(!r)throw new Ai("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(vK.all);e.filter(u=>u!==vK.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==vK.all).join(",")),n.searchParams.set("scope",o?vK.all:vK.repo);let c=await qf(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 eM(c)}return this.#s("fetch.success"),bK(tGo,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(r0).getRepo(sf(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,`${JQt}.${e}`,Wt.createAndMarkAsIssued(r,n))}};function r_n(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(r_n,"stringToRegex");function ZQt(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(ZQt,"fileBlockedEvaluationResult");var ZHo=S.Object({name:S.String(),type:S.String()}),XHo=S.Object({paths:S.Array(S.String()),ifNoneMatch:S.Optional(S.Array(S.String())),ifAnyMatch:S.Optional(S.Array(S.String())),source:ZHo}),XQt=S.Array(XHo),eGo=S.Object({rules:XQt,last_updated_at:S.String(),scope:S.String()}),tGo=S.Array(eGo);var tc=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new XYe(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=U0(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get($r).onDidFocusTextDocument(r),Es(this.ctx,n=>{this.#e=n.envelope.copilotignore_enabled??!1,this.evaluateResultCache.clear(),this.#t.refresh()})}static{a(this,"CopilotContentExclusionManager")}#e;#t;get enabled(){return this.#e}async evaluate(e,r,n){if(!this.#e)return{isBlocked:!1};let o=[],s=a(async(u,d)=>{let f=performance.now(),h=await d.evaluate(e,r),m=performance.now();return o.push({key:u,result:h,elapsedMs:Math.round(m-f)}),h},"track"),l=(await Promise.all([s("contentExclusion.evaluate",this.#t)])).find(u=>u?.isBlocked)??{isBlocked:!1};try{for(let u of o)this.#r(u.key,e,u.result,u.elapsedMs)}catch(u){XQ.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(cs).setClsInactive(r??"Copilot is disabled"):this.ctx.get(cs).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===GYe.reason)return XQ.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),XQ.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 $le(t,e,r){let n=await t.get(tc).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a($le,"isDocumentValid");var $r=class{constructor(e,r=$le){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=Os(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($o).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get($o).readFileString(e)}getWorkspaceFolder(e){let r=Os(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(Os(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=Os(e.uri);for(let n of this.getWorkspaceFolders()){let o=Os(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return Ji(r)}};p();p();var ot=new pe("chat");p();var eKe=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new Hi;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 Vx=class{constructor(e){this.ctx=e;this.watchers=new En(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(U0(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 eq=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},rGo="workspaceLifecycleManager",Xy=new pe(rGo),OS=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=Es(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?Xy.debug(this.ctx,`listener ${e.constructor.name} is already started`):(Xy.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):Xy.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);Xy.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){Xy.debug(r,"No workspaces to add.");return}Xy.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];Xy.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)));Xy.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));Xy.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));Xy.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){Xy.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(Vx).terminateWatching(l);for(let d of this.activeListeners)Xy.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;Xy.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(Vx);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){Xy.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)Xy.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)Xy.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(Vx).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 tKe(t){t.set(OS,new OS(t))}a(tKe,"setupWorkspaceLifecycleListener");var tq=de(require("fs")),Wx=de(require("path"));var eqt=".agent.md",nGo=300*1e3,iGo="github",i_n="agents";function axe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(axe,"sanitizeSegment");function oGo(t){return t.replace(/\\/g,"/")}a(oGo,"toPosix");var D3=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new pe("OrgCustomAgentService");this.fetchSequencer=new Gx;this.activated=!1;this.orgs=new Map;this.client=o.client??new HYe(e),this.resolveNwo=o.resolveNwo??(s=>qQt(s,[e.get(Fm).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??nGo,this.cacheRoot=Wx.join(this.persistenceManager.directory,iGo),this.lifecycleListener=new tqt(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=oGo(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${i_n}/*${eqt}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:o_n.githubOrg}),this.tokenSubscription=Es(this.ctx,()=>{this.refreshAll()}),this.refreshIntervalMs>0&&(this.refreshTimer=setInterval(()=>{this.refreshAll()},this.refreshIntervalMs),this.refreshTimer.unref?.())}async dispose(){this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=void 0),this.tokenSubscription?.dispose(),this.tokenSubscription=void 0,this.registration?.dispose(),this.registration=void 0,this.activated=!1,await this.fetchSequencer.drain()}async refreshAll(){let e=Array.from(this.orgs.entries()).map(([r,n])=>this.fetchSequencer.queue(r,()=>this.fetchAndCacheOrg(r,n.probeNwo)));await Promise.all(e)}visibleOwnersForWorkspaces(e){let r=new Set(e.map(o=>Os(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(axe(o.probeNwo.owner));break}return n}isCachedAgentVisibleFor(e,r){let n=this.extractOwnerFromPath(e);return n===void 0?!0:this.visibleOwnersForWorkspaces(r).has(n)}extractOwnerFromPath(e){let r=Wx.relative(this.cacheRoot,e);if(r.startsWith("..")||Wx.isAbsolute(r))return;let n=r.indexOf(Wx.sep);if(!(n<=0))return r.slice(0,n)}_isActivated(){return this.activated}async _handleWorkspaceAdded(e){await this.onWorkspaceAdded(e)}async _handleWorkspaceRemoved(e){await this.onWorkspaceRemoved(e)}async onWorkspaceAdded(e){if(!e?.uri)return;let r;try{r=gn(e.uri)}catch{return}let n=await this.resolveNwo(r);if(!n)return;let o=Os(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=Os(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,Ke.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await tq.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${eqt}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(Wx.join(o,l),kEn(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return Wx.join(this.cacheRoot,axe(e.owner),axe(e.repo),i_n)}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 tq.promises.stat(e)).size===n.length&&(await tq.promises.readFile(e)).equals(n))return}catch{}await tq.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await tq.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(eqt)&&!r.has(o.name))try{await tq.promises.unlink(Wx.join(e,o.name)),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed orphan ${o.name}`)}catch(s){this.logger.warn(this.ctx,`[OrgCustomAgentService] orphan unlink failed: ${String(s)}`)}}async removeOrgCache(e){let r=Wx.join(this.cacheRoot,axe(e.owner),axe(e.repo));try{await tq.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)}`)}}},tqt=class extends eq{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 CA=class{static{a(this,"PromptChangeNotifier")}},rKe=class extends CA{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function s_n(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a(s_n,"createPromptFilesChangedEvent");function a_n(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(a_n,"createBatchPromptFilesChangedEvent");p();var Xf=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 Vle(...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(Vle,"anyEvent");var d_n=require("os"),cxe=de(require("path"));function Wle(t){return t.replace(/\\/g,"/")}a(Wle,"toForwardSlash");function c_n(...t){return cxe.default.posix.join(...t.map(Wle))}a(c_n,"globJoin");function aGo(t){let e=Wle(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(aGo,"containsTraversal");function l_n(t,e){let r=Wle(cxe.default.posix.normalize(Wle(t))),n=Wle(cxe.default.posix.normalize(Wle(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(l_n,"isContained");var u_n=["*","?","{","["],bA=class{constructor(e,r){this.ctx=e;this.logger=new pe("PromptFileLocationRegistry");this._onLocationsChanged=new Xf;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??d_n.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(aGo(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=u_n.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=c_n(f,d.pattern.slice(2));if(!l_n(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=c_n(f,d.pattern);l_n(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 u_n){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire(s_n(e,"ConfigChanged"))}};p();p();p();p();var rqt=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=rqt.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!rqt.posix.isAbsolute(s)}a(zx,"isEqualOrParent");var BC=process.platform==="linux";function nq(t){return t.replace(/\\/g,"/")}a(nq,"normalizeSlashes");function M_(t){let e=nq(t);return BC?e:e.toLowerCase()}a(M_,"canonicalKey");function f_n(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>BC?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,BC))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(f_n,"coalesceEvents");var nKe=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=Vle(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=Vle(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 N3=de(require("fs"));var TK=new pe("NodeJSWatcherService"),cGo=1e3,iKe=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new Xf;this.onDidChange=this._onDidChange.event;this._onDidError=new Xf;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??N3.watch,this._fsWatchFile=o??{watchFile:N3.watchFile,unwatchFile:N3.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=nq(e.path),n=M_(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){TK.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){TK.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return N3.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?dGo(e,nq(o)):e,c=lGo(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),TK.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}),TK.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){TK.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=uGo(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:cGo},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),TK.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){TK.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function lGo(t,e){if(t==="change")return"update";try{return N3.statSync(e),"create"}catch{return"delete"}}a(lGo,"classify");function uGo(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(uGo,"classifyStat");function dGo(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(dGo,"joinPosix");p();var V_n=de($_n()),W_n=require("os"),z_n=de(require("path"));var cKe=new pe("ParcelWatcherService"),t$o=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",r$o=process.platform==="darwin"?[z_n.join((0,W_n.homedir)(),"Library","Containers")]:[],lKe=class{constructor(e,r){this.ctx=e;this._onDidChange=new Xf;this.onDidChange=this._onDidChange.event;this._onDidError=new Xf;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??V_n.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=nq(e.path),n=M_(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=nq(e),o=this._findCoveringRoot(n);if(!o)return;let s=M_(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,BC))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&zx(e.path,o.path,BC)){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=M_(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=>{cKe.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:t$o,ignore:r$o}).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=M_(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=nq(s.path);n.push({path:c,type:s.type})}let o=f_n(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=M_(s.path),l=e.pathSubscribers.get(c);if(l)for(let u of l)try{u(s)}catch(d){cKe.debug(this.ctx,"Path subscriber threw",s.path,d)}}}_onWatchError(e,r){if(this._disposed)return;let n=e.toString();if(cKe.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(_s).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),cKe.warn(this.ctx,"Failed to watch for file changes at",r,e))}};function uKe(t){let e=new lKe(t),r=new iKe(t,e);return new nKe(t,e,r)}a(uKe,"createUniversalWatcher");var Y_n=de(require("fs"));var iq=de(require("path"));var n$o=100,dKe=/[*?{[]/,pqt=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,BC)&&!zx(this.request.path,e.path,BC))return;this._tryActivate();return}e.type==="delete"&&zx(e.path,this.request.path,BC)&&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=iq.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=i$o(this.request.path,this.statSync);if(n===void 0||o$o(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 i$o(t,e){let r=iq.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=iq.dirname(r)}}a(i$o,"findExistingAncestor");function o$o(t,e){return iq.dirname(e)===t?!1:t===iq.parse(t).root}a(o$o,"isAncestorTooBroad");var fKe=class{constructor(e,r,n=Y_n.statSync){this._onPromptFileChanged=new Xf;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??uKe(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=dKe.test(d)?m.path:void 0;h={refCountByType:new Map,matcher:new N_(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=a_n([...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 pqt(e,this._watcher,r=>this._deferredSubs.add(r),r=>this._deferredSubs.delete(r),this._statSync)}_toWatchRequest(e){if(!dKe.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 dKe.test(n)}_extractBaseDir(e){let r=dKe.exec(e);if(!r)return iq.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,BC),d=zx(l,r.path,BC);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()},n$o)}_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 X_n(t,e=[],r={}){let n=t.length===0?[]:t.split(/\r\n|\n/);return new mqt(n,e,r).parse()}a(X_n,"parse");function mxe(t,e){return{line:t,character:e}}a(mxe,"createPosition");function Yx(t,e,r){return{type:"string",value:t,start:e,end:r}}a(Yx,"createStringNode");function s$o(t,e,r){return{type:"number",value:t,start:e,end:r}}a(s$o,"createNumberNode");function K_n(t,e,r){return{type:"boolean",value:t,start:e,end:r}}a(K_n,"createBooleanNode");function a$o(t,e){return{type:"null",value:null,start:t,end:e}}a(a$o,"createNullNode");function J_n(t,e,r){return{type:"object",start:e,end:r,properties:t}}a(J_n,"createObjectNode");function Z_n(t,e,r){return{type:"array",start:e,end:r,items:t}}a(Z_n,"createArrayNode");function evn(t){return t===" "||t===" "}a(evn,"isWhitespace");function c$o(t){return/^-?\d*\.?\d+$/.test(t)}a(c$o,"isValidNumber");var hqt=class{constructor(e){this.currentLine=0;this.currentChar=0;this.lines=e}static{a(this,"YamlLexer")}getCurrentPosition(){return mxe(this.currentLine,this.currentChar)}getCurrentLineNumber(){return this.currentLine}getCurrentCharNumber(){return this.currentChar}getCurrentLineText(){return this.currentLine=this.lines.length}getCurrentChar(){return this.isAtEnd()||this.currentChar>=this.lines[this.currentLine].length?"":this.lines[this.currentLine][this.currentChar]}peek(e=1){let r=this.currentChar+e;return this.currentLine>=this.lines.length||r>=this.lines[this.currentLine].length?"":this.lines[this.currentLine][r]}advance(){let e=this.getCurrentChar();return this.currentChar>=this.lines[this.currentLine].length&&this.currentLine0&&!e.startsWith("#")){this.skipWhitespace();return}}if(this.currentLine++,this.currentChar=0,this.currentLine0&&!e.startsWith("#")){this.skipWhitespace();return}}}}},mqt=class{constructor(e,r,n){this.flowLevel=0;this.lexer=new hqt(e),this.errors=r,this.options=n}static{a(this,"YamlParser")}addError(e,r,n,o){this.errors.push({message:e,code:r,start:n,end:o})}parseValue(e){if(this.lexer.skipWhitespace(),this.lexer.isAtEnd()){let n=this.lexer.getCurrentPosition();return Yx("",n,n)}let r=this.lexer.getCurrentChar();return r==='"'||r==="'"?this.parseQuotedString(r):r==="["?this.parseInlineArray():r==="{"?this.parseInlineObject():this.parseUnquotedValue()}parseQuotedString(e){let r=this.lexer.getCurrentPosition();this.lexer.advance();let n="";for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==e;)n+=this.lexer.advance();this.lexer.getCurrentChar()===e&&this.lexer.advance();let o=this.lexer.getCurrentPosition();return Yx(n,r,o)}parseUnquotedValue(){let e=this.lexer.getCurrentPosition(),r="",n=e,o=a(d=>d==="#"||this.flowLevel>0&&(d===","||d==="]"||d==="}"),"isTerminator"),s=this.lexer.getCurrentChar();if(s==='"'||s==="'")for(r+=this.lexer.advance(),n=this.lexer.getCurrentPosition();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="";){let d=this.lexer.getCurrentChar();if(d===s||o(d))break;r+=this.lexer.advance(),n=this.lexer.getCurrentPosition()}else for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="";){let d=this.lexer.getCurrentChar();if(o(d))break;r+=this.lexer.advance(),n=this.lexer.getCurrentPosition()}let c=r.trimEnd(),l=r.length-c.length;l&&(n=mxe(e.line,n.character-l));let u=s==='"'||s==="'"?c.substring(1):c;return this.createValueNode(u,e,n)}createValueNode(e,r,n){if(e==="")return Yx("",r,r);if(e==="true")return K_n(!0,r,n);if(e==="false")return K_n(!1,r,n);if(e==="null"||e==="~")return a$o(r,n);let o=Number(e);return!isNaN(o)&&isFinite(o)&&c$o(e)?s$o(o,r,n):Yx(e,r,n)}parseInlineArray(){let e=this.lexer.getCurrentPosition();this.lexer.advance(),this.flowLevel++;let r=[];for(;!this.lexer.isAtEnd();){if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="]"){this.lexer.advance();break}if(this.lexer.getCurrentChar()===""){this.lexer.advanceLine();continue}if(this.lexer.getCurrentChar()==="#"){this.lexer.skipToEndOfLine(),this.lexer.advanceLine();continue}let o=this.lexer.savePosition(),s=this.parseValue();s.type==="string"&&s.value===""&&s.start.line===s.end.line&&s.start.character===s.end.character||r.push(s);let c=this.lexer.savePosition();if(o.line===c.line&&o.char===c.char)if(!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="")this.lexer.advance();else break;this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===","&&this.lexer.advance()}let n=this.lexer.getCurrentPosition();return this.flowLevel--,Z_n(r,e,n)}parseInlineObject(){let e=this.lexer.getCurrentPosition();this.lexer.advance(),this.flowLevel++;let r=[];for(;!this.lexer.isAtEnd();){if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="}"){this.lexer.advance();break}if(this.lexer.getCurrentChar()==="#"){this.lexer.skipToEndOfLine(),this.lexer.advanceLine();continue}let o=this.lexer.savePosition(),s=this.lexer.getCurrentPosition(),c="";if(this.lexer.getCurrentChar()==='"'||this.lexer.getCurrentChar()==="'"){let h=this.lexer.getCurrentChar();for(this.lexer.advance();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==h;)c+=this.lexer.advance();this.lexer.getCurrentChar()===h&&this.lexer.advance()}else for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==":";)c+=this.lexer.advance();c=c.trim();let l=this.lexer.getCurrentPosition(),u=Yx(c,s,l);this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===":"&&this.lexer.advance(),this.lexer.skipWhitespace();let d=this.parseValue();r.push({key:u,value:d});let f=this.lexer.savePosition();if(o.line===f.line&&o.char===f.char)if(!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="")this.lexer.advance();else break;this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===","&&this.lexer.advance()}let n=this.lexer.getCurrentPosition();return this.flowLevel--,J_n(r,e,n)}parseBlockArray(e){let r=this.lexer.getCurrentPosition(),n=[];for(;!this.lexer.isAtEnd()&&(this.lexer.moveToNextNonEmptyLine(),!this.lexer.isAtEnd());){let s=this.lexer.getIndentation();if(ss)if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"){let u=this.parseBlockArray(l);n.push(u)}else{let u=this.lexer.getCurrentLineText(),d=this.lexer.getCurrentCharNumber(),f=u.substring(d);if(f.includes(":")&&!f.trim().startsWith("#")){let h=this.parseBlockObject(l,this.lexer.getCurrentCharNumber());n.push(h)}else n.push(Yx("",c,c))}else n.push(Yx("",c,c))}else{let l=this.lexer.getCurrentLineText(),u=this.lexer.getCurrentCharNumber();if(l.substring(u).includes(":")){let h=this.parseBlockObject(c.character,c.character);n.push(h)}else{let h=this.parseValue();for(n.push(h);!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!=="#";)this.lexer.advance();this.lexer.advanceLine()}}}else break}let o=r;return n.length>0?o=n[n.length-1].end:o=mxe(r.line,r.character+1),Z_n(n,r,o)}parseBlockObject(e,r){let n=this.lexer.getCurrentPosition(),o=[],s=new Set,c=r!==void 0,l=!0;for(;!this.lexer.isAtEnd()&&((!l||!c)&&this.lexer.moveToNextNonEmptyLine(),l=!1,!this.lexer.isAtEnd());){let d=this.lexer.getIndentation();if(c){if(this.lexer.skipWhitespace(),this.lexer.getCurrentCharNumber()e){let E=mxe(this.lexer.getCurrentLineNumber(),0),_=mxe(this.lexer.getCurrentLineNumber(),this.lexer.getCurrentLineText().length);this.addError("Unexpected indentation","indentation",E,_),this.lexer.skipWhitespace()}else this.lexer.skipWhitespace()}let f=this.lexer.getCurrentPosition(),h="";for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==":";)h+=this.lexer.advance();h=h.trim();let m=this.lexer.getCurrentPosition(),g=Yx(h,f,m);!this.options.allowDuplicateKeys&&s.has(h)&&this.addError(`Duplicate key '${h}'`,"duplicateKey",f,m),s.add(h),this.lexer.getCurrentChar()===":"&&this.lexer.advance(),this.lexer.skipWhitespace();let A,y=this.lexer.getCurrentPosition();if(this.lexer.getCurrentChar()===""||this.lexer.getCurrentChar()==="#")if(this.lexer.advanceLine(),this.lexer.isAtEnd())A=Yx("",y,y);else{let E=this.lexer.getIndentation();if(E>d)if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-")A=this.parseBlockArray(E);else{let _=this.lexer.getCurrentLineText(),v=this.lexer.getCurrentCharNumber(),b=_.substring(v);b.includes(":")&&!b.trim().startsWith("#")?A=this.parseBlockObject(E):A=this.parseValue()}else!c&&E===d?(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"?A=this.parseBlockArray(d):A=Yx("",y,y)):A=Yx("",y,y)}else{for(A=this.parseValue();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!=="#"&&evn(this.lexer.getCurrentChar());)this.lexer.advance();this.lexer.getCurrentChar()==="#"&&this.lexer.skipToEndOfLine(),!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()===""&&this.lexer.advanceLine()}o.push({key:g,value:A})}let u=n;return o.length>0&&(u=o[o.length-1].value.end),J_n(o,n,u)}parse(){if(!this.lexer.isAtEnd()&&(this.lexer.moveToNextNonEmptyLine(),!this.lexer.isAtEnd()))if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"){let e=this.lexer.peek();return e===" "||e===" "||e===""||e==="#"?this.parseBlockArray(0):this.parseValue()}else{if(this.lexer.getCurrentChar()==="[")return this.parseInlineArray();if(this.lexer.getCurrentChar()==="{")return this.parseInlineObject();{let e=this.lexer.getCurrentLineText(),r=this.lexer.getCurrentCharNumber(),n=e.substring(r),o=!1,s=!1,c="";for(let l=0;lf>0&&d.match(/^---[\s\r\n]*$/));l===-1?(l=n.length,c=n.length):c=l+1;let u=new qk.Range(2,1,l+1,1);o=new yqt(u,n)}if(c({message:c.message,range:this.asRange(c),code:c.code}));if(n)if(n.type!=="object")s.push({message:"Invalid header, expecting pairs",range:this.range,code:"INVALID_YAML"});else for(let c of n.properties)o.push({key:c.key.value,range:this.asRange({start:c.key.start,end:c.value.end}),value:this.asValue(c.value)});this._parsed={node:n,attributes:o,errors:s}}return this._parsed}asRange({start:e,end:r}){return new qk.Range(this.range.startLineNumber+e.line,e.character+1,this.range.startLineNumber+r.line,r.character+1)}asValue(e){switch(e.type){case"string":return{type:"string",value:e.value,range:this.asRange(e)};case"number":return{type:"number",value:e.value,range:this.asRange(e)};case"boolean":return{type:"boolean",value:e.value,range:this.asRange(e)};case"null":return{type:"null",value:e.value,range:this.asRange(e)};case"array":return{type:"array",items:e.items.map(r=>this.asValue(r)),range:this.asRange(e)};case"object":return{type:"object",properties:e.properties.map(n=>({key:this.asValue(n.key),value:this.asValue(n.value)})),range:this.asRange(e)}}}get attributes(){return this._parsedHeader.attributes}getAttribute(e){return this._parsedHeader.attributes.find(r=>r.key===e)}get errors(){return this._parsedHeader.errors}getStringAttribute(e){let r=this._parsedHeader.attributes.find(n=>n.key===e);if(r?.value.type==="string")return r.value.value}get name(){return this.getStringAttribute("name")}get description(){return this.getStringAttribute("description")}get agent(){return this.getStringAttribute("agent")??this.getStringAttribute("mode")}get model(){return this.getStringAttribute("model")}get applyTo(){return this.getStringAttribute("applyTo")}get invokePolicy(){let e=this._parsedHeader.attributes.find(r=>r.key===u$o);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}}},Eqt=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;sqk.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 qk.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 qk.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)=>qk.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 d$o=new Set(["sessionStart","sessionEnd","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),f$o="agentHook.event.load",gKe=class{constructor(){this.logger=new pe("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 yt(e,f$o,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 d$o.has(e)}isValidHook(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="command"&&("bash"in e&&typeof e.bash=="string"||"powershell"in e&&typeof e.powershell=="string")}};var oq="globalPromptFiles://";function sq(t){return t.storage==="plugin"?t.pluginUri:void 0}a(sq,"pluginUriOf");function Yle(t){return t==="extension"||t==="plugin"}a(Yle,"isReadonlyStorage");var rvn=["agent","skill","prompt","instructions","hook"];function nvn(t,e){return`${t}::${e}`}a(nvn,"entryKey");function p$o(t){return`${t}::`}a(p$o,"typePrefix");var ig=class{constructor(e,r,n){this.ctx=e;this.fileLocator=r;this.logger=new pe("PromptService");this.watchHandles=new Map;this.entryCache=new Map;this.parseInflight=new Map;this.parsers=new Map;this.disposed=!1;n===void 0?(this.watcher=new fKe(e),this.ownsWatcher=!0):(this.watcher=n,this.ownsWatcher=!1);let o=e.get(bA),s=new class{constructor(){this.inner=new hO}parse(u,d,f){return this.inner.parse(d,f)}};this.parsers.set("prompt",s),this.parsers.set("instructions",s),this.parsers.set("skill",s),this.parsers.set("agent",s),this.parsers.set("hook",new gKe),this.onPromptFilesChanged=Vle(o.onLocationsChanged,this.watcher.onPromptFileChanged),this.mergedChangeSubscription=this.onPromptFilesChanged(u=>this.handleChange(u));for(let u of rvn)this.rewatch(u);this.registrySubscription=o.onLocationsChanged(u=>{for(let d of u.affectedTypes)this.rewatch(d)});let c=a(u=>{this.evictFolder(u),this.rewatchAll()},"onWorkspaceRemoved"),l=a(()=>{this.rewatchAll()},"onWorkspaceAdded");this.workspaceListener=new class extends eq{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(u){c(u)}},e.get(OS).addListener(this.workspaceListener)}static{a(this,"PromptService")}async collect(e,r,n,o){let s=await this.fileLocator.listFiles(e,n,r),c=o?.includePlugins?s:s.filter(d=>d.classification.storage!=="plugin"),u=(await Promise.all(c.map(d=>this.resolveEntry(e,r,d)))).filter(d=>d!==void 0);return o?.includePlugins?u:u.filter(d=>d.promptPath.storage!=="plugin")}async resolveEntry(e,r,n){let o=nvn(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($o).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();try{this.ctx.get(OS).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($o).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(nvn(o,Ta(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(CA).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=p$o(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(bA),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 rvn)this.rewatch(e)}evictFolder(e){let r=e.uri.endsWith("/")?e.uri:`${e.uri}/`;for(let[n,o]of this.entryCache){let s=o.entry.promptPath.uri;(s===e.uri||s.startsWith(r))&&this.invalidateKey(n)}}currentWorkspacePaths(){let e;try{e=this.ctx.get($r).getWorkspaceFolders().map(o=>gn(o.uri))}catch{return[]}let r=e.map(o=>({raw:o,normalized:o.replace(/\\/g,"/")})).sort((o,s)=>o.normalized.length-s.normalized.length),n=[];for(let o of r)n.some(s=>zx(s.normalized,o.normalized,BC))||n.push(o);return n.map(o=>o.raw)}};p();var Fl=class{constructor(){this.policyChangeEmitter=new Xf;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},AKe=class extends Fl{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var _qt=64;var M3=(r=>(r.enabled="enabled",r.disabled="disabled",r))(M3||{}),og={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},ep={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},xK=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,_qt),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},aq=class extends xK{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},Pr=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},cq=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},wK=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}},lq=class extends Br{static{a(this,"ExtendedLanguageModelToolResult")}},ivn=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")]))}),O3=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(O3||{}),ovn=S.Object({result:S.Enum(O3)});var vqt=de(require("fs"));var gxe=de(require("path"));var h$o=["user","model"],bqt="source",Sqt={githubOrg:"github-org"},o_n={githubOrg:{[bqt]:Sqt.githubOrg}},Cqt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._id=n.uri,this._name=r.name??Ji(n.uri).replace(".agent.md","")}static{a(this,"CustomAgent")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get id(){return this._id}get name(){return this._name}get description(){return this.parsedPromptFile.header?.description}get tools(){return this.parsedPromptFile.header?.tools}get model(){return this.parsedPromptFile.header?.model}get handOffs(){return this.parsedPromptFile.header?.handOffs}get instruction(){return this.parsedPromptFile.body?.content}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||Yle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??h$o}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get pluginUri(){return sq(this.promptFileEntry.promptPath)}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(Sqt));for(let n of e){let o=n[bqt];if(typeof o=="string"&&r.has(o))return o}}get providers(){return k3(this.promptFileEntry.promptPath.metadata)}},svn="./assets/prompts.contributions.json",m$o="CVE Remediator",g$o="Debugger",avn=new Map([[m$o,"cveRemediatorAgent"],[g$o,"debuggerAgent"]]),Yp=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new pe("CustomAgentService");this.agentUpdateSequencer=new Gx;this.extensionAgents=new Map;this.agentsByExtension=new Map;this.agentFileLocationsPatterns=[];this.gateSubscriptions=[];this.lastGatedCapabilities={};this.syncRegistry(),this.ready=this.loadAssetsContributions(e),this.subscribeToGateChanges()}static{a(this,"CustomAgentService")}static{this.DEFAULT_AGENT_REGISTRATIONS=[".github/agents/**/*.agent.md",".claude/agents/**/*.agent.md","~/.copilot/agents/**/*.agent.md"]}static{this.AGENT_GLOB_SUFFIX="**/*.agent.md"}subscribeToGateChanges(){try{let e=this.ctx.get(Mo);this.lastEnableCustomAgents=Ft(this.ctx,Ke.EnableCustomAgents),this.lastEnableOrgCustomAgents=Ft(this.ctx,Ke.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ft(this.ctx,Ke.EnableCustomAgents),n=Ft(this.ctx,Ke.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(Fl);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(Pn),r=Array.from(new Set(avn.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(CA).notify("agent").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}syncRegistry(){let e=new Set(t.DEFAULT_AGENT_REGISTRATIONS);for(let r of this.agentFileLocationsPatterns)e.add(r);this.registryAgentPatterns=this.promptFileLocationRegistry.replace(this.registryAgentPatterns,"agent",Array.from(e))}setAgentFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(gn(n.uri)):n.type==="location"&&r.add(gxe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e,r){if(this.ctx.get(Fl).getPolicyValue("customAgent.enabled")===!1)return[];await this.ready;let s=(await this.ctx.get(ig).collect(this.ctx,"agent",e,{includePlugins:r?.includePlugins})).map(d=>new Cqt(d)),c=this.ctx.get(D3),l=Ft(this.ctx,Ke.EnableOrgCustomAgents)!==!1,u=this.ctx.get(Pn).getCapabilities();return s.filter(d=>{if(this.isOrgScopedAgent(d)){if(!l)return!1;let m=d.promptFileEntry?.parsedPromptFile.uri,g=m?Zo(m):void 0;if(!g||!c.isCachedAgentVisibleFor(g,e))return!1}let f=avn.get(d.name);if(f===void 0)return!0;let h=u[f]??!1;return h||this.logger.debug(this.ctx,`Filtering out agent '${d.name}' (capability '${f}' is disabled)`),h})}isOrgScopedAgent(e){let r=e.promptFileEntry?.promptPath.metadata;return r?r.some(n=>n[bqt]===Sqt.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",[gn(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=gxe.default.extname(__filename)===".ts"?gxe.default.resolve(__dirname,"../../../..",e):gxe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(svn),n=await vqt.promises.readFile(r,"utf8"),s=JSON.parse(n).chatAgents||[];for(let c of s)if(c.name&&c.description&&c.path){let l=this.resolveAssetsPath(c.path);this.promptFileLocationRegistry.register("agent",[l],{watchable:!1,classification:{storage:"clsAssets",extensionInfo:{name:c.name,description:c.description}}})}}catch(r){this.logger.warn(e,`Failed to read assets contribution file ${svn}:`,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=_K({[A]:y}).trim();m.push(E)}}u=m.join(` +`}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()===` +`||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=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===` +`||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&&(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===` +`||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===` +`||b==="\r";if(E==="-"&&_==="-"&&v==="-"&&T||E==="."&&_==="."&&v==="."&&T){this.pos=m;break}}if(c===0){if(g<=s){this.pos=m;break}c=g}if(g0&&(E[0]===" "||E[0]===" ");E===""?(d+=` +`,g=!0):y===0?(d=E,m=_,A=!0):g?((m||_)&&A?d+=` +`+E:d+=E,m=_,g=!1,A=!0):_||m?(d+=` +`+E,m=_,A=!0):(d+=" "+E,m=!1,A=!0)}}if(u>0){let m=d.length;for(;m>0&&d[m-1]===` +`;)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]!==` +`&&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.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+=` +`.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;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(` `)+` `}let d=c.body?.content,f=u?`--- ${u}--- -${d}`:d||"",h=Zo(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await vqt.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 yxe=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}},Axe=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")}},El={Ask:new Axe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new Axe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new Axe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function lvn(t){return t===El.Agent||t.id===El.Agent.id}a(lvn,"isBuiltInAgentMode");function A$o(t){return t===El.InlineAgent||t.id===El.InlineAgent.id}a(A$o,"isBuiltInInlineAgentMode");function uvn(t){return t===El.Ask||t.id===El.Ask.id||lvn(t)||A$o(t)}a(uvn,"isBuiltInChatMode");function Exe(t){return lvn(t)||!t.isBuiltIn&&t.customTools===void 0}a(Exe,"shouldApplyGlobalToolsSetting");var B_=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[El.Ask,El.Agent,El.InlineAgent],o=await this.ctx.get(Yp).listCustomAgents(e||[]);return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new yxe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return El.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??El.Agent:El.Agent;case"InlineAgent":return El.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var Nc=class extends Error{static{a(this,"CanceledError")}constructor(){super("Canceled"),this.name="Canceled"}};p();var yKe=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 y$o=new pe("conversationProgress"),uq={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var Sc=class{constructor(e){this.ctx=e;this.progressEntries=new En(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);y$o.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 oo={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic"},E$o=new Set(Object.values(oo));function RK(t){return!E$o.has(t)}a(RK,"isCustomEndpointProvider");var _xe="chatCompletions",_$o=128e3,v$o=16e3;function gO(t){return t===oo.Azure?1:0}a(gO,"getAuthTypeForProvider");function dvn(t){switch(t){case"responses":return"responses";case"messages":return"v1/messages";default:return"completions"}}a(dvn,"customEndpointApiTypeToEndpoint");function EKe(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(EKe,"resolveCustomEndpointBaseUrl");function Kle(t){return t===oo.OpenAI||t===oo.Gemini||t===oo.Groq||t===oo.OpenRouter||t===oo.Anthropic}a(Kle,"isOpenAICompatible");async function AO(t,e,r){let n=new ca(t.get(zn)),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=RK(e),d=u?_$o:1e5,f=u?v$o:8192,h=c?.maxInputTokens||d,m=c?.maxOutputTokens||f,g=s?.deploymentUrl,A;return u&&(A=(await n.getProviderConfig(e))?.apiType??_xe),{modelId:r,uiName:l,modelFamily:In.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(AO,"resolveModelConfiguration");async function _Ke(t,e,r){return await new ca(t.get(zn)).getAPIKey(e,r)}a(_Ke,"resolveModelKey");function fvn(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(fvn,"resolveAzureUrl");function dq(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(dq,"isBYOKEnabled");var FC="byok",ca=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(FC,this.modelApiKeyKey(e,r));if(o)return o}return await this.persistenceManager.read(FC,this.providerApiKeyKey(e))}async storeAPIKey(e,r,n,o){n!==2&&(n===0?await this.persistenceManager.update(FC,this.providerApiKeyKey(e),r):n===1&&o&&await this.persistenceManager.update(FC,this.modelApiKeyKey(e,o),r))}async deleteAPIKey(e,r,n){r!==2&&(r===0?await this.persistenceManager.delete(FC,this.providerApiKeyKey(e)):r===1&&n&&await this.persistenceManager.delete(FC,this.modelApiKeyKey(e,n)))}async getStoredModelConfigs(e){return await this.persistenceManager.read(FC,this.modelsConfigKey(e))||{}}async getProviderConfig(e){return await this.persistenceManager.read(FC,this.providerConfigKey(e))}async saveProviderConfig(e,r){await this.persistenceManager.update(FC,this.providerConfigKey(e),r)}async deleteProviderConfig(e){await this.persistenceManager.delete(FC,this.providerConfigKey(e))}async listCustomProviderNames(){let e=await this.persistenceManager.listKeys(FC),r=this.providerConfigKey(""),n=new Set(Object.values(oo));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(oo),...e]))}async getAllModels(e){let r=[];if(!dq(await e.get(Ut).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(FC,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(FC,this.modelsConfigKey(e),n),o.deploymentUrl&&await this.deleteAPIKey(e,1,r))}async removeAllModelConfigs(e){await this.persistenceManager.delete(FC,this.modelsConfigKey(e))}};p();p();p();p();function Tqt(t,e){let r=PK(t,e);return r===-1?void 0:t[r]}a(Tqt,"findLastMonotonous");function PK(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?bKe.isErrorNoTelemetry(e)?new bKe(e.message+` +${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+` `+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)}},C$o=new Iqt;function Jle(t){wqt(t)||C$o.onUnexpectedError(t)}a(Jle,"onUnexpectedError");var xqt="Canceled";function wqt(t){return t instanceof L_?!0:t instanceof Error&&t.name===xqt&&t.message===xqt}a(wqt,"isCancellationError");var L_=class extends Error{static{a(this,"CancellationError")}constructor(){super(xqt),this.name=this.message}};var bKe=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"}},Mc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function Rqt(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(kqt,"shuffle");var mvn;(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})(mvn||={});function Zle(t,e){return(r,n)=>e(t(r),t(n))}a(Zle,"compareBy");var Xle=a((t,e)=>t-e,"numberComparator");var hvn=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||mvn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function vxe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(vxe,"sumBy");p();function Evn(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(Evn,"groupBy");var Avn,yvn,gvn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[Avn]="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))}[(yvn=Symbol.iterator,Avn=Symbol.toStringTag,yvn)](){return this.values()}};p();function Dqt(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(Dqt,"createSingleCallFunction");p();var Nqt;(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 Mqt(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]}*[(vvn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},Cvn,_vn=class{constructor(e,r){this[Cvn]="ResourceSet";!e||typeof e=="function"?this._map=new SKe(e):(this._map=new SKe(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()}[(Cvn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var bvn,Oqt=class{constructor(){this[bvn]="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}[(bvn=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)}},Bqt=class extends Oqt{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))}},TKe=class extends Bqt{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 IKe=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 S$o=!1,eue=null;var Svn=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 IKe;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(Zle(u=>u.idx,Xle));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)}},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;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=tyn([...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} ==================== @@ -2392,7 +2435,7 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};function T$o(t){eue=t}a(T$o,"setDisposableTracker");if(S$o){let t="__is_disposable_tracked__";T$o(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!==F_.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==F_.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function Fqt(t){return eue?.trackDisposable(t),t}a(Fqt,"trackDisposable");function Uqt(t){eue?.markAsDisposed(t)}a(Uqt,"markAsDisposed");function Lqt(t,e){eue?.setParent(t,e)}a(Lqt,"setParentOfDisposable");function I$o(t,e){if(eue)for(let r of t)eue.setParent(r,e)}a(I$o,"setParentOfDisposables");function Tvn(t){if(Nqt.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(Tvn,"dispose");function Ivn(...t){let e=xKe(()=>Tvn(t));return I$o(t,e),e}a(Ivn,"combinedDisposable");function xKe(t){let e=Fqt({dispose:Dqt(()=>{Uqt(e),t()})});return e}a(xKe,"toDisposable");var fq=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;Fqt(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(Uqt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Tvn(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 Lqt(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),Lqt(e,null))}},F_=class{constructor(){this._store=new fq;Fqt(this),Lqt(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){Uqt(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 tue(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(tue,"formatResetDate");var pq=class{static{a(this,"QuotaWarningNotifier")}};var kK=class{static{a(this,"QuotaChangeNotifier")}};var Qqt=[50,75,90,95],pu=class extends F_{constructor(r){super();this._shownThresholds={chat:new Set,completions:new Set,premium_interactions:new Set};this._hasNotifiedOverage={};this._isTBBEnabled=!1;this._canUpgradePlan=!1;this._turnCredits=new Map;this._ctx=r,this._register(Es(r,n=>{let o=n.userInfo?.raw?.analytics_tracking_id;if(o!==this._userId){for(let s of Object.values(this._shownThresholds))s.clear();this._hasNotifiedOverage={},this._turnCredits.clear(),this._userId=o}this._copilotPlan=n.userInfo.copilotPlan,this._isTBBEnabled=!!n.userInfo?.isTBBEnabled,this._canUpgradePlan=!!n.userInfo?.canUpgradePlan,this.processUserInfoQuotaSnapshot(n.userInfo?.raw)}))}static{a(this,"ChatQuotaService")}get overageEnabled(){return this._quotaInfo?.chat?.overageEnabled===!0||this._quotaInfo?.completions?.overageEnabled===!0||this._quotaInfo?.premium_interactions?.overageEnabled===!0}get quotaExhausted(){return this._quotaInfo?.premium_interactions?this._quotaInfo.premium_interactions.used>=this._quotaInfo.premium_interactions.quota&&!this._quotaInfo.premium_interactions.overageEnabled:!1}setLastCopilotUsage(r,n){let o=r/1e9;this.addAic(o,n)}addAic(r,n){r>0&&this._turnCredits.set(n,(this._turnCredits.get(n)??0)+r)}transferTurnCredits(r,n){if(r===n)return;let o=this._turnCredits.get(r);o!==void 0&&(this._turnCredits.delete(r),this.addAic(o,n))}resetTurnCredits(r){this._turnCredits.delete(r)}getCreditsForTurn(r){return this._turnCredits.get(r)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(r){let n=r.get("x-quota-snapshot-premium_models")||r.get("x-quota-snapshot-premium_interactions"),o=r.get("x-quota-snapshot-chat"),s=r.get("x-quota-snapshot-completions");!n&&!o&&!s||(this._quotaInfo={chat:this._parseQuotaHeader(o),completions:this._parseQuotaHeader(s),premium_interactions:this._parseQuotaHeader(n)},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse()))}processUserInfoQuotaSnapshot(r){if(!r?.quota_snapshots)return;let{chat:n,completions:o,premium_interactions:s}=r.quota_snapshots;this._quotaInfo={chat:n?this._buildSnapshotFromRaw(n):void 0,completions:o?this._buildSnapshotFromRaw(o):void 0,premium_interactions:s?this._buildSnapshotFromRaw(s):void 0},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse())}_parseQuotaHeader(r){if(r)try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("ov")||"0.0"),c=n.get("ovPerm")==="true",l=Number.parseFloat(n.get("rem")||"0.0"),u=n.get("rst")??"",d=Math.max(0,o*(1-l/100)),f=o<0;return{quota:o,used:d,percentRemaining:l,overageUsed:s,overageEnabled:c,resetDate:u,unlimited:f}}catch(n){console.error("Failed to parse quota header",n);return}}_buildSnapshotFromRaw(r){return{overageEnabled:r.overage_permitted,overageUsed:r.overage_count,quota:r.entitlement,percentRemaining:r.percent_remaining,resetDate:r.quota_reset_at!=null&&r.quota_reset_at!==0?new Date(r.quota_reset_at*1e3).toISOString():"",used:Math.max(0,r.entitlement*(1-r.percent_remaining/100)),unlimited:r.unlimited}}async sendQuotaChangeNotification(){if(!this._quotaInfo)return;let r={chat:this._quotaInfo.chat,completions:this._quotaInfo.completions,premium_interactions:this._quotaInfo.premium_interactions,copilotPlan:this._copilotPlan};if(this._hasQuotaChanged(r)){this._lastSentQuotaParams=r;try{await this._ctx.get(kK).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=Qqt[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(Qqt[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(pq).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(pq).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 ${tue(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function wKe(t){let e=await t.get(Ur).resolveSession();if(e){let r=await $Ce(t,e);if(r.ok){let n=await r.json();t.get(pu).processUserInfoQuotaSnapshot(n)}}}a(wKe,"refreshUserQuota");p();p();var Cxe=new pe("openAICompatibleLMProvider"),rue={[oo.OpenAI]:"https://api.openai.com/v1",[oo.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[oo.Groq]:"https://api.groq.com/openai/v1",[oo.OpenRouter]:"https://openrouter.ai/api/v1",[oo.Anthropic]:"https://api.anthropic.com/v1"},Kx=class{constructor(e,r){this._lastFetchTime=0;this.providerName=e,this.ctx=r}static{a(this,"BaseOpenAICompatibleLMProvider")}async getAllModels(){await this.ensureKnownModelsCache();try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new ca(this.ctx.get(zn)).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 Cxe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getBaseUrl(){let e=rue[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*bxe(t,e){for await(let r of t)yield e(r)}a(bxe,"asyncIterableMap");async function*xvn(t,e){for await(let r of t)await e(r)&&(yield r)}a(xvn,"asyncIterableFilter");async function*Sxe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(Sxe,"asyncIterableMapFilter");p();var RKe="interleaved-thinking-2025-05-14",wvn="2023-06-01";p();var jk=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 Jc=class{static{a(this,"ModelConfigurationProvider")}},PKe=class extends Jc{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(Ss).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(Ss).getMetadata(),o=w$o(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===In.Gpt35turbo||r===In.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:jqt(6144,s),maxLongContextTokens:void 0,maxResponseTokens:qqt(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===In.Gpt4||r===In.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:jqt(10240,s),maxLongContextTokens:void 0,maxResponseTokens:qqt(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===In.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await x$o(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:qqt(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:Rvn(s),maxLongContextTokens:Pvn(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(Ss).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:Rvn(o),maxLongContextTokens:Pvn(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===Uln.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function x$o(t,e){let r=t.get(Zt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),jqt(o,e)}a(x$o,"getExpRequestTokens");function jqt(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(jqt,"getRequestTokens");function Rvn(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(Rvn,"getMaxRequestTokens");function Pvn(t){return t.billing?.token_prices?.long_context?.context_max}a(Pvn,"getMaxLongContextTokens");function qqt(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(qqt,"getResponseTokens");function w$o(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(w$o,"filterModelsByCapabilities");function yO(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(yO,"pickReasoningEffort");function R$o(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(R$o,"shouldUseResponsesApi");function P$o(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(P$o,"shouldUseMessagesApi");var kvn=["completions","responses","v1/messages"];function kKe(t,e){return e?"v1/messages":t&&R$o(t)?"responses":"completions"}a(kKe,"resolveEndpointRoute");function DKe(t,e){if(!P$o(e))return!1;let r=Ft(t,Ke.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(DKe,"willUseMessagesEndpoint");p();function NKe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(NKe,"isCodexStyleGptModel");function Dvn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(Dvn,"isGpt5PlusFamily");function Nvn(t){return t?t.toLowerCase().startsWith("claude"):!1}a(Nvn,"isAnthropicModel");p();p();function Mvn(t,e){if(!e||!e.providerName)return;let r=e.apiType==="messages";e.providerName===oo.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(Mvn,"adaptRequestForBYOKProvider");p();p();var LS=class{static{a(this,"RateLimitNotifier")}},MKe=class extends LS{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var Hqt=[50,75,90,95],EO=class extends F_{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(Es(r,()=>{this._shownSessionThresholds.clear(),this._shownWeeklyThresholds.clear(),this.clearRateLimits()}))}static{a(this,"ChatUsageRateLimitService")}get weeklyRateLimit(){return this._weeklyRateLimit}get sessionRateLimit(){return this._sessionRateLimit}clearRateLimits(){this._weeklyRateLimit=void 0,this._sessionRateLimit=void 0}processRateLimitHeaders(r){let n=r.get("x-usage-ratelimit-weekly"),o=r.get("x-usage-ratelimit-session");if(!n&&!o)return;n&&(this._weeklyRateLimit=this.parseRateLimitHeader(n)),o&&(this._sessionRateLimit=this.parseRateLimitHeader(o)),this.clearStaleThresholds(this._sessionRateLimit,this._shownSessionThresholds),this.clearStaleThresholds(this._weeklyRateLimit,this._shownWeeklyThresholds);let s=this.checkThreshold(this._sessionRateLimit,this._shownSessionThresholds,"session")??this.checkThreshold(this._weeklyRateLimit,this._shownWeeklyThresholds,"weekly");s&&this.ctx.get(LS).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=Hqt[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(Hqt[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=tue(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 sg="https://aka.ms/github-copilot-rate-limit-error";function k$o(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(k$o,"secondsToHumanReadableTime");var U_=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":k$o(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](${sg})`;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](${sg})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n}. [Learn More](${sg})`;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](${sg})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${sg})`;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](${sg})`:`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l}. [Learn More](${sg})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${sg})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${sg})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${sg})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${sg})`}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](${sg})`:`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${sg})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${sg})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${sg})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${sg})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${sg})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${sg})`}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 hq="copilot-edits-session";p();p();p();p();jo();function OKe(t,e,r,n,o,s,c){return OYr(t,e,r,o,n,c),{completionText:e,meanLogProb:D$o(t,r),meanAlternativeLogProb:N$o(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:Gt(),finishReason:r.finish_reason}}a(OKe,"convertToAPIChoice");function D$o(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(D$o,"calculateMeanLogProb");function N$o(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(N$o,"calculateMeanAlternativeLogProb");function nue(t,e){return w1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(nue,"getTemperatureForSamples");var M$o={markdown:[` +`),{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:[` `],python:[` @@ -2400,23 +2443,23 @@ def `,` class `,` if `,` -#`]};function Ovn(t,e){return M$o[e??""]??[` +#`]};function Ayn(t,e){return HUo[e??""]??[` -`,"\n```"]}a(Ovn,"getStops");function iue(t){return 1}a(iue,"getTopP");function BKe(t){return NTe}a(BKe,"getMaxSolutionTokens");p();p();var O$o=1.15,B$o=1.17,L$o=2;function F$o(t){if(!t)return!1;let e=t.toLowerCase();return e.includes("opus")||e.includes("sonnet-4.6")}a(F$o,"isHighMultiplierModel");function U$o(t){return t.text?Array.isArray(t.text)?t.text.join(""):t.text:""}a(U$o,"getThinkingText");function oue(t,e){let r=U$o(t);if(r.length>0){let n=Ts(),o=F$o(e)?B$o:O$o;return Math.ceil(n.tokenLength(r)*L$o*o)}return 0}a(oue,"estimateThinkingTokens");function Gqt(t){let e=t.delta;if(!e)return;let r=q$o(e),n=Q$o(e);if(r||n)return{id:r,text:n}}a(Gqt,"extractThinkingDeltaFromChoice");function Q$o(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(Q$o,"getThinkingDeltaText");function q$o(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(q$o,"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 FS=new pe("streamChoices"),$qt=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new Yqt;this.tool_calls=new Wqt;this.function_call=new zqt;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=Gqt(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 j$o(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!=""),r]}a(j$o,"splitChunk");var Vqt=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)}},Wqt=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 Vqt,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},zqt=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},Yqt=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]??[]}},DK=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 Kqt;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(),FS.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),FS.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();FS.debug(this.ctx,"chunk",u);let[d,f]=j$o(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{FS.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&H$o(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?FS.error(this.ctx,"Error in response:",g.error.message):FS.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=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;A-1||y.delta?.content?.indexOf(` -`)>-1,T=E?Gqt(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(()=>Ixe(_,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:eQ(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&&FS.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{FS.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(()=>Ixe(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?(FS.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 Zqt(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(FS.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),FS.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),FS.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=Ixe(e.solution,t);return OKe(t,n,s,e.index,e.requestId,o,r)}a(Zqt,"prepareSolutionForReturn");function Ixe(t,e){let r=t.text.join(""),n=G$o(t,e),o=$$o(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(Ixe,"convertToAPIJsonData");function H$o(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(H$o,"isCopilotConfirmation");function Bvn(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&&yt(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(Bvn,"parseCallArguments");function G$o(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=Bvn(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(G$o,"extractToolCalls");function $$o(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=Bvn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a($$o,"extractFunctionCall");var Kqt=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new Jqt,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(", ")}},Jqt=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function LKe(t,e){return t!==null&&typeof t=="object"&&e in t}a(LKe,"hasKey");function Vh(t,e){return LKe(t,e)?t[e]:void 0}a(Vh,"getKey");var Fvn=de(ri());var tp=new pe("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 F3(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(F3,"getProcessingTime");function Uvn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(Uvn,"uiKindToIntent");var _O=class{static{a(this,"OpenAIFetcher")}};function V$o(t,e,r,n){return KI(t,e,"proxy","v1/engines",r,n)}a(V$o,"getProxyEngineUrl");function FKe(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(FKe,"sanitizeRequestOptionTelemetry");async function W$o(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(cs),m=V$o(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},tse(e));FKe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,Et(t,"request.sent",g);let A=pl(),y=Uvn(l);return DW(t,m,c.token,y,o,s,d,f).then(E=>{let _=L3(E);g.extendWithRequestId(_);let v=pl()-A;return g.measurements.totalTimeMs=v,tp.info(t,`Request ${o} at <${m}> finished with ${E.status} status after ${v}ms`),g.properties.status=String(E.status),tp.debug(t,"request.response properties",g.properties),tp.debug(t,"request.response measurements",g.measurements),tp.debug(t,"prompt:",e),Et(t,"request.response",g),E}).catch(E=>{if(Lm(E))throw Et(t,"request.cancel",g),E;h.setWarning("cls",{message:Vh(E,"message")??""});let _=g.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",_),g.properties.message=String(Vh(E,"name")??""),g.properties.code=String(Vh(E,"code")??""),g.properties.errno=String(Vh(E,"errno")??""),g.properties.type=String(Vh(E,"type")??"");let v=pl()-A;throw g.measurements.totalTimeMs=v,tp.info(t,`Request ${o} at <${m}> rejected with ${String(E)} after ${v}ms`),tp.debug(t,"request.error properties",g.properties),tp.debug(t,"request.error measurements",g.measurements),Et(t,"request.error",g),E}).finally(()=>{BYr(t,e,g)})}a(W$o,"fetchWithInstrumentation");async function z$o(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});FKe(s,f,["messages"]),f.properties.headerRequestId=o,Et(t,"request.sent",f);let h=pl(),m=Uvn(l),g=Zm(t);uL()&&(g=await o$e(t,g));try{let A=await DW(t,n,c.token,m,o,s,d,g),y=L3(A);f.extendWithRequestId(y);let E=pl()-h;return f.measurements.totalTimeMs=E,tp.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${E}ms`),tp.debug(t,"request.response properties",f.properties),tp.debug(t,"request.response measurements",f.measurements),tp.debug(t,"messages:",JSON.stringify(e)),Et(t,"request.response",f),A}catch(A){if(Lm(A))throw Et(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",y),f.properties.message=String(Vh(A,"name")??""),f.properties.code=String(Vh(A,"code")??""),f.properties.errno=String(Vh(A,"errno")??""),f.properties.type=String(Vh(A,"type")??"");let E=pl()-h;throw f.measurements.totalTimeMs=E,tp.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${E}ms`),tp.debug(t,"request.error properties",f.properties),tp.debug(t,"request.error measurements",f.measurements),Et(t,"request.error",f),A}finally{sue(t,e,f)}}a(z$o,"fetchChatWithInstrumentation");function Lvn(t){return xvn(t,e=>e.completionText.trim().length>0)}a(Lvn,"postProcessChoices");var Y$o="github.copilot.completions.quotaExceeded",Txe=class extends _O{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(cs),l="completions",u=await e.get(Ut).getToken(),d=await this.fetchWithParameters(e,l,r,u,n,s);if(d==="not-sent")return{type:"canceled",reason:"before fetch request"};if(s?.isCancellationRequested){let g=d.body();try{g&&"destroy"in g&&typeof g.destroy=="function"?g.destroy():g instanceof ReadableStream&&g.cancel()}catch(A){tp.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=DK.create(e,r.count,d,n,[],s).processSSE(o),m=bxe(h,g=>Zqt(e,g,n));return{type:"success",choices:Lvn(m),getProcessingTime:a(()=>F3(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(cs),A=await e.get(Ut).getToken(),y=await z$o(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){tp.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 _=DK.create(e,1,y,m,[],Fvn.CancellationToken.None).processSSE(),v=bxe(_,b=>Zqt(e,b,n));return{type:"success",choices:Lvn(v),getProcessingTime:a(()=>F3(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:BKe(e),temperature:nue(e,n.count),top_p:iue(e),n:n.count,stop:Ovn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=bY(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 AC(0),c?.isCancellationRequested?"not-sent":await W$o(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:Y$o,title:"Learn More"});let l=Es(e,u=>{this.#e=void 0,(u.envelope.limited_user_quotas?.completions??1)>0&&(r.forceNormal("cls",{inactive:!1}),l.dispose())});return{type:"failed",reason:this.#e}}if(o.status===466)return r.setError("cls",{message:c}),tp.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`;tp.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?(tp.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(Ut).resetToken("code_completion",o.status),{type:"failed",reason:`token expired or invalid: ${o.status}`};if(o.status===429){let l=vU(o);yt(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.`,tp.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(tp.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(tp.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};jo();async function xxe(t,e,r,n){let o=Wt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(xxe,"createTelemetryWithExpWithId");function Zc(t,{turn:e,conversation:r}={},n){return xxe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(Zc,"createTelemetryWithExpWithTurn");function wxe(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(K$o(l))),c=c.extendedBy(d,f),c}a(wxe,"extendUserMessageTelemetryData");function K$o(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(K$o,"mapSkillResolutionsForTelemetry");function Qvn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),UKe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(Qvn,"createUserMessageTelemetryData");function qvn(t,e,r,n,o,s,c){let l=Z$o(r);return UKe(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(qvn,"createModelMessageTelemetryData");function jvn(t,e,r,n,o,s,c){UKe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(jvn,"createOffTopicMessageTelemetryData");function Hvn(t,e,r,n,o,s,c,l,u){let d=UKe(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 J$o(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(Hvn,"createSuggestionMessageTelemetryData");async function Gvn(t,e,r){let n=await Zc(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";US(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(Gvn,"telemetryIndexCodesearch");function UKe(t,e,r,n,o,s,c){let l=c??Wt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=Gt();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=eE(r);return Et(t,`${h}.message`,d),Et(t,`${h}.messageText`,f,1),d}a(UKe,"telemetryMessage");function $vn(t,e,r,n){US(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a($vn,"createSuggestionShownTelemetryData");function J$o(t,e,r,n,o,s,c,l){US(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(J$o,"createSuggestionSelectedTelemetryData");function US(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(US,"telemetryUserAction");function sue(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return Et(t,"engine.messages",n,1)}a(sue,"logEngineMessages");function eE(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(eE,"telemetryPrefixForUiKind");function Z$o(t){let e=t.split(` -`),r=[],n;for(let o=0;o-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(s.System="system",s.User="user",s.Assistant="assistant",s.Function="function",s.Tool="tool",s))(rc||{});function kn(t){return t?(t=QS(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(kn,"getTextPart");function Kvn(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(Kvn,"hasImageContent");function gq(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(aue(n))return n.some(o=>o.type==="image_url");if(NK(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(gq,"hasImageContentInTurns");var Jvn=a((t,e)=>S.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),Zvn=S.Optional(S.Object({agentSlug:S.String(),state:S.Union([S.Literal("accepted"),S.Literal("dismissed")]),confirmation:S.Any()}));function Q3(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a(Q3,"parseToolCallArguments");function Xvn(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(Xvn,"toOpenAIToolCall");function eCn(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),sue(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=oue(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(eCn,"convertToChatCompletion");function aue(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(aue,"isChatCompletionContentPartArray");function NK(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(NK,"isChatMessageArray");function QS(t){if(typeof t=="string")return t;if(aue(t))return t;if(NK(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(QS,"resolveAsChatMessageContent");function Aq(t,e){return(typeof t=="string"||aue(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(Aq,"appendChatMessageContent");function vO(t,e){if(t){if(typeof t=="string"||aue(t))return[{role:"assistant",content:t}];if(NK(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(vO,"resolveResponseAsChatMessages");p();var ejt=new pe("streamMessages");function tCn(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(ejt.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),ejt.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),ejt.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=Ixe(e.solution,t),u={role:"assistant",content:s};return eCn(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(tCn,"prepareChatCompletionForReturn");jo();var QKe=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:nue(e,r.count),top_p:iue(e),n:r.count,stop:[` +`);return r+n}a(u7o,"truncateContentIfNeeded");var d7o=["requestSource","chatRequestModel","mapper","headerRequestId","mode","modelId","languageId","messageId","conversationId","uiKind"];function Pyn(t,e,r,n,o,s,c){let l=`${aE(e)}.${c}`,u=s.extendedBy(r,n);Et(t,l,u);let d={...r,uiKind:e||""};At(t,c,fU(d,d7o),n);let f={...r};o.currentFileContent!==void 0&&(f.completionTextJson=u7o(o.currentFileContent));let h=s.extendedBy(f,n);Et(t,`${l}.restricted`,h,1)}a(Pyn,"telemetryEditSurvivalTracking");var ic=(s=>(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:[` -`],copilot_thread_id:r.copilot_thread_id};r.modelConfiguration?.maxResponseTokens!==void 0&&(o.max_tokens=r.modelConfiguration.maxResponseTokens);let s=bY(r.repoInfo);if(s!==void 0&&(o.nwo=s),r.postOptions&&Object.assign(o,r.postOptions),r.enableThinking||r.modelConfiguration?.reasoningEfforts?.length){let c=yO(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(hq)||void 0;return s.postOptions?.stream===!1?{type:"success",chatCompletions:this.processNonStreamingResponse(r,n,o,c),getProcessingTime:a(()=>F3(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")??Gt(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:kn(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=kn(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=DK.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:bxe(u,f=>tCn(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>F3(r),"getProcessingTime")}}};p();p();p();var tE=de(xo());var rCn="ephemeral",tjt=4,nVo=2;function nCn(t){let e=tjt-nVo-iVo(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===tE.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===tE.Raw.ChatRole.Tool&&c?.role!==tE.Raw.ChatRole.Tool,d=s.role===tE.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===tE.Raw.ChatRole.User)||d)&&(s.content.push({type:tE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:rCn}),e--,e<=0))break;s.role===tE.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===tE.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===tE.Raw.ChatRole.User||o.role===tE.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:tE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:rCn})),o.role!==tE.Raw.ChatRole.User&&o.role!==tE.Raw.ChatRole.System)break}}a(nCn,"addCacheBreakpoints");function iVo(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===tE.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(iVo,"countCacheBreakpoints");function iCn(t){for(let e of t)e.content=e.content.filter(r=>r.type!==tE.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(iCn,"removeCacheBreakpoints");var sCn=new pe("messagesApi"),oVo="Please continue.";function aCn(t){let e=cVo(t.tools),r=sVo(t.messages,t.ctx);lVo(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:oVo}]});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(aCn,"buildMessagesApiRequest");function sVo(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=qKe(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=qKe(s.content);s.copilot_cache_control&&oCn(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=qKe(s.content);if(s.thinking&&aVo(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{sCn.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&&oCn(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=qKe(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(sVo,"convertToAnthropicMessages");function qKe(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(qKe,"convertContentToAnthropicBlocks");function aVo(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&&sCn.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(aVo,"addThinkingBlocks");function oCn(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(oCn,"applyCacheControlToLastBlock");function cVo(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(cVo,"convertToAnthropicTools");function lVo(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=tjt-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(lVo,"addToolsAndSystemCacheControl");p();p();var cue=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;rO3(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;r{try{if(A.data==="[DONE]")return;let y;try{y={type:A.type,...JSON.parse(A.data)}}catch(_){Rxe.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){Rxe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(cCn,"processMessagesApiStream");var rjt=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}}):Rxe.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 Rxe.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&&Rxe.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=oue(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 jKe=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 aCn({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(hq)||void 0;return{type:"success",chatCompletions:cCn(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>F3(r),"getProcessingTime")}}};p();p();p();p();var dCn=de(xo());var lr=class extends dCn.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?lCn(r):void 0,s=n?uCn(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?lCn(n):void 0,c=o?uCn(o):void 0;return this.renderCopilot(e,r,s,c)}};function lCn(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(lCn,"adaptProgressCallbackFromVSCode");function uCn(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(uCn,"adaptCancellationTokenFromVSCode");var fCn="phase_data",HKe=class extends lr{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:fCn,phase:e}})}};function GKe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===fCn&&typeof r.phase=="string")return r.phase}a(GKe,"rawPartAsPhaseData");p();var pCn="thinking",lue=class extends lr{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:pCn,thinking:e},tokenUsage:e.tokens??0})}};function $Ke(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===pCn&&r.thinking&&typeof r.thinking=="object")return r.thinking}a($Ke,"rawPartAsThinkingData");var qS=de(xo());function uVo(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=hCn(r);e.push({role:"system",content:n});break}case"user":{let n=hCn(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=fVo(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(uVo,"convertToResponsesApiInput");function dVo(t){let e=[];for(let r of t)switch(r.role){case qS.Raw.ChatRole.Assistant:if(r.content&&r.content.length>0){let n=pVo(r.content);e.push(...n)}if(r.content&&r.content.length>0){let n=[];for(let o of r.content)o.type===qS.Raw.ChatCompletionContentPartKind.Text&&o.text.trim()&&n.push({type:"output_text",text:o.text,annotations:[]});if(n.length>0){let o=hVo(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 qS.Raw.ChatRole.Tool:if(r.toolCallId&&r.content){let n=r.content.filter(s=>s.type===qS.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===qS.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 qS.Raw.ChatRole.User:if(r.content){let n=[];for(let o of r.content)o.type===qS.Raw.ChatCompletionContentPartKind.Text?n.push({type:"input_text",text:o.text}):o.type===qS.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 qS.Raw.ChatRole.System:if(r.content){let n=[];for(let o of r.content)o.type===qS.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(dVo,"convertRawMessagesToResponsesApiInput");function hCn(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(hCn,"convertMessageContentToInputParts");function fVo(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(fVo,"convertMessageContentToOutputParts");function pVo(t){let e=[];for(let r of t)if(r.type===qS.Raw.ChatCompletionContentPartKind.Opaque){let n=$Ke(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a(pVo,"extractReasoningFromRawMessage");function hVo(t){for(let e of t)if(e.type===qS.Raw.ChatCompletionContentPartKind.Opaque){let r=GKe(e);if(r)return r}}a(hVo,"extractPhaseFromRawMessage");function mCn(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=dVo(r).input:u=uVo(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(mCn,"buildResponsesApiRequest");p();var njt=new pe("responsesApiStream"),mVo=10,VKe=500,MK=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function gCn(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(gCn,"parseCallArguments");async function*ACn(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 ijt(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new cue(E=>{try{let _={type:E.type,...JSON.parse(E.data)},v=f.push(_,r);v&&h.push(v)}catch(_){m=_}},(E,_)=>{if(A.length>=mVo)return;let v=E.trim(),b=_?.trim(),T=v&&b?`${v}: ${b}`:v||b||"";T.length>0&&A.push(T.length>VKe?T.substring(0,VKe):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>VKe&&(_=_.substring(0,VKe)+"\u2026"),njt.error(t,`Non-SSE text received in stream for request ${u}: ${_}`),E?new MK(`The server disconnected unexpectedly while generating a response (${_}). The partial response above may be incomplete.`):new MK(`The server returned an error: ${_}`)}else if(E)throw njt.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new MK("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){njt.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a(ACn,"processResponsesApiStream");var ijt=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 Cxe=new fe("messagesApiStream");async function*s_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 tQt(t,n,u,d,o,c),h=[],m;try{let g=new iue(A=>{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(` `),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=gCn(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=gCn(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=oue(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 WKe=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return mCn({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??iue(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:yO(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}processResponse(e,r,n,o,s){let c=r.headers.get(hq)||void 0;return{type:"success",chatCompletions:ACn(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>F3(r),"getProcessingTime")}}};jk.register(new WKe);jk.register(new QKe);jk.register(new jKe);p();var zKe=require("fs"),jS=de(require("path"));function JKe(t){return Oae(()=>!!Ft(t,Ke.PromptPersistBasePath)?.trim(),!1)}a(JKe,"isPromptPersistEnabled");var gVo={mkdir:a((t,e)=>zKe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>zKe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>zKe.promises.appendFile(t,e,r),"appendFile")},Hk,YKe,ajt,ojt=new Map,yCn=0,sjt=new Map,cjt=new Map;function ljt(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(ljt,"formatHumanTimestamp");function ujt(t,e){return YKe||(YKe=AVo(t,e)),YKe}a(ujt,"getSharedProcessRoot");async function AVo(t,e){let r=ljt(new Date);Hk=jS.join(t,`pid-${process.pid}_${r}`),await e.mkdir(Hk,{recursive:!0});let n=new Date().toISOString();ajt=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:Hk};return await e.writeFile(jS.join(Hk,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await EVo(Hk,e).catch(()=>{}),await _Vo(Hk,e).catch(()=>{}),Hk}a(AVo,"initProcessRoot");async function yVo(t){if(Hk)try{let e=jS.join(Hk,"session.json"),r=new Date().toISOString(),n={createdAt:ajt??r,updatedAt:r,pid:process.pid,processRoot:Hk};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(yVo,"touchProcessRootSessionJson");function djt(t){return cjt.get(t)}a(djt,"getTurnDir");function ECn(){Hk=void 0,YKe=void 0,ajt=void 0,ojt.clear(),yCn=0,sjt.clear(),cjt.clear()}a(ECn,"resetSharedProcessRoot");async function EVo(t,e){await e.writeFile(jS.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=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 This directory contains persisted HTTP requests, LLM call logs, and tool-call trajectory data captured during a single CLS process. @@ -2465,7 +2508,7 @@ node generateHar.js http-log my-session.har \`\`\` Run from this directory, or pass absolute paths. -`,"utf8")}a(EVo,"writeReadme");async function _Vo(t,e){await e.writeFile(jS.join(t,"generateHar.js"),`#!/usr/bin/env node +`,"utf8")}a(RQo,"writeReadme");async function kQo(t,e){await e.writeFile(zS.join(t,"generateHar.js"),`#!/usr/bin/env node "use strict"; /** * Converts per-request JSON files from an http-log directory into a single HAR @@ -2534,51 +2577,51 @@ async function main() { } main().catch(e => { console.error(e); process.exit(1); }); -`,"utf8")}a(_Vo,"writeGenerateHarScript");var KKe=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??gVo}static{a(this,"LLMRequestPersistence")}isEnabled(){return!!this.getBasePath()}async ensureInitialized(){if(this.isEnabled())try{await this.ensureSessionDir()}catch{}}getBasePath(){return Ft(this.ctx,Ke.PromptPersistBasePath)?.trim()||void 0}ensureSessionDir(){return this.sessionDirPromise||(this.sessionDirPromise=this.initSessionDir()),this.sessionDirPromise}async initSessionDir(){let e=this.getBasePath(),r=await ujt(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=(ojt.get(this.conversationId)??0)+1;ojt.set(this.conversationId,l);let u=String(l).padStart(6,"0"),d=this.parentTurnId?djt(this.parentTurnId):void 0;if(this.subagentName&&d)this.sessionDir=jS.join(d,"runSubAgent",n,`${u}_${o}${c}`);else{let f=sjt.get(this.conversationId);f||(f=String(++yCn).padStart(6,"0"),sjt.set(this.conversationId,f)),this.sessionDir=jS.join(r,"conversations",`${f}_${n}`,`${u}_${o}${c}`)}await this.fileOps.mkdir(this.sessionDir,{recursive:!0}),cjt.set(this.turnId,this.sessionDir),await this.writeTurnMetadata(),yVo(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=jS.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=jS.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=jS.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=jS.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=jS.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 XKe=require("fs"),CO=de(require("path"));var _Cn=require("stream");var vVo={mkdir:a((t,e)=>XKe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>XKe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>XKe.promises.appendFile(t,e,r),"appendFile")},ZKe,eJe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??vVo,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(){ZKe=void 0,ECn(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return Ft(this.ctx,Ke.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return ZKe||(ZKe=this.initHttpLogDir()),ZKe}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 ujt(this.basePath,this.toPersistenceFileOps()),r=CO.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=djt(e);if(!r)return;let n=CO.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(CO.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(CO.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(CO.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(CO.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(CO.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(CO.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(CO.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},tJe=class extends YI{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 _Cn.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 OK=class t extends F_{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new pe("AutoModelService"),this._register(Es(this._ctx,()=>{this._autoModelCache.clear(),this._reserveToken=void 0,this._ongoingFetches.clear(),this._logger.info(this._ctx,"Auto model cache cleared due to token update")}))}static{a(this,"AutoModelService")}static{this.EXPIRY_THRESHOLD_MS=300*1e3}async resolveModelConfiguration(r,n){let o=this._autoModelCache.get(r);o||(o={},this._autoModelCache.set(r,o)),this._pruneExpiredTokens(o),!o.active&&o.standby&&(o.active=o.standby,o.standby=void 0),o.active||(o.active=await this._acquireActiveToken(r)),(!o.standby||!this._isTokenValid(o.standby)||this._isExpiringSoon(o.standby)||this._isExpiringSoon(o.active))&&this._refreshStandbyInBackground(r),this._ensureReserveRefill();let s=await this._ctx.get(Ss).getMetadata(),c=await this._ctx.get(Jc).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 s$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 rJe="Auto",Q_="auto";var Ro=class t{static{a(this,"ModelPickerUtils")}static async formatModelDisplayName(e,r,n){if(!r)return;let o=n?.trim();if(o){try{let u=(await new ca(e.get(zn)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(Ss).getMetadata()).find(u=>u.id===r);if(l)return`${l.name}`}catch{}return`${r}`}static async getModelConfiguration(e,r,n){let o=await e.get(Ut).getToken(),s=!!o.userInfo?.isTBBEnabled,c=!!o.userInfo?.isFreeUser,l=e.get(pu);if(!s&&l.quotaExhausted&&!c){let u=await e.get(Ss).getFallbackModel();if(u?.id)return e.get(Jc).getBestChatModelConfig([u.id])}if(r)return e.get(Jc).getBestChatModelConfig(_S(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===Q_)return await e.get(OK).resolveModelConfiguration(n??"unknown",o);let s=await e.get(Jc).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===Q_?Q_:(await e.get(Ss).getMetadata()).find(o=>o.capabilities.family===r&&o.capabilities.type==="chat"&&o.model_picker_enabled===!0)?.id}static transformMessages(e,r){return r===In.O1Ga||r===In.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}=fjt(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var Kp=new pe("fetchChat"),CVo=new Set([500,502,504]),bVo=[1e3,1e4,1e4],nJe=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(Lm(f)||!zI(f))throw f;Kp.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(IVo(l.status)){Kp.info(e,`Server returned ${l.status}, checking network connectivity before retry [${c}]`);let f=await this.retryAfterError(e,r,n,s,c);if(f&&"canceled"in f)return this.destroyResponseBody(e,l),f.canceled;f&&"response"in f&&(this.destroyResponseBody(e,l),l=f.response)}if(l.status!==200){let f=this.createTelemetryData(r.endpoint,e,r),h=await Ro.formatModelDisplayName(e,r.model,r.modelProviderName),m=await this.handleError(e,f,l,h,r.uiKind);return m.type==="failed"?{...m,ghRequestId:l.headers.get("x-github-request-id")||void 0}:m}e.get(pu).processQuotaHeaders(l.headers),e.get(EO).processRateLimitHeaders(l.headers);let u=jk.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){Kp.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 xVo(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){Kp.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}Kp.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=jk.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 Mvn(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await SVo(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`;Kp.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(Ut).resetToken("chat_messages",n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`,code:n.status};if(n.status===499)return Kp.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=vU(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return yt(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 Kp.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400){let f=U_.translate400Reason(c,o);if(f!==void 0)return{type:"failed",reason:f,code:n.status}}if(n.status===424)return{type:"failedDependency",reason:c};let u=n.headers.get("retry-after"),d=await e.get(Ut).getToken();return n.status===402?{type:"failed",reason:U_.translate402Reason(c,{retryAfterHeader:u??void 0,retryAfterSeconds:vU(n),copilotPlan:d.userInfo?.copilotPlan,isTBBEnabled:d.userInfo?.isTBBEnabled,canUpgradePlan:d.userInfo?.canUpgradePlan,overageEnabled:e.get(pu).overageEnabled}),code:n.status}:n.status===503?{type:"failed",reason:c,code:n.status}:(Kp.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function SVo(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=n===""&&o===""?r:Ia(r,n,o),b=d.extendedBy({endpoint:o,engineName:n,uiKind:u});FKe(c,b,["messages"]),b.properties.headerRequestId=s,Et(t,"request.sent",b);let T=pl(),w=Vvn(u),R={...Zm(t),...f.toCapiHeaders()};uL()&&(R=await o$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"]=wvn):R["api-key"]=h),g&&(R[hq]=g),A&&(R["copilot-session-token"]=A),o==="v1/messages"&&!E&&(R["anthropic-beta"]=RKe),c.messages&&c.messages.forEach(D=>{TVo(D)&&D.tool_calls&&(D.tool_calls=D.tool_calls.map(N=>Xvn(N)))});let P=Oae(()=>JKe(t)?new eJe(t):void 0,void 0);return DW(t,v,l,w,s,c,y,R,void 0,m,P,e,x).then(D=>{let N=L3(D);b.extendWithRequestId(N);let B=pl()-T;return b.measurements.totalTimeMs=B,Kp.info(t,`Request ${s} at <${v}> finished with ${D.status} status after ${B}ms`),Kp.debug(t,"request.response properties",b.properties),Kp.debug(t,"request.response measurements",b.measurements),Kp.debug(t,"messages:",JSON.stringify(e)),Et(t,"request.response",b),P?new tJe(D,P,s,T):D}).catch(D=>{if(Lm(D))throw D;let N=b.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",N),b.properties.message=String(Vh(D,"name")??""),b.properties.code=String(Vh(D,"code")??""),b.properties.errno=String(Vh(D,"errno")??""),b.properties.type=String(Vh(D,"type")??"");let B=pl()-T;throw b.measurements.totalTimeMs=B,Kp.info(t,`Request ${s} at <${v}> rejected with ${String(D)} after ${B}ms`),Kp.debug(t,"request.error properties",b.properties),Kp.debug(t,"request.error measurements",b.measurements),Et(t,"request.error",b),D}).finally(()=>{sue(t,e,b)})}a(SVo,"fetchWithInstrumentation");function TVo(t){return"tool_calls"in t}a(TVo,"isChatMessageWithToolCalls");function IVo(t){return CVo.has(t)}a(IVo,"shouldRetryStatusCode");async function xVo(t,e,r,n,o=bVo){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(Kp.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([AC(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await AC(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 Kp.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,Kp.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,Kp.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return Kp.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(xVo,"checkNetworkConnectivity");p();var wVo=[{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 iJe(t){let e=t.slice();return e.reverse(),vCn(e)||vCn(e.filter(r=>r.trim().length>0))}a(iJe,"isRepetitive");function vCn(t){let e=RVo(t);for(let r of wVo){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(RVo,"kmp_prefix_function");jo();var nc=class{constructor(e){this.ctx=e;this.fetcher=new nJe}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=Gt(),d={n:e.num_suggestions??1,temperature:e.temperature??0,stop:e.stop,top_p:e.topP??1,copilot_thread_id:e.copilot_thread_id,prediction:e.prediction},f=e.modelConfiguration;f&&(e.prediction?.content||delete d.prediction,e.prediction||e.modelConfiguration?.providerName===void 0&&f.maxResponseTokens!==void 0&&(d.max_tokens=f.maxResponseTokens),d.stream=!!f.stream),e.logitBias&&(d.logit_bias=e.logitBias);let h=e.chatModeKind==="Ask",m=await this.ctx.get(Ut).getToken(),g=!h&&Ft(this.ctx,Ke.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&Nvn(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=yO(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=Ft(this.ctx,Ke.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(!dq(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await _Ke(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===oo.Azure)if(e.modelConfiguration.deploymentUrl)A=fvn(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(Kle(e.modelConfiguration?.providerName))A=rue[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??_xe;A=EKe(e.modelConfiguration.deploymentUrl,D),y=dvn(D),e.authToken=E}}else{if(A=KI(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?DKe(this.ctx,f):!1;y=kKe(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=jk.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 B=x;if(await c.onRetry?.(B,N),B.type==="failed"&&B.retryAfter!==void 0&&B.retryAfter>0){let L=B.retryAfter;if(await new Promise(j=>{let M=setTimeout(()=>{O.dispose(),j()},L*1e3),O=r.onCancellationRequested(()=>{clearTimeout(M),O.dispose(),j()})}),r.isCancellationRequested)break}x=await this.fetch(R,o,r,n),yt(this.ctx,"request.throttled.retry",{requestSource:e.uiKind??"unknown",resultType:x.type,modelId:f?f.providerName?"custom-byok":f.modelId:"unknown"},{retryAfter:B.type==="failed"?B.retryAfter??-1:-1,resultCode:x.type==="failed"?x.code??-1:-1})}}let P=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,x,n,P,y),this.trackTurnCredits(e,x),Mae(()=>{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=Sxe(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:kn(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:kn(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=>kn(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 iJe(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(Lm(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 MK?!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(pu).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),yt(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var Wh=class{static{a(this,"ConversationInspector")}};p();p();var zh=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]}},pjt=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}}},hjt=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}}},cg=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 pjt(this._resolver(e),this.id,this.stepTitle)}processor(e){return new hjt(this._processor(e),this.id)}};p();p();var hu=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")}},uue=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new hu(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 CCn=new pe("EncodingConfigurationService"),bO=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),CCn.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),CCn.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var bCn=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 PVo=globalThis.performance&&typeof globalThis.performance.now=="function",oJe=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=PVo&&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 SCn=!1,kVo=!1,kxe;(M=>{M.None=a(()=>F_.None,"None");function e(O){if(kVo){let{onDidAddListener:q}=O,Q=Pxe.create(),U=0;O.onDidAddListener=()=>{++U===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),Q.print()),q?.()}}}a(e,"_addLeakageTraceLogic");function r(O,q){return g(O,()=>{},0,void 0,!0,void 0,q)}M.defer=r,a(r,"defer");function n(O){return(q,Q=null,U)=>{let z=!1,$;return $=O(W=>{if(!z)return $?$.dispose():z=!0,q.call(Q,W)},null,U),z&&$.dispose(),$}}M.once=n,a(n,"once");function o(O,q){return M.once(M.filter(O,q))}M.onceIf=o,a(o,"onceIf");function s(O,q,Q){return h((U,z=null,$)=>O(W=>U.call(z,q(W)),null,$),Q)}M.map=s,a(s,"map");function c(O,q,Q){return h((U,z=null,$)=>O(W=>{q(W),U.call(z,W)},null,$),Q)}M.forEach=c,a(c,"forEach");function l(O,q,Q){return h((U,z=null,$)=>O(W=>q(W)&&U.call(z,W),null,$),Q)}M.filter=l,a(l,"filter");function u(O){return O}M.signal=u,a(u,"signal");function d(...O){return(q,Q=null,U)=>{let z=Ivn(...O.map($=>$(W=>q.call(Q,W))));return m(z,U)}}M.any=d,a(d,"any");function f(O,q,Q,U){let z=Q;return s(O,$=>(z=q(z,$),z),U)}M.reduce=f,a(f,"reduce");function h(O,q){let Q,U={onWillAddFirstListener(){Q=O(z.fire,z)},onDidRemoveLastListener(){Q?.dispose()}};q||e(U);let z=new HS(U);return q?.add(z),z.event}a(h,"snapshot");function m(O,q){return q instanceof Array?q.push(O):q&&q.add(O),O}a(m,"addAndReturnDisposable");function g(O,q,Q=100,U=!1,z=!1,$,W){let J,ne,H,re=0,ae,Be={leakWarningThreshold:$,onWillAddFirstListener(){J=O(Ue=>{re++,ne=q(ne,Ue),U&&!H&&(ve.fire(ne),ne=void 0),ae=a(()=>{let Pe=ne;ne=void 0,H=void 0,(!U||re>1)&&ve.fire(Pe),re=0},"doFire"),typeof Q=="number"?(clearTimeout(H),H=setTimeout(ae,Q)):H===void 0&&(H=0,queueMicrotask(ae))})},onWillRemoveListener(){z&&re>0&&ae?.()},onDidRemoveLastListener(){ae=void 0,J.dispose()}};W||e(Be);let ve=new HS(Be);return W?.add(ve),ve.event}M.debounce=g,a(g,"debounce");function A(O,q=0,Q){return M.debounce(O,(U,z)=>U?(U.push(z),U):[z],q,void 0,!0,void 0,Q)}M.accumulate=A,a(A,"accumulate");function y(O,q=(U,z)=>U===z,Q){let U=!0,z;return l(O,$=>{let W=U||!q($,z);return U=!1,z=$,W},Q)}M.latch=y,a(y,"latch");function E(O,q,Q){return[M.filter(O,q,Q),M.filter(O,U=>!q(U),Q)]}M.split=E,a(E,"split");function _(O,q=!1,Q=[],U){let z=Q.slice(),$=O(ne=>{z?z.push(ne):J.fire(ne)});U&&U.add($);let W=a(()=>{z?.forEach(ne=>J.fire(ne)),z=null},"flush"),J=new HS({onWillAddFirstListener(){$||($=O(ne=>J.fire(ne)),U&&U.add($))},onDidAddFirstListener(){z&&(q?setTimeout(W):W())},onDidRemoveLastListener(){$&&$.dispose(),$=null}});return U&&U.add(J),J.event}M.buffer=_,a(_,"buffer");function v(O,q){return a((U,z,$)=>{let W=q(new T);return O(function(J){let ne=W.evaluate(J);ne!==b&&U.call(z,ne)},void 0,$)},"fn")}M.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(q){return this.steps.push(q),this}forEach(q){return this.steps.push(Q=>(q(Q),Q)),this}filter(q){return this.steps.push(Q=>q(Q)?Q:b),this}reduce(q,Q){let U=Q;return this.steps.push(z=>(U=q(U,z),U)),this}latch(q=(Q,U)=>Q===U){let Q=!0,U;return this.steps.push(z=>{let $=Q||!q(z,U);return Q=!1,U=z,$?z:b}),this}evaluate(q){for(let Q of this.steps)if(q=Q(q),q===b)break;return q}}function w(O,q,Q=U=>U){let U=a((...J)=>W.fire(Q(...J)),"fn"),z=a(()=>O.on(q,U),"onFirstListenerAdd"),$=a(()=>O.removeListener(q,U),"onLastListenerRemove"),W=new HS({onWillAddFirstListener:z,onDidRemoveLastListener:$});return W.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(O,q,Q=U=>U){let U=a((...J)=>W.fire(Q(...J)),"fn"),z=a(()=>O.addEventListener(q,U),"onFirstListenerAdd"),$=a(()=>O.removeEventListener(q,U),"onLastListenerRemove"),W=new HS({onWillAddFirstListener:z,onDidRemoveLastListener:$});return W.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(O,q){return new Promise(Q=>n(O)(Q,null,q))}M.toPromise=x,a(x,"toPromise");function P(O){let q=new HS;return O.then(Q=>{q.fire(Q)},()=>{q.fire(void 0)}).finally(()=>{q.dispose()}),q.event}M.fromPromise=P,a(P,"fromPromise");function D(O,q){return O(Q=>q.fire(Q))}M.forward=D,a(D,"forward");function N(O,q,Q){return q(Q),O(U=>q(U))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class B{constructor(q,Q){this._observable=q;this._counter=0;this._hasChanged=!1;let U={onWillAddFirstListener:a(()=>{q.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{q.removeObserver(this)},"onDidRemoveLastListener")};Q||e(U),this.emitter=new HS(U),Q&&Q.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(q){this._counter++}handlePossibleChange(q){}handleChange(q,Q){this._hasChanged=!0}endUpdate(q){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function L(O,q){return new B(O,q).emitter.event}M.fromObservable=L,a(L,"fromObservable");function j(O){return(q,Q,U)=>{let z=0,$=!1,W={beginUpdate(){z++},endUpdate(){z--,z===0&&(O.reportChanges(),$&&($=!1,q.call(Q)))},handlePossibleChange(){},handleChange(){$=!0}};O.addObserver(W),O.reportChanges();let J={dispose(){O.removeObserver(W)}};return U instanceof fq?U.add(J):Array.isArray(U)&&U.push(J),J}}M.fromObservableLight=j,a(j,"fromObservableLight")})(kxe||={});var mjt=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 oJe,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}}},TCn=-1;var gjt=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 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||r{if(t instanceof due)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new gjt(e?.onListenerError??Jle,this._options?.leakWarningThreshold??TCn):void 0,this._perfMon=this._options?._profName?new mjt(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(SCn){let e=this._listeners;queueMicrotask(()=>{MVo(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 yjt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||Jle)(f),F_.None}if(this._disposed)return F_.None;r&&(e=e.bind(r));let o=new due(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Pxe.create(),s=this._leakageMon.check(o.stack,this._size+1)),SCn&&(o.stack=c??Pxe.create()),this._listeners?this._listeners instanceof due?(this._deliveryQueue??=new Ejt,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=xKe(()=>{s?.(),this._removeListener(o)});return n instanceof fq?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*NVo<=r.length){let s=0;for(let c=0;c0}};var Ejt=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 ICn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),OVo;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof _jt?!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:kxe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ICn})})(OVo||={});var _jt=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?ICn:(this._emitter||(this._emitter=new HS),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function LVo(t){return t}a(LVo,"identity");var sJe=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=LVo):(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 yq=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 vjt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(vjt,"escapeRegExpCharacters");function kCn(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(kCn,"ltrim");function aJe(t){return t.split(/\r\n|\r|\n/)}a(aJe,"splitLines");function Cjt(t,e){return te?1:0}a(Cjt,"compare");function cJe(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(cJe,"compareSubstring");function bjt(t,e){return Nxe(t,e,0,t.length,0,e.length)}a(bjt,"compareIgnoreCase");function Nxe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return cJe(t.toLowerCase(),e.toLowerCase(),r,n,o,s);xCn(u)&&(u-=32),xCn(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(Nxe,"compareSubstringIgnoreCase");function xCn(t){return t>=97&&t<=122}a(xCn,"isLowerAsciiLetter");function DCn(t,e){let r=e.length;return e.length>t.length?!1:Nxe(t,e,0,r)===0}a(DCn,"startsWithIgnoreCase");function fue(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(FVo,"startsWithUTF8BOM");function NCn(t){return FVo(t)?t.substr(1):t}a(NCn,"stripUTF8BOM");var wCn=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=UVo()}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 UVo(){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(UVo,"getGraphemeBreakRawData");var RCn=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new yq(()=>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 sJe({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 yq(()=>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;rMCn)return{status:"notfound",message:"File too large"};let c=await $le(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:RS.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=ro(e);if(sa.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(sa),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof hu))throw c}let o=(await this.ctx.get($o).stat(e)).size/1024/1024;return o>MCn?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(bO).getEncodingForFile(e)}catch(o){if(!(o instanceof hu))throw o}let n=await this.ctx.get($o).readFileString(e,r);return NCn(n)}};p();function Oxe(t){for(var e=[],r=1;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;rr.status!=="in-progress"&&(r.response===void 0||r.response?.type==="model")),e}a(OCn,"filterConversationTurns");function Tjt(t){return OCn(t).getLastTurn()?.id}a(Tjt,"getLastTurnId");async function BCn(t){let e=OCn(t.conversation),r=Tjt(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(lg).getDump(r),s=jVo(o,e.turns);Nr.debug(t.ctx,`conversation.dump +`)),c+=h+n[u+1]}),c}a(wxe,"dedent");var is=wxe;var bQt=class{constructor(){this.resolvedSkills={};this.resolutions=[]}static{a(this,"SkillDump")}},Ag=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 bQt,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 N_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(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 `,` -`+s);let c=await HVo(o,t.ctx);return es` - ${qVo(t.conversation,r)} - ${QVo(t.ctx)} +`+s);let c=await XQo(o,t.ctx);return is` + ${JQo(t.conversation,r)} + ${KQo(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(BCn,"getConversationDump");function QVo(t){let e=t.get(Ir);return es` + `}a(M_n,"getConversationDump");function KQo(t){let e=t.get(Ir);return is` - IDE: \`${e.getEditorInfo().name} (${e.getEditorInfo().version})\` - Plugin: \`${e.getEditorPluginInfo().version}\` - `}a(QVo,"getEditorInfoDumpMessage");function qVo(t,e){return es` + `}a(KQo,"getEditorInfoDumpMessage");function JQo(t,e){return is` Debug information for the last turn of the conversation. - ConversationId: \`${t.id}\` - MessageId: \`${e}\` - `}a(qVo,"getInfoDumpMessage");async function LCn(t,e,r){let n=t.ctx.get(zh),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(Wo).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&&kn(t.turn.request.message).trim().length>0&&(o+=` + `}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+=` +- ${c.id}`;t.turn.request.message&&Pn(t.turn.request.message).trim().length>0&&(o+=` -**User message**: ${kn(t.turn.request.message)}`);for(let c of s){o+=` -## ${c.id}`,o+=es` +**User message**: ${Pn(t.turn.request.message)}`);for(let c of s){o+=` +## ${c.id}`,o+=is` \n\n **Description** - ${c.description()}`;let l=n.getSkill(c.id),u=await l?.resolver(t).resolveSkill(t);if(u){o+=es` + ${c.description()}`;let l=n.getSkill(c.id),u=await l?.resolver(t).resolveSkill(t);if(u){o+=is` \n\n **Resolution** \`\`\`yaml - ${_K(u)} - \`\`\``;let d=await l?.processor(t).processSkill(u,t);if(d){let f=typeof d=="string"?d:d.elide(1e3).getText();o+=es` + ${fK(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** @@ -2586,17 +2629,17 @@ ${c}`:""} **Unprocessable**`}else o+=` -**Unresolvable**`}return o}a(LCn,"getSkillsDump");function jVo(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:kn(n.request.message)};return n.response&&(s.response=kn(n.response.message)),s})};return _K(r)}a(jVo,"toSimulationFormat");async function HVo(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: +**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 `,u),o+=` **${s.uri}** \`\`\`${l?.detectedLanguageId} ${u} -\`\`\``}return o}a(HVo,"fileDump");p();function Ijt(t,e){let r=Ts(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(kn(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(Ijt,"countMessagesTokens");p();function FCn(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(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(` `),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(FCn,"chatBasePrompt");p();p();async function Eq(t){return!!(await t.get(Ut).getToken()).userInfo?.isTBBEnabled}a(Eq,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function uJe(t){return!!t&&typeof t.then=="function"}a(uJe,"isThenable");var lJe=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 Mc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Mc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var GVo;(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")})(GVo||={});var UCn=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 HS,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 dJe=!1,fJe=!1,Bxe=!1,$Vo=!1,VVo=!1,QCn=!1,WVo=!1,zVo=!1,YVo=!1,KVo=!1;var q3,j3=globalThis,Jx;typeof j3.vscode<"u"&&typeof j3.vscode.process<"u"?Jx=j3.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Jx=process);var qCn=typeof Jx?.versions?.electron=="string",JVo=qCn&&Jx?.type==="renderer";typeof Jx=="object"?(dJe=Jx.platform==="win32",fJe=Jx.platform==="darwin",Bxe=Jx.platform==="linux",$Vo=Bxe&&!!Jx.env.SNAP&&!!Jx.env.SNAP_REVISION,WVo=qCn,YVo=!!Jx.env.CI||!!Jx.env.BUILD_ARTIFACTSTAGINGDIRECTORY,VVo=!0):typeof navigator=="object"&&!JVo?(q3=navigator.userAgent,dJe=q3.indexOf("Windows")>=0,fJe=q3.indexOf("Macintosh")>=0,zVo=(q3.indexOf("Macintosh")>=0||q3.indexOf("iPad")>=0||q3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Bxe=q3.indexOf("Linux")>=0,KVo=q3?.indexOf("Mobi")>=0,QCn=!0):console.error("Unable to resolve platform.");var xjt=0;fJe?xjt=1:dJe?xjt=3:Bxe&&(xjt=2);var wjt=dJe,jCn=fJe,HCn=Bxe;var ZVo=QCn&&typeof j3.importScripts=="function",Ged=ZVo?j3.origin:void 0;var SO=q3;var XVo=typeof j3.postMessage=="function"&&!j3.importScripts,$ed=(()=>{if(XVo){let t=[];j3.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}),j3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var eWo=!!(SO&&SO.indexOf("Chrome")>=0),Ved=!!(SO&&SO.indexOf("Firefox")>=0),Wed=!!(!eWo&&SO&&SO.indexOf("Safari")>=0),zed=!!(SO&&SO.indexOf("Edg/")>=0),Yed=!!(SO&&SO.indexOf("Android")>=0);var BK,Rjt=globalThis.vscode;if(typeof Rjt<"u"&&typeof Rjt.process<"u"){let t=Rjt.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 wjt?"win32":jCn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var Lxe=BK.cwd,GCn=BK.env,$Cn=BK.platform,ttd=BK.arch;var rWo=65,nWo=97,iWo=90,oWo=122,Cq=46,ug=47,UC=92,_q=58,sWo=63,pJe=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 aWo(t,e){if(t===null||typeof t!="object")throw new pJe(e,"Object",t)}a(aWo,"validateObject");function rp(t,e){if(typeof t!="string")throw new pJe(e,"string",t)}a(rp,"validateString");var QC=$Cn==="win32";function ts(t){return t===ug||t===UC}a(ts,"isPathSeparator");function Pjt(t){return t===ug}a(Pjt,"isPosixPathSeparator");function vq(t){return t>=rWo&&t<=iWo||t>=nWo&&t<=oWo}a(vq,"isWindowsDeviceRoot");function hJe(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===Cq&&l!==-1?++l:l=-1}return o}a(hJe,"normalizeString");function cWo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(cWo,"formatExt");function VCn(t,e){aWo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${cWo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(VCn,"_format");var Yh={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],rp(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=Lxe():(s=GCn[`=${e}`]||Lxe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===UC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)ts(f)&&(l=1,d=!0);else if(ts(f))if(d=!0,ts(s.charCodeAt(1))){let h=2,m=h;for(;h2&&ts(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=hJe(r,!n,"\\",ts),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){rp(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return Pjt(s)?"\\":t;if(ts(s))if(o=!0,ts(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ts(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&ts(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){rp(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return ts(r)||e>2&&vq(r)&&t.charCodeAt(1)===_q&&ts(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"&&ts(r.charCodeAt(0))){++o;let s=r.length;s>1&&ts(r.charCodeAt(1))&&(++o,s>2&&(ts(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Yh.normalize(e)},relative(t,e){if(rp(t,"from"),rp(e,"to"),t===e)return"";let r=Yh.resolve(t),n=Yh.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===UC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===UC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===UC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===UC?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)===UC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===UC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Yh.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===UC){if(e.charCodeAt(1)===UC){let r=e.charCodeAt(2);if(r!==sWo&&r!==Cq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(vq(e.charCodeAt(0))&&e.charCodeAt(1)===_q&&e.charCodeAt(2)===UC)return`\\\\?\\${e}`;return t},dirname(t){rp(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return ts(o)?t:".";if(ts(o)){if(r=n=1,ts(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ts(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(ts(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&&rp(e,"suffix"),rp(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&vq(t.charCodeAt(0))&&t.charCodeAt(1)===_q&&(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(ts(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(ts(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){rp(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===_q&&vq(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(ts(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===Cq?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:VCn.bind(null,"\\"),parse(t){rp(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 ts(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(ts(o)){if(n=1,ts(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),ts(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===Cq?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},lWo=(()=>{if(QC){let t=/\\/g;return()=>{let e=Lxe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Lxe()})(),yf={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:lWo();rp(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===ug)}return e=hJe(e,!r,"/",Pjt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(rp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===ug,r=t.charCodeAt(t.length-1)===ug;return t=hJe(t,!e,"/",Pjt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return rp(t,"path"),t.length>0&&t.charCodeAt(0)===ug},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?".":yf.normalize(e)},relative(t,e){if(rp(t,"from"),rp(e,"to"),t===e||(t=yf.resolve(t),e=yf.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)===ug)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===ug?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===ug)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(rp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===ug,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===ug){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&&rp(e,"ext"),rp(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===ug){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)===ug){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){rp(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===ug){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===Cq?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:VCn.bind(null,"/"),parse(t){rp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===ug,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===ug){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===Cq?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};yf.win32=Yh.win32=Yh;yf.posix=Yh.posix=yf;var uWo=QC?Yh.normalize:yf.normalize,dWo=QC?Yh.isAbsolute:yf.isAbsolute,mJe=QC?Yh.join:yf.join,ntd=QC?Yh.resolve:yf.resolve,itd=QC?Yh.relative:yf.relative,otd=QC?Yh.dirname:yf.dirname,WCn=QC?Yh.basename:yf.basename,zCn=QC?Yh.extname:yf.extname,std=QC?Yh.format:yf.format,atd=QC?Yh.parse:yf.parse,ctd=QC?Yh.toNamespacedPath:yf.toNamespacedPath,LK=QC?Yh.sep:yf.sep,ltd=QC?Yh.delimiter:yf.delimiter;p();p();function FK(t,e="unexpected state"){if(!t)throw new Mc(`Assertion Failed: ${e}`)}a(FK,"assert");function kjt(t){if(!t()){debugger;t(),Jle(new Mc("Assertion Failed"))}}a(kjt,"assertFn");function Fxe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!DCn(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(YCn,"isEqualOrParent");var gJe="**",KCn="/",AJe="[/\\\\]",yJe="[^/\\\\]",pWo=/\//g;function JCn(t,e){switch(t){case 0:return"";case 1:return`${yJe}*?`;default:return`(?:${AJe}|${yJe}+${AJe}${e?`|${AJe}${yJe}+`:""})*?`}}a(JCn,"starsToRegExp");function Uxe(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(Uxe,"splitGlobAware");function tbn(t){if(!t)return"";let e="",r=Uxe(t,KCn);if(r.every(n=>n===gJe))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===gJe){if(n)return;e+=JCn(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===KCn?h="":h=vjt(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${Uxe(l,",").map(g=>tbn(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=yJe;continue;case"*":e+=JCn(1);continue;default:e+=vjt(f)}}sMjt(l,e)).filter(l=>l!==Gk),t),n=r.length;if(!n)return Gk;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(CWo,"trivia3");function ebn(t,e,r){let n=LK===yf.sep,o=n?t:t.replace(pWo,LK),s=LK+o,c=yf.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(ebn,"trivia4and5");function bWo(t){try{let e=new RegExp(`^${tbn(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return Gk}}a(bWo,"toRegExp");function nbn(t,e,r){return!t||typeof e!="string"?!1:Ojt(t)(e,void 0,r)}a(nbn,"match");function Ojt(t,e={}){if(!t)return Njt;if(typeof t=="string"||SWo(t)){let r=Mjt(t,e);if(r===Gk)return Njt;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 TWo(t,e)}a(Ojt,"parse");function SWo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(SWo,"isRelativePattern");function TWo(t,e){let r=ibn(Object.getOwnPropertyNames(t).map(l=>IWo(l,t[l],e)).filter(l=>l!==Gk)),n=r.length;if(!n)return Gk;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(TWo,"parsedExpression");function IWo(t,e,r){if(e===!1)return Gk;let n=Mjt(t,r);if(n===Gk)return Gk;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 uJe(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(IWo,"parseExpressionPattern");function ibn(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(ibn,"aggregateBasenameMatches");function obn(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return xWo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(obn,"validate");function sbn(t,e){let r=Uxe(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(nbn(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(sbn,"matches");function xWo(t){try{let e=Uxe(t,",");if(e.length===0)return!1;for(let r of e){let n=Ojt(r);if(rbn(n))return!1}return!0}catch{return!1}}a(xWo,"isValidGlob");var cbn=de(require("path"));var Kh={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var Ljt=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 k3(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||Yle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return sq(this.promptFileEntry.promptPath)}},lbn={name:"copilot-instructions",source:Kh.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},ubn={name:"git-commit-instructions",source:Kh.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},dbn={name:"agents-md-instructions",source:Kh.agentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["AGENTS.md"]},wWo={name:"nested-agents-md-instructions",source:Kh.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},fbn={name:"claude-md-instructions",source:Kh.claudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},RWo={name:"nested-claude-md-instructions",source:Kh.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},PWo=[lbn,ubn,dbn,wWo,fbn,RWo],kWo={name:"instruction-file",source:Kh.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},Bjt={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},DWo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function abn(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(abn,"optionKey");function Fjt(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=abn(n);if(!(o in Bjt)||(r=!0,!(e[o]??Bjt[o])))continue;let c=DWo[n];if(c){let l=abn(c);if(!(e[l]??Bjt[l]))continue}return!0}return r?!1:void 0}a(Fjt,"shouldIncludeSource");var Ujt=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)Fjt([n],e)!==!1&&r.push(...o);return r}},NWo=new hO;function MWo(t,e,r,n,o){if(!t)return;let s=`${oq}${e}`,c=NWo.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:k3(o?[{providers:o}]:void 0)}}a(MWo,"resolveContent");var UK=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?MWo(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(cbn.default.posix.join(g.path,h)):g.type==="file"&&m.add(gn(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 OWo(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(OWo,"stripSource");var BWo="workspace",Ef=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new Ujt;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[Kh.copilotInstructions,new UK(lbn,this.inMemoryManager,n)],[Kh.gitCommitInstructions,new UK(ubn,this.inMemoryManager,n)],[Kh.agentsMdInstructions,new UK(dbn,this.inMemoryManager,n)],[Kh.claudeMdInstructions,new UK(fbn,this.inMemoryManager,n)],[Kh.customInstructionFiles,new UK(kWo,this.inMemoryManager,n)]]);for(let o of PWo)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(Kh.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e,r){return(await this.ctx.get(ig).collect(this.ctx,"instructions",e,{includePlugins:r?.includePlugins})).map(o=>new Ljt(o))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=BWo){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=Kh.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(OWo(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:Kh.customInstructionFiles}));this.dispatchToSlots(r,"global-instruction-files")}getGlobalInstructionFiles(){return this.inMemoryManager.get(Kh.customInstructionFiles)}setGlobalCopilotInstructions(e){let r=e?[{...e,source:Kh.copilotInstructions}]:[];this.dispatchToSlots(r,"global-copilot-instructions")}setGlobalGitCommitInstructions(e){let r=e?[{...e,source:Kh.gitCommitInstructions}]:[];this.dispatchToSlots(r,"global-git-commit-instructions")}setGlobalAgentsMdInstructions(e){let r=e?[{...e,source:Kh.agentsMdInstructions}]:[];this.dispatchToSlots(r,"global-agents-md-instructions")}setGlobalClaudeMdInstructions(e){let r=e?[{...e,source:Kh.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(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(` ${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."} @@ -2604,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=obn(n);return o.isValid&&!!sbn(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=Fjt(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&&Fjt(o.source,r)!==void 0).length;yt(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function bq(t,e){if(t.length==0)return new yr([]);let r=t.map((n,o)=>{let s;switch(e){case"linear":s=1-o/t.length;break;case"inverseLinear":s=(o+1)/t.length;break;case"positional":s=1/(o+1);break;case"inversePositional":s=1/(t.length-o);break}return Array.isArray(n)&&n.length==2&&(s*=n[1],n=n[0]),[n,s]});return new yr(r)}a(bq,"weighElidableList");p();function pbn(t){let e=t.split(` -`),r=[],n=!1,o=[];for(let s of e)s.startsWith("```")?(n?(r.push([xS(o.join(` -`)),1]),o=[],r.push([new yr([s]),1])):r.push([new yr([s]),1]),n=!n):n?o.push(s):r.push([new yr([s]),.8]);return n&&(r.push([xS(o.join(` -`)),1]),r.push([new yr(["```"]),1])),new yr(r)}a(pbn,"fromMessage");function pue(t){let e=qjt(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=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;n1&&n!==e.length-1?` -`:"")),r.push(pbn(l))}return r.length>0?new yr([[new yr(["Consider the following conversation history:"]),1],[bq(r,"inverseLinear"),1]]):null}a(pue,"fromHistory");var LWo=5;function qjt(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&kn(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,LWo).reverse()}a(qjt,"filterTurns");function hbn(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=kn(t.message).startsWith("```")?` -`:" ";return`${e>0?`${e}) `:""}${r}:${n}${kn(t.message)}`}a(hbn,"formatTurnMessage");p();p();p();var FWo=4,jjt={skillIds:[]},EJe=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"MetaPromptFetcher")}async fetchPromptContext(e,r,n,o,s){let c=e.conversation.getLastTurn().request.message;if(r.length>0){let l=await Ro.getModelConfiguration(e.ctx,"meta",{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(SA).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(Wh).inspectFetchResult(m),this.handleResult(m,f,kn(c),s,d.toolConfig)}else return jjt}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),jjt;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,FWo);else return ot.error(this.ctx,"Missing tool call in meta prompt response"),jjt;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,`${eE(o)}.metaPrompt`,u,0),Et(this.ctx,`${eE(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 TO=class{constructor(e,r,n){this.doc=e;this.selection=r;this.visibleRange=n}static{a(this,"ElidableDocument")}fromSelectedCode(e){let r=this.getExpandedSelection(),n=r;if(e.trimNewLines){let s=this.doc.getText(r),c=s.match(/^\n*/)?.[0].length??0,l=s.match(/\n*$/)?.[0].length??0;n={start:this.getLineStart(r.start.line+c),end:this.expandLineToEnd(r.end.line-l)}}let o=new yr([es(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!hue(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:xS(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||hue(this.selection)}getExpandedSelection(){return this.selection!==void 0?{start:this.getLineStart(this.selection.start.line),end:this.expandLineToEnd(this.selection.end.line)}:this.getDocumentRange()}getDocumentRange(){return{start:this.getLineStart(0),end:this.expandLineToEnd(this.doc.lineCount-1)}}getLineStart(e){return{line:e,character:0}}expandLineToEnd(e){return e>this.doc.lineCount-1&&(e=this.doc.lineCount-1),{line:e,character:this.doc.lineAt({line:e,character:0}).text.length}}rangeContainedIn(e,r){return e.start.line<=r.start.line&&e.end.line>=r.end.line}rangeEquals(e,r){return e.start.line==r.start.line&&e.end.line==r.end.line}wrapInTicks(e,r){return new yr([["```"+this.doc.detectedLanguageId,1],[e,r??1],["```",1]])}addLineNumbers(e){let r=this.doc.getText(e).split(` +`:"")),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(` `),n=this.doc.lineCount.toString().length;return r.map((s,c)=>`${(e.start.line+c+1).toString().padEnd(n," ")}:${s}`).join(` -`)}};function hue(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(hue,"isEmptyRange");p();p();var mbn=de(ri()),gbn=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({}))}),Hjt;(r=>(r.method="github/didChangeAuth",r.type=new mbn.ProtocolNotificationType(r.method)))(Hjt||={});p();var Abn=de(ri()),Gjt;(r=>(r.method="copilot/ipCodeCitation",r.type=new Abn.NotificationType(r.method)))(Gjt||={});p();var ybn=de(ri()),_Je;(r=>(r.method="context/update",r.type=new ybn.ProtocolRequestType(r.method)))(_Je||={});p();p();p();var jn=de(ri()),Qxe=S.String(),qC=S.Object({uri:Qxe}),QK=S.Intersect([qC,S.Object({version:S.Optional(S.Integer())})]),end=S.Required(QK),n0=S.Object({line:S.Integer({minimum:0}),character:S.Integer({minimum:0})}),_f=S.Object({start:n0,end:n0}),$jt=S.Union([S.Integer(),S.String()]),tnd=S.Object({isCancellationRequested:S.Boolean(),onCancellationRequested:S.Any()});p();var Ebn=de(ri()),Vjt;(r=>(r.method="textDocument/didFocus",r.type=new Ebn.ProtocolNotificationType(r.method)))(Vjt||={});p();var UWo=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()}),QWo=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),_bn=S.Object({name:S.String(),version:S.Optional(S.String()),readableName:S.Optional(S.String())}),vbn=S.Object({editorInfo:S.Optional(_bn),editorPluginInfo:S.Optional(_bn),relatedPluginInfo:S.Optional(S.Array(QWo)),copilotIntegrationId:S.Optional(S.String()),copilotCapabilities:S.Optional(S.Partial(UWo)),githubAppId:S.Optional(S.String()),sessionId:S.Optional(S.String())});p();var qxe=de(ri());var Wjt=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(Wjt||{}),qWo=S.Enum(Wjt),jWo=S.Object({triggerKind:qWo,selectedCompletionInfo:S.Optional(S.Object({text:S.String(),range:_f,tooltipSignature:S.Optional(S.String())}))}),Cbn=S.Object({textDocument:QK,position:n0,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:jWo,data:S.Optional(S.Unknown())}),zjt;(r=>(r.method="textDocument/inlineCompletion",r.type=new qxe.ProtocolRequestType(r.method)))(zjt||={});var bbn=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),Sbn=S.Object({item:bbn}),Yjt;(r=>(r.method="textDocument/didShowCompletion",r.type=new qxe.ProtocolNotificationType(r.method)))(Yjt||={});var Tbn=S.Object({item:bbn,acceptedLength:S.Integer({minimum:1})}),Kjt;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new qxe.ProtocolNotificationType(r.method)))(Kjt||={});p();var Ibn=de(ri()),HWo;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new Ibn.ProtocolRequestType(r.method)))(HWo||={});p();var xbn=de(ri()),GWo=S.Object({severity:S.Union([S.Literal("error"),S.Literal("warning")]),message:S.String(),range:_f,code:S.Optional(S.Union([S.String(),S.Number()])),source:S.Optional(S.String())}),wbn=S.Object({textDocument:QK,position:n0,diagnostics:S.Optional(S.Array(GWo))}),$Wo=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),Rbn=S.Object({item:$Wo}),Jjt;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new xbn.ProtocolNotificationType(r.method)))(Jjt||={});p();var vJe=de(ri());var Pbn=S.Object({textDocument:QK,position:n0,partialResultToken:S.Optional($jt),workDoneToken:S.Optional($jt)}),CJe;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new vJe.ProtocolRequestType(n.method),n.partialResult=new vJe.ProgressType))(CJe||={});p();var kbn=de(ri()),Zjt;(r=>(r.method="copilot/related",r.type=new kbn.ProtocolRequestType(r.method)))(Zjt||={});p();var Xjt=de(ri()),eHt;(r=>(r.method="statusNotification",r.type=new Xjt.ProtocolNotificationType(r.method)))(eHt||={});var tHt;(r=>(r.method="didChangeStatus/v2",r.type=new Xjt.ProtocolNotificationType(r.method)))(tHt||={});var Dbn=de(require("path"));var Nbn=S.Object({uri:S.String(),visibleRange:S.Optional(_f),selection:S.Optional(_f)}),rHt=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=ed(n);if(await this.turnContext.collectFile(rE,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new TO(n.document,e.selection,e.visibleRange),l=r.getRelativePath(n.document);if(o==="empty")return new yr([`The currently open file \`${l}\` is empty.`]);let u=[[`Code excerpt from the currently open file \`${l}\`:`,1],[c.fromAllCode({addLineNumbers:s}),1]],d=[];if(c.selectionIsDocument())d=[["The user is selecting the entire file.",1]];else if(s){let[f,h]=c.fromSelectedCode({trimNewLines:!0}),m=h.start.line+1;if(hue(h))d=[[`The user is selecting line ${m}, which is empty.`,1]];else{let g=h.end.line+1;d=[["The user is selecting"+(m==g?` line ${m}:`:` lines ${m} to ${g} (inclusive):`),1],[f,1]]}}else c.selectionIsEmpty()||(d=[["The user is selecting this code:",1],[c.fromSelectedCode({trimNewLines:!1})[0],1]]);return new yr([...u,...d])}else if(n.status==="invalid")return new yr([`The currently open file \`${Dbn.basename(e.uri)}\` is content excluded.`])}},rE="current-editor",bJe=class{constructor(e){this._resolver=e;this.id=rE;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 rHt(e)}};p();var Mbn=S.Object({labels:S.Array(S.String())}),nHt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectLabelsSkillProcessor")}value(){return 1}processSkill(e){let r=[];return r.push([new yr(["The developer is working on a project with the following characteristics (languages, frameworks):"]),1]),e.labels.forEach(n=>{r.push([new yr([`- ${n}`]),.9]),this.turnContext.collectLabel($k,n)}),new yr(r)}},$k="project-labels",SJe=class{constructor(e){this._resolver=e;this.id=$k;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 nHt(e)}};p();p();p();var TJe=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}},IJe=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}},xJe=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}},wJe=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}},RJe=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}},PJe=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}},kJe=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}},DJe=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}},NJe=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}},MJe=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 OJe=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 Bbn(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(Bbn,"determineProgrammingLanguage");var Obn=[new TJe,new IJe,new xJe,new wJe,new RJe,new PJe,new kJe,new DJe,new NJe,new MJe];function Lbn(t){let e=Obn.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new OJe(t,Obn);return new iHt(e)}a(Lbn,"getMetadataLookup");var iHt=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 Fbn=S.Object({name:S.String(),version:S.Optional(S.String())}),Ubn=S.Object({language:S.Object({id:S.String(),name:S.String(),version:S.Optional(S.String())}),libraries:S.Array(Fbn),buildTools:S.Array(Fbn)}),oHt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectMetadataSkillProcessor")}value(){return 1}processSkill(e){let r=[];r.push([new yr([`The user is working on a project with the following characteristics: -`]),1]);let n=Lbn(e.language.id);return this.addProgrammingLanguage(e,r),this.addBuildTools(e,r,n),this.addApplicationFramework(e,r,n),this.addCoreLibraries(e,r,n),this.addTestingFrameworks(e,r,n),this.addTestingLibraries(e,r,n),new yr(r)}addProgrammingLanguage(e,r){let n=Bbn(e);this.turnContext.collectLabel(IO,n),r.push([new yr([`- programming language: ${n}`]),1])}addBuildTools(e,r,n){this.addToPrompt(r,"- build tools:",n.determineBuildTools(e))}addApplicationFramework(e,r,n){this.addToPrompt(r,"- application frameworks:",n.determineApplicationFrameworks(e))}addCoreLibraries(e,r,n){this.addToPrompt(r,"- core libraries:",n.determineCoreLibraries(e))}addTestingFrameworks(e,r,n){this.addToPrompt(r,"- testing frameworks:",n.determineTestingFrameworks(e))}addTestingLibraries(e,r,n){this.addToPrompt(r,"- testing libraries:",n.determineTestingLibraries(e))}addToPrompt(e,r,n){if(n.length>0){n.forEach(s=>{this.turnContext.collectLabel(IO,`${s.name}${s.version?" "+s.version:""}`)});let o=n.map(s=>` - ${s.name}${s.version?" "+s.version:""}`).join(` -`);e.push([new yr([`${r} -${o}`]),1])}}},IO="project-metadata",BJe=class{constructor(e){this._resolver=e;this.id=IO;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 oHt(e)}};p();var Qbn=de(require("path"));var sHt=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 yr(["The user wants you to consider the following referenced files when computing your answer."]),1]),n.push(...s),new yr(n)}filterIncludedFiles(e){return e.filter(r=>r.type==="file"&&!this.turnContext.isFileIncluded(r.uri))}async toFileChunks(e,r){return await Promise.all(e.map(async n=>{if(n.type==="file"&&n.uri)return await this.elideReferencedFiles(r,n)}))}async elideReferencedFiles(e,r){let n=await e.getOrReadTextDocument(r),o=ed(n);if(await this.turnContext.collectFile(FJe,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new TO(n.document,r.selection,r.visibleRange);return[[`Code excerpt from referenced file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),1]]}else if(o==="empty")return[[new yr([`The referenced file \`${s}\` is empty.`]),1]]}else if(n.status==="invalid")return[[new yr([`The referenced file \`${Qbn.basename(r.uri)}\` is content excluded.`]),1]]}},aHt=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},FJe="references",LJe=class{constructor(){this.id=FJe;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new aHt}processor(e){return new sHt(e)}};var qK=a(()=>[IO,$k,FJe,rE],"mandatorySkills"),mue=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new EJe(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=>!qK().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)&&!qK().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!qK().includes(d)))}return l.push(...qK()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(Wo).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(Wo).getSupportedSkills(r.id),c=e.get(zh).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 Zx(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...qK(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function QJe(t,e){let[r,n,o]=await VWo(t,e);return o.push(...YWo(t)),r.length>0||n.length>0?[new yr([[new yr(["Consider the additional context:"]),1],[bq(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(QJe,"fromSkills");async function VWo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await KWo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await WWo(t,c.skillId);l&&(qK().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(VWo,"handleSkillsInReverse");async function WWo(t,e){let n=t.ctx.get(zh).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 zWo(t,n,l,d,c,f):[void 0,await UJe(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await UJe(t,n,"unresolvable",void 0,c)]}catch(o){if(ot.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof jxe)throw o;return[void 0,await UJe(t,n,"failed")]}}a(WWo,"safelyProcessSkill");async function zWo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new yr([[n,1]]):c=n,[[c,r?.value()||0],await UJe(t,e,"resolved",c,o,s)]}a(zWo,"handleProcessedSkill");async function UJe(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 Eq(t.ctx),f=await t.ctx.get(Jc).getBestChatModelConfig(_S("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=Ts(f.tokenizer).tokenLength(h)}return t.ctx.get(lg).addResolution(t.turn.id,u),u}a(UJe,"determineResolution");function YWo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(YWo,"handleIgnoredSkills");async function KWo(t,e,r){if(e!==IO&&e!==$k)return!0;let n=t.ctx.get(Zt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===IO:e===$k}a(KWo,"includeSkill");var jK=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=pue(e.conversation.turns.slice(0,-1));o!==null&&n.push([o,.6]);let[s,c]=await this.elidableSkills(e,r);return s!==null&&(o!==null&&n.push(["",.1]),n.push([s,.8])),[new yr(n),c]}async elidableSkills(e,r){return await QJe(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ft(e.ctx,Ke.UseAgentsMd),includeNestedAgentsMdInstructions:Ft(e.ctx,Ke.UseNestedAgentsMd),includeClaudeMdInstructions:Ft(e.ctx,Ke.UseClaudeMd),includeNestedClaudeMdInstructions:Ft(e.ctx,Ke.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(Ef).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(Ef).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=QS(e.conversation.getLastTurn().request.message),u;o?typeof l=="string"?u=o+` +`)}};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(` +`);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+` -`+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]}},qJe=class extends jK{static{a(this,"PanelUserPromptStrategy")}suffix(e){return es` +`+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` 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. @@ -2636,7 +2679,7 @@ ${o}`]),1])}}},IO="project-metadata",BJe=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 jJe=class extends jK{static{a(this,"InlineUserPromptStrategy")}suffix(e){return es` + `.trim()}};var $Ke=class extends HK{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. @@ -2691,7 +2734,7 @@ ${o}`]),1])}}},IO="project-metadata",BJe=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 HJe=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=pue(e.turns.slice(0,-1)),n=[];return r!==null&&n.push([r,.6]),new yr(n)}suffix(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");if(!e.supportedSkillDescriptors)throw new Error("Supported skills must be provided for meta prompts");return this.buildMetaPrompt(e.supportedSkillDescriptors)}buildMetaPrompt(e){return es` + `.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` 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. @@ -2700,14 +2743,14 @@ ${o}`]),1])}}},IO="project-metadata",BJe=class{constructor(e){this._resolver=e;t ${e.map(r=>`${this.skillToPrompt(r)} `).join(` `)} - `.trim()}createFunctionArgumentSchema(e){let r=Jvn(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:Q3(r).skillIds}}}}skillToPrompt(e){let r=e.description?e.description():e.id,n=`Skill Id: ${e.id} + `.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} 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:es` +`)}`),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: - ${kn(o).trim()} - `.trim()}],[]]}};p();var GJe=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=Q3(e);return{suggestedTitle:r.suggestedTitle,followUp:r.followUp}}}}suffix(e){return es` + ${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` 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. @@ -2723,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=pue(e.turns.slice()),n=[];return r!==null&&n.push([r,.6]),new yr(n)}promptContent(e,r,n){return[[{role:"system",content:r},{role:"user",content:this.elidableContent(e.conversation)},{role:"system",content:this.suffix(e)}],[]]}};p();var JWo=[{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."})}))})}}],$Je=class extends jK{static{a(this,"UserQuerySynonymsPromptStrategy")}suffix(){return` + `.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` 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. @@ -2746,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=QS(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:JWo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=Q3(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!LKe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!LKe(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 cHt=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function Hxe(t,e,r){return new cHt(t,e,r)}a(Hxe,"descriptor");var qbn=[Hxe("user",_S("user"),()=>new qJe),Hxe("inline",_S("inline"),()=>new jJe),Hxe("meta",_S("meta"),()=>new HJe),Hxe("suggestions",_S("suggestions"),()=>new GJe),Hxe("synonyms",_S("synonyms"),()=>new $Je)],VJe=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await Eq(e),s=_S(r,o),c=qbn.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 qbn}};var Hbn=require("console");var SA=class{constructor(e,r=new VJe){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(Wh).inspectPrompt({type:r.promptType,prompt:jbn(l),tokens:u}),this.ctx.get(lg).addPrompt(e.turn.id,jbn(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,Hbn.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:ZWo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,Ijt(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),Ijt(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Ir).getEditorInfo().readableName??this.ctx.get(Ir).getEditorInfo().name,o=XWo(process.platform);return FCn(this.ctx,n,r?.login,o,e)}};function ZWo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(ZWo,"processResultOfElidableText");function jbn(t){return t.map(e=>kn(e.content)).join(` +`.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(` -`)}a(jbn,"debugChatMessages");function XWo(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(XWo,"mapPlatformToOs");var Sq=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await Ro.getModelConfiguration(e.ctx,"suggestions",{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(SA).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 lHt="v1",Vk=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},Xx=class extends Vk{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},i0=class extends Vk{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},np=class extends Vk{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},Gxe=class extends Vk{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var Aue=new pe("codingAgentUtils"),gue=29950;function Gbn(t,e,r){if(e.length>=gue)return Aue.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${gue}`),e=e.slice(-gue),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=gue){let o=gue-e.length-2;Aue.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${gue}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` +`)}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?` -${r}`:""),isTruncated:n}}a(Gbn,"truncatePrompt");function WJe(t){return t.length<=20?t:t.substring(0,20)+"..."}a(WJe,"generateTitleFromUserPrompt");function $bn(t){return`Cloud agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a($bn,"formatBodyPlaceholder");function Vbn(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),Aue.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`;Aue.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),Aue.debug(t,`Added active editor: ${c}`))}catch(c){Aue.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a(Vbn,"extractContextPaths");function Wbn(t){return t.length===0?"":`The user has attached the following files from their workspace: +${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: ${t.map(r=>`- ${r}`).join(` -`)}`}a(Wbn,"formatContextFiles");p();p();var zJe=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},nE=class extends zJe{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},Od=class extends zJe{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 uHt=(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))(uHt||{});p();p();p();function Tq(){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(Tq,"getUserAgent");p();p();function YJe(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)=>YJe.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(YJe,"register");p();function zbn(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(zbn,"addHook");p();function Ybn(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(Ybn,"removeHook");var Kbn=Function.bind,Jbn=Kbn.bind(Kbn);function Zbn(t,e,r){let n=Jbn(Ybn,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]=Jbn(zbn,null).apply(null,s)})}a(Zbn,"bindApi");function ezo(){let t=Symbol("Singular"),e={registry:{}},r=YJe.bind(null,e,t);return Zbn(r,e,t),r}a(ezo,"Singular");function tzo(){let t={registry:{}},e=YJe.bind(null,t);return Zbn(e,t),e}a(tzo,"Collection");var Xbn={Singular:ezo,Collection:tzo};p();p();var rzo="0.0.0-development",nzo=`octokit-endpoint.js/${rzo} ${Tq()}`,izo={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":nzo},mediaType:{format:""}};function ozo(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(ozo,"lowercaseKeys");function szo(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(szo,"isPlainObject");function r1n(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{szo(e[n])?n in t?r[n]=r1n(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(r1n,"mergeDeep");function e1n(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(e1n,"removeUndefinedProperties");function fHt(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=ozo(r.headers),e1n(r),e1n(r.headers);let n=r1n(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(fHt,"merge");function azo(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(azo,"addQueryParameters");var czo=/\{[^{}}]+\}/g;function lzo(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(uzo,"extractUrlVariableNames");function t1n(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(t1n,"omit");function n1n(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(n1n,"encodeReserved");function Eue(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a(Eue,"encodeUnreserved");function $xe(t,e,r){return e=t==="+"||t==="#"?n1n(e):Eue(e),r?Eue(r)+"="+e:e}a($xe,"encodeValue");function yue(t){return t!=null}a(yue,"isDefined");function dHt(t){return t===";"||t==="&"||t==="?"}a(dHt,"isKeyOperator");function dzo(t,e,r,n){var o=t[r],s=[];if(yue(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($xe(e,o,dHt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(yue).forEach(function(c){s.push($xe(e,c,dHt(e)?r:""))}):Object.keys(o).forEach(function(c){yue(o[c])&&s.push($xe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(yue).forEach(function(l){c.push($xe(e,l))}):Object.keys(o).forEach(function(l){yue(o[l])&&(c.push(Eue(l)),c.push($xe(e,o[l].toString())))}),dHt(e)?s.push(Eue(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?yue(o)&&s.push(Eue(r)):o===""&&(e==="&"||e==="?")?s.push(Eue(r)+"="):o===""&&s.push("");return s}a(dzo,"getValues");function fzo(t){return{expand:pzo.bind(null,t)}}a(fzo,"parseUrl");function pzo(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(dzo(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 n1n(s)}),t==="/"?t:t.replace(/\/$/,"")}a(pzo,"expand");function i1n(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=t1n(t,["method","baseUrl","url","headers","request","mediaType"]),c=uzo(r);r=fzo(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=t1n(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=azo(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(i1n,"parse");function hzo(t,e,r){return i1n(fHt(t,e,r))}a(hzo,"endpointWithDefaults");function o1n(t,e){let r=fHt(t,e),n=hzo.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:o1n.bind(null,r),merge:fHt.bind(null,r),parse:i1n})}a(o1n,"withDefaults");var s1n=o1n(null,izo);var E1n=de(u1n(),1);p();var mzo=/^-?\d+$/,p1n=/^-?\d+n+$/,pHt=JSON.stringify,d1n=JSON.parse,gzo=/^-?\d+n$/,Azo=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,yzo=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,h1n=a((t,e,r)=>"rawJSON"in JSON?pHt(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?pHt(t,(c,l)=>typeof l=="string"&&p1n.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(Azo,"$1$2$3").replace(yzo,"$1$2$3"):pHt(t,e,r),"JSONStringify"),XJe=new Map,Ezo=a(()=>{let t=JSON.parse.toString();if(XJe.has(t))return XJe.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return XJe.set(t,e),e}catch{return XJe.set(t,!1),!1}},"isContextSourceSupported"),_zo=a((t,e,r,n)=>typeof e=="string"&&gzo.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&p1n.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),vzo=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return d1n(t,e);if(Ezo())return vzo(t,e);let r=t.replace(Czo,(n,o,s,c)=>{let l=n[0]==='"';if(l&&bzo.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.length_zo(n,o,s,e))},"JSONParse");p();var GK=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 y1n(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=Izo(t.body)||Array.isArray(t.body)?h1n(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 GK(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 GK(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await hHt(c),new GK("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await hHt(c),new GK(wzo(f.data),l,{response:f,request:t});return f.data=n?await hHt(c):c.body,f}a(y1n,"fetchWrapper");async function hHt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch(A1n);let r=(0,E1n.safeParse)(e);if(xzo(r)){let n="";try{return n=await t.text(),g1n(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(A1n):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(hHt,"getResponseData");function xzo(t){return t.type==="application/json"||t.type==="application/scim+json"}a(xzo,"isJSONResponse");function wzo(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(wzo,"toErrorMessage");function mHt(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 y1n(r.parse(c));let l=a((u,d)=>y1n(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:mHt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:mHt.bind(null,r)})}a(mHt,"withDefaults");var Wxe=mHt(s1n,Tzo);p();var Rzo="0.0.0-development";function Pzo(t){return`Request failed due to following response errors: +`)}`}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: `+t.errors.map(e=>` - ${e.message}`).join(` -`)}a(Pzo,"_buildMessageForResponseErrors");var kzo=class extends Error{static{a(this,"GraphqlResponseError")}constructor(t,e,r){super(Pzo(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},Dzo=["method","baseUrl","url","headers","request","query","mediaType","operationName"],Nzo=["query","method","url"],_1n=/\/api\/v3\/?$/;function Mzo(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(Nzo.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)=>Dzo.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 _1n.test(s)&&(o.url=s.replace(_1n,"/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 kzo(o,l,c.data)}return c.data.data})}a(Mzo,"graphql");function gHt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>Mzo(r,o,s),"newApi"),{defaults:gHt.bind(null,r),endpoint:r.endpoint})}a(gHt,"withDefaults");var v1n=gHt(Wxe,{headers:{"user-agent":`octokit-graphql.js/${Rzo} ${Tq()}`},method:"POST",url:"/graphql"});function C1n(t){return gHt(t,{method:"POST",url:"/graphql"})}a(C1n,"withCustomRequest");p();var AHt="(?:[a-zA-Z0-9_-]+)",b1n="\\.",S1n=new RegExp(`^${AHt}${b1n}${AHt}${b1n}${AHt}$`),Ozo=S1n.test.bind(S1n);async function Bzo(t){let e=Ozo(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(Bzo,"auth");function Lzo(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a(Lzo,"withAuthorizationPrefix");async function Fzo(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=Lzo(t),e(o)}a(Fzo,"hook");var T1n=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(Bzo.bind(null,e),{hook:Fzo.bind(null,e)})},"createTokenAuth2");p();var yHt="7.0.6";var I1n=a(()=>{},"noop"),Uzo=console.warn.bind(console),Qzo=console.error.bind(console);function qzo(t={}){return typeof t.debug!="function"&&(t.debug=I1n),typeof t.info!="function"&&(t.info=I1n),typeof t.warn!="function"&&(t.warn=Uzo),typeof t.error!="function"&&(t.error=Qzo),t}a(qzo,"createLogger");var x1n=`octokit-core.js/${yHt} ${Tq()}`,eZe=class{static{a(this,"Octokit")}static VERSION=yHt;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 Xbn.Collection,n={baseUrl:Wxe.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} ${x1n}`:x1n,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=Wxe.defaults(n),this.graphql=C1n(this.request).defaults(n),this.log=qzo(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=T1n(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(EHt,"requestLog");EHt.VERSION=w1n;p();var jzo="0.0.0-development";function Hzo(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(Hzo,"normalizePaginatedListResponse");function _Ht(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=Hzo(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:P1n(t,e,r,n)})}a(P1n,"gather");var rcd=Object.assign(R1n,{iterator:_Ht});function vHt(t){return{paginate:Object.assign(R1n.bind(null,t),{iterator:_Ht.bind(null,t)})}}a(vHt,"paginateRest");vHt.VERSION=jzo;p();p();var CHt="17.0.0";p();p();var Gzo={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"]}},k1n=Gzo;var $K=new Map;for(let[t,e]of Object.entries(k1n))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);$K.has(t)||$K.set(t,new Map),$K.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var $zo={has({scope:t},e){return $K.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[...$K.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=$K.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=Vzo(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function bHt(t){let e={};for(let r of $K.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},$zo);return e}a(bHt,"endpointsToMethods");function Vzo(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(Vzo,"decorate");function Wzo(t){return{rest:bHt(t)}}a(Wzo,"restEndpointMethods");Wzo.VERSION=CHt;function SHt(t){let e=bHt(t);return{...e,rest:e}}a(SHt,"legacyRestEndpointMethods");SHt.VERSION=CHt;p();var D1n="22.0.1";var N1n=eZe.plugin(EHt,SHt,vHt).defaults({userAgent:`octokit-rest.js/${D1n}`});var Yzo=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),gc=new pe("GitHubClient"),iE=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 N1n({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!Yzo.has(o))return gc.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];gc.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;){gc.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 gc.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(gc.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 Od(l.status,l.message||"GitHub API error")}throw c}}async getCopilotWorkingStatus(e,r,n,o){gc.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 gc.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return gc.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){gc.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}),gc.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(gc.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 Od(c.status,c.message||"GitHub API error")}throw s}}async listPullRequestFiles(e,r,n){gc.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;){gc.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 gc.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(gc.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 Od(c.status,c.message||"GitHub API error")}throw s}}async getBranch(e,r,n){gc.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 gc.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 gc.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new Od(c.status,c.message||"GitHub API error")}throw gc.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){gc.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 gc.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 gc.debug(this.ctx,`GitHub API error getting pull request #${n}: HTTP ${c.status} - ${c.message}`),new Od(c.status,c.message||"GitHub API error")}throw gc.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){gc.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 gc.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 gc.debug(this.ctx,`GitHub API error adding comment to #${n}: HTTP ${l.status} - ${l.message}`),new Od(l.status,l.message||"GitHub API error")}throw gc.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){gc.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;){gc.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 gc.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(gc.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw gc.debug(this.ctx,`GitHub API error listing security advisories for ${r.length} ${e} packages: HTTP ${c.status} - ${c.message}`),new Od(c.status,c.message||"GitHub API error")}throw s}}async getApiSession(){let e=await this.ctx.get(Ur).resolveSession();if(!e)throw new nE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var Xc=new pe("CodingAgentClient"),ew=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){Xc.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/${lHt}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:$bn(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...Zm(this.ctx)};if(c?.isCancellationRequested)throw Xc.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new L_;let g=await this.ctx.get(tr).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw Xc.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new L_;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw Xc.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new L_;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw Xc.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new L_;let E=y.pull_request?.number;if(typeof E!="number")throw new i0("No valid pull request number returned from job");let v=await new iE(this.ctx).getPullRequest(n,o,E);return Xc.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 Xc.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new np("Title is required and cannot be empty");if(!r?.trim())throw Xc.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new np("ProblemStatement is required and cannot be empty");if(!n?.trim())throw Xc.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new np("Owner is required and cannot be empty");if(!o?.trim())throw Xc.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new np("Repository name is required and cannot be empty");Xc.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Ur).resolveSession();if(!r?.accessToken)throw Xc.debug(this.ctx,"Failed to get access token"),new Xx("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){Xc.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 Xc.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new L_;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...Zm(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Xc.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new L_;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get cloud agent sessions: HTTP ${l.status} - ${d}`;throw Xc.error(this.ctx,f),new i0(f)}let u=await l.json();return Xc.debug(this.ctx,`Found ${u.sessions?.length||0} coding agent sessions for pull request ID: ${e}`),u.sessions||null}catch(s){if(s instanceof Vk)throw s;let c=`Failed to get cloud agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Xc.error(this.ctx,c),new Gxe(c)}}async getSessionLogs(e,r){if(Xc.debug(this.ctx,`Getting coding agent session logs for session ID: ${e}`),!e?.trim())throw new np("Session ID is required and cannot be empty");let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw Xc.debug(this.ctx,`Get session logs operation was cancelled before sending API request for session ID: ${e}`),new L_;try{let s=`${o}/agents/sessions/${e}/logs`,c={Authorization:`Bearer ${n}`,...Zm(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Xc.debug(this.ctx,`Get session logs operation was cancelled after sending API request for session ID: ${e}`),new L_;if(!l.ok){let u=await l.text().catch(()=>l.statusText),d=`Failed to get cloud agent session logs: HTTP ${l.status} - ${u}`;throw Xc.error(this.ctx,d),new i0(d)}return await l.text()}catch(s){if(s instanceof Vk)throw s;let c=`Failed to get cloud agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Xc.error(this.ctx,c),new Gxe(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 Xc.error(this.ctx,`Cloud agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new i0("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 i0(`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 Xc.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new i0(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw Xc.error(this.ctx,"API response missing job_id or session_id",r),new i0("Invalid response from cloud agent");return r}};p();p();var xO=class{static{a(this,"LSPRequestSender")}};var M1n=de(ri());var tZe=class{constructor(){this.codingAgentMessageRequestType=new M1n.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(xO).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 jC=de(xo());function THt(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(THt,"adaptCancellationToken");function O1n(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(O1n,"adaptProgressCallback");function B1n(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(B1n,"createEndpointInfo");function L1n(t){let e={role:Kzo(t.role),content:Jzo(t.content)};if(t.role===jC.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===jC.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===jC.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=$Ke(n);o&&(e.thinking=o);let s=GKe(n);s&&(e.phase=s)}n.type===jC.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(L1n,"convertToCopilotChatMessage");function Kzo(t){switch(t){case jC.Raw.ChatRole.System:return"system";case jC.Raw.ChatRole.User:return"user";case jC.Raw.ChatRole.Assistant:return"assistant";case jC.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(Kzo,"convertRole");function Jzo(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===jC.Raw.ChatCompletionContentPartKind.Text||r.type===jC.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===jC.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===jC.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===jC.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(Jzo,"convertContent");p();var H3=de(xo());var rZe=class extends H3.PromptRenderer{constructor(r,n,o,s,c){super(o,r,n,s);this.options=c}static{a(this,"InternalPromptRenderer")}async renderWithOptions(r,n,o){let s=await super.render(r,n);return{...this.options,...o}.collapseSystemMessages&&this.collapseConsecutiveSystemMessages(s.messages),s}collapseConsecutiveSystemMessages(r){let n=[],o=null;for(let s of r)if(s.role===H3.Raw.ChatRole.System&&o?.role===H3.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===H3.Raw.ChatCompletionContentPartKind.Text&&l.type===H3.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` -`+l.text,o.content=o.content.concat(s.content.slice(1))):(o.content.push({type:H3.Raw.ChatCompletionContentPartKind.Text,text:` -`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===H3.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function F1n(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(rYo(e)){case"image/png":return Zzo(e);case"image/gif":return Xzo(e);case"image/jpeg":case"image/jpg":return eYo(e);case"image/webp":return tYo(e);default:throw new Error("Unsupported image format")}}a(F1n,"getImageDimensions");function Zzo(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(Zzo,"getPngDimensions");function Xzo(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(Xzo,"getGifDimensions");function eYo(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(eYo,"getJpegDimensions");function tYo(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 nZe(t){let e=Ts(t.tokenizer);return new IHt(e,t)}a(nZe,"createPromptTsxTokenizer");function oYo(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(oYo,"estimateDocumentTokenCost");var ip=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=B1n(n),c=nZe(n);this._internalRenderer=new rZe(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?O1n(e):void 0,s=r?THt(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?nCn(c.messages):iCn(c.messages),{messages:c.messages.map(L1n),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles}}async countTokens(e){let r=e?THt(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function xHt(t,e,r,n,o,s){return await ip.create(t,e,r,s).renderPrompt(n,o,s)}a(xHt,"renderTsxPrompt");p();p();p();var U1n=new pe("toolCallRoundsBuilder");function wO(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(wO,"buildAssistantRounds");p();var q_=de(xo());var zxe=new pe("toolCalling"),tw=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,q_.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 zxe.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(lue,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(HKe,{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(q_.AssistantMessage,null,vscpp(vscppf,null,A),c,l)),e.followUpUserMessage){let v=this.getMessageContent(e.followUpUserMessage);v&&_.push(vscpp(q_.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"}`;zxe.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(q_.AssistantMessage,null,vscpp(vscppf,null,""),c,l),vscpp(q_.UserMessage,null,vscpp(vscppf,null,_))]}return[]}let E=[vscpp(q_.AssistantMessage,null,vscpp(vscppf,null,y),c,l)];if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);_&&E.push(vscpp(q_.UserMessage,null,vscpp(vscppf,null,_)))}return E}if(d.length{let y=(0,q_.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(q_.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"}`;zxe.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(q_.ToolMessage,{toolCallId:y.id},vscpp(vscppf,null,v))))}if(e.followUpUserMessage){let A=this.getMessageContent(e.followUpUserMessage);A&&m.push(vscpp(q_.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.lengthjjo.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.lengthn.type==="image_url"),r=t.filter(n=>n.type==="text").map(n=>n.text).join("");return{imageUrls:e,textContent:r}}a(sYo,"separateTextAndImages");function aYo(t){return t.map(e=>vscpp(Jh.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(aYo,"createImageElements");function iZe(t){let{imageUrls:e,textContent:r}=sYo(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(Jh.TextChunk,null,vscpp(vscppf,null,r)),...aYo(e)]}a(iZe,"renderMixedContent");function wHt(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(wHt,"convertToPromptTsxToolCall");function oZe(t){switch(t.role){case"assistant":return cYo(t);case"tool":return lYo(t);case"user":return uYo(t);case"system":return dYo(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(oZe,"convertChatMessageToPromptTsx");function cYo(t){let e=t.thinking?vscpp(lue,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(Jh.AssistantMessage,{toolCalls:wHt(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(Jh.AssistantMessage,{toolCalls:wHt(t.tool_calls)},vscpp(vscppf,null,iZe(t.content)),e):vscpp(Jh.AssistantMessage,{toolCalls:wHt(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(cYo,"renderAssistantMessage");function lYo(t){return typeof t.content=="string"?vscpp(Jh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Jh.ToolMessage,{toolCallId:t.tool_call_id||""},iZe(t.content)):vscpp(Jh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(lYo,"renderToolMessage");function uYo(t){return typeof t.content=="string"?vscpp(Jh.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Jh.UserMessage,null,iZe(t.content)):vscpp(Jh.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(uYo,"renderUserMessage");function dYo(t){return typeof t.content=="string"?vscpp(Jh.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Jh.SystemMessage,null,iZe(t.content)):vscpp(Jh.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(dYo,"renderSystemMessage");var fYo=new pe("conversationHistoryPrompt"),_ue=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):fYo.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=wO(s,{ctx:this.props.ctx,identifier:"conversation history",enableWarnings:!0});c.length>0&&e.push(vscpp(tw,{assistantRounds:c,ctx:this.props.ctx,isHistorical:!0,identifier:"conversation-history",modelConfiguration:this.props.modelConfiguration}))}}return e}};var aZe=de(xo());var sZe=class extends lr{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(aZe.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(_ue,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(aZe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function Q1n(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(Q1n,"parseStructuredSummary");var cZe=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 AO(this.ctx,n.modelProviderName,n.userRequestedModelIdOrEmpty):await Ro.getModelConfigurationById(this.ctx,n.userRequestedModelIdOrEmpty,e.id.toString(),gq(c));Ro.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await ip.create(sZe,{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 Yxe=new pe("repository"),G3=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)}},rw=class{static{a(this,"GitBranchLoader")}},Iq=class extends rw{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 q1n=require("child_process");var xq=class extends rw{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,q1n.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){Yxe.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=Zo(r);if(n===void 0)return;let o;try{o=(await pO()).path}catch(c){Yxe.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?G3.branch(c):G3.detachedHead()}}extraArgs(){return[]}};p();var wq=class extends rw{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get($o),o=Ia(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;Yxe.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 G3.branch(r)}else return this.isCommitSha(e)?G3.detachedHead():G3.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var Rq=new pe("codingAgentTurnProcessor"),lZe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Sc),this.chatFetcher=this.chatFetcher??new nc(e.ctx),this.turnSuggestions=new Sq(e.ctx,this.chatFetcher),this.codingAgentClient=new ew(e.ctx),this.gitHubClient=new iE(e.ctx),this.codingAgentMessageHandler=new tZe,this.conversationSummarizer=new cZe(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 Zc(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:uq.Unknown,responseIsIncomplete:!0}})}finally{wKe(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()=>{Rq.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 np("No workspace folder available for git repository detection");let f=await new r0(this.turnContext.ctx).getRepo(u);if(!f||!f.isGitHub())throw new np("No GitHub repository found in the workspace folder");if(!f.owner||!f.name)throw new np("Could not determine repository owner and name");let h={owner:f.owner,name:f.name},g=await new Iq([new xq,new wq]).getBranchInfo(this.turnContext.ctx,u),A;if(g?.currentBranch&&!g.isDetachedHead){A=g.currentBranch,Rq.debug(this.turnContext.ctx,`Found current branch: ${A}`);try{await this.gitHubClient.getBranch(h.owner,h.name,A),Rq.debug(this.turnContext.ctx,`Branch ${A} exists remotely`)}catch(N){if(N instanceof Od&&N.status===404){let B=`Base branch "${A}" does not exist remotely in ${h.owner}/${h.name}. Please push the branch to the remote repository before creating a cloud agent job.`;throw await this.conversationProgress.report(this.conversation,this.turn,{reply:`${B} +`,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 Xh=de(Io());function gHo(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(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} -`}),Rq.error(this.turnContext.ctx,B),new np(B)}throw N}}else throw new np("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let y=kn(this.turn.request.message),E=Vbn(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),_=Wbn(E);Rq.debug(this.turnContext.ctx,`Extracted ${E.length} context file paths (${_.length} characters formatted)`);let v="",b=WJe(y);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... +`}),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... -`});let{structuredSummary:N,rawSummary:B}=await this.summarizeConversation(r,o,l);if(r.isCancellationRequested)return;N&&N.title&&(b=N.title),v=B||""}let T=_;v&&(T=_+(_?` +`});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}=Gbn(this.turnContext.ctx,y,T||void 0);await this.conversationProgress.report(this.conversation,this.turn,{reply:`Delegating to cloud agent... +`:"")+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... -`});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){Rq.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),WI(this.turnContext.ctx,"codingAgent",D),await this.endProgress(P)}catch(u){if(QUe(this.turnContext.ctx,"codingAgent",u,o),u instanceof Nc)Rq.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 Vk)Ua(this.turnContext.ctx,u,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(u.message),await this.endProgress({error:{message:u.message,code:uq.Default,responseIsIncomplete:!0}});else throw Rq.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=Q1n(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=Aq(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 j1n="```",Kxe=String.raw``,pYo=String.raw`${j1n}[\w]*?\n(?[\s\S]*?)\n${j1n}`,hYo=new RegExp(Kxe+` -`+pYo,"gs"),RHt=["replace","delete"];function PHt(t,e){let r=t.matchAll(hYo),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!RHt.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){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(` `),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=kHt([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(PHt,"extractEditsFromTaggedCodeblocks");function kHt(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=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(` `);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(kHt,"applyEditsToDocument");var vue=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Oops, an error has occurred. Please try again";this.uiKind="conversationPanel";this.computeSuggestions=!0}static{a(this,"PanelTurnProcessorStrategy")}processResponse(){return[]}async buildConversationPrompt(e,r,n,o){let s="user",c=await Ro.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(SA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},uZe=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 Eq(e.ctx),u=await e.ctx.get(Jc).getBestChatModelConfig(_S(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(SA).toPrompt(e,d)}async processResponse(e){let r=[],n=kn(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(rE);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=PHt(e,r).filter(c=>RHt.includes(c.mode)),s=kHt(o,r);if(s)return await this.ctx.get(Wh).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return PHt(e,r)}};var dZe=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 vue(e.ctx);return new lZe(e,r)}};p();p();p();p();function H1n(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(H1n,"filterUnsupportedReferences");function G1n(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(G1n,"convertToCopilotReferences");var $1n=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 Pq=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,H1n(r.copilotReferences),r.copilotErrors??[],r.copilotConfirmation,r.thinking)}append(e,r,n,o,s,c){this.deltaApplier(e,r,n,o,s,c),this.appliedLength+=e.length,this.appliedText+=e,this.appliedAnnotations.push(...r.map(l=>l.id))}mapAnnotations(e){if(!e)return[];let r=[],n=e.for("CodeVulnerability").map(s=>({...s,type:"code_vulnerability"})),o=e.for("IPCodeCitations").map(s=>({...s,type:"ip_code_citations"}));return r.push(...n),r.push(...o),r}};p();p();var RO=class{constructor(e){this.ctx=e;this.githubRepositoryInfoCache=new Map}static{a(this,"GitHubRepositoryApi")}async getRepositoryInfo(e){let r=`${e.hostname}/${e.owner}/${e.repo}`,n=this.githubRepositoryInfoCache.get(r);if(n)return n;let o=await this._doGetRepositoryInfo(e);if(o?.ok){let s=await o.json();return this.githubRepositoryInfoCache.set(r,s),s}}async _doGetRepositoryInfo({owner:e,repo:r,hostname:n}){let o=await this.ctx.get(Ur).resolveSession(),s;if(o&&new URL(o.serverUrl).hostname===n)s=o;else{let u=await this.ctx.get(ZI).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 V1n=S.Object({name:S.String(),url:S.String()}),W1n=S.Object({path:S.String(),head:S.Optional(S.Object({name:S.String(),upstream:S.Optional(V1n)})),remotes:S.Optional(S.Array(V1n))}),DHt=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(PO,"git repository information");let r=[];return r.push([new yr(["Metadata about the current git repository:"]),1]),e.head&&e.head.name?(r.push([new yr([`- Current branch name: ${e.head.name}`]),1]),e.head.upstream&&r.push([new yr([`- Upstream name and url: ${e.head.upstream.name} - ${e.head.upstream.url}`]),1])):r.push([new yr(["- Detached HEAD: yes"]),1]),e.remotes&&e.remotes.length>0&&r.push([new yr([`- Remotes: ${e.remotes.map(n=>n.name).join(", ")}`]),1]),new yr(r)}},PO="git-metadata",fZe=class extends cg{static{a(this,"GitMetadataSkill")}constructor(e){super(PO,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new DHt(r))}};async function z1n(t){let e=await t.skillResolver.resolve(rE);if(e){let c=e.uri,l=tQ(t.ctx,c);if(Uun(l))return{repoInfo:l,skillUsed:rE}}let r=await t.skillResolver.resolve(PO);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=LFt(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:PO}}a(z1n,"extractRepoInfo");async function Y1n(t){let e=[];return await mYo(t,e),await gYo(t,e),await AYo(t,e),e}a(Y1n,"skillsToReference");async function mYo(t,e){let r=await yYo(t);r&&e.push(r)}a(mYo,"addRepositoryReference");async function gYo(t,e){let r=await EYo(t);r&&e.push(r)}a(gYo,"addSelectionReference");async function AYo(t,e){let r=[],n=await vYo(t);n&&r.push(n),r.push(...await CYo(t)),r.length>0&&e.push(...r)}a(AYo,"addFileReferences");async function yYo(t){let e=await z1n(t);if(e){let r=t.ctx.get(RO),n=e.repoInfo.owner,o=e.repoInfo.repo,s=await r.getRepositoryInfo(e.repoInfo);if(s)return{type:"github.repository",id:`${n}/${o}`,data:{type:"repository",name:o,ownerLogin:n,id:s.id}}}}a(yYo,"gitMetadataToReference");async function EYo(t){let e=await t.skillResolver.resolve(rE);if(e&&e.selection){let n=await t.ctx.get(ii).getOrReadTextDocument(e),o=ed(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return _Yo(e,n.document)}}a(EYo,"currentEditorToSelectionReference");function _Yo(t,e){if(t.selection&&!hue(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(_Yo,"extractSelection");async function vYo(t){let e=await t.skillResolver.resolve(rE);if(e){let n=await t.ctx.get(ii).getOrReadTextDocument(e),o=ed(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(vYo,"currentEditorToFileReference");async function CYo(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=ed(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(CYo,"fileReferenceToPlatformFileReference");p();jo();var bYo=new pe("ChatFetchResultPostProcessor"),Cue=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(Qvn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s),await this.turnContext.ctx.get(Wh).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:kn(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"},bYo.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:U_.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===Q_,copilotPlan:JI(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:e.code}};case"filtered":return this.turnContext.turn.status="filtered",{error:{message:"Oops, your response got filtered. Vote down if you think this shouldn't have happened.",responseIsFiltered:!0}};case"length":return this.turnContext.turn.status="error",{error:{message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0}};case"agentAuthRequired":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},{error:{message:"Authorization required",responseIsFiltered:!1}};case"no_choices":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"No choices returned",type:"server"},{error:{message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"no_finish_reason":return this.turnContext.turn.status="error",n&&n.length>0?this.turnContext.turn.response={message:n,type:"model",references:this.turnContext.turn.response?.references}:this.turnContext.turn.response={message:"No finish reason",type:"server"},{error:{message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"model_not_supported":{this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model not supported",type:"server"};let{modelName:d,modelProviderName:f}=Ro.parseModelNotSupportedReason(e.reason);return{error:{message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:d,modelProviderName:f}}}case"model_max_prompt_tokens_exceeded":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model max prompt tokens exceeded",type:"server"},{error:{message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",code:400,reason:"model_max_prompt_tokens_exceeded",responseIsFiltered:!1}};case"successMultiple":case"tool_calls":case"unknown":return this.turnContext.turn.status="error",{error:{message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1}}}}async processSuccessfulFetchResult(e,r,n,o,s,c,l,u){if(e&&e.length>0){c.markAsDisplayed(),l.markAsDisplayed(),this.turnContext.turn.status="success",this.turnContext.turn.response={message:e,type:"model",references:this.turnContext.turn.response?.references},qvn(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:kn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new Sq(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:Gt(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return $vn(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",jvn(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var pZe=S.Union([S.String(),S.Number()]),VK=S.Union([S.String(),S.Number()]),SYo=S.Union([S.Literal("included"),S.Literal("blocked"),S.Literal("notfound"),S.Literal("empty")]),hZe=S.Object({uri:S.String(),position:S.Optional(n0)}),TYo=S.Object({type:S.Literal("file"),uri:S.String(),position:S.Optional(n0),visibleRange:S.Optional(_f),selection:S.Optional(_f),status:S.Optional(SYo),range:S.Optional(_f)}),IYo=S.Object({type:S.Literal("directory"),uri:S.String()}),xYo=S.Object({type:S.Literal("tool"),uri:S.String(),name:S.Optional(S.String()),server:S.Optional(S.String()),description:S.Optional(S.String())}),kO=S.Union([TYo,IYo,$1n,xYo]),DO=S.Union([S.Literal("panel"),S.Literal("inline")]),wYo=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")]))})})]),NHt=S.Union([S.String(),S.Array(wYo)]),K1n=S.Object({request:NHt,response:S.Optional(S.String()),agentSlug:S.Optional(S.String()),turnId:S.Optional(VK),model:S.Optional(S.String())});function mZe(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(mZe,"convertToMessageContent");function gZe(t,e){if(t=QS(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(gZe,"appendToMessage");var AZe=S.Union([S.Literal("Ask"),S.Literal("Agent"),S.Literal("InlineAgent")]),RYo=S.Object({type:S.String(),description:S.String()}),J1n=S.Object({name:S.String(),description:S.String(),inputSchema:S.Optional(S.Object({type:S.String(),properties:S.Record(S.String(),RYo),required:S.Array(S.String())})),confirmationMessages:S.Optional(S.Object({title:S.String(),message:S.String()}))}),Oc=S.Object({uri:S.String(),name:S.String()}),PYo=S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")]),yZe=S.Object({id:S.Number(),title:S.String(),description:S.Optional(S.String()),status:PYo});jo();var MHt="generate-response",EZe=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},Jxe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(Sc),this.chatFetcher=this.chatFetcher??new nc(r.ctx),this.postProcessor=new Cue(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 EZe?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 Zc(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(Wh).inspectPrompt(l),await n.steps.start(MHt,"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:QS(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 Gt()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return qjt(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:QS(r.request.message)}),r.response&&r.response.type==="model"){let o=G1n(r.response.references);n.push({role:"assistant",content:QS(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await Y1n(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 Pq((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=gZe(this.turn.response.message,h),this.turn.response.references.push(...g)):this.turn.response={message:h,type:"model",references:g},this.turn.annotations.push(...m??[]),_&&(this.turn.confirmationRequest=_)}),u=await this.turnContext.ctx.get(Ut).getGitHubSession(),d={engineName:"agents",endpoint:this.agent.endpoint??this.agent.slug,messages:r,uiKind:"conversationPanel",intentParams:{intent:!0,intent_threshold:.7,intent_content:kn(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()),kn(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 EZe("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return wxe(this.conversation,"conversationPanel",kn(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(MHt,e.error.message):await r.steps.finish(MHt)}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 Jxe(this,e)}},_Ze=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 Jxe(this,e)}};p();var kYo="github",zk=class{static{a(this,"RemoteAgentRegistry")}},vZe=class extends zk{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 _Y(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!==kYo).map(o=>new Zxe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var Z1n=de(require("fs")),j_=de(require("path"));var OHt=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],BHt="test_",Xxe={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"}},ewe=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=j_.extname(r).replace(".",""),o=Xxe[n]??{location:"sameFolder",prefix:BHt,suffix:OHt},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=Zo(sf(e)),l===void 0)return}else{let d=Zo(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=j_.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=Ta(l);if(await this.fileExists(u))return Ia(u,s[0])}parseTestFilePath(e){try{return Ta(e)}catch(r){Nr.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=Ji(e),n=j_.extname(r).replace(".",""),o=Xxe[n]??{location:"sameFolder",prefix:BHt,suffix:OHt},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=sf(e):l=this.determineImplFolder(e);for(let u of s){let d=Ia(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=Zo(e);if(r===void 0)return;let n=j_.extname(Ji(e)).replace(".",""),o,s=Xxe[n]?.location??"sameFolder";s==="sameFolder"?o=j_.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,Xxe[n]);if(c.length>0)return Ta(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${j_.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 Z1n.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&Zo(this.baseUri))??"",o=j_.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(j_.sep)}getRelativeTestFolder(e,r,n,o){let s=j_.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=j_.extname(Ji(e)).replace(".",""),n=sf(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 twe(t){let e=Ji(t),r=j_.extname(e),n=Xxe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(OHt.some(s=>e.endsWith(s+r))||e.startsWith(BHt))}a(twe,"isTestFile");p();var LHt=class extends Error{static{a(this,"UserQueryParserError")}constructor(e){super(String(e),{cause:e}),this.name="UserQueryParserError"}};async function X1n(t,e){let r=t.ctx,n=await Ro.getModelConfiguration(r,"synonyms",{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(SA).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 nc(r),u=await Zc(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 LHt(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"UserQueryParser.parseUserQuery")}}a(X1n,"parseUserQuery");p();p();p();p();var zo=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 zo(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new zo(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 eSn=250;function TA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/eSn)),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(TA,"getMaxChunks");var tSn=32e3,rSn=2e4,rwe=.75;p();p();function IA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(IA,"getFenceForCodeBlock");p();var oSn=de(Al()),sSn=de(zp());p();var HC=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 DYo=Object.freeze({[HC.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[HC.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function FHt(t){return DYo[t.id]}a(FHt,"getWellKnownEmbeddingTypeInfo");function NYo(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:nwe(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(nSn,"rankEmbeddings");p();p();var $3=de(Yc()),iSn=de(zp());var NO=new pe("GitHubCodeSearch"),MYo=300*1e3,CZe=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new $3.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()},MYo)}updateIndexedRepoCommit(){if(this._indexedRepos.size!==0)for(let[e,r]of this._indexedRepos.entries())this._indexedCommits.get(e)&&(async()=>{try{let o=await this._ctx.get(Ut).getGitHubSession();if(!o)return;let{currentStatus:s,indexedCommit:c}=await this.getRemoteIndexState(o,r,{isCancellationRequested:!1});if(s==="ready"&&c){let l=this._indexedCommits.get(e);l!==c&&(this._indexedCommits.set(e,c),NO.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){NO.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(NO.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),NO.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){NO.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,$3.raceTimeout)((async()=>{if(!await(0,$3.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,$3.raceCancellationError)((0,$3.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 NO.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 qf(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return NO.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return NO.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=bue(this._ctx),c=n.owner+"/"+n.name,l=await qf(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(NO.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=bue(this._ctx),u=await qf(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:BYo(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 OYo(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function bue(t){let e=t.get(Ir);return{"X-Client-Application":`${x1(e.getEditorInfo())}`,"X-Client-Source":x1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(bue,"editorVersionHeaders");async function OYo(t,e,r){let o=[],s=new HC(e.embedding_model),c=Os(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=Ia(c,l.location.path)}catch(d){NO.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:bZe(l.chunk.text),rawText:void 0,range:new iSn.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(OYo,"parseGithubCodeSearchResponse");function BYo(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(BYo,"truncateToMaxUtf8Length");function bZe(t){let e=LYo(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` -`):t}a(bZe,"stripChunkTextMetadata");function LYo(t){return t.split(/\r\n|\r|\n/)}a(LYo,"splitLines");var Yk=de(Yc()),aSn=de(ale()),cSn=de(Qh());var iwe=new pe("ChunkingEndpointClient"),UHt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new aSn.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 Yk.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,Yk.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,Yk.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,Yk.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){iwe.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{iwe.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{iwe.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},SZe=class{constructor(e){this.ctx=e;this._requestLimiter=new UHt(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,Yk.raceCancellationError)(n.getText(),l);if((0,cSn.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=bue(this.ctx);return await qf(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:Zo(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,Yk.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){iwe.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,oSn.coalesce)(h.chunks.map(m=>{let g=new sSn.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:bZe(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 HC(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:bZe(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){iwe.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var oE={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},o0=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),yt(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};Ua(e,n,r,o),Zn(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,oE.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,oE.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,oE.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,oE.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,oE.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,oE.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,oE.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,oE.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),yt(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,oE.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,oE.Aggregate,r)}};var lSn=de(Al()),uSn=de(Yc()),QHt=de(iO());var V3=new pe("Remote Search"),TZe=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(r0),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 QHt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(V3.info(this.ctx,"Starting workspace search",{rawQuery:e.rawQuery,repoCount:s.length,repos:s.map(P=>`${P.owner}/${P.name}`),maxResults:TA(r)}),s.length===0)throw V3.error(this.ctx,"No GitHub repositories found"),o0.sendRemoteSkipped(this.ctx,"no_github_repos"),new Error("No GitHub repositories found in CodeSearchChunkSearch");let c=await this.ctx.get(Ut).getGitHubSession();if(!c)throw V3.error(this.ctx,"No GitHub session found"),o0.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 V3.error(this.ctx,"Remote index not ready for any repositories"),o0.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=TA(r),d=Promise.all(l.map(async P=>{jh(n);let D=await e.resolveQuery(n),N=new QHt.StopWatch,B=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,P,D,u,n);return V3.info(this.ctx,`Search completed for ${P.owner}/${P.name}`,{searchTime:N.elapsed(),chunkCount:B.chunks.length}),B})),f=await this._localDiffSearch.getLocalDiff(r.workspaceFolders),h=new Set(f),m=this._localDiffSearch.shouldDoLocalDiffSearch(f,r.workspaceFolders);V3.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,uSn.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{V3.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(P=>{V3.error(this.ctx,"Local diff search failed",P)})??Promise.resolve(void 0)]),E=(0,lSn.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();V3.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 o0.sendRemoteSuccess(this.ctx,R,b,w,x),{chunks:v}}};p();p();var sxn=require("node:url"),axn=require("path");p();var qZe=de(fSn(),1);p();var qHt=new WeakMap;function Tue(...t){let e=new String(t);return qHt.set(e,t),e}a(Tue,"c");function nw(t){return t instanceof String&&qHt.has(t)}a(nw,"r");function Iue(t){return qHt.get(t)??[]}a(Iue,"o");var UZe=de(ESn(),1),YTn=require("child_process");var NIn=de($Ht(),1),GIn=require("node:path");p();function*_Sn(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(_Sn,"U");var uKo=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),dKo=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),fKo=new Set(["edit","remove-section","rename-section","set","unset"]),pKo=new Set(["get","get-color","get-colorbool","list"]);function hKo(t,e){for(let{name:n}of _Sn(t,"task")){if(uKo.has(n))return Pue(!0,e);if(dKo.has(n))return Pue(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:fKo.has(r)?Pue(!0,e.slice(1)):pKo.has(r)?Pue(!1,e.slice(1)):e.length===1?Pue(!1,e):Pue(!0,e)}a(hKo,"F");function Pue(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(Pue,"p");function mKo(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(mKo,"A");function gKo(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a(gKo,"M");function AKo(t){for(let{name:e}of _Sn(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(AKo,"N");function yKo({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(yKo,"G");function*EKo(t){for(let e of t){let r=yKo(e),n=r&&gKo(e.value);n&&(yield{...n,scope:r})}}a(EKo,"O");function _Ko(t,e,r){let n={read:[],write:[...EKo(e)]};return t==="config"&&vKo(n,AKo(e),hKo(e,r)),n}a(_Ko,"L");function vKo(t,e,r){if(r===null)return;let n=mKo(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(vKo,"$");var vSn={short:new Map([["c",!0]])},CKo={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...vSn.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},bKo={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"])}},SKo={short:new Map,long:new Set};function TKo(t){let e=bKo[t??""]??SKo;return{short:new Map([...vSn.short.entries(),...e.short.entries()]),long:e.long}}a(TKo,"I");function CSn(t,e=CKo){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 IKo(t,e.short)}a(CSn,"b");function IKo(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(IKo,"W");function xKo(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[hGt(t)[0]])(t=0)),e},"__init"),"__esm"),jKo=a((t,e)=>a(function(){return e||(0,t[hGt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),Zh=a((t,e)=>{for(var r in e)pGt(t,r,{get:e[r],enumerable:!0})},"__export"),HKo=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of hGt(e))!qKo.call(t,o)&&o!==r&&pGt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=QKo(e,o))||n.enumerable});return t},"__copyProps"),Jp=a(t=>HKo(pGt({},"__esModule",{value:!0}),t),"__toCommonJS"),W3,Dq=Zr({"src/lib/errors/git-error.ts"(){"use strict";W3=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),lwe,Mue=Zr({"src/lib/errors/git-response-error.ts"(){"use strict";Dq(),lwe=class extends W3{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),iTn,oTn=Zr({"src/lib/errors/task-configuration-error.ts"(){"use strict";Dq(),iTn=class extends W3{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function sTn(t){return typeof t!="function"?JK:t}a(sTn,"asFunction");function aTn(t){return typeof t=="function"&&t!==JK}a(aTn,"isUserFunction");function cTn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a(cTn,"splitOn");function lTn(t,e=0){return uTn(t)&&t.length>e?t[e]:void 0}a(lTn,"first");function KK(t,e=0){if(uTn(t)&&t.length>e)return t[t.length-1-e]}a(KK,"last");function uTn(t){return $Ze(t)}a(uTn,"isArrayLike");function uwe(t="",e=!0,r=` -`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(uwe,"toLinesWithContent");function mGt(t,e){return uwe(t,!0).map(r=>e(r))}a(mGt,"forEachLineWithContent");function gGt(t){return(0,qZe.exists)(t,qZe.FOLDER)}a(gGt,"folderExists");function sw(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(sw,"append");function dTn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(dTn,"including");function jZe(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(jZe,"remove");function MO(t){return Array.isArray(t)?t:[t]}a(MO,"asArray");function fTn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a(fTn,"asCamelCase");function Oue(t){return MO(t).map(e=>e instanceof String?e:String(e))}a(Oue,"asStringArray");function mu(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(mu,"asNumber");function awe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a(pTn,"pick");function ZHt(t=0){return new Promise(e=>setTimeout(e,t))}a(ZHt,"delay");function XHt(t){if(t!==!1)return t}a(XHt,"orVoid");var Due,JK,dwe,HZe=Zr({"src/lib/utils/util.ts"(){"use strict";AGt(),Due="\0",JK=a(()=>{},"NOOP"),dwe=Object.prototype.toString.call.bind(Object.prototype.toString)}});function sE(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(sE,"filterType");function eGt(t,e){let r=nw(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(eGt,"filterPrimitives");function GZe(t){return!!t&&dwe(t)==="[object Object]"}a(GZe,"filterPlainObject");function hTn(t){return typeof t=="function"}a(hTn,"filterFunction");var fwe,mTn,op,LZe,$Ze,AGt=Zr({"src/lib/utils/argument-filters.ts"(){"use strict";HZe(),fwe=a(t=>Array.isArray(t),"filterArray"),mTn=a(t=>typeof t=="number","filterNumber"),op=a(t=>typeof t=="string"||nw(t),"filterString"),LZe=a(t=>op(t)||Array.isArray(t)&&t.every(op),"filterStringOrStringArray"),$Ze=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),tGt,GKo=Zr({"src/lib/utils/exit-codes.ts"(){"use strict";tGt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(tGt||{})}}),FZe,$Ko=Zr({"src/lib/utils/git-output-streams.ts"(){"use strict";FZe=class gTn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new gTn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function VKo(){throw new Error("LineParser:useMatches not implemented")}a(VKo,"useMatchesDefault");var Po,kq,WKo=Zr({"src/lib/utils/line-parser.ts"(){"use strict";Po=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=VKo,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))}},kq=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 ATn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...yTn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(ATn,"createInstanceConfig");var yTn,zKo=Zr({"src/lib/utils/simple-git-options.ts"(){"use strict";yTn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function yGt(t,e=[]){return GZe(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(nw(o))r.push(o);else if(eGt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)eGt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(yGt,"appendTaskOptions");function H_(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=uwe(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($C,"parseStringResponse");var JKo=Zr({"src/lib/utils/task-parser.ts"(){"use strict";HZe()}}),ETn={};Zh(ETn,{ExitCodes:a(()=>tGt,"ExitCodes"),GitOutputStreams:a(()=>FZe,"GitOutputStreams"),LineParser:a(()=>Po,"LineParser"),NOOP:a(()=>JK,"NOOP"),NULL:a(()=>Due,"NULL"),RemoteLineParser:a(()=>kq,"RemoteLineParser"),append:a(()=>sw,"append"),appendTaskOptions:a(()=>yGt,"appendTaskOptions"),asArray:a(()=>MO,"asArray"),asCamelCase:a(()=>fTn,"asCamelCase"),asFunction:a(()=>sTn,"asFunction"),asNumber:a(()=>mu,"asNumber"),asStringArray:a(()=>Oue,"asStringArray"),bufferToString:a(()=>cwe,"bufferToString"),callTaskParser:a(()=>rGt,"callTaskParser"),createInstanceConfig:a(()=>ATn,"createInstanceConfig"),delay:a(()=>ZHt,"delay"),filterArray:a(()=>fwe,"filterArray"),filterFunction:a(()=>hTn,"filterFunction"),filterHasLength:a(()=>$Ze,"filterHasLength"),filterNumber:a(()=>mTn,"filterNumber"),filterPlainObject:a(()=>GZe,"filterPlainObject"),filterPrimitives:a(()=>eGt,"filterPrimitives"),filterString:a(()=>op,"filterString"),filterStringOrStringArray:a(()=>LZe,"filterStringOrStringArray"),filterType:a(()=>sE,"filterType"),first:a(()=>lTn,"first"),folderExists:a(()=>gGt,"folderExists"),forEachLineWithContent:a(()=>mGt,"forEachLineWithContent"),getTrailingOptions:a(()=>H_,"getTrailingOptions"),including:a(()=>dTn,"including"),isUserFunction:a(()=>aTn,"isUserFunction"),last:a(()=>KK,"last"),objectToString:a(()=>dwe,"objectToString"),orVoid:a(()=>XHt,"orVoid"),parseStringResponse:a(()=>$C,"parseStringResponse"),pick:a(()=>pTn,"pick"),prefixedArray:a(()=>awe,"prefixedArray"),remove:a(()=>jZe,"remove"),splitOn:a(()=>cTn,"splitOn"),toLinesWithContent:a(()=>uwe,"toLinesWithContent"),trailingFunctionArgument:a(()=>Bd,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>EGt,"trailingOptionsArgument")});var so=Zr({"src/lib/utils/index.ts"(){"use strict";AGt(),GKo(),$Ko(),WKo(),zKo(),KKo(),JKo(),HZe()}}),_Tn={};Zh(_Tn,{CheckRepoActions:a(()=>nGt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>CTn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>vTn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>ZKo,"checkIsRepoTask")});function ZKo(t){switch(t){case"bare":return CTn();case"root":return vTn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:VZe,parser:_Gt}}a(ZKo,"checkIsRepoTask");function vTn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:VZe,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(vTn,"checkIsRepoRootTask");function CTn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:VZe,parser:_Gt}}a(CTn,"checkIsBareRepoTask");function XKo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(XKo,"isNotRepoMessage");var nGt,VZe,_Gt,bTn=Zr({"src/lib/tasks/check-is-repo.ts"(){"use strict";so(),nGt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(nGt||{}),VZe=a(({exitCode:t},e,r,n)=>{if(t===128&&XKo(e))return r(Buffer.from("false"));n(e)},"onError"),_Gt=a(t=>t.trim()==="true","parser")}});function eJo(t,e){let r=new STn(t),n=t?ITn:TTn;return uwe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(xTn.test(s)?r.folders:r.files).push(s)}),r}a(eJo,"cleanSummaryParser");var STn,TTn,ITn,xTn,tJo=Zr({"src/lib/responses/CleanSummary.ts"(){"use strict";so(),STn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},TTn=/^[a-z]+\s*/i,ITn=/^[a-z]+\s+[a-z]+\s*/i,xTn=/\/$/}}),iGt={};Zh(iGt,{EMPTY_COMMANDS:a(()=>WZe,"EMPTY_COMMANDS"),adhocExecTask:a(()=>wTn,"adhocExecTask"),configurationErrorTask:a(()=>GC,"configurationErrorTask"),isBufferTask:a(()=>PTn,"isBufferTask"),isEmptyTask:a(()=>kTn,"isEmptyTask"),straightThroughBufferTask:a(()=>RTn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>G_,"straightThroughStringTask")});function wTn(t){return{commands:WZe,format:"empty",parser:t}}a(wTn,"adhocExecTask");function GC(t){return{commands:WZe,format:"empty",parser(){throw typeof t=="string"?new iTn(t):t}}}a(GC,"configurationErrorTask");function G_(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(G_,"straightThroughStringTask");function RTn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(RTn,"straightThroughBufferTask");function PTn(t){return t.format==="buffer"}a(PTn,"isBufferTask");function kTn(t){return t.format==="empty"||!t.commands.length}a(kTn,"isEmptyTask");var WZe,Zp=Zr({"src/lib/tasks/task.ts"(){"use strict";oTn(),WZe=[]}}),DTn={};Zh(DTn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>vGt,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>CGt,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>bGt,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>NZe,"CleanOptions"),cleanTask:a(()=>NTn,"cleanTask"),cleanWithOptionsTask:a(()=>rJo,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>nJo,"isCleanOptionsArray")});function rJo(t,e){let{cleanMode:r,options:n,valid:o}=iJo(t);return r?o.options?(n.push(...e),n.some(aJo)?GC(vGt):NTn(r,n)):GC(bGt+JSON.stringify(t)):GC(CGt)}a(rJo,"cleanWithOptionsTask");function NTn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return eJo(t==="n",n)}}}a(NTn,"cleanTask");function nJo(t){return Array.isArray(t)&&t.every(e=>SGt.has(e))}a(nJo,"isCleanOptionsArray");function iJo(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{oJo(o)?(e=o,n.cleanMode=!0):n.options=n.options&&sJo(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(iJo,"getCleanOptions");function oJo(t){return t==="f"||t==="n"}a(oJo,"isCleanMode");function sJo(t){return/^-[a-z]$/i.test(t)&&SGt.has(t.charAt(1))}a(sJo,"isKnownOption");function aJo(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(aJo,"isInteractiveMode");var vGt,CGt,bGt,NZe,SGt,MTn=Zr({"src/lib/tasks/clean.ts"(){"use strict";tJo(),so(),Zp(),vGt="Git clean interactive mode is not supported",CGt='Git clean mode parameter ("n" or "f") is required',bGt="Git clean unknown option found in: ",NZe=(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))(NZe||{}),SGt=new Set(["i",...Oue(Object.values(NZe))])}});function cJo(t){let e=new BTn;for(let r of OTn(t))e.addValue(r.file,String(r.key),r.value);return e}a(cJo,"configListParser");function lJo(t,e){let r=null,n=[],o=new Map;for(let s of OTn(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(lJo,"configGetParser");function uJo(t){return t.replace(/^(file):/,"")}a(uJo,"configFilePath");function*OTn(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=KK(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 VHt(t,e){return typeof t=="string"&&Object.hasOwn(oGt,t)?t:e}a(VHt,"asConfigScope");function fJo(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(fJo,"addConfigTask");function pJo(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 lJo(n,t)}}}a(pJo,"getConfigTask");function hJo(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return cJo(r)}}}a(hJo,"listConfigTask");function mJo(){return{addConfig(t,e,...r){return this._runTask(fJo(t,e,r[0]===!0,VHt(r[1],"local")),Bd(arguments))},getConfig(t,e){return this._runTask(pJo(t,VHt(e,void 0)),Bd(arguments))},listConfig(...t){return this._runTask(hJo(VHt(t[0],void 0)),Bd(arguments))}}}a(mJo,"config_default");var oGt,LTn=Zr({"src/lib/tasks/config.ts"(){"use strict";dJo(),so(),oGt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(oGt||{})}});function gJo(t){return FTn.has(t)}a(gJo,"isDiffNameStatus");var WHt,FTn,UTn=Zr({"src/lib/tasks/diff-name-status.ts"(){"use strict";WHt=(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))(WHt||{}),FTn=new Set(Object.values(WHt))}});function AJo(...t){return new qTn().param(...t)}a(AJo,"grepQueryBuilder");function yJo(t){let e=new Set,r={};return mGt(t,n=>{let[o,s,c]=n.split(Due);e.add(o),(r[o]=r[o]||[]).push({line:mu(s),path:o,preview:c})}),{paths:e,results:r}}a(yJo,"parseGrep");function EJo(){return{grep(t){let e=Bd(arguments),r=H_(arguments);for(let o of QTn)if(r.includes(o))return this._runTask(GC(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=AJo().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return yJo(o)}},e)}}}a(EJo,"grep_default");var QTn,swe,xSn,qTn,jTn=Zr({"src/lib/tasks/grep.ts"(){"use strict";so(),Zp(),QTn=["-h"],swe=Symbol("grepQuery"),qTn=class{static{a(this,"GrepQuery")}constructor(){this[xSn]=[]}*[(xSn=swe,Symbol.iterator)](){for(let t of this[swe])yield t}and(...t){return t.length&&this[swe].push("--and","(",...awe(t,"-e"),")"),this}param(...t){return this[swe].push(...awe(t,"-e")),this}}}}),HTn={};Zh(HTn,{ResetMode:a(()=>MZe,"ResetMode"),getResetMode:a(()=>vJo,"getResetMode"),resetTask:a(()=>_Jo,"resetTask")});function _Jo(t,e){let r=["reset"];return GTn(t)&&r.push(`--${t}`),r.push(...e),G_(r)}a(_Jo,"resetTask");function vJo(t){if(GTn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(vJo,"getResetMode");function GTn(t){return typeof t=="string"&&$Tn.includes(t)}a(GTn,"isValidResetMode");var MZe,$Tn,VTn=Zr({"src/lib/tasks/reset.ts"(){"use strict";so(),Zp(),MZe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(MZe||{}),$Tn=Oue(Object.values(MZe))}});function CJo(){return(0,UZe.default)("simple-git")}a(CJo,"createLog");function wSn(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(wSn,"prefixedLogger");function bJo(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(bJo,"childLoggerName");function TGt(t,e,r,n=CJo()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=bJo(sE(e,op),c,n);return d(r);function u(f,h){return sw(s,TGt(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&&wSn(c,h)||JK,g=wSn(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(TGt,"createLogger");var WTn=Zr({"src/lib/git-logger.ts"(){"use strict";so(),UZe.default.formatters.L=t=>String($Ze(t)?t.length:"-"),UZe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):dwe(t)}}),zTn,SJo=Zr({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Dq(),WTn(),zTn=class sGt{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=sGt.getName(e.commands[0]),n=TGt(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 W3(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++sGt.counter}`}static{this.counter=0}}}});function YK(t,e){return{method:lTn(t.commands)||"",commands:e}}a(YK,"pluginContext");function TJo(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(TJo,"onErrorReceived");function RSn(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(RSn,"onDataReceived");var aGt,IJo=Zr({"src/lib/runners/git-executor-chain.ts"(){"use strict";Dq(),Zp(),so(),SJo(),aGt=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 zTn}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(kTn(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 W3?Object.assign(e,{task:t}):new W3(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","",YK(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...YK(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)?rGt(t.parser,s):rGt(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},{...YK(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",dwe(h)),u(new FZe(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 FZe(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},YK(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,{...YK(t,r),kill(m){f=m||f}});let h=(0,YTn.spawn)(e,r,c);h.stdout.on("data",RSn(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",RSn(d,"stdErr",o,s.step("stdErr"))),h.on("error",TJo(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,{...YK(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,{...YK(t,e),kill(n){r=n||r}}),r}}}}),KTn={};Zh(KTn,{GitExecutor:a(()=>JTn,"GitExecutor")});var JTn,xJo=Zr({"src/lib/runners/git-executor.ts"(){"use strict";IJo(),JTn=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new aGt(this,this._scheduler,this._plugins)}chain(){return new aGt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function wJo(t,e,r=JK){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof lwe?RJo(s):s,void 0)},"onError2");e.then(n,o)}a(wJo,"taskCallback");function RJo(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=JK},"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(RJo,"addDeprecationNoticeToError");var PJo=Zr({"src/lib/task-callback.ts"(){"use strict";Mue(),so()}});function PSn(t,e){return wTn(r=>{if(!gGt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a(PSn,"changeWorkingDirectoryTask");var kJo=Zr({"src/lib/tasks/change-working-directory.ts"(){"use strict";so(),Zp()}});function zHt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=jZe(e,"-B")),G_(e)}a(zHt,"checkoutTask");function DJo(){return{checkout(){return this._runTask(zHt(H_(arguments,1)),Bd(arguments))},checkoutBranch(t,e){return this._runTask(zHt(["-b",t,e,...H_(arguments)]),Bd(arguments))},checkoutLocalBranch(t){return this._runTask(zHt(["-b",t,...H_(arguments)]),Bd(arguments))}}}a(DJo,"checkout_default");var NJo=Zr({"src/lib/tasks/checkout.ts"(){"use strict";so(),Zp()}});function MJo(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(MJo,"countObjectsResponse");function OJo(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return $C(MJo(),[ZTn],t)}})}}}a(OJo,"count_objects_default");var ZTn,BJo=Zr({"src/lib/tasks/count-objects.ts"(){"use strict";so(),ZTn=new Po(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=fTn(e);Object.hasOwn(t,n)&&(t[n]=mu(r))})}});function LJo(t){return $C({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},XTn,t)}a(LJo,"parseCommitResult");var XTn,FJo=Zr({"src/lib/parsers/parse-commit.ts"(){"use strict";so(),XTn=[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 UJo(t,e,r){return{commands:["-c","core.abbrev=40","commit",...awe(t,"-m"),...e,...r],format:"utf-8",parser:LJo}}a(UJo,"commitTask");function QJo(){return{commit(e,...r){let n=Bd(arguments),o=t(e)||UJo(MO(e),MO(sE(r[0],LZe,[])),[...Oue(sE(r[1],fwe,[])),...H_(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!LZe(e)&&GC("git.commit: requires the commit message to be supplied as a string/string[]")}}a(QJo,"commit_default");var qJo=Zr({"src/lib/tasks/commit.ts"(){"use strict";FJo(),so(),Zp()}});function jJo(){return{firstCommit(){return this._runTask(G_(["rev-list","--max-parents=0","HEAD"],!0),Bd(arguments))}}}a(jJo,"first_commit_default");var HJo=Zr({"src/lib/tasks/first-commit.ts"(){"use strict";so(),Zp()}});function GJo(t,e){let r=["hash-object",t];return e&&r.push("-w"),G_(r,!0)}a(GJo,"hashObjectTask");var $Jo=Zr({"src/lib/tasks/hash-object.ts"(){"use strict";Zp()}});function VJo(t,e,r){let n=String(r).trim(),o;if(o=eIn.exec(n))return new OZe(t,e,!1,o[1]);if(o=tIn.exec(n))return new OZe(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new OZe(t,e,/^re/i.test(n),s)}a(VJo,"parseInit");var OZe,eIn,tIn,WJo=Zr({"src/lib/responses/InitSummary.ts"(){"use strict";OZe=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},eIn=/^Init.+ repository in (.+)$/,tIn=/^Rein.+ in (.+)$/}});function zJo(t){return t.includes(IGt)}a(zJo,"hasBareCommand");function YJo(t=!1,e,r){let n=["init",...r];return t&&!zJo(n)&&n.splice(1,0,IGt),{commands:n,format:"utf-8",parser(o){return VJo(n.includes("--bare"),e,o)}}}a(YJo,"initTask");var IGt,KJo=Zr({"src/lib/tasks/init.ts"(){"use strict";WJo(),IGt="--bare"}});function xGt(t){for(let e=0;e$C(new rIn,e,r,!1)}a(nIn,"getDiffParser");var YHt,kSn,DSn,NSn,iIn,oIn=Zr({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";pwe(),ZJo(),UTn(),so(),YHt=[new Po(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:mu(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:mu(r),after:mu(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=mu(e),t.insertions=mu(n?.[1]),t.deletions=mu(o?.[1])})],kSn=[new Po(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=mu(e),s=mu(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})})],DSn=[new Po(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],NSn=[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:XHt(gJo(e)&&e),from:XHt(!!s&&n!==s&&n),similarity:mu(r)})})],iIn={"":YHt,"--stat":YHt,"--numstat":kSn,"--name-status":NSn,"--name-only":DSn}}});function XJo(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(XJo,"lineBuilder");function sIn(t=kGt,e=aIn,r=""){let n=nIn(r);return function(o){let s=uwe(o.trim(),!1,RGt).map(function(c){let l=c.split(PGt),u=XJo(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(sIn,"createListLogSummaryParser");var RGt,PGt,kGt,aIn,cIn=Zr({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";so(),oIn(),pwe(),RGt="\xF2\xF2\xF2\xF2\xF2\xF2 ",PGt=" \xF2\xF2",kGt=" \xF2 ",aIn=["hash","date","message","refs","author_name","author_email"]}}),lIn={};Zh(lIn,{diffSummaryTask:a(()=>eZo,"diffSummaryTask"),validateLogFormatConfig:a(()=>zZe,"validateLogFormatConfig")});function eZo(t){let e=xGt(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),zZe(r)||{commands:r,format:"utf-8",parser:nIn(e)}}a(eZo,"diffSummaryTask");function zZe(t){let e=t.filter(JJo);if(e.length>1)return GC(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return GC(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}a(zZe,"validateLogFormatConfig");var DGt=Zr({"src/lib/tasks/diff.ts"(){"use strict";pwe(),oIn(),Zp()}});function tZo(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(tZo,"prettyFormat");function rZo(t){return Object.keys(t).reduce((e,r)=>(r in cGt||(e[r]=t[r]),e),{})}a(rZo,"userOptions");function uIn(t={},e=[]){let r=sE(t.splitter,op,kGt),n=GZe(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]=tZo(n,r),c=[],l=[`--pretty=format:${RGt}${s}${PGt}`,...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 op(t.file)&&l.push("--follow",Tue(t.file)),yGt(rZo(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(uIn,"parseLogOptions");function nZo(t,e,r){let n=sIn(t,e,xGt(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(nZo,"logTask");function iZo(){return{log(...r){let n=Bd(arguments),o=uIn(EGt(arguments),Oue(sE(arguments[0],fwe,[]))),s=e(...r)||zZe(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return nZo(r.splitter,r.fields,r.commands)}function e(r,n){return op(r)&&op(n)&&GC("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(iZo,"log_default");var cGt,dIn=Zr({"src/lib/tasks/log.ts"(){"use strict";pwe(),cIn(),so(),Zp(),DGt(),cGt=(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))(cGt||{})}}),BZe,fIn,oZo=Zr({"src/lib/responses/MergeSummary.ts"(){"use strict";BZe=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}`}},fIn=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"}}}}),lGt,pIn,sZo=Zr({"src/lib/responses/PullSummary.ts"(){"use strict";lGt=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}}},pIn=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function KHt(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(KHt,"objectEnumerationResult");function MSn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:mu(e&&e[1]||"0"),delta:mu(r&&r[1]||"0")}}a(MSn,"asObjectCount");var hIn,aZo=Zr({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";so(),hIn=[new kq(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=KHt(t.remoteMessages);Object.assign(o,{[n]:mu(r)})}),new kq(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=KHt(t.remoteMessages);Object.assign(o,{[n]:mu(r)})}),new kq(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=KHt(t.remoteMessages);o.total=MSn(e),o.reused=MSn(r),o.packReused=mu(n)})]}});function mIn(t,e){return $C({remoteMessages:new AIn},gIn,e)}a(mIn,"parseRemoteMessages");var gIn,AIn,yIn=Zr({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";so(),aZo(),gIn=[new kq(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...hIn,new kq([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new kq([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:mu(e),summary:r,url:n}})],AIn=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function cZo(t,e){let r=$C(new pIn,EIn,[t,e]);return r.message&&r}a(cZo,"parsePullErrorResult");var OSn,BSn,LSn,FSn,EIn,USn,NGt,_In=Zr({"src/lib/parsers/parse-pull.ts"(){"use strict";sZo(),so(),yIn(),OSn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,BSn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,LSn=/^(create|delete) mode \d+ (.+)/,FSn=[new Po(OSn,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new Po(BSn,(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(LSn,(t,[e,r])=>{sw(t.files,r),sw(e==="create"?t.created:t.deleted,r)})],EIn=[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})],USn=a((t,e)=>$C(new lGt,FSn,[t,e]),"parsePullDetail"),NGt=a((t,e)=>Object.assign(new lGt,USn(t,e),mIn(t,e)),"parsePullResult")}}),QSn,vIn,qSn,lZo=Zr({"src/lib/parsers/parse-merge.ts"(){"use strict";oZo(),so(),_In(),QSn=[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 BZe(e,r))}),new Po(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new BZe(e,r,{deleteRef:n}))}),new Po(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new BZe(e,null))}),new Po(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],vIn=a((t,e)=>Object.assign(qSn(t,e),NGt(t,e)),"parseMergeResult"),qSn=a(t=>$C(new fIn,QSn,t),"parseMergeDetail")}});function jSn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=vIn(e,r);if(n.failed)throw new lwe(n);return n}}:GC("Git.merge requires at least one option")}a(jSn,"mergeTask");var uZo=Zr({"src/lib/tasks/merge.ts"(){"use strict";Mue(),lZo(),Zp()}});function dZo(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(dZo,"pushResultPushedItem");var HSn,CIn,GSn,fZo=Zr({"src/lib/parsers/parse-push.ts"(){"use strict";so(),yIn(),HSn=[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(dZo(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}}})],CIn=a((t,e)=>{let r=GSn(t,e),n=mIn(t,e);return{...r,...n}},"parsePushResult"),GSn=a((t,e)=>$C({pushed:[]},HSn,[t,e]),"parsePushDetail")}}),bIn={};Zh(bIn,{pushTagsTask:a(()=>pZo,"pushTagsTask"),pushTask:a(()=>MGt,"pushTask")});function pZo(t={},e){return sw(e,"--tags"),MGt(t,e)}a(pZo,"pushTagsTask");function MGt(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),jZe(r,"-v"),sw(r,"--verbose"),sw(r,"--porcelain"),{commands:r,format:"utf-8",parser:CIn}}a(MGt,"pushTask");var SIn=Zr({"src/lib/tasks/push.ts"(){"use strict";fZo(),so()}});function hZo(){return{showBuffer(){let t=["show",...H_(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(RTn(t),Bd(arguments))},show(){let t=["show",...H_(arguments,1)];return this._runTask(G_(t),Bd(arguments))}}}a(hZo,"show_default");var mZo=Zr({"src/lib/tasks/show.ts"(){"use strict";so(),Zp()}}),$Sn,TIn,gZo=Zr({"src/lib/responses/FileStatusSummary.ts"(){"use strict";$Sn=/^(.+)\0(.+)$/,TIn=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=$Sn.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function VSn(t){let[e,r]=t.split(Due);return{from:r||e,to:e}}a(VSn,"renamedFile");function VS(t,e,r){return[`${t}${e}`,r]}a(VS,"parser3");function JHt(t,...e){return e.map(r=>VS(t,r,(n,o)=>n.conflicted.push(o)))}a(JHt,"conflicts");function AZo(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 TIn(c,o,s))}a(n,"data")}a(AZo,"splitLine");var WSn,IIn,xIn,yZo=Zr({"src/lib/responses/StatusSummary.ts"(){"use strict";so(),gZo(),WSn=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([VS(" ","A",(t,e)=>t.created.push(e)),VS(" ","D",(t,e)=>t.deleted.push(e)),VS(" ","M",(t,e)=>t.modified.push(e)),VS("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),VS("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),VS("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),VS("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),VS("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),VS("R"," ",(t,e)=>{t.renamed.push(VSn(e))}),VS("R","M",(t,e)=>{let r=VSn(e);t.renamed.push(r),t.modified.push(r.to)}),VS("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),VS("?","?",(t,e)=>t.not_added.push(e)),...JHt("A","A","U"),...JHt("D","D","U"),...JHt("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=sE(l?.[1],op,null),l=s.exec(e),t.tracking=sE(l?.[1],op,null),l=c.exec(e),l&&(t.current=sE(l?.[1],op,t.current)),t.detached=/\(no branch\)/.test(e)}]]),xIn=a(function(t){let e=t.split(Due),r=new WSn;for(let n=0,o=e.length;n!wIn.includes(r))],parser(r){return xIn(r)}}}a(EZo,"statusTask");var wIn,_Zo=Zr({"src/lib/tasks/status.ts"(){"use strict";yZo(),wIn=["--null","-z"]}});function QZe(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(QZe,"versionResponse");function vZo(){return QZe(0,0,0,"",!1)}a(vZo,"notInstalledResponse");function CZo(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:bZo,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(OGt));n(e)}})}}}a(CZo,"version_default");function bZo(t){return t===OGt?vZo():$C(QZe(0,0,0,t),RIn,t)}a(bZo,"versionParser");var OGt,RIn,SZo=Zr({"src/lib/tasks/version.ts"(){"use strict";so(),OGt="installed=false",RIn=[new Po(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,QZe(mu(e),mu(r),mu(n),o))}),new Po(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,QZe(mu(e),mu(r),n,o))})]}});function zSn(t,e,r,...n){return op(r)?e(r,sE(n[0],op),H_(arguments)):GC(`git.${t}() requires a string 'repoPath'`)}a(zSn,"createCloneTask");function TZo(){return{clone(t,...e){return this._runTask(zSn("clone",uGt,sE(t,op),...e),Bd(arguments))},mirror(t,...e){return this._runTask(zSn("mirror",PIn,sE(t,op),...e),Bd(arguments))}}}a(TZo,"clone_default");var uGt,PIn,IZo=Zr({"src/lib/tasks/clone.ts"(){"use strict";Zp(),so(),uGt=a((t,e,r)=>{let n=["clone",...r];return op(t)&&n.push(Tue(t)),op(e)&&n.push(Tue(e)),G_(n)},"cloneTask"),PIn=a((t,e,r)=>(sw(r,"--mirror"),uGt(t,e,r)),"cloneMirrorTask")}}),kIn={};Zh(kIn,{SimpleGitApi:a(()=>dGt,"SimpleGitApi")});var dGt,xZo=Zr({"src/lib/simple-git-api.ts"(){"use strict";PJo(),kJo(),NJo(),BJo(),qJo(),LTn(),HJo(),jTn(),$Jo(),KJo(),dIn(),uZo(),SIn(),mZo(),_Zo(),Zp(),SZo(),so(),IZo(),dGt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&wJo(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(G_(["add",...MO(t)]),Bd(arguments))}cwd(t){let e=Bd(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(GC("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(GJo(t,e===!0),Bd(arguments))}init(t){return this._runTask(YJo(t===!0,this._executor.cwd,H_(arguments)),Bd(arguments))}merge(){return this._runTask(jSn(H_(arguments)),Bd(arguments))}mergeFromTo(t,e){return op(t)&&op(e)?this._runTask(jSn([t,e,...H_(arguments)]),Bd(arguments,!1)):this._runTask(GC("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=MGt({remote:sE(arguments[0],op),branch:sE(arguments[1],op)},H_(arguments));return this._runTask(t,Bd(arguments))}stash(){return this._runTask(G_(["stash",...H_(arguments)]),Bd(arguments))}status(){return this._runTask(EZo(H_(arguments)),Bd(arguments))}},Object.assign(dGt.prototype,DJo(),TZo(),QJo(),mJo(),OJo(),jJo(),EJo(),iZo(),hZo(),CZo())}}),DIn={};Zh(DIn,{Scheduler:a(()=>MIn,"Scheduler")});var YSn,MIn,wZo=Zr({"src/lib/runners/scheduler.ts"(){"use strict";so(),WTn(),YSn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,NIn.createDeferred)();return{promise:e,done:r,id:t}}})(),MIn=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=TGt("","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=sw(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),jZe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=sw(this.pending,YSn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),OIn={};Zh(OIn,{applyPatchTask:a(()=>RZo,"applyPatchTask")});function RZo(t,e){return G_(["apply",...e,...t])}a(RZo,"applyPatchTask");var PZo=Zr({"src/lib/tasks/apply-patch.ts"(){"use strict";Zp()}});function kZo(t,e){return{branch:t,hash:e,success:!0}}a(kZo,"branchDeletionSuccess");function DZo(t){return{branch:t,hash:null,success:!1}}a(DZo,"branchDeletionFailure");var BIn,NZo=Zr({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";BIn=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function LIn(t,e){return e===1&&fGt.test(t)}a(LIn,"hasBranchDeletionError");var KSn,fGt,JSn,YZe,MZo=Zr({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";NZo(),so(),KSn=/(\S+)\s+\(\S+\s([^)]+)\)/,fGt=/^error[^']+'([^']+)'/m,JSn=[new Po(KSn,(t,[e,r])=>{let n=kZo(e,r);t.all.push(n),t.branches[e]=n}),new Po(fGt,(t,[e])=>{let r=DZo(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],YZe=a((t,e)=>$C(new BIn,JSn,[t,e]),"parseBranchDeletions")}}),FIn,OZo=Zr({"src/lib/responses/BranchSummary.ts"(){"use strict";FIn=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 ZSn(t){return t?t.charAt(0):""}a(ZSn,"branchStatus");function UIn(t,e=!1){return $C(new FIn,e?[qIn]:QIn,t)}a(UIn,"parseBranchSummary");var QIn,qIn,BZo=Zr({"src/lib/parsers/parse-branch.ts"(){"use strict";OZo(),so(),QIn=[new Po(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(ZSn(e),!0,r,n,o)}),new Po(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(ZSn(e),!1,r,n,o)})],qIn=new Po(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),jIn={};Zh(jIn,{branchLocalTask:a(()=>FZo,"branchLocalTask"),branchTask:a(()=>LZo,"branchTask"),containsDeleteBranchCommand:a(()=>HIn,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>QZo,"deleteBranchTask"),deleteBranchesTask:a(()=>UZo,"deleteBranchesTask")});function HIn(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(HIn,"containsDeleteBranchCommand");function LZo(t){let e=HIn(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?YZe(o,s).all[0]:UIn(o,r)}}}a(LZo,"branchTask");function FZo(){return{format:"utf-8",commands:["branch","-v"],parser(t){return UIn(t)}}}a(FZo,"branchLocalTask");function UZo(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return YZe(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!LIn(String(o),r))return c(o);s(n)}}}a(UZo,"deleteBranchesTask");function QZo(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return YZe(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!LIn(String(c),n))return u(c);throw new lwe(r.parser(cwe(s),cwe(o)),String(c))}};return r}a(QZo,"deleteBranchTask");var qZo=Zr({"src/lib/tasks/branch.ts"(){"use strict";Mue(),MZo(),BZo(),so()}});function jZo(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,GIn.normalize)(e)}a(jZo,"toPath");var $In,HZo=Zr({"src/lib/responses/CheckIgnore.ts"(){"use strict";$In=a(t=>t.split(/\n/g).map(jZo).filter(Boolean),"parseCheckIgnore")}}),VIn={};Zh(VIn,{checkIgnoreTask:a(()=>GZo,"checkIgnoreTask")});function GZo(t){return{commands:["check-ignore",...t],format:"utf-8",parser:$In}}a(GZo,"checkIgnoreTask");var $Zo=Zr({"src/lib/tasks/check-ignore.ts"(){"use strict";HZo()}});function VZo(t,e){return $C({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},WIn,[t,e])}a(VZo,"parseFetchResult");var WIn,WZo=Zr({"src/lib/parsers/parse-fetch.ts"(){"use strict";so(),WIn=[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})})]}}),zIn={};Zh(zIn,{fetchTask:a(()=>YZo,"fetchTask")});function zZo(t){return/^--upload-pack(=|$)/.test(t)}a(zZo,"disallowedCommand");function YZo(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(zZo)?GC("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:VZo}}a(YZo,"fetchTask");var KZo=Zr({"src/lib/tasks/fetch.ts"(){"use strict";WZo(),Zp()}});function JZo(t){return $C({moves:[]},YIn,t)}a(JZo,"parseMoveResult");var YIn,ZZo=Zr({"src/lib/parsers/parse-move.ts"(){"use strict";so(),YIn=[new Po(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),KIn={};Zh(KIn,{moveTask:a(()=>XZo,"moveTask")});function XZo(t,e){return{commands:["mv","-v",...MO(t),e],format:"utf-8",parser:JZo}}a(XZo,"moveTask");var eXo=Zr({"src/lib/tasks/move.ts"(){"use strict";ZZo(),so()}}),JIn={};Zh(JIn,{pullTask:a(()=>tXo,"pullTask")});function tXo(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 NGt(o,s)},onError(o,s,c,l){let u=cZo(cwe(o.stdOut),cwe(o.stdErr));if(u)return l(new lwe(u));l(s)}}}a(tXo,"pullTask");var rXo=Zr({"src/lib/tasks/pull.ts"(){"use strict";Mue(),_In(),so()}});function nXo(t){let e={};return ZIn(t,([r])=>e[r]={name:r}),Object.values(e)}a(nXo,"parseGetRemotes");function iXo(t){let e={};return ZIn(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(iXo,"parseGetRemotesVerbose");function ZIn(t,e){mGt(t,r=>e(r.split(/\s+/)))}a(ZIn,"forEach");var oXo=Zr({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";so()}}),XIn={};Zh(XIn,{addRemoteTask:a(()=>sXo,"addRemoteTask"),getRemotesTask:a(()=>aXo,"getRemotesTask"),listRemotesTask:a(()=>cXo,"listRemotesTask"),remoteTask:a(()=>lXo,"remoteTask"),removeRemoteTask:a(()=>uXo,"removeRemoteTask")});function sXo(t,e,r){return G_(["remote","add",...r,t,e])}a(sXo,"addRemoteTask");function aXo(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?iXo:nXo}}a(aXo,"getRemotesTask");function cXo(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),G_(e)}a(cXo,"listRemotesTask");function lXo(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),G_(e)}a(lXo,"remoteTask");function uXo(t){return G_(["remote","remove",t])}a(uXo,"removeRemoteTask");var dXo=Zr({"src/lib/tasks/remote.ts"(){"use strict";oXo(),Zp()}}),exn={};Zh(exn,{stashListTask:a(()=>fXo,"stashListTask")});function fXo(t={},e){let r=uIn(t),n=["stash","list",...r.commands,...e],o=sIn(r.splitter,r.fields,xGt(n));return zZe(n)||{commands:n,format:"utf-8",parser:o}}a(fXo,"stashListTask");var pXo=Zr({"src/lib/tasks/stash-list.ts"(){"use strict";pwe(),cIn(),DGt(),dIn()}}),txn={};Zh(txn,{addSubModuleTask:a(()=>hXo,"addSubModuleTask"),initSubModuleTask:a(()=>mXo,"initSubModuleTask"),subModuleTask:a(()=>KZe,"subModuleTask"),updateSubModuleTask:a(()=>gXo,"updateSubModuleTask")});function hXo(t,e){return KZe(["add",t,e])}a(hXo,"addSubModuleTask");function mXo(t){return KZe(["init",...t])}a(mXo,"initSubModuleTask");function KZe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),G_(e)}a(KZe,"subModuleTask");function gXo(t){return KZe(["update",...t])}a(gXo,"updateSubModuleTask");var AXo=Zr({"src/lib/tasks/sub-module.ts"(){"use strict";Zp()}});function yXo(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?rxn(t,e):0}a(yXo,"singleSorted");function rxn(t,e){return t===e?0:t>e?1:-1}a(rxn,"sorted");function EXo(t){return t.trim()}a(EXo,"trimmed");function DZe(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(DZe,"toNumber");var XSn,nxn,_Xo=Zr({"src/lib/responses/TagList.ts"(){"use strict";XSn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},nxn=a(function(t,e=!1){let r=t.split(` -`).map(EXo).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return yXo(DZe(c[0]),DZe(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new XSn(r,n)},"parseTagList")}}),ixn={};Zh(ixn,{addAnnotatedTagTask:a(()=>bXo,"addAnnotatedTagTask"),addTagTask:a(()=>CXo,"addTagTask"),tagListTask:a(()=>vXo,"tagListTask")});function vXo(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return nxn(r,e)}}}a(vXo,"tagListTask");function CXo(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a(CXo,"addTagTask");function bXo(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(bXo,"addAnnotatedTagTask");var SXo=Zr({"src/lib/tasks/tag.ts"(){"use strict";_Xo()}}),TXo=jKo({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(xJo(),Jp(KTn)),{SimpleGitApi:n}=(xZo(),Jp(kIn)),{Scheduler:o}=(wZo(),Jp(DIn)),{adhocExecTask:s,configurationErrorTask:c}=(Zp(),Jp(iGt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(so(),Jp(ETn)),{applyPatchTask:E}=(PZo(),Jp(OIn)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:b,deleteBranchTask:T}=(qZo(),Jp(jIn)),{checkIgnoreTask:w}=($Zo(),Jp(VIn)),{checkIsRepoTask:R}=(bTn(),Jp(_Tn)),{cleanWithOptionsTask:x,isCleanOptionsArray:P}=(MTn(),Jp(DTn)),{diffSummaryTask:D}=(DGt(),Jp(lIn)),{fetchTask:N}=(KZo(),Jp(zIn)),{moveTask:B}=(eXo(),Jp(KIn)),{pullTask:L}=(rXo(),Jp(JIn)),{pushTagsTask:j}=(SIn(),Jp(bIn)),{addRemoteTask:M,getRemotesTask:O,listRemotesTask:q,remoteTask:Q,removeRemoteTask:U}=(dXo(),Jp(XIn)),{getResetMode:z,resetTask:$}=(VTn(),Jp(HTn)),{stashListTask:W}=(pXo(),Jp(exn)),{addSubModuleTask:J,initSubModuleTask:ne,subModuleTask:H,updateSubModuleTask:re}=(AXo(),Jp(txn)),{addAnnotatedTagTask:ae,addTagTask:Be,tagListTask:ve}=(SXo(),Jp(ixn)),{straightThroughBufferTask:Ue,straightThroughStringTask:Pe}=(Zp(),Jp(iGt));function Z(ee,K){this._plugins=K,this._executor=new r(ee.baseDir,new o(ee.maxConcurrentProcesses),K),this._trimmed=ee.trimmed}a(Z,"Git2"),(Z.prototype=Object.create(n.prototype)).constructor=Z,Z.prototype.customBinary=function(ee){return this._plugins.reconfigure("binary",ee),this},Z.prototype.env=function(ee,K){return arguments.length===1&&typeof ee=="object"?this._executor.env=ee:(this._executor.env=this._executor.env||{})[ee]=K,this},Z.prototype.stashList=function(ee){return this._runTask(W(y(arguments)||{},u(ee)&&ee||[]),A(arguments))},Z.prototype.mv=function(ee,K){return this._runTask(B(ee,K),A(arguments))},Z.prototype.checkoutLatestTag=function(ee){var K=this;return this.pull(function(){K.tags(function(he,X){K.checkout(X.latest,ee)})})},Z.prototype.pull=function(ee,K,he,X){return this._runTask(L(m(ee,f),m(K,f),g(arguments)),A(arguments))},Z.prototype.fetch=function(ee,K){return this._runTask(N(m(ee,f),m(K,f),g(arguments)),A(arguments))},Z.prototype.silent=function(ee){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},Z.prototype.tags=function(ee,K){return this._runTask(ve(g(arguments)),A(arguments))},Z.prototype.rebase=function(){return this._runTask(Pe(["rebase",...g(arguments)]),A(arguments))},Z.prototype.reset=function(ee){return this._runTask($(z(ee),g(arguments)),A(arguments))},Z.prototype.revert=function(ee){let K=A(arguments);return typeof ee!="string"?this._runTask(c("Commit must be a string"),K):this._runTask(Pe(["revert",...g(arguments,0,!0),ee]),K)},Z.prototype.addTag=function(ee){let K=typeof ee=="string"?Be(ee):c("Git.addTag requires a tag name");return this._runTask(K,A(arguments))},Z.prototype.addAnnotatedTag=function(ee,K){return this._runTask(ae(ee,K),A(arguments))},Z.prototype.deleteLocalBranch=function(ee,K,he){return this._runTask(T(ee,typeof K=="boolean"?K:!1),A(arguments))},Z.prototype.deleteLocalBranches=function(ee,K,he){return this._runTask(b(ee,typeof K=="boolean"?K:!1),A(arguments))},Z.prototype.branch=function(ee,K){return this._runTask(_(g(arguments)),A(arguments))},Z.prototype.branchLocal=function(ee){return this._runTask(v(),A(arguments))},Z.prototype.raw=function(ee){let K=!Array.isArray(ee),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.")))},Z.prototype.checkIgnore=function(ee,K){return this._runTask(w(l(m(ee,h,[]))),A(arguments))},Z.prototype.checkIsRepo=function(ee,K){return this._runTask(R(m(ee,f)),A(arguments))},e.exports=Z}});Dq();var IXo=class extends W3{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};Dq();Dq();var Nue=class extends W3{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};Mue();oTn();bTn();MTn();LTn();UTn();jTn();VTn();function xXo(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new Nue(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new Nue(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(xXo,"abortPlugin");function wXo(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of ISn(e,r))if(t[n.category]!==!0)throw new Nue(void 0,"unsafe",n.message);return e}}}a(wXo,"blockUnsafeOperationsPlugin");so();function RXo(t){let e=awe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(RXo,"commandConfigPrefixingPlugin");so();var eTn=(0,kue.deferred)().promise;function PXo({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,kue.deferred)(),closeTimeout:(0,kue.deferred)(),exit:(0,kue.deferred)(),exitTimeout:(0,kue.deferred)()},c=Promise.race([t===!1?eTn:s.closeTimeout.promise,e===!1?eTn: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(()=>ZHt(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 ZHt(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(PXo,"completionDetectionPlugin");so();var kXo="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",tTn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function DXo(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}a(DXo,"isBadArgument");function rTn(t,e){if(t.length<1||t.length>2)throw new Nue(void 0,"binary",kXo);if(t.some(DXo))if(e)console.warn(tTn);else throw new Nue(void 0,"binary",tTn);let[n,o]=t;return{binary:n,prefix:o}}a(rTn,"toBinaryConfig");function NXo(t,e=["git"],r=!1){let n=rTn(MO(e),r);t.on("binary",o=>{n=rTn(MO(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(NXo,"customBinaryPlugin");Dq();function MXo(t){return!!(t.exitCode&&t.stdErr.length)}a(MXo,"isTaskError");function OXo(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(OXo,"getErrorMessage");function BXo(t=!1,e=MXo,r=OXo){return(n,o)=>!t&&n||!e(o)?n:r(o)}a(BXo,"errorDetectionHandler");function nTn(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 W3(void 0,n.toString("utf-8"))}:{error:n}}}}a(nTn,"errorDetectionPlugin");so();var LXo=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new oxn.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=sw(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return MO(t).forEach(r=>r&&this.plugins.add(sw(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}};so();function FXo(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?dTn(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:UXo(u[1]),progress:mu(u[2]),processed:mu(u[3]),total:mu(u[4])})})}}]}a(FXo,"progressMonitorPlugin");function UXo(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(UXo,"progressEventStage");so();function QXo(t){let e=pTn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(QXo,"spawnOptionsPlugin");function qXo({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 Nue(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(qXo,"timeoutPlugin");function jXo(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;onw(c)&&Iue(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a(jXo,"suffixPathsPlugin");so();var HXo=TXo();function GXo(t,e){let r=new LXo,n=ATn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!gGt(n.baseDir))throw new IXo(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(RXo(n.config)),r.add(wXo(n.unsafe)),r.add(PXo(n.completion)),n.abort&&r.add(xXo(n.abort)),n.progress&&r.add(FXo(n.progress)),n.timeout&&r.add(qXo(n.timeout)),n.spawnOptions&&r.add(QXo(n.spawnOptions)),r.add(jXo()),r.add(nTn(BXo(!0))),n.errors&&r.add(nTn(n.errors)),NXo(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new HXo(n,r)}a(GXo,"gitInstanceFactory");Mue();var Bue=GXo;var aw=new pe("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 pO()).path;n=Bue({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,axn.join)(n,r);return Ta(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){aw.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){aw.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){aw.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){aw.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){aw.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 aw.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};aw.warn(this.ctx,`Failed to diff with indexed commit ${r}, falling back to upstream`)}if(!await this.hasUpstream(e)){aw.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){aw.warn(this.ctx,`Failed to diff with indexed commit for ${e}`,n);return}}normalizeRepoPath(e){if(e.startsWith("file://"))try{return(0,sxn.fileURLToPath)(e)}catch(r){aw.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 aw.error(this.ctx,`Failed to parse URI with fallback: ${e}`,n),e}}return e}dispose(){this.gitInstances.clear(),this._upstreamCache.clear()}};var cxn=de(Yc());var Kk=new pe("Local Diff Tracker");var ZZe=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(r0),this._diffRefreshTimer=new cxn.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{Kk.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):Kk.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`)}catch(e){Kk.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){Kk.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)&&Kk.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?Kk.warn(this.ctx,n,o):Kk.warn(this.ctx,n):o!==void 0?Kk.debug(this.ctx,n,o):Kk.debug(this.ctx,n)}dispose(){this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var Nq;(n=>{function t(o){return new BGt(o)}n.ok=t,a(t,"ok");function e(o){return new LGt(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(Nq||={});var BGt=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}},LGt=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 FGt=new pe("GithubAvailableEmbeddingTypes"),XZe=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Ut).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):Nq.error({type:"noSession"}))}static{a(this,"GithubAvailableEmbeddingTypesManager")}async getAllAvailableTypes(){if(this._cached){let e=this._cached;try{let r=await this._cached;if(r.isOk())return r}catch{}this._cached===e&&(this._cached=void 0)}return this._cached??=(async()=>{let e=await this._ctx.get(Ut).getGitHubSession();return e?await this.doGetAvailableTypes(e):Nq.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=bue(this._ctx);r=await qf(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return FGt.error(this._ctx,"Error fetching available embedding types",c),Nq.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?Nq.error({type:"unauthorized",status:r.status}):Nq.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new HC(c.id);c.active===!1?s.push(l):o.push(l)}return Nq.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){FGt.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return FGt.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var $Xo=new pe("GithubEmbeddingComputer"),Lue=class{constructor(e){this.ctx=e;this.batchSize=100}static{a(this,"GithubEmbeddingComputer")}async computeEmbeddings(e,r,n,o){try{let s=await this.ctx.get(Ut).getGitHubSession();if(!s)throw new Error("No GitHub session available");let c=[],l;for(let u=0;u0&&(l=f[0].type),c.push(...f)}if(!l)throw new Error("No embedding type resolved from API response");return{type:l,values:c}}catch(s){$Xo.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 qf(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 HC(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 hwe=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var lxn=de(EA()),uxn=de(J9()),dxn=require("os"),UGt=de(require("path")),Fue=require("process");function eXe(t){let e=gn(t.workspaceFolder.uri),r=(0,lxn.basename)(e),o=(0,uxn.SHA256)(e).toString().substring(0,8);return UGt.default.join(VXo(),"project-index",`${r}.${o}`)}a(eXe,"getWorkspaceCachePath");function VXo(){return Fue.env.XDG_CACHE_HOME&&UGt.default.isAbsolute(Fue.env.XDG_CACHE_HOME)?Fue.env.XDG_CACHE_HOME+"/github-copilot":(0,dxn.platform)()==="win32"?Fue.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":Fue.env.HOME+"/.cache/github-copilot"}a(VXo,"getXdgCachePath");p();p();function fxn(t){if(FHt(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(QGt,"unpackEmbedding");p();var pxn=de(Yc()),hxn=de(bk()),jGt=de(zp()),mxn=de(require("fs")),HGt=de(require("node:sqlite")),GGt=de(require("path"));var qGt=new pe("WorkspaceChunkAndEmbeddingCache");async function gxn(t,e,r,n){return await $Gt.create(t,e,r??":memory:",n)}a(gxn,"createWorkspaceChunkAndEmbeddingCache");var $Gt=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new hxn.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=GGt.default.join(n,"workspace-chunks.db");try{await mxn.default.promises.mkdir(GGt.default.dirname(d),{recursive:!0}),c=new HGt.default.DatabaseSync(d,s),qGt.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${d}`)}catch(f){qGt.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",f)}}c||(c=new HGt.default.DatabaseSync(":memory:",s),qGt.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` +`)}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(` PRAGMA journal_mode = OFF; PRAGMA synchronous = 0; PRAGMA cache_size = ${-32768}; @@ -2811,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=ro(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=QGt(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new jGt.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=ro(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 jGt.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:QGt(this.embeddingType,l.embedding),chunkHash:l.chunkHash}))}}async update(e,r){let n=ro(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,pxn.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,fxn(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var Axn=de(Al()),mwe=de(Yc()),yxn=de(u3());var tXe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new yxn.Lazy(async()=>(this._cacheRoot=eXe(this._workspaceFileIndex),await gxn(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 hwe,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,mwe.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,mwe.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return nSn(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 hwe,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,Axn.coalesce)(s).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,mwe.raceCancellationError)(this._cache.value,s),l=await(0,mwe.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 Exn=de(Yc()),_xn=de(bk()),Uue=de(iO());var xA=new pe("Embeddings Search"),rXe=class t{constructor(e,r,n,o){this._ctx=e;this._workspaceFileIndex=r;this.embeddingType=n;this.chunkingEndpointClient=o;this.id="embeddings";this._state="unknown";this._disposeCts=new jn.CancellationTokenSource;this._reindexRequests=new _xn.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(xA.info(this._ctx,"Triggering local indexing..."),await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAutomaticIndexing"){xA.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 Uue.StopWatch;xA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:TA(r),indexStatus:this._state});let s=await this._ctx.get(Ut).getGitHubSession();if(!s)throw xA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let c=e.resolveQueryEmbeddings(n);if(await this.doInitialIndexing(),jh(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new Uue.StopWatch,d=await this._embeddingsIndex.searchWorkspace(s,c,TA(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 xA.info(this._ctx,`Workspace search completed successfully in ${h}ms`,{totalTime:h,searchTime:f,chunkCount:m,uniqueFileCount:A,indexStatus:this._state}),o0.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,oE.Aggregate),{chunks:d}}else{xA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),o0.sendEmbeddingsSkipped(this._ctx,"index_not_ready");return}}async searchFiles(e,r,n,o){if(!n.length)return xA.info(this._ctx,"No files to search, returning empty results"),{chunks:[]};let s=new Uue.StopWatch;xA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:TA(r),fileCount:n.length});let c=await this._ctx.get(Ut).getGitHubSession();if(!c)throw xA.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){xA.info(this._ctx,"Too many files for subset search",{fileCount:n.length});return}jh(o);let d=new Uue.StopWatch,f=await u.searchSubsetOfFiles(c,n,l,TA(r),o),h=d.elapsed(),m=s.elapsed(),g=f.length,y=new Set(f.map(_=>_.chunk.file)).size,E=this._workspaceFileIndex.fileCount;return xA.info(this._ctx,`File subset search completed successfully in ${m}ms`,{totalTime:m,searchTime:h,chunkCount:g,uniqueFileCount:y}),o0.sendEmbeddingsSuccess(this._ctx,m,h,g,y,E,oE.Remote),{chunks:f}}async initializeForFileSubset(e){await this._workspaceFileIndex.initialize();let r=this.getAutoIndexFileCap();if(e>r){xA.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?(xA.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 tXe(this._ctx,this.embeddingType,this._workspaceFileIndex,this.chunkingEndpointClient),xA.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 Uue.StopWatch;xA.info(this._ctx,"Starting workspace indexing...",{fileCount:this._workspaceFileIndex.fileCount}),this.setState("updatingIndex");try{let r=await this._ctx.get(Ut).getGitHubSession();if(!r)throw new Error("No GitHub session found");await this._embeddingsIndex?.triggerIndexingOfWorkspace(r,new jn.CancellationTokenSource().token),this.setState("ready"),xA.info(this._ctx,`Workspace indexing completed in ${e.elapsed()}ms`,{status:"ready",indexingTime:e.elapsed()})}catch(r){xA.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=ro(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=ro(o),c=this._reindexRequests.get(s);c||(c=new Exn.Delayer(n),this._reindexRequests.set(s,c)),c.trigger(async()=>{if(await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let l=await this._ctx.get(Ut).getGitHubSession();this._embeddingsIndex?.triggerIndexingOfFile(o,l,this._disposeCts.token)},r?0:n)}}};p();p();var Awe=de(cw());async function sXe(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 Awe.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&Dk(r.reason)))return Awe.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!Dk(r.reason))return Awe.Result.error({errorDiagMessage:r.reason+""});return Awe.Result.error({errorDiagMessage:"unknown error"})}a(sXe,"raceSearchOperations");var ywe=de(cw()),Ewe=de(Yc());var nes=2e3,ies=.7,Ixn=8e3,oes=300,aXe=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>nes)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>ies)}async searchLocalDiff(e,r,n,o){if(e.length===0)return ywe.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 ywe.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,Ewe.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return ywe.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>oes){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return ywe.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,Ewe.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 sXe([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,Ewe.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:nwe(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 xxn=de(require("path")),wxn=require("worker_threads");var JGt=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 ses(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(ses,"createRpcProxy");var lXe=class{constructor(e,r,n){this.responseHandler=new JGt;this.worker=new wxn.Worker(e,r),qIe(this.worker,xxn.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=ses((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 fXe=de(Yc()),Rxn=de(u3()),Pxn=de(Io()),Que=de(iO()),kxn=require("fs"),uXe=de(require("path"));var Xh=new pe("Tfidf Search"),aes=100,dXe=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 cXe(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new Rxn.Lazy(()=>{let s=this.firstExistingPath([uXe.join(__dirname,"tfidfWorker.js"),uXe.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)=>(Xh.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(Xh.error(r,u,...d),Promise.resolve()),"logError")};return new lXe(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(){Xh.info(this.ctx,"Starting initialization...");let r=new Que.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return Xh.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 Que.StopWatch;Xh.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:TA(n)});try{if(await this.initialize(),this._isDisposed)throw o0.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:TA(n),maxSpread:rwe},l=await r.resolveQuery(o),u=new Que.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();Xh.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),jh(o);let h=await this.applyEmbeddingReranking(l,d.chunks,TA(n),o),m=h.chunks.length,A=new Set(h.chunks.map(_=>_.chunk.file)).size,y=this._workspaceFileIndex.fileCount,E=s.elapsed();return Xh.info(this.ctx,`Search with reranking completed successfully in ${E}ms`,{totalTime:E,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),o0.sendTfidfSuccess(this.ctx,E,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,oE.Aggregate),{chunks:h.chunks}}catch(c){throw Xh.error(this.ctx,"TF-IDF search failed",c),o0.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new Que.StopWatch;if(Xh.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return Xh.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:TA(n),maxSpread:rwe},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));Xh.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,TA(n),s),A=g.chunks.length,E=new Set(g.chunks.map(v=>v.chunk.file)).size,_=c.elapsed();return Xh.info(this.ctx,`File-scoped search completed in ${_}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),o0.sendTfidfSuccess(this.ctx,_,m,g.telemetry.rerankTime,A,E,h.length,o.length,oE.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new Que.StopWatch,l=[];if(Xh.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new jn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,fXe.raceTimeout)(h,f,()=>{Xh.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,Xh.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(Xh.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){Xh.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 Xh.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),Xh.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),Xh.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new fXe.Limiter(aes),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($o).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=eXe(this._workspaceFileIndex);return uXe.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,kxn.existsSync)(n))return n}};p();p();p();var ZGt=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 e$t(e,r))}static forPaths(e=!1){return new t(new pXe(void 0,!e))}static forStrings(){return new t(new ZGt)}static forConfigKeys(){return new t(new XGt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);kqt(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);kqt(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 que,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 que,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new que,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new que,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=z3.unwrap(o.value);o.value=z3.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 z3.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:FK(!1);case 1:FK(!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=z3.unwrap(n.value)||o,n=n.mid;else break}return n&&z3.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?z3.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,z3.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 Dxn=de(Yc()),Nxn=de(require("fs")),Mxn=de(ri());var ces=1.5*1024*1024,t$t=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new Mxn.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}`}},mXe=class extends t$t{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($o).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(tc).evaluate(this.uri,o)).isBlocked?"":o}catch{return""}}async _readFile(){try{let r=gn(this.uri);return await this._fileReadLimiter.queue(async()=>({data:await(0,Dxn.raceCancellationError)(les(r,ces),this._disposedCts.token)}))}catch{return}}};async function les(t,e){return new Promise((r,n)=>{let o=Nxn.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(les,"readLocalTextFileUsingReadStream");var gXe=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new r$t;this._onDidCreateFiles=new Hi;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new Hi;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new Hi;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=Zo(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 mXe(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(Vx).getWatchedFileUris(this.workspaceFolder),r=this.ctx.get(tc);(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=Zo(o.uri);s&&this._fsFileTree.addFile(s,new mXe(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($o).stat(e)).type}catch{return}}},r$t=class{constructor(){this._tree=hXe.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 Oxn=de(Yc());var AXe=class extends eq{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new Hi;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new Hi;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(OS).addListener(this),this._fileReadLimiter=new Oxn.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 gXe(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 _we=de(cw()),Bxn=de(Al()),lw=de(Yc()),Oq=de(iO());var el=new pe("Semantic Search"),Jk=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new XZe(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 n$t(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)}},n$t=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 AXe(this._ctx),o=new SZe(this._ctx);this._localDiffSearch=new aXe(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new CZe(this._ctx),this._codeSearchChunkSearch=new TZe(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new rXe(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new dXe(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new ZZe(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&!Ck(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 Oq.StopWatch,s=await this.resolveQueryText(e,n);el.info(this._ctx,"Starting semantic search",{resolvedQuery:s,maxResults:TA(r),tokenBudget:r.tokenBudget,workspaceFolders:r.workspaceFolders});let c=this.toQueryWithEmbeddings(e,s),l=await this.doSearchFileChunks(c,r,n);if(l.isError())throw el.error(this._ctx,"Semantic search failed",l.err),o0.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);el.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,lw.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);el.info(this._ctx,"Chunks filtered",{beforeFilter:l.val.result.chunks.length,afterFilter:u.length});let d=await this.rerankChunks(c,u,TA(r),n),f=d.length,m=new Set(d.map(A=>A.chunk.file)).size,g=o.elapsed();return el.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),o0.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){jh(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(Dk(n))throw n;return el.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new Lue(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){el.info(this._ctx,"Starting semantic search with fallback strategy");let o=process.env.GITHUB_COPILOT_SIMULATION==="1"?1e6:12500;return this.runSearchStrategyWithFallback(this._codeSearchChunkSearch,()=>(0,lw.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new Oq.StopWatch;el.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,lw.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,lw.raceCancellationError)((0,lw.raceTimeout)(u,n),c);if(d?.isOk())return el.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;el.warn(this._ctx,`Primary strategy '${e.id}' failed or timed out, falling back to local search`,{elapsedTime:l.elapsed(),isTimeout:d===void 0,error:d?.isError()?d.err:void 0});let f=r();c.onCancellationRequested(()=>f.cancel()),f.then(()=>u.cancel(),()=>u.cancel());let h=new Oq.StopWatch,m=await sXe([u,f]);return el.info(this._ctx,`Search operation completed in ${l.elapsed()}ms (fallback took ${h.elapsed()}ms)`,{totalTime:l.elapsed(),fallbackTime:h.elapsed(),success:m.isOk()}),m}async doSearchFileChunksLocally(e,r,n){el.info(this._ctx,"Starting local file chunk search",{folderCount:r.workspaceFolders.length});let o=[],s=new Set;for(let l of r.workspaceFolders){let u=this._localEmbeddingsByWorkspace.get(l),d=this._localTfidfByWorkspace.get(l);if(u&&d){el.info(this._ctx,`Both strategies available for folder: ${l}, using embeddings with TF-IDF fallback`);let f=8e3,h=new Oq.StopWatch,m=await this.runSearchStrategyWithFallback(u,()=>(0,lw.createCancelablePromise)(g=>this.runSearchStrategy(d,e,r,g)),f,e,r,n);m.isOk()&&(o.push(...m.val.result.chunks),s.add(m.val.strategy),el.info(this._ctx,`Folder search completed in ${h.elapsed()}ms`,{folder:l,strategy:m.val.strategy,chunkCount:m.val.result.chunks.length,elapsedTime:h.elapsed()}))}else if(u){el.info(this._ctx,`Using embeddings search for folder: ${l}`);let f=new Oq.StopWatch,h=await this.runSearchStrategy(u,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(u.id),el.info(this._ctx,`Embeddings search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else if(d){el.info(this._ctx,`Using TF-IDF search for folder: ${l}`);let f=new Oq.StopWatch,h=await this.runSearchStrategy(d,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(d.id),el.info(this._ctx,`TF-IDF search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else el.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return el.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),_we.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new Oq.StopWatch;el.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,lw.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(el.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),_we.Result.ok({strategy:e.id,result:c})):(el.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),_we.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(Dk(c))throw el.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return el.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),_we.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,Bxn.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(tc).evaluate(r.chunk.file,r.chunk.text)).isBlocked?null:r)))}async rerankChunks(e,r,n,o){if(!r.length)return[];try{let s,c=r.at(0)?.distance?.embeddingType;if(c&&r.every(f=>typeof f.distance<"u"&&f.distance.embeddingType.equals(c)))s=[...r].sort((f,h)=>h.distance.value-f.distance.value);else{let h=r.map((A,y)=>({...A.chunk,distance:A.distance,index:y})).filter(A=>typeof A.distance>"u"||!A.distance.embeddingType.equals(this._embeddingType)),m;if(h.length){el.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,lw.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*rwe,d=s.filter(f=>f.distance.value>=u);return el.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return Dk(s)||el.error(this._ctx,"Failed to search chunk embeddings index"),r.slice(0,n)}}async scoreChunks(e,r,n){if(!r.length)return[];let o=r.map(l=>this.chunkToIndexString(l)),[s,c]=await(0,lw.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:nwe(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,Zo(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=IA(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=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}\` ${n} ${e.text} -${n}`}};var Lxn=new pe("ProjectContextSkill"),l_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()})})}),ues=47,i$t=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(Y3);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 TO(d.document,u,u),h=new yr([l]),g=twe(c)?.5:.8;r.push([`Code excerpt from file \`${Zo(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(jue,c,ed(d),u)}}if(r.length>0)return r.unshift([new yr(["The user wants you to consider the following snippets when computing your answer."]),1]),new yr(r)}removeDuplicateSnippets(e){let r={};return e.forEach(n=>{let o=`${n.uri}#[${n.range.start.line},${n.range.start.character}]-[${n.range.end.line},${n.range.end.character}]`;r[o]||(r[o]=n)}),Object.values(r)}},Y3="collect-project-context",yXe=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if(Lxn.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(Y3,"Collecting relevant project context"),Ck(e.ctx)){await e.steps.error(Y3,"Workspace indexing is disabled by configuration");return}await e.info(es`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(Jk);if(!r){await e.steps.error(Y3,"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(Y3,"No workspace folders available for search");return}let o=kn(e.turn.request.message),c=await(this.dependencies.parseUserQuery??X1n)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(Y3,"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:tSn,maxResults:Math.min(10*c.length,ues),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??Gvn)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(Y3,"No project context found");return}return await e.steps.finish(Y3),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(Y3,"Project context search failed"),Lxn.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}},jue="project-context",EXe=class extends cg{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 i$t(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=>!Ck(r))}};var o$t=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[jue]}};async function Zx(t){let e=[];return e.push(new _Ze),e.push(...await t.get(zk).agents()),e.push(new o$t),e.push(new dZe),e}a(Zx,"getAgents");p();p();var uw=require("fs"),ZK=de(require("path"));jo();var s0=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return Ft(this.ctx,Ke.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=ZK.dirname(o);await uw.promises.mkdir(s,{recursive:!0,mode:448});let c=JSON.stringify(n)+` -`;await uw.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:Gt(),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 ZK.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return ZK.join(r,String(e))}async readTranscriptFile(e,r){if(!this.isEnabled())return[];try{let n=this.getTranscriptFilePath(e,r);return(await uw.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 uw.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 uw.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=ZK.dirname(o);await uw.promises.mkdir(s,{recursive:!0,mode:448});let c=n.map(l=>JSON.stringify(l)).join(` +${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(` `)+` -`;await uw.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 ZK.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 uw.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 Zf({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=Fxn(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 Zf({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 uw.promises.access(s)}catch{continue}await uw.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 Zf({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=Fxn(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 Zf({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 uw.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 Uxn(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:Gt(),timestamp:new Date().toISOString(),parentId:r}}a(Uxn,"createUserMessageEvent");function Qxn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:Gt(),timestamp:new Date().toISOString(),parentId:r}}a(Qxn,"createUserMessageRenderedEvent");function _Xe(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:Gt(),timestamp:new Date().toISOString(),parentId:r}}a(_Xe,"createAssistantMessageEvent");function qxn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:Gt(),timestamp:new Date().toISOString(),parentId:n}}a(qxn,"createToolExecutionStartEvent");function jxn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:Gt(),timestamp:new Date().toISOString(),parentId:n}}a(jxn,"createToolExecutionCompleteEvent");function vXe(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:Gt(),timestamp:new Date().toISOString(),parentId:e}}a(vXe,"createAssistantTurnStartEvent");function Hue(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:Gt(),timestamp:new Date().toISOString(),parentId:r}}a(Hue,"createAssistantTurnEndEvent");function Fxn(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(Fxn,"parseAssistantMessageContent");var K3=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},OO=class{constructor(e){this.ctx=e;this.transcriptPersistence=new s0(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 K3(`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 K3(`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 K3(`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 K3("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 K3(`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 K3(`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 K3||(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 Zf)return e;let r=e,n=new Zf(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 Hxn={id:0,start_offset:0,stop_offset:0,type:"ip_code_citations",details:{},citations:{snippet:`html lang="en"> +`;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"> Canvas Example -<`,url:"https://github.com/duonghle285/gnoud9x.github.io/tree/c95127bc5b7a491d9223f21ac3b8c5100996e754/26062020-vehinhchunhat%2Findex.html",ip_type:"LICENSE",license:"NOASSERTION"}},Gxn="Alright, This response contains a code citation.";p();var $xn=` +<`,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=` # Should render ## Links @@ -3034,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 Vxn="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",des=95,fes={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 Wxn(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(Wxn,"parseFirstNumber");function pes(t){return Math.min(100,Math.max(0,t))}a(pes,"clampPercentage");function hes(t){return t.includes("session")?"session":"weekly"}a(hes,"getRateLimitNotificationKind");function mes(t,e,r){let n=tue(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(mes,"getRateLimitNotificationMessage");function ges(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(ges,"getRateLimitErrorVariant");var s$t=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 Xp(Vxn,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},l$t=new s$t,a$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=hes(n),s=pes(Wxn(n)??des),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=mes(o,s,c);return await e.ctx.get(LS).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new Xp("Alright, I'm producing a rate limit notification")}},u$t=new a$t,c$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=ges(n),s=Wxn(n),c=U_.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:fes[o],isAuto:n.includes("auto")});return new Xp(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},d$t=new c$t;p();function Aes(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(Aes,"createVulnerability");var Yxn=Oxe` +`;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` 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. -`,CXe=Oxe` +`,pXe=wxe` \`\`\`kotlin fun main() { println("Hello, World!") } \`\`\` -`,yes=Oxe` +`,xXo=wxe` ### Inputs \`p\` - paragraph message @@ -3059,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 -`,f$t=` +`,t$t=` -`,zxn=Yxn+f$t+CXe;function Kxn(t){let e=1,r="",n=[];if(t.length===0)r=zxn;else if(t==="0")r=zxn,e=0;else{if(t==="help")return{reply:yes,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+=Yxn+f$t:s==="c"&&(r+=CXe+f$t);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(CXe,o);if(c===-1)break;let l=c+CXe.length;for(let u=0;u0?r:"Debug Fail")}},_es=new p$t,h$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 Xp("Alright, I'm producing a notification",void 0,[],s)}},ves=new h$t,m$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 Xp(Ees,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},Ces=new m$t,g$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 Xp(await BCn(e))}},bes=new g$t,A$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[$k,rE]}instructions(e,r){return"Create a function that prints a christmas tree"}},Ses=new A$t,y$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 Xp(kn(e.turn.request.message))}},Tes=new y$t,E$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(lg).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+=es` +`,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` ### ${c} prompt \`\`\`\` ${s} \`\`\`\` - `}),new Xp(o)}return new Xp("No prompt available")}},Ies=new E$t,_$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 Xp(await LCn(e,n,o))}},xes=new _$t,v$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}=Kxn(r);return e.turn.annotations.push(...o),new Xp(n,void 0,e.turn.annotations)}},wes=new v$t,C$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(Hxn),new Xp(Gxn,void 0,e.turn.annotations)}},Res=new C$t,b$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 Xp($xn)}},Pes=new b$t,S$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"}},kes=new S$t,T$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]}},Des=new T$t,I$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 Xp("Alright, I'm producing a notification",void 0,[],[],[],e)}},Nes=new I$t;function Jxn(){return[_es,l$t,u$t,d$t,ves,Ces,Ses,bes,Tes,Ies,xes,wes,Res,Nes,Pes,kes,Des]}a(Jxn,"getDebugTemplates");p();var Zxn=S.Object({uri:S.String(),problems:S.Array(S.Object({message:S.String(),range:_f}))}),x$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(Bq,e.uri,ed(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(Bq,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(Bq,"problem markers")}getElidableProblems(e,r,n){let o=[];return o.push(new yr([`Problems and errors in the active document (\`${n}\`):`])),o.push(...this.createElidableProblems(e,r)),bq(o,"linear")}createElidableProblems(e,r){return e.problems.map(n=>{let o=[];o.push(new yr([`- "${n.message}" at line ${n.range.start.line}.`+(r.document?" Excerpt from the code:":"")]));let s=n.range,c;if(s&&(this.isEmpty(s)?c=r.document.lineAt(s.start).text:c=r.document.getText(s),c)){let l=r.document.detectedLanguageId;o.push(new yr([["```"+l,1],[xS(c),.8],["```",1]]))}return new yr(o)})}isEmpty(e){return e.start.line===e.end.line&&e.start.character===e.end.character}async preElideDocuments(e){let r=(await Ro.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new yr([n])}},Bq="problems-in-active-document",bXe=class extends cg{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(Bq,"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 x$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 SXe=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 ewe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=twe(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(!twe(e))return;let n=this.turnContext.ctx.get($r).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new ewe(this.turnContext.ctx,o,n?.uri).findImplFileForTestFile(e.uri);if(c){let l=e.detectedLanguageId;if(await o(c))return await this.asImplFilePrompt(l,c)}}async asImplFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new yr([[`${Mes} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new yr([])}async asTestFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new yr([[`${Oes} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new yr([])}async asExampleFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new yr([[`${Bes} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new yr([])}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(Zk,e,ed(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[xS(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get($o).stat(e),!0}catch{return!1}}}},Mes="Code excerpt from the implementation source file",Oes="Code excerpt from the test file",Bes="Code excerpt from an example test file";var Xxn=S.Object({currentFileUri:S.String(),sourceFileUri:S.Optional(S.String()),testFileUri:S.Optional(S.String())}),w$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 SXe(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(Zk,e.testFileUri,ed(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(Zk,e.sourceFileUri,ed(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(Zk,e.sourceFileUri,ed(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(Zk,e.testFileUri,ed(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},Zk="test-context",TXe=class extends cg{static{a(this,"TestContextSkill")}constructor(e){super(Zk,"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 w$t(r))}};p();var ewn=S.Object({failures:S.Array(S.Object({testName:S.String(),testSuite:S.Optional(S.String()),testFileUri:S.String(),failureReason:S.Optional(S.String()),testLocation:_f}))}),R$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(XK,"test failures");let r=await this.createElidableFailures(e.failures);if(r){let n=new yr(["The latest test run produced the following failures and errors:"]);return new yr([[n,1],[r,1]])}}}async createElidableFailures(e){let r=this.turnContext.ctx.get(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(XK,s,ed(l)),l.status==="valid"){let u=r.getRelativePath(l.document),d=this.createElidableFailuresOfDoc(c,u),f=this.appendCode(d,u,l.document);n.push([f,1])}}if(n.length>0)return new yr(n)}groupFailuresByFile(e){let r=new Map;for(let n of e){let o=r.get(n.testFileUri)||[];o.push(n),r.set(n.testFileUri,o)}return r}createElidableFailuresOfDoc(e,r){let n=e.map(o=>{let s=`\`${o.testName}\``,c=`${o.testSuite?` in suite \`${o.testSuite}\``:""}`,l=` in file \`${r}\` `,u=". ";o.failureReason&&(u=" with the following error:",o.failureReason.includes(` -`)?u+="\n```\n"+o.failureReason+"\n```\n":u+=` \`${o.failureReason}\`. `);let d=`${o.testLocation.start.line==o.testLocation.end.line?"on line "+o.testLocation.start.line:"between lines "+o.testLocation.start.line+" and "+o.testLocation.end.line}`;return[new yr([es`\n\n- Test ${s}${c}${l}failed${u}The failed test is ${d}.\n`]),1]});return new yr(n)}appendCode(e,r,n){let o=[new yr([` + `}),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(` +`)?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 yr([["```"+n.detectedLanguageId,1],[xS(n.getText()),.9],["```",1]]),.7];return new yr([[e,1],o,s])}},XK="test-failures",IXe=class extends cg{static{a(this,"TestFailuresSkill")}constructor(e){super(XK,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new R$t(r))}};var Xp=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")}},dw=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}},Les=new dw("tests","Generate unit tests","Generate Tests",es` +`]),.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` 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. @@ -3083,18 +3126,18 @@ The code of file \`${r}\` is: Follow the same test style as in existing tests if they exist. You must not create inline comments like "Arrange, Act, Assert", unless existing tests use inline comments as well. If existing tests use any mocking or stubbing libraries, use the same libraries before writing your own test doubles. - `,[Zk,XK],["chat-panel","agent-panel","editor"]),Fes=new dw("simplify","Simplify the code","Simplify This",es` + `,[r2,cJ],["chat-panel","agent-panel","editor"]),WXo=new pw("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. Do not reply with the original code but only a simplified version. - Do only reply with one code snippet that contains the complete simplified code and explain what you have simplified after.`,[],["editor","chat-panel","agent-panel","inline","inline-agent"],es` + Do only reply with one code snippet that contains the complete simplified code and explain what you have simplified after.`,[],["editor","chat-panel","agent-panel","inline","inline-agent"],is` Provide a simplified version of the selected code. Modify the selected code to make it simpler and easier to understand. Do not change the behavior of the code. Removing empty lines is not a simplification. You must not omit any code that is necessary for the code to compile and run, for example by replacing lines with ... or similar. - Do not reply with the original code but only a simplified version.`,!0),Ues=new dw("fix","Fix problems and compile errors","Fix This",es` + 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` Fix the provided errors and problems. Do not invent new problems. The fixed code should still be readable and easy to understand. @@ -3105,28 +3148,28 @@ 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.`,[Bq],["editor","chat-panel","agent-panel","inline","inline-agent"],es` + 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` 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),Qes=new dw("explain","Explain how the code works","Explain This",es` + Briefly explain the problems without repeating the detailed error message.`,!0),YXo=new pw("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. - The explanation should be easy to understand for a developer who is familiar with the programming language used but not familiar with the code.`,[],["editor","chat-panel","agent-panel","inline"],es` + The explanation should be easy to understand for a developer who is familiar with the programming language used but not familiar with the code.`,[],["editor","chat-panel","agent-panel","inline"],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),qes=new dw("doc","Document the current selection or file","Generate Docs",es` + 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` 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"],es` + 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),twn=new dw("create-agent","Create a new custom agent","Create Agent",es` + 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` 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. @@ -3145,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"]),rwn=new dw("create-skill","Create a new custom skill","Create Skill",es` + 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` 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. @@ -3163,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"]),nwn=new dw("create-instruction","Create a new instruction file","Create Instruction",es` + 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` 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. @@ -3181,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"]),iwn=new dw("create-prompt","Create a new prompt file","Create Prompt",es` + 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` 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. @@ -3199,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"]),own=new dw("create-hook","Create a new hook configuration","Create Hook",es` + 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` 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 @@ -3252,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"]),P$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=Tjt(e.conversation),n=es` + \`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` 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 Xp(n+` + `;return r?new ih(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 Xp(n)}},jes=new P$t,k$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=D$t(e.ctx).filter(o=>o!=this),n=es` +\`\`\``):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` 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(` @@ -3272,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 Xp(n)}},Hes=new k$t,swn=new Set([twn.id,rwn.id,nwn.id,iwn.id,own.id]);function Xk(){return[Les,Fes,Ues,Qes,qes,twn,rwn,nwn,iwn,own,jes,Hes,...Jxn()]}a(Xk,"getPromptTemplates");function D$t(t){let e=Xk();return!pCe(t)&&!w1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(D$t,"getUserFacingPromptTemplates");var awn=de(require("path"));var N$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||Yle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return sq(this.promptFileEntry.promptPath)}get providers(){return k3(this.promptFileEntry.promptPath.metadata)}},fg=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 hO}partitionSettings(e){let r=new Set,n=[];for(let o of e)if(o.type==="file")r.add(gn(o.uri));else if(o.type==="location")r.add(awn.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(`${oq}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${oq}${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(ig).collect(this.ctx,"prompt",e,{includePlugins:r?.includePlugins})).map(u=>new N$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(oq))return e.message=`Follow instructions: ${f.content} + `;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} -${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=Xk().find(g=>g.id===u&&g.scopes.includes(h));return m?.instructions?(e.message=m.instructions(this.ctx,d,"inline"),!0):!1}};var xXe=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},Wo=class{constructor(e){this.ctx=e;this.conversations=new En(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new yK([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(zh).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new xXe(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(OO).restoreConversation(r,n);if(!u){ot.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new yK(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(zh).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new xXe(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}`),yt(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new s0(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"&&!NW.has(ro(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!NW.has(ro(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 s0(this.ctx);if(!n.isEnabled())return;let o=Uxn(kn(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new s0(this.ctx);if(!n.isEnabled()||!r.response)return;let o=kn(r.response.message),s=String(r.id),c=_Xe(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=Hue(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&kn(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(kn(r.request.message),"@");(await Zx(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(kn(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(kn(r.request.message),"/"),s=Xk().find(c=>c.id===n);if(s){r.request.message=o,r.request.type="user",await this.determineAndApplyAgent(e,r);let c=s.instructions?s.instructions(this.ctx,r.request.message,e.source):o;r.template={templateId:n,userQuestion:r.request.message},r.request.message=c,r.request.type="template"}}}async determineAndApplyPromptTemplate(e,r,n){if(kn(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(kn(n.request.message),"/"),l=await e.get(fg).getPromptTemplate(o);l&&(l.uri.startsWith(oq)?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=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} -${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(zh).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 s0(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 wXe=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 RXe=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 Ges="X-Initiator",$es="X-Interaction-ID",Ves="X-Interaction-Type";var PXe=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},M$t=class extends PXe{static{a(this,"User")}static id(){return"user"}},O$t=class extends PXe{static{a(this,"Agent")}static id(){return"agent"}},B$t=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[Ges]:this.initiator,[$es]:this.interactionId,[Ves]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return wA.agent(e??this.interactionType,this.interactionId)}},wA=class t extends B$t{static{a(this,"LlmInteraction")}static user(e,r){return new t(M$t,e,r)}static agent(e,r){return new t(O$t,e,r)}};function cwn(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a(cwn,"interactionTypeForChatMode");var fw=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new L$t(this),this.steps=new RXe(e,r,n,e.get(Sc)),this.collector=new F$t(r,n,e.get(Sc)),this.agentToolCalls=new wXe(e,r,n,e.get(Sc))}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 wA.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?wA.agent(e,this.turn.telemetryId):wA.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(Sc).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},kXe=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")}},jxe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},L$t=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(Wo).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(lg).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 kXe(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(zh).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(lg).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof kXe||o instanceof jxe)throw o;ot.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},F$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 Wes={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function lwn(t){let e=Ft(t,Ke.AutoCompress);return{...Wes,enabled:e}}a(lwn,"getAutomaticCompressionConfig");p();var Lq=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(ds).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=kn(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=kn(y.response.message),b=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(b*t.MESSAGE_OVERHEAD_MULTIPLIER),NK(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 VC=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new Lq}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=lwn(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 RA=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var Ld=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var DXe=de($ce());var uwn=new Map;function aE(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(aE,"createNumberRange");function U$t(t){return[...t].sort((e,r)=>r.length-e.length)}a(U$t,"sortByStringLengthDesc");async function zes(t){let e=uwn.get(t);if(e)return e;let r=(async()=>{try{let n=await p$e(`tree-sitter-${t}.wasm`);return await DXe.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return uwn.set(t,r),r}a(zes,"loadShellLanguage");function dwn(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(dwn,"isPowerShell");var Yes=new Map([["sh",U$t([...aE(1,9).concat("").map(t=>`${t}<<<`),...aE(1,9).concat("").flatMap(t=>aE(1,9).map(e=>`${t}>&${e}`)),...aE(1,9).concat("").map(t=>`${t}<>`),...aE(1,9).concat("&","").map(t=>`${t}>>`),...aE(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",U$t([...aE(1,9).concat("").map(t=>`${t}<<<`),...aE(1,9).concat("").flatMap(t=>aE(1,9).map(e=>`${t}>&${e}`)),...aE(1,9).concat("").map(t=>`${t}<>`),...aE(1,9).concat("&","").map(t=>`${t}>>`),...aE(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",U$t([...aE(1,6).concat("*","").flatMap(t=>aE(1,6).map(e=>`${t}>&${e}`)),...aE(1,6).concat("*","").map(t=>`${t}>>`),...aE(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function Kes(t,e){let r,n=e.replace(/\.exe$/,"");dwn(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(Kes,"splitCommandLineIntoSubCommands");async function NXe(t,e){try{let r;dwn(e)?r="powershell":r="bash",await DXe.default.init();let n,o;try{n=new DXe.default;let s=await zes(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 Kes(t,e)}}a(NXe,"extractSubCommandsWithTreeSitter");var Jes=new Set(["sudo","env"]),Zes=/^[A-Za-z_][A-Za-z0-9_]*=/;function Q$t(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(Zes.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||Jes.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(Q$t,"extractCommandNameFromSubCommand");var Gue=new pe("CommandLineAutoApprover"),fwn=/(?!.*)/,Xes=/^[A-Z_][A-Z0-9_]*=/i,zS=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(Xes.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 NXe(e,r);Gue.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 Gue.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 Gue.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return Gue.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await NXe(e,r),o=[...new Set(n.map(Q$t).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await NXe(e,r),o=n.map(s=>Q$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})}}}),Gue.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),Gue.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)?fwn:c}catch{return fwn}}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 MXe=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 OXe=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 BXe=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=ets(this.stdout)}static{a(this,"CommandHookResult")}};function ets(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(ets,"parseOutput");var G$t=require("child_process");var q$t=new pe("HookExecutor"),LXe=class{constructor(){this.handlers=[new j$t,new H$t]}static{a(this,"HookExecutor")}async execute(e,r,n,o){for(let s of this.handlers)if(s.isAcceptable(n))try{return await s.handle(e,r,n,o)}catch(c){q$t.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}q$t.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},FXe=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"&&q$t.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 BXe(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"]}}},j$t=class extends FXe{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,G$t.spawn)(e.bash,[],n)}},H$t=class extends FXe{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,G$t.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var tts=new LXe,WC=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 tts.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var J3=class extends WC{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var e2=class extends WC{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var $ue={allow:"allow",deny:"deny",ask:"ask"},t2=class extends WC{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var eJ=class extends WC{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var tJ=class extends WC{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var r2=class extends WC{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var rJ=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 nJ(t){try{return!(!Ft(t,Ke.EnableHooks)||t.get(Fl).getPolicyValue("customHook.enabled")===!1)}catch{return!1}}a(nJ,"hooksEnabled");var rts=".github/hooks/**/*.json",nts="agentHook.execution",its={sessionStart:tJ,sessionEnd:eJ,userPromptSubmitted:r2,preToolUse:t2,postToolUse:e2,errorOccurred:J3},cE=class{constructor(e){this.logger=new pe("HookService");this.gateSubscriptions=[];this.ctx=e,this.registration=this.ctx.get(bA).register("hook",[rts]),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&&yt(e,nts,{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(ig).collect(this.ctx,"hook",e):[]}areHooksEnabled(){let e=nJ(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(Mo);this.lastEnableHooks=Ft(this.ctx,Ke.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ft(this.ctx,Ke.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(Fl);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(CA).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(its).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(ig).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 PA(t){return`[${Ji(t)}](${t})`}a(PA,"formatUriForFileWidget");function td(t,e){let r=ots(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(td,"resolvePathInput");function ots(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 NW.has(s)||sa.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(sa.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||pwn()&&ats(t)||pwn()&&t.startsWith("\\\\"))return Ta(t)}a(ots,"resolveFsUri");function pwn(){return process.platform==="win32"}a(pwn,"isWindows");function sts(t){return t>=65&&t<=90||t>=97&&t<=122}a(sts,"isWindowsDriveLetter");function ats(t){return sts(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(ats,"hasDriveLetter");function BO(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof Pr?r.value:r instanceof wK?"":r instanceof cq?JSON.stringify(r.value):"").join(` -`)),e===""?"(empty)":e}a(BO,"parseToolResultToString");function UXe(t){let{content:e}=t;return{message:BO(e)}}a(UXe,"formatToolErrorResult");function hwn(t){let{content:e}=t,r={data:e.map(n=>n instanceof Pr?{type:"text",value:n.value}:n instanceof wK?{type:"text",value:""}:n instanceof cq?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof lq&&(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(hwn,"formatToolSuccessResult");function iJ(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(iJ,"extractShellFromToolDescription");var QXe=new pe("HookTrigger"),Vue=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(cE),c=o?new rJ(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,t2,{timestamp:Date.now(),cwd:gn(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 QXe.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(cE),l=s?new rJ(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,e2,{timestamp:Date.now(),cwd:gn(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:BO(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){QXe.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(cE),o=this.extractPromptFromMessage(e),s=r?new rJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,r2,{timestamp:Date.now(),cwd:gn(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){QXe.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(cE),o=Ft(this.ctx,Ke.HookErrorOccurredStackTrace),s=r?new rJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,J3,{timestamp:Date.now(),cwd:gn(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){QXe.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===$ue.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 $$t=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},Cwe=class extends $$t{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var oJ=de(xo());var Hn=class t extends oJ.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(oJ.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,oJ.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> -`)),vscpp(V$t,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},V$t=class extends oJ.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function mwn(){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(mwn,"renderAskModeInstructionBody");p();p();var Fq=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 qXe=class extends lr{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var gwn=require("path");var jXe=class extends lr{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,gwn.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(ds).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=iJ(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 Uq=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=ro(c.uri);return` - ${sa.isRegisteredScheme(l.scheme)?c.uri:Zo(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 Awn(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(Awn,"partsLength");async function Ewn(t,e=1/0,r){let n=ywn(0,t,e),o=e-Awn(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 cts();let d=ywn(l.level+1,u,o-1);d.length&&(s=!0,o-=Awn(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(Ewn,"visualFileTree");function ywn(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(ywn,"toParts");var cts=a(()=>({tree:"",files:[]}),"emptyTree");p();async function HXe(t,e){let r=ro(e);return sa.isRegisteredScheme(r.scheme)?(await t.get(sa).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get($o).readDirectory(e)}a(HXe,"readDirectory");var lts=new pe("fileReferencesPrompt");async function _wn(t,e,r,n){let o=await vwn(t,e,r,n);if(!o.length)return"";let s="";for(let{label:l,uri:u,tree:d}of o){let f=ro(u),h=sa.isRegisteredScheme(f.scheme)?u:gn(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(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})/ `;for(let m of d.tree.split(` `))s+=` ${m} -`}let c=IA(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(_wn,"generateWorkspaceStructurePrompt");async function vwn(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await Ewn(await Cwn(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(vwn,"generateWorkspaceStructure");async function Cwn(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await HXe(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=Ia(e,s);return!sa.isRegisteredScheme(ro(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||fts(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>Cwn(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(Cwn,"buildFileList");var uts=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],dts=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function fts(t){return!!(dts.includes(Ji(t).toLowerCase())||Zo(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>uts.includes(r)))}a(fts,"shouldAlwaysIgnoreFile");async function GXe(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:Ji(c.uri)})),o=await vwn(t,n,{maxLength:2e3,excludeDotFiles:!0},e),s=[];for(let{label:c,uri:l,tree:u}of o)s.push(""),s.push(`Directory: ${c} (${gn(l)})`),s.push(u.tree),s.push("");return s}catch(n){return lts.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(GXe,"processDirectoryReferences");var Wue=class extends lr{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await _wn(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||jn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var bwn=de(xo());var bwe=class extends lr{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(bwn.UserMessage,null,vscpp(Hn,{name:"environment_info"},vscpp(Fq,{ctx:this.props.ctx}),vscpp(jXe,{ctx:this.props.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Uq,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(Wue,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(qXe,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var $Xe=de(require("path"));function z$t(t){let e=Ft(t,Ke.EnableSkills),r=t.get(Fl).getPolicyValue("customSkill.enabled")!==!1;return e&&r}a(z$t,"isSkillsEnabled");var W$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(sf(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}get pluginUri(){return sq(this.promptFileEntry.promptPath)}get providers(){return k3(this.promptFileEntry.promptPath.metadata)}},a0=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.registrySkillPatterns=[];this.skillFileLocationsPatterns=[];this.logger=new pe("CustomSkillService");this._onDidChangeSkillsEnabled=new Xf;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(Fl);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(CA).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,Ke.EnableSkills);return()=>{let n=Ft(this.ctx,Ke.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){return z$t(this.ctx)}syncRegistry(){if(this.disposeSkillPatterns(),!Ft(this.ctx,Ke.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(gn(n.uri)):n.type==="location"&&r.add($Xe.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(ig).collect(this.ctx,"skill",e,{includePlugins:r?.includePlugins})).map(s=>new W$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=$Xe.default.dirname(r)),!!r)return $Xe.default.normalize(r)}};var VXe=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(a0).listSkills(e);if(yt(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=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=>` ${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 Swn={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},zue=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await N$e(e.ctx)&&r.set(Swn.name,Swn);let o=await e.ctx.get(Yp).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&&yt(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 pts=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 Twn(t){return pts.get(t)??"unknown"}a(Twn,"getToolFunctionalType");var hts=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"]]),mts=new Map;for(let[t,e]of hts)mts.set(e,t);var Iwn=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),xwn=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var WXe=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 zue().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 Yue=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 gts=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],LO=class extends lr{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&>s.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var wwn=de(xo());var zXe=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(wwn.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(Yue,null)),vscpp(Hn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","read_file",` tool, say "I'll read the file".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",r&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"but do not parallelize dependent steps.",vscpp("br",null),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),!o&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(Hn,{name:"contextGathering"},r&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then answer the question. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"Unless it is clear that the user's question relates to the current workspace, you should avoid using search tools and instead prefer to answer the user's question directly.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(Hn,{name:"codesearchModeInstructions"},"These instructions apply when answering questions about the user's codebase.",vscpp("br",null),"First, analyze the user's request to determine how complicated their task is. Leverage any of the tools available to you to gather the context needed to provide a complete and accurate response. Keep your search focused on the user's request, and don't run extra tools if the user's request clearly can be satisfied by just one.",vscpp("br",null),"Think step by step:",vscpp("br",null),"1. Read the provided relevant workspace information (code excerpts, file names, and symbols) to understand the user's workspace.",vscpp("br",null),"2. Consider how to answer the user's prompt based on the provided information and your specialized coding knowledge. Always assume that the user is asking about the code in their workspace instead of asking a general programming question.",vscpp("br",null),"3. Generate a response that clearly and accurately answers the user's question. In your response, add fully qualified links for referenced symbols and links for files so that the user can open them.",vscpp("br",null),"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can print a codeblock with the suggested changes."),vscpp(Hn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),e("manage_todo_list")&&vscpp(Hn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex research into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple questions or conversational requests."),vscpp(LO,{languageOverride:this.props.languageOverride}))}};p();var Rwn=de(xo());var YXe=class extends lr{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp(Rwn.SystemMessage,null,"You are a coding agent based on GPT-5-Codex.",vscpp("br",null),vscpp("br",null),"## Editing constraints",vscpp("br",null),vscpp("br",null),"- Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.",vscpp("br",null),'- Add succinct code comments that explain what is going on if code is not self-explanatory. You should not add comments like "Assigns the value to the variable", but a brief comment might be useful ahead of a complex code block that the user would otherwise have to spend time parsing out. Usage of these comments should be rare.',vscpp("br",null),"- You may be in a dirty git worktree.",vscpp("br",null),"* NEVER revert existing changes you did not make unless explicitly requested, since these changes were made by the user.",vscpp("br",null),"* If asked to make a commit or code edits and there are unrelated changes to your work or changes that you didn't make in those files, don't revert those changes.",vscpp("br",null),"* If the changes are in files you've touched recently, you should read carefully and understand how you can work with the changes rather than reverting them.",vscpp("br",null),"* If the changes are in unrelated files, just ignore them and don't revert them.",vscpp("br",null),"- While you are working, you might notice unexpected changes that you didn't make. If this happens, STOP IMMEDIATELY and ask the user how they would like to proceed.",vscpp("br",null),vscpp("br",null),"## Tool use",vscpp("br",null),"- You have access to many tools. If a tool exists to perform a specific task, you MUST use that tool instead of running a terminal command to perform that task.",vscpp("br",null),this.props.hasSearchSubagent&&vscpp(vscppf,null,"- For broader codebase exploration that would require more than 3 search tool calls, use"," ","run_subagent",' with the "Search" agent. The search agent runs in an isolated context, keeping verbose search results out of your main context window. For simple, directed searches (e.g. a specific file or class), use ',"semantic_search",", ","file_search",", or"," ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),"- When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),vscpp("br",null),"## Special user requests",vscpp("br",null),vscpp("br",null),"- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as `date`), you should do so.",vscpp("br",null),'- If the user asks for a "review", default to a code review mindset: prioritise identifying bugs, risks, behavioural regressions, and missing tests. Findings must be the primary focus of the response - keep summaries or overviews brief and only after enumerating the issues. Present findings first (ordered by severity with file/line references), follow with open questions or assumptions, and offer a change-summary only as a secondary detail. If no findings are discovered, state that explicitly and mention any residual risks or testing gaps.',vscpp("br",null),vscpp("br",null),"## Presenting your work and final message",vscpp("br",null),vscpp("br",null),"You are producing text that will be rendered as markdown by the VS Code UI. Follow these rules exactly. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value.",vscpp("br",null),vscpp("br",null),"- Default: be very concise; friendly coding teammate tone.",vscpp("br",null),"- Ask only when needed; suggest ideas; mirror the user's style.",vscpp("br",null),"- For substantial work, summarize clearly; follow final-answer formatting.",vscpp("br",null),"- Skip heavy formatting for simple confirmations.",vscpp("br",null),"- Don't dump large files you've written; reference paths only.",vscpp("br",null),'- No "save/copy this file" - User is on the same machine.',vscpp("br",null),"- Offer logical next steps (tests, commits, build) briefly; add verify steps if you couldn't do something.",vscpp("br",null),"- For code changes:",vscpp("br",null),'* Lead with a quick explanation of the change, and then give more details on the context covering where and why a change was made. Do not start this explanation with "summary", just jump right in.',vscpp("br",null),"* If there are natural next steps the user may want to take, suggest them at the end of your response. Do not make suggestions if there are no natural next steps.",vscpp("br",null),"* When suggesting multiple options, use numeric lists for the suggestions so the user can quickly respond with a single number.",vscpp("br",null),"- The user does not command execution outputs. When asked to show the output of a command (e.g. `git show`), relay the important details in your answer or summarize the key lines so the user understands the result.",vscpp("br",null),"- Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null),vscpp("br",null),"### Final answer structure and style guidelines",vscpp("br",null),vscpp("br",null),"- Markdown text. Use structure only when it helps scannability.",vscpp("br",null),"- Headers: optional; short Title Case (1-3 words) wrapped in **\u2026**; no blank line before the first bullet; add only if they truly help.",vscpp("br",null),"- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.",vscpp("br",null),"- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **.",vscpp("br",null),"- Code samples or multi-line snippets should be wrapped in fenced code blocks; add a language hint whenever obvious.",vscpp("br",null),"- Structure: group related bullets; order sections general \u2192 specific \u2192 supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.",vscpp("br",null),'- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.',vscpp("br",null),"- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short\u2014wrap/reformat if long; avoid naming formatting styles in answers.",vscpp("br",null),"- Adaptation: code explanations \u2192 precise, structured with code refs; simple tasks \u2192 lead with outcome; big changes \u2192 logical walkthrough + rationale + next actions; casual one-offs \u2192 plain sentences, no headers/bullets.",vscpp("br",null),"- File References: When referencing files in your response, always follow the below rules:",vscpp("br",null),"* Use inline code to make file paths clickable.",vscpp("br",null),"* Each reference should have a stand alone path. Even if it's the same file.",vscpp("br",null),"* Accepted: absolute, workspace-relative, a/ or b/ diff prefixes, or bare filename/suffix.",vscpp("br",null),"* Do not use URIs like file://, vscode://, or https://.",vscpp("br",null),"* Examples: src/app.ts, C:\\repo\\project\\main.rs",vscpp("br",null),vscpp(LO,{languageOverride:this.props.languageOverride}))}};p();p();var Pwn="filepath:",kA="...existing code...";p();var KXe=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 Qq=class extends lr{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!NKe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===In.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(In.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 kwn(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(kwn,"modelSupportsReplaceString");function Dwn(t){return t?t.startsWith("gpt-5"):!1}a(Dwn,"isGpt5PlusFamily");function Ats(t){return t?t==="gpt-5.2-codex":!1}a(Ats,"isGpt52CodexFamily");function yts(t){return t?t==="gpt-5.2":!1}a(yts,"isGpt52Family");function Nwn(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||Ats(e)||yts(e))}a(Nwn,"modelSupportsApplyPatch");var Mwn=de(xo());var JXe=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=Dwn(this.props.modelConfiguration.modelFamily);return vscpp(Mwn.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(Qq,{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(KXe,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),"// ",kA,vscpp("br",null),"changed code",vscpp("br",null),"// ",kA,vscpp("br",null),"changed code",vscpp("br",null),"// ",kA,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 {",` // ${kA}`," age: number;",` // ${kA}`," getAge() {"," return this.age;"," }","}"].join(` -`))),vscpp(Hn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),f&&vscpp(Hn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex tasks into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple tasks or conversational requests."),vscpp(LO,{languageOverride:this.props.languageOverride}))}};p();var ZXe=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.")}},XXe=class extends lr{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var Kue=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))}},eet=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))}},tet=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 Own=de(xo());var ret=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(Own.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(Qq,{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 `",kA,"` to represent regions of unchanged code.",vscpp("br",null)):vscpp(vscppf,null,"You do not have edit tools available. Describe the code changes to the user instead.",vscpp("br",null)),s&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited. Fix relevant errors, but don't loop more than 3 times on the same file.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null)),vscpp(LO,{languageOverride:this.props.languageOverride}))}},net=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 iet=de(xo());var oet=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,Ke.UseAgentsMd);return NKe(n.modelFamily)?vscpp(YXe,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(zXe,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp(ret,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(JXe,{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(Pn).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(iet.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(In.Gpt5)?vscpp(vscppf,null,vscpp(XXe,null),vscpp(eet,null)):vscpp(vscppf,null,vscpp(ZXe,null),vscpp(Kue,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(iet.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(iet.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 Bwn=de(xo());var set=class extends lr{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=vO(this.props.currentTurn.response?.message,!0),r=wO(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,Bwn.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},vscpp(tw,{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 aet=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 cet=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&&Ets(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 ",gn(e.uri),". ",n)}};function Ets(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(Ets,"notEmptySelection");p();var uet=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 `",kA,"` to represent regions of unchanged code.")}};p();var det=class extends lr{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(In.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(In.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 FO=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=IA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${Pwn} ${gn(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 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(` `),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 n2=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 FO({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=Zo(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 _ts=new pe("activeEditorPrompt");async function Lwn(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new Nc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&vts(n.selection)){let s=new n2(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 n2(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new n2(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 n2(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else _ts.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(Lwn,"processActiveEditor");function vts(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(vts,"notEmptySelection");p();var Cts=["png","jpg","jpeg","bmp","gif","webp"];function bts(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!Cts.some(n=>r.endsWith(`.${n}`))})}a(bts,"filterOutImageFiles");function fet(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:bts(e)}}a(fet,"getFileAndDirectoryReferences");var Sts=new pe("fileReferencesPrompt");async function Fwn(t,e){let{validFileReferences:r,directoryReferences:n}=fet(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([Tts({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),Lwn(t,e),GXe(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(Fwn,"processFileReferences");async function Tts(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 Nc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new n2(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 n2(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new n2(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else Sts.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(Tts,"processValidFileReferences");var Uwn=de(xo());var Its=new pe("fileReferences"),pet=class extends lr{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new jn.CancellationTokenSource().token,c=[];try{c=await Fwn({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){Its.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(Y$t,{fileReferencesParts:c})}},Y$t=class extends lr{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(Uwn.TextChunk,null,[this.props.fileReferencesParts.join(` -`)])}};p();var Qwn=de(xo());var het=class extends lr{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=fet(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(Qwn.TextChunk,null,[n.join(` -`)])}};p();var qwn=new pe("SkillContextPrompt"),xts=5e4,met=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 QJe(s);if(!c)return;qwn.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(xts).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(", ");qwn.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var Au=class extends aq{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:og,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Nc;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(Ld).invokeClientToolConfirmation(e,o)}};p();var c0=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 wts(){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(wts,"createManageTodoListInputSchema");var UO=class t extends Au{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:wts()}),this.ctx=e}get service(){return this.ctx.get(c0)}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 Pr("Error: Unknown operation")],"error")):Promise.resolve(new Br([new Pr("Error: operation parameter is required")],"error"))}catch(c){let l=`Error: ${c instanceof Error?c.message:"Unknown error"}`;return Promise.resolve(new Br([new Pr(l)],"error"))}}handleReadOperation(e){let r=this.getTodos(e);if(r.length===0)return new Br([new Pr("No todo list found.")],"success");let n=t.formatTodoListAsMarkdown(r);return new Br([new Pr(`# Todo List +`){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 -${n}`)],"success")}handleWriteOperation(e,r){if(!r)return new Br([new Pr("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 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?` `+l.join(` -`):""}`,d=new lq([new Pr(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 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(` `)}).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(c0).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return Dvn(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(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. 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. @@ -3334,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 get=class extends lr{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(Pn).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??UO.getTodoList(this.props.turnContext);if(r.length===0)return;let n=UO.formatTodoListAsMarkdown(r);return vscpp(Hn,{name:"todoList"},[n])}};p();p();var Rts=new pe("fileReferencesPrompt");function jwn(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 Rts.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(jwn,"processMcpToolsReferences");var Pts=new pe("ToolContext"),Aet=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 Nc;let n=jwn(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(Hn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` -`)))}catch(r){Pts.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var Jue=de(xo());var yet=class extends lr{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=kn(this.props.userRawMessage),c=aue(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(Jue.UserMessage,null,vscpp(Jue.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp(pet,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(Jue.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(het,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(Aet,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(met,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(Hn,{name:"context"},vscpp(aet,null),vscpp(get,{turnContext:this.props.turnContext})),vscpp(cet,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(Hn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(Yue,null):vscpp(Qq,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(uet,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(net,null),vscpp(det,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(Hn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var sJ=de(xo());var K$t=new pe("agentPrompt"),Eet=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(Pn).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(oet,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(sJ.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(sJ.UserMessage,null,vscpp(WXe,{turnContext:this.turnContext})),vscpp(sJ.UserMessage,null,vscpp(VXe,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(_ue,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp(yet,{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(set,{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?kts(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(Cwe);if(s?.renderedGlobalContext)return K$t.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}K$t.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await xHt(bwe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new Cwe(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(Ef).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ft(this.ctx,Ke.UseAgentsMd),includeNestedAgentsMdInstructions:Ft(this.ctx,Ke.UseNestedAgentsMd),includeClaudeMdInstructions:Ft(this.ctx,Ke.UseClaudeMd),includeNestedClaudeMdInstructions:Ft(this.ctx,Ke.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(mwn());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(sJ.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){K$t.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function kts(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(sJ.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(kts,"renderedMessageToTsxChildren");p();var _et="uncategorized_tools",Hwn="Tools that could not be automatically categorized into existing groups.";p();var qq=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var Z3=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 Zue=new pe("roundMetricsTracker"),vet=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=Dts(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:J$t(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:J$t(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:J$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;Zue.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){Zue.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 Zue.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;Zue.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(Zue.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,Ke.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else Zue.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 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=` \`\`\` --- 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 J$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(Dts,"stripDriftingFields");p();p();var Cet=new pe("agentModePolicy");function Gwn(t){try{let e=JI(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(Cet.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(Fl).getPolicyValue("agentMode.autoApproval.enabled")===!1?(Cet.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(Cet.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return Cet.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(Gwn,"isAutoApprovalEnabled");p();var bet=new pe("McpAutoApproveService"),X3=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){bet.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return bet.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||bet.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})),bet.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 aJ=de(require("path"));var pw=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 pe("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&&sa.isRegisteredScheme(s[1].toLowerCase()))return;let c=Ta(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=gn(e);return r.some(o=>{try{let s=gn(o),c=aJ.normalize(s),l=aJ.normalize(n),u=aJ.relative(c,l);return!u.startsWith("..")&&!aJ.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return Af(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 Wwn=`*** Begin Patch -`,Xue=` -*** End Patch`,ede="*** Add File: ",jq="*** Delete File: ",tde="*** Update File: ",Nts="*** Move to: ",Z$t="*** End of File";var Mts=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var em=class extends Error{static{a(this,"DiffError")}},rde=class extends em{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},QO=class extends em{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function $wn(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($wn,"guessIndentation");function Vwn(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a(Vwn,"computeIndentLevel");function Ots(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(Ots,"getIndentationChar");function Bts(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(Bts,"transformIndentation");function Lts(t){return!t||!t.trim()}a(Lts,"isFalsyOrWhitespace");function Fts(t,e){let r=0;for(let n of t)n===e&&r++;return r}a(Fts,"countOccurrences");function Uts(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(Uts,"computeLevenshteinDistance");function Swe(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(Swe,"replaceExplicitTabs");function Tet(t){return Swe(t.replaceAll("\\n",` -`))}a(Tet,"replaceExplicitNl");var X$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]=$wn(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 em(`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([Xue]);){let e=this.readStr(tde);if(e){if(this.patch.actions[e])throw new em(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(Nts);if(!(e in this.currentFiles))throw new em(`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(jq),e){if(this.patch.actions[e])throw new em(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new em(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(ede),e){if(this.patch.actions[e])throw new em(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new em(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new em(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(Xue.trim()))throw new QO("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=!Mts.test(e.trimEnd()),l=0;for(;!this.isDone([Xue,tde,jq,ede,Z$t]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new em(`Invalid line. Consider splitting each change into individual apply_patch tool calls: +`}}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: ${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 rde(`Invalid EOF context at character ${l}: -${_}`,r,"invalidContext-eof");{let v=_.match(/^\\t/)?"invalidContext-maybeInvalidTab":_.match(/^\\\t/)?"invalidContext-maybeEscapedTab":"invalidContext";throw new rde(`Invalid context at character ${l}: -${_}`,r,v)}}this.fuzz+=h.fuzz;let m=$wn(f.chunks.flatMap(_=>_.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=Vwn(s[h.line]??"",n.tabSize),A=h.fuzz&4?Swe(f.nextChunkContext[0]??""):h.fuzz&128?Tet(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?Vwn(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(Tet),_.delLines=_.delLines.map(Tet)),(c||h.fuzz&4)&&(_.insLines=_.insLines.map(Swe)),_.insLines=_.insLines.map(v=>Lts(v)?v:E+Bts(v,m,n)),h.fuzz&4&&(_.delLines=_.delLines.map(Swe)),o.chunks.push(_);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([Xue,tde,jq,ede]);){let r=this.readStr();if(!r.startsWith("+"))throw new QO(`Invalid Add File Line: ${r}`,"invalidAddFileLine");e.push(r.slice(1))}return{type:"add",newFile:e.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(` `),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 QO(`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 em(`${r}: chunk.origIndex ${c.origIndex} > len(lines) ${n.length}`);if(s>c.origIndex)throw new em(`${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(qts,"getUpdatedFile");function jts(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=qts(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(jts,"patchToCommit");async function Hts(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new em(`File not found: ${n}`)}return r}a(Hts,"loadFiles");async function Ywn(t,e){if(!t.startsWith(Wwn))throw new QO("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=cJ(t),n=await Hts(r,e),[o]=Qts(t,n);return jts(o,n)}a(Ywn,"processPatch");var qO=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=cJ(s),l=nde(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(pw),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(pw),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 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. 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 ide=new pe("AutoApproveService"),lJ=class{constructor(e){this.ctx=e}static{a(this,"AutoApproveService")}async checkApproval(e,r,n){if(uL()&&process.env.HMAC_SECRET)return{needConfirm:!1};if(Ft(e.ctx,Ke.EditorHandlesAllConfirmation)===!0)return{needConfirm:!0};let o=this.classifyTool(r);if(o==="other")return ide.debug(this.ctx,"Auto approve check for build-in safe tool decided: approve (always auto-approved)"),{needConfirm:!1};if(!Gwn(this.ctx)){if(o==="file-operation"){let u=this.checkSensitiveFileApproval(r,n,e,!0),d=u.action==="confirm";return ide.debug(this.ctx,`Auto approve check (policy disabled, file-operation, default rules only) decided: ${u.action}`),{needConfirm:d}}return ide.info(this.ctx,"Tool confirmation required: auto-approval disabled by policy"),{needConfirm:!0}}if(Ft(e.ctx,Ke.AutoApproveYoloMode)===!0)return ide.info(this.ctx,`Auto approve yolo mode: auto-approving ${o} tool call`),{needConfirm:!1};let s=Ft(e.ctx,Ke.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,Ke.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,Ke.AutoApproveUnmatchedFileOp);u!==void 0?c=u?{action:"approve"}:{action:"confirm"}:c={action:"approve"}}break}}let l=c.action==="confirm";return ide.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":qO.isPotentiallySensitiveTool(e)?"file-operation":"other"}checkMcpApproval(e){if(this.ctx.get(X3).isApproved(e.toolProvider.id,e.name))return{action:"approve"};if(Ft(this.ctx,Ke.TrustToolAnnotations)){let o=this.ctx.get(ds).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(zS),c=iJ(e.description)||"sh";ide.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=qO.getMatchingRuleForToolCall(e,r,n,o);return s?s.rule.requiresConfirmation?{action:"confirm"}:{action:"approve"}:{action:"continue"}}};p();p();p();function Twe(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($ts,"isUndefined");function eVt(t){return Buffer.from(t,"base64").toString("utf-8")}a(eVt,"decodeBase64");function Zwn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Zwn,"isObject");p();var Hq="activate_",V_=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(Hq))throw new Error(`Virtual tool name must start with '${Hq}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(Hq+e+this.name.slice(Hq.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))}},tVt=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))}},Iet=class extends lr{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Gq.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(Gq.UserMessage,null,this.props.tools.map(e=>vscpp(Iwe,{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)))}},xet=class extends lr{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Gq.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(Gq.UserMessage,null,this.props.tools.map(e=>vscpp(Iwe,{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)))}},wet=class extends lr{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Gq.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(Gq.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(tVt,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(Iwe,{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 uVt={};Ri(uVt,{arrayReplaceAt:()=>lVt,asciiTrim:()=>hJ,assign:()=>cde,escapeHtml:()=>tF,escapeRE:()=>xrs,fromCodePoint:()=>lde,has:()=>grs,isMdAsciiPunct:()=>fJ,isPunctChar:()=>ERn,isPunctCharCode:()=>dJ,isSpace:()=>zs,isString:()=>Qet,isValidEntityCode:()=>qet,isWhiteSpace:()=>uJ,lib:()=>wrs,normalizeReference:()=>pJ,unescapeAll:()=>eF,unescapeMd:()=>vrs});p();var Net={};Ri(Net,{decode:()=>xwe,encode:()=>ket,format:()=>ode,parse:()=>wwe});p();p();var Xwn={};function Vts(t){let e=Xwn[t];if(e)return e;e=Xwn[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(Ret,"decode");Ret.defaultChars=";/?:@&=+$,#";Ret.componentChars="";var xwe=Ret;p();var eRn={};function Wts(t){let e=eRn[t];if(e)return e;e=eRn[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=Wts(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(Pet,"encode");Pet.defaultChars=";/?:@&=+$,-_.!~*'()#";Pet.componentChars="-_.!~*'()";var ket=Pet;p();function ode(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(ode,"format");p();function Det(){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(Det,"Url");var zts=/^([a-z0-9.+-]+:)/i,Yts=/:[0-9]*$/,Kts=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Jts=["<",">",'"',"`"," ","\r",` -`," "],Zts=["{","}","|","\\","^","`"].concat(Jts),Xts=["'"].concat(Zts),tRn=["%","/","?",";","#"].concat(Xts),rRn=["/","?","#"],ers=255,nRn=/^[+a-z0-9A-Z_-]{0,63}$/,trs=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,iRn={javascript:!0,"javascript:":!0},oRn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function rrs(t,e){if(t&&t instanceof Det)return t;let r=new Det;return r.parse(t,e),r}a(rrs,"urlParse");Det.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=Kts.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=zts.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&&iRn[c])&&(s=s.substr(2),this.slashes=!0)),!iRn[c]&&(o||c&&!oRn[c])){let d=-1;for(let A=0;A127?v+="x":v+=_[b];if(!v.match(nRn)){let b=A.slice(0,y),T=A.slice(y+1),w=_.match(trs);w&&(b.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=b.join(".");break}}}}this.hostname.length>ers&&(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),oRn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Det.prototype.parseHost=function(t){let e=Yts.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 wwe=rrs;var rVt={};Ri(rVt,{Any:()=>Met,Cc:()=>Oet,Cf:()=>sRn,P:()=>sde,S:()=>Bet,Z:()=>Let});p();p();var Met=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var Oet=/[\0-\x1F\x7F-\x9F]/;p();var sRn=/[\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 sde=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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 Bet=/[\$\+<->\^`\|~\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 Let=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var aRn=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 cRn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var nVt,nrs=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]]),iVt=(nVt=String.fromCodePoint)!==null&&nVt!==void 0?nVt: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 oVt(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=nrs.get(t))!==null&&e!==void 0?e:t}a(oVt,"replaceCodePoint");var mg;(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"})(mg||(mg={}));var irs=32,$q;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})($q||($q={}));function sVt(t){return t>=mg.ZERO&&t<=mg.NINE}a(sVt,"isNumber");function ors(t){return t>=mg.UPPER_A&&t<=mg.UPPER_F||t>=mg.LOWER_A&&t<=mg.LOWER_F}a(ors,"isHexadecimalCharacter");function srs(t){return t>=mg.UPPER_A&&t<=mg.UPPER_Z||t>=mg.LOWER_A&&t<=mg.LOWER_Z||sVt(t)}a(srs,"isAsciiAlphaNumeric");function ars(t){return t===mg.EQUALS||srs(t)}a(ars,"isEntityInAttributeInvalidEnd");var hg;(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"})(hg||(hg={}));var i2;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(i2||(i2={}));var Fet=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=hg.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=i2.Strict}startEntity(e){this.decodeMode=e,this.state=hg.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case hg.EntityStart:return e.charCodeAt(r)===mg.NUM?(this.state=hg.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=hg.NamedEntity,this.stateNamedEntity(e,r));case hg.NumericStart:return this.stateNumericStart(e,r);case hg.NumericDecimal:return this.stateNumericDecimal(e,r);case hg.NumericHex:return this.stateNumericHex(e,r);case hg.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|irs)===mg.LOWER_X?(this.state=hg.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=hg.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===mg.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==i2.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:r,decodeTree:n}=this,o=(n[r]&$q.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,r,n){let{decodeTree:o}=this;return this.emitCodePoint(r===1?o[e]&~$q.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case hg.NamedEntity:return this.result!==0&&(this.decodeMode!==i2.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case hg.NumericDecimal:return this.emitNumericEntity(0,2);case hg.NumericHex:return this.emitNumericEntity(0,3);case hg.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case hg.EntityStart:return 0}}};function lRn(t){let e="",r=new Fet(t,n=>e+=iVt(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(lRn,"getDecoder");function crs(t,e,r,n){let o=(e&$q.BRANCH_LENGTH)>>7,s=e&$q.JUMP_TABLE;if(o===0)return s!==0&&n===s?r:-1;if(s){let u=n-s;return u<0||u>=o?-1:t[r+u]-1}let c=r,l=c+o-1;for(;c<=l;){let u=c+l>>>1,d=t[u];if(dn)l=u-1;else return t[u+o]}return-1}a(crs,"determineBranch");var uRn=lRn(aRn),jNd=lRn(cRn);function ade(t,e=i2.Legacy){return uRn(t,e)}a(ade,"decodeHTML");function Rwe(t){return uRn(t,i2.Strict)}a(Rwe,"decodeHTMLStrict");p();p();function Uet(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 aVt(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(aVt,"getEscaper");var dRn=aVt(/[&<>'"]/g,urs),fRn=aVt(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),pRn=aVt(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var hRn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(hRn||(hRn={}));var mRn;(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"})(mRn||(mRn={}));function hrs(t){return Object.prototype.toString.call(t)}a(hrs,"_class");function Qet(t){return hrs(t)==="[object String]"}a(Qet,"isString");var mrs=Object.prototype.hasOwnProperty;function grs(t,e){return mrs.call(t,e)}a(grs,"has");function cde(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(cde,"assign");function lVt(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(lVt,"arrayReplaceAt");function qet(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(qet,"isValidEntityCode");function lde(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(lde,"fromCodePoint");var yRn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Ars=/&([a-z#][a-z0-9]{1,31});/gi,yrs=new RegExp(yRn.source+"|"+Ars.source,"gi"),Ers=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function _rs(t,e){if(e.charCodeAt(0)===35&&Ers.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return qet(n)?lde(n):t}let r=ade(t);return r!==t?r:t}a(_rs,"replaceEntityPattern");function vrs(t){return t.indexOf("\\")<0?t:t.replace(yRn,"$1")}a(vrs,"unescapeMd");function eF(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(yrs,function(e,r,n){return r||_rs(e,n)})}a(eF,"unescapeAll");var Crs=/[&<>"]/,brs=/[&<>"]/g,Srs={"&":"&","<":"<",">":">",'"':"""};function Trs(t){return Srs[t]}a(Trs,"replaceUnsafeChar");function tF(t){return Crs.test(t)?t.replace(brs,Trs):t}a(tF,"escapeHtml");var Irs=/[.?*+^$[\]\\(){}|-]/g;function xrs(t){return t.replace(Irs,"\\$&")}a(xrs,"escapeRE");function zs(t){switch(t){case 9:case 32:return!0}return!1}a(zs,"isSpace");function uJ(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(uJ,"isWhiteSpace");function ERn(t){return sde.test(t)||Bet.test(t)}a(ERn,"isPunctChar");function dJ(t){return ERn(lde(t))}a(dJ,"isPunctCharCode");function fJ(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(fJ,"isMdAsciiPunct");function pJ(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(pJ,"normalizeReference");function ARn(t){return t===32||t===9||t===10||t===13}a(ARn,"isAsciiTrimmable");function hJ(t){let e=0;for(;e=e&&ARn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(hJ,"asciiTrim");var wrs={mdurl:Net,ucmicro:rVt};var hVt={};Ri(hVt,{parseLinkDestination:()=>fVt,parseLinkLabel:()=>dVt,parseLinkTitle:()=>pVt});p();p();function dVt(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=eF(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(fVt,"parseLinkDestination");p();function pVt(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"+tF(s.content)+""};jO.code_block=function(t,e,r,n,o){let s=t[e];return""+tF(t[e].content)+` -`};jO.fence=function(t,e,r,n,o){let s=t[e],c=s.info?eF(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)||tF(s.content):d=tF(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(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("${d} `}return`
${d}
-`};jO.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)};jO.hardbreak=function(t,e,r){return r.xhtmlOut?`
+`};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?`
`:`
-`};jO.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?`
+`};KO.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?`
`:`
`:` -`};jO.text=function(t,e){return tF(t[e].content)};jO.html_block=function(t,e){return t[e].content};jO.html_inline=function(t,e){return t[e].content};function ude(){this.rules=cde({},jO)}a(ude,"Renderer");ude.prototype.renderAttrs=a(function(e){let r,n,o;if(!e.attrs)return"";for(o="",r=0,n=e.attrs.length;r -`:">",s},"renderToken");ude.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");dde.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 rF=dde;function vRn(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(vRn,"StateCore");vRn.prototype.Token=rF;var CRn=vRn;p();var Rrs=/\r\n?|\n/g,Prs=/\0/g;function mVt(t){let e;e=t.src.replace(Rrs,` -`),e=e.replace(Prs,"\uFFFD"),t.src=e}a(mVt,"normalize");p();function gVt(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(gVt,"block");p();function AVt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a(krs,"isLinkOpen");function Drs(t){return/^<\/a\s*>/i.test(t)}a(Drs,"isLinkClose");function yVt(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"&&(krs(l.content)&&s>0&&s--,Drs(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(Mrs,Brs)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(Lrs,"replace_scoped");function Frs(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&bRn.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(Frs,"replace_rare");function EVt(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)&&Lrs(t.tokens[e].children),bRn.test(t.tokens[e].content)&&Frs(t.tokens[e].children))}a(EVt,"replace");p();var Urs=/['"]/,SRn=/['"]/g,TRn="\u2019";function jet(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(jet,"addReplacement");function Qrs(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&&jet(o,s,h.index,TRn);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"||!Urs.test(t.tokens[e].content)||qrs(t.tokens[e].children,t)}a(_Vt,"smartquotes");p();function vVt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};HO.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");HO.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!zs(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");HO.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");HO.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");HO.prototype.Token=rF;var xRn=HO;p();var jrs=65536;function SVt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(SVt,"getLine");function wRn(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=wRn(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=wRn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),b+=h-d.length,b>jrs))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(IVt,"code");p();function xVt(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=RRn(t,u))>=0)h=!1;else return!1;if(f&&t.skipSpaces(g)>=t.eMarks[u])return!1;if(n)return!0;let A=t.src.charCodeAt(g-1),y=t.tokens.length;h?(l=t.push("ordered_list_open","ol",1),m!==1&&(l.attrs=[["start",m]])):l=t.push("bullet_list_open","ul",1);let E=[u,0];l.map=E,l.markup=String.fromCharCode(A);let _=!1,v=t.md.block.ruler.getRules("list"),b=t.parentType;for(t.parentType="list";u=o?x=1:x=w-T,x>4&&(x=1);let P=T+x;l=t.push("list_item_open","li",1),l.markup=String.fromCharCode(A);let D=[u,0];l.map=D,h&&(l.info=t.src.slice(c,g-1));let N=t.tight,B=t.tShift[u],L=t.sCount[u],j=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=P,t.tight=!0,t.tShift[u]=R-t.bMarks[u],t.sCount[u]=w,R>=o&&t.isEmpty(u+1)?t.line=Math.min(t.line+2,r):t.md.block.tokenize(t,u,r,!0),(!t.tight||_)&&(d=!1),_=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=j,t.tShift[u]=B,t.sCount[u]=L,t.tight=N,l=t.push("list_item_close","li",-1),l.markup=String.fromCharCode(A),u=t.line,D[1]=u,u>=r||t.sCount[u]=4)break;let M=!1;for(let O=0,q=v.length;O=4||t.src.charCodeAt(o)!==91)return!1;function l(v){let b=t.lineMax;if(v>=b||t.isEmpty(v))return null;let T=!1;if(t.sCount[v]-t.blkIndent>3&&(T=!0),t.sCount[v]<0&&(T=!0),!T){let x=t.md.block.ruler.getRules("reference"),P=t.parentType;t.parentType="reference";let D=!1;for(let N=0,B=x.length;N"u"&&(t.env.references={}),typeof t.env.references[_]>"u"&&(t.env.references[_]={title:E,href:h}),t.line=c),!0):!1}a(kVt,"reference");p();p();var kRn=["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 Grs="[a-zA-Z_:][a-zA-Z0-9:._-]*",$rs="[^\"'=<>`\\x00-\\x20]+",Vrs="'[^']*'",Wrs='"[^"]*"',zrs="(?:"+$rs+"|"+Vrs+"|"+Wrs+")",Yrs="(?:\\s+"+Grs+"(?:\\s*=\\s*"+zrs+")?)",DRn="<[A-Za-z][A-Za-z0-9\\-]*"+Yrs+"*\\s*\\/?>",NRn="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Krs="",Jrs="<[?][\\s\\S]*?[?]>",Zrs="]*>",Xrs="",MRn=new RegExp("^(?:"+DRn+"|"+NRn+"|"+Krs+"|"+Jrs+"|"+Zrs+"|"+Xrs+")"),ORn=new RegExp("^(?:"+DRn+"|"+NRn+")");var gJ=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(ORn.source+"\\s*$"),/^$/,!1]];function DVt(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=hJ(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(NVt,"heading");p();function MVt(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};Pwe.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(tns);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(LVt,"linkify");p();function FVt(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){UVt[t.charCodeAt(0)]=1});function QVt(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&&UVt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(QVt,"escape");p();function qVt(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(URn,"postProcess");function ons(t){let e=t.tokens_meta,r=t.tokens_meta.length;URn(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[pJ(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(GVt,"link");p();function $Vt(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[pJ(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($Vt,"image");p();var sns=/^([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])?)*)$/,ans=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function VVt(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(ans.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(sns.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(VVt,"autolink");p();function cns(t){return/^\s]/i.test(t)}a(cns,"isLinkOpen");function lns(t){return/^<\/a\s*>/i.test(t)}a(lns,"isLinkClose");function uns(t){let e=t|32;return e>=97&&e<=122}a(uns,"isLetter");function WVt(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&&!uns(o))return!1;let s=t.src.slice(n).match(MRn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],cns(c.content)&&t.linkLevel++,lns(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a(WVt,"html_inline");p();var dns=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,fns=/^&([a-z][a-z0-9]{1,31});/i;function zVt(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(dns);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=qet(c)?lde(c):lde(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(fns);if(s){let c=Rwe(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(zVt,"entity");p();function QRn(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(QRn,"processDelimiters");function YVt(t){let e=t.tokens_meta,r=t.tokens_meta.length;QRn(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};kwe.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()};kwe.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(XVt,"default");function eWt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(eWt,"assign");function Vet(t){return Object.prototype.toString.call(t)}a(Vet,"_class");function pns(t){return Vet(t)==="[object String]"}a(pns,"isString");function hns(t){return Vet(t)==="[object Object]"}a(hns,"isObject");function mns(t){return Vet(t)==="[object RegExp]"}a(mns,"isRegExp");function jRn(t){return Vet(t)==="[object Function]"}a(jRn,"isFunction");function gns(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(gns,"escapeRE");var GRn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Ans(t){return Object.keys(t||{}).reduce(function(e,r){return e||GRn.hasOwnProperty(r)},!1)}a(Ans,"isOptionsObj");var yns={"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")}},Ens="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]",_ns="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function vns(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a(vns,"createValidator");function HRn(){return function(t,e){e.normalize(t)}}a(HRn,"createNormalizer");function $et(t){let e=t.re=XVt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(Ens),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,hns(u)){mns(u.validate)?d.validate=vns(u.validate):jRn(u.validate)?d.validate=u.validate:s(l,u),jRn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=HRn();return}if(pns(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:HRn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(gns).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($et,"compile");function $Rn(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($Rn,"Match");function YS(t,e){if(!(this instanceof YS))return new YS(t,e);e||Ans(t)&&(e=t,t={}),this.__opts__=eWt({},GRn,e),this.__schemas__=eWt({},yns,t),this.__compiled__={},this.__tlds__=_ns,this.__tlds_replaced__=!1,this.re={},$et(this)}a(YS,"LinkifyIt");YS.prototype.add=a(function(e,r){return this.__schemas__[e]=r,$et(this),this},"add");YS.prototype.set=a(function(e){return this.__opts__=eWt(this.__opts__,e),this},"set");YS.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");YS.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");YS.prototype.testSchemaAt=a(function(e,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,n,this):0},"testSchemaAt");YS.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"},tWt=35,GO=Math.floor,rWt=String.fromCharCode;function Vq(t){throw new RangeError(Tns[t])}a(Vq,"error");function Ins(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(Ins,"map");function zRn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(Sns,".");let o=t.split("."),s=Ins(o,e).join(".");return n+s}a(zRn,"mapDomain");function YRn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),wns=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"),WRn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),KRn=a(function(t,e,r){let n=0;for(t=r?GO(t/700):t>>1,t+=GO(t/e);t>tWt*26>>1;n+=36)t=GO(t/tWt);return GO(n+(tWt+1)*t/(t+38))},"adapt"),JRn=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&&Vq("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&Vq("invalid-input");let m=wns(t.charCodeAt(l++));m>=36&&Vq("invalid-input"),m>GO((2147483647-n)/f)&&Vq("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(mGO(2147483647/A)&&Vq("overflow"),f*=A}let d=e.length+1;s=KRn(n-u,d,u==0),GO(n/d)>2147483647-o&&Vq("overflow"),o+=GO(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),ZRn=a(function(t){let e=[];t=YRn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push(rWt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fGO((2147483647-o)/d)&&Vq("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&Vq("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=nWt.toASCII(e.hostname)}catch{}return ket(ode(e))}a(Bns,"normalizeLink");function Lns(t){let e=wwe(t,!0);if(e.hostname&&(!e.protocol||rPn.indexOf(e.protocol)>=0))try{e.hostname=nWt.toUnicode(e.hostname)}catch{}return xwe(ode(e),xwe.defaultChars+"%")}a(Lns,"normalizeLinkText");function hw(t,e){if(!(this instanceof hw))return new hw(t,e);e||Qet(t)||(e=t||{},t="default"),this.inline=new qRn,this.block=new BRn,this.core=new IRn,this.renderer=new _Rn,this.linkify=new VRn,this.validateLink=Ons,this.normalizeLink=Bns,this.normalizeLinkText=Lns,this.utils=uVt,this.helpers=cde({},hVt),this.options={},this.configure(t),e&&this.set(e)}a(hw,"MarkdownIt");hw.prototype.set=function(t){return cde(this.options,t),this};hw.prototype.configure=function(t){let e=this;if(Qet(t)){let r=t;if(t=Dns[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};hw.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};hw.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};hw.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};hw.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};hw.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};hw.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};hw.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var iWt=hw;function oWt(t){return Array.isArray(t)}a(oWt,"isArray");function Fns(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||oWt(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a(Fns,"isFenceToken");function*nPn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;oWt(r.children)&&(yield*nPn(r.children))}}a(nPn,"flattenTokensLists");function Uns(){return new iWt}a(Uns,"createMarkdownIt");function iPn(t){let e=[],n=Uns().parse(t,{});if(!oWt(n))return e;for(let o of nPn(n)){if(!o||typeof o!="object")continue;let s=o;if(Fns(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(iPn,"extractCodeBlocks");function sWt(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(sWt,"escapeProblematicHtmlTags");var cWt=In.Gpt4oMini,oPn=new pe("virtualToolSummarizer"),Dwe=class extends Error{static{a(this,"SummarizerError")}};function sPn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(sPn,"isValidCategoryItem");function aPn(t,e){if(!Array.isArray(t))throw new Dwe(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(sPn))throw new Dwe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(aPn,"validateCategoriesWithoutToolsResponse");function Qns(t){return sPn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(Qns,"isValidCategorizationItem");function cPn(t,e){if(aPn(t,e),!t.every(Qns))throw new Dwe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(cPn,"validateCategorizationResponse");function lPn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(lPn,"deduplicateTools");function qns(t){let e=new Map;for(let r of t){let n=dPn(r.name),o=e.get(n);o?(r.summary&&r.summary!==o.summary&&(o.summary=`${o.summary} +`:">",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} -${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=lPn(r.tools);return[...e.values()]}a(qns,"validateAndCleanupCategories");function uPn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(Jwn)}));return qns(r)}a(uPn,"processCategorizationResponse");function dPn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(dPn,"normalizeGroupName");function aWt(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:_et,summary:Hwn,tools:[...r.values()]}),t}a(aWt,"addUncategorizedToolsIfNeeded");async function lWt(t,e,r,n){if(n.isCancellationRequested)return oPn.debug(t.ctx,"Summarization cancelled"),null;let o=wA.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await Zc(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new nc(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return oPn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of iPn(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(lWt,"getResponse");async function fPn(t,e,r){let n=await t.ctx.get(Jc).getBestChatModelConfig([cWt]),s=await ip.create(Iet,{tools:e},n).renderPrompt(void 0,r),c=await lWt(t,s,n,r);if(!c)return;let l=[c];return aPn(l,"categorizer"),{...l[0],tools:lPn(e),name:dPn(l[0].name)}}a(fPn,"summarizeToolGroup");async function pPn(t,e,r){let n=await t.ctx.get(Jc).getBestChatModelConfig([cWt]),s=await ip.create(xet,{tools:e},n).renderPrompt(void 0,r),c=await lWt(t,s,n,r);if(!c)return;cPn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=uPn(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 uWt(t,u,f,r);h&&(u=h),u=aWt(u,l)}return u}a(pPn,"divideToolsIntoGroups");async function uWt(t,e,r,n){let o=await t.ctx.get(Jc).getBestChatModelConfig([cWt]),c=await ip.create(wet,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await lWt(t,c,o,n);if(!l)return;cPn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=uPn(l,d);return aWt(f,d)}a(uWt,"divideToolsIntoExistingGroups");var gPn=de(require("crypto"));var dWt=new pe("virtualToolGrouper"),mPn="builtin",$ns=`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=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: -`,Vns=` +`,tns=` -Be sure to call this tool if you need a capability related to the above.`,Wet=class{static{a(this,"VirtualToolGrouper")}constructor(e){this.turnContext=e}async addGroups(e,r,n){if(r.length<_qt){e.contents=r;return}dWt.info(this.turnContext.ctx,`Grouping ${r.length} tools into virtual tools.`,r);let o=Kwn(r,u=>u.type==="mcp"?"mcp_"+u.toolProvider.id:u.type==="client"||u.type==="shared"?mPn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof V_&&(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===mPn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof xK);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 V_){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){dWt.error(this.turnContext.ctx,`Failed to categorize tools: ${Xu(d)}`)}}dWt.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===_et);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 V_(Hq+d.name,$ns+d.summary+Vns,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 V_&&!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 fPn(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 uWt(this.turnContext,r,e,n):await pPn(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 V_&&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 V_&&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 gPn.createHash("sha256").update(r).digest("hex")}};var zet=class{constructor(e){this._root=new V_(Hq,"",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){Twe(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new Wet(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 V_)return o.isExpanded=!0,new Br([new Pr(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var $O=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===El.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 zet(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 APn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(APn,"calculateReducedMaxRequestTokens");jo();var Kns=500,Yet=3,gg=new pe("toolCallingLoop"),Jns="internal.tool_calling_loop_continue_confirmation",fde=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(Sc),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(ds),this.transcriptPersistence=new s0(e.ctx),this.llmRequestPersistence=Oae(()=>{if(!JKe(e.ctx))return;let d=e.subagentInfo;return new KKe(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 Vue(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new vet(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=APn(c),u=c-l;gg.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=Gt(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(Kns,Ft(e.ctx,Ke.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new MXe(new OXe(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(c0).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=DKe(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 N$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(Wvn(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.`,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 -`}]}));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 Z3?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 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} -`}]})}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=ip.create(Eet,R,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=kKe(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 Pq((R,x,P,D,N,B)=>{let L=R.trim(),M=L.match(Kxe)!==null&&L.endsWith("-->")||!!this.subagentConfig?.hideReplyText;this.conversationProgress.report(this.conversation,this.turn,{annotations:x,references:P,hideText:M,notifications:D.map(O=>({severity:"warning",message:O.message})),thinking:B,editAgentRounds:[{roundId:e,reply:M?"":R}]}),this.turn.annotations.push(...x??[]),d+=R});this.abortIfCanceled(r);let h=await this.getAvailableChatTools(o,r);this.abortIfCanceled(r);let m=this.metricsTracker.computePromptPrefixMetrics(u,h),g={messages:u,modelConfiguration:this.modelConfiguration,uiKind:"agentPanel",chatModeKind:this.turnContext.turn.chatMode?.kind,tools:h,intentParams:{intent:!0},llmInteraction:this.turnContext.toLlmInteraction(),endpoint:l,turnId:String(this.turn.id)};this.checkChatPayload(g),gg.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&&(gg.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 RA({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new Nc;case"failed":throw this.turn.status="error",gg.error(this.turnContext.ctx,"Fetch failed:",r),new RA({message:U_.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===Q_,copilotPlan:JI(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new RA({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new RA({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new RA({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new RA({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 RA({message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"model_not_supported":{this.turn.status="error";let{modelName:l,modelProviderName:u}=Ro.parseModelNotSupportedReason(r.reason);throw new RA({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 RA({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 RA({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 V_)this.handleVirtualToolCall(c,e,n);else if(c instanceof xK)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;gg.error(this.turnContext.ctx,l);let u=new Br([new Pr(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=UXe(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($O).didCall(this.turnContext,e.name),c,l;s?(l=s,c=s.status):(c="error",l=new Br([new Pr(`Failed to activate virtual tool group ${e.name}`)],"error")),this.addToolCallResultToTurn(l,r.id);let u=performance.now()-o;Xqt(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=Q3(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){gg.info(this.turnContext.ctx,`Tool execution denied by hook: ${h.reason||"No reason provided"}`),l="cancelled";let A=new Br([new Pr(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=hwn(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=UXe(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 qq||u instanceof Nc)this.turn.status="cancelled",l="cancelled",this.addToolCallResultToTurn(new Br([new Pr("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{gg.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${Xu(u)}`,u),l="error";let d=new Br([new Pr(Xu(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=UXe(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),Xqt(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=Q3(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){gg.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($O);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 gg.error(this.turnContext.ctx,`Error while computing tool grouping: ${Xu(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof V_?{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"?kwn(this.modelConfiguration):e.name==="apply_patch"?Nwn(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?UO.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=Aq(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+BO(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(NK(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){gg.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=Aq(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get($O).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(lJ).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(zS),c=iJ(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!qO.isPotentiallySensitiveTool(e))return;let n=qO.getMatchingRuleForToolCall(e,r,this.turnContext),o=qO.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 Nc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){gg.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=qO.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=Twn(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?iJ(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 qq("Cancelled by user");case"accept":return Promise.resolve();default:throw new qq(`Invalid confirmation result ${E.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(gg.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,gg.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new Z3}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(Ld)}catch(s){return gg.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:Jns,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 gg.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${Xu(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new RA({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new RA({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(VC).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){gg.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=_Xe(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=Qxn(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=qxn(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=jxn(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}));Mae(()=>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||Mae(()=>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=BO(n.content),c=Math.round(performance.now()-o);Mae(()=>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 fWt=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},pWt=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 fjt(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(fjt,"parseModelString");var Ket=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 Zf({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 yxe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new yK([c],e.conversation.source,e.conversation.userLanguage),f=new fw(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let b=fjt(this.config.model),T=b.modelName.toLowerCase(),w=b.provider.toLowerCase()||"copilot";if(w==="copilot"){let P=(await f.ctx.get(Ss).getMetadata()).find(D=>D.name.toLowerCase()===T);if(P)h=await Ro.getModelConfigurationById(e.ctx,P.id);else if(T===rJe.toLowerCase())m=!0,h=await Ro.getModelConfigurationById(e.ctx,Q_,d.id.toString(),gq(d.turns));else throw new Error(`Model "${b.modelName}" not found in available models`)}else{let P=(await new ca(f.ctx.get(zn)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(P)h=await AO(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 Zns(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 nc(e.ctx),A=await Zc(e.ctx,f,{languageId:""}),y=n||new fWt,E=new pWt(y,e.turn.id);await e.ctx.get(Sc).begin(d,c,E),await new fde(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(pu).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?kn(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 Zns(t,e){let r=t.turn.resolvedModelConfiguration,n=e(r.modelFamily);if(!n||n.length===0)return r;let o=r.originalBillingMultiplier;for(let s of n)try{let c=await Ro.resolveModelIdFromFamily(t.ctx,s);if(!c)continue;let l=await Ro.getModelConfigurationById(t.ctx,c);if(o!==void 0&&l.originalBillingMultiplier!==void 0&&l.originalBillingMultiplier>o)continue;return l}catch{continue}return r}a(Zns,"resolvePreferredSubagentModel");p();p();p();var Wq=de(xo());var Jet=class extends lr{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=kn(r.request.message),c=vO(r.response?.message,!0),l=wO(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,Wq.useKeepWith)();return vscpp(vscppf,null,vscpp(Wq.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(Wq.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(Fq,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Uq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(Wue,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(Wq.UserMessage,{priority:900},vscpp(vscppf,null,s)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(tw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`SearchSubagent-${r.id}`})),o&&vscpp(Wq.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 hWt=10,Xns=new Set(["file_search","grep_search","read_file"]),Zet=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[In.ClaudeHaiku45,In.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:hWt,isLastTurn:o.oneBasedIterationNum>hWt};return ip.create(Jet,s,n)}filterTools(e){return e.filter(r=>Xns.has(r.name))}getMaxRounds(){return hWt+1}};p();var yJ=de(xo());var Xet=class extends lr{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=vO(r.response?.message,!0),l=wO(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,yJ.useKeepWith)(),d=kn(r.request.message);return vscpp(vscppf,null,vscpp(yJ.SystemMessage,{priority:1e3},vscpp(Kue,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(yJ.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(Fq,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Uq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(yJ.UserMessage,{priority:900},vscpp(vscppf,null,d)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(tw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`Subagent-${o}-${r.id}`})))}};var mWt=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 ip.create(Xet,s,n)}};function yPn(t){return t.isBuiltIn&&t.name==="Search"?new Zet:new mWt(t)}a(yPn,"resolveSubagentConfig");var pde=class extends Au{constructor(){super({name:"run_subagent",displayName:"Run Sub Agent",description:`Launch a new agent to handle complex, multi-step tasks autonomously. +`}]})}throw s}}async runOne(e,r){this.abortIfCanceled(r);let n=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode),o=this.getAvailableLanguageModelTools(n),s;if(this.subagentConfig){let R=this.subagentConfig.filterTools?.(o);R!==void 0&&(o=R),s=this.subagentConfig.createPromptRenderer(this.turnContext,o,this.modelConfiguration,{oneBasedIterationNum:e,maxRounds:this.maxToolCallingLoop})}else{let R=this.createAgentPromptProps(o);s=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. The run_subagent tool launches specialized agents that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it. @@ -3417,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 zue}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await Zc(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",$0(r.ctx,"runSubagentTool.error",l),WI(r.ctx,"runSubagentTool.error",l),new Br([new Pr(`Custom agent '${c}' not found`)],"error");if(!d.invokePolicy.includes("model"))return l.properties.message="Agent model invocation disabled",$0(r.ctx,"runSubagentTool.error",l),WI(r.ctx,"runSubagentTool.error",l),new Br([new Pr(`Agent '${c}' is not available for model invocation`)],"error");u=yPn(d);let f=new Ket(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(Sc).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),WI(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 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}": -${A.response}`,_=new Br([new Pr(E)],"success");return _.subagentConversationId=A.conversationId,_.subagentTurnId=A.turnId,_}catch(d){let f="";return d instanceof Z3?(l.properties.message="Tool call round exceed",$0(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",QUe(r.ctx,"runSubagentTool.error",d,l.extendedBy({message:f})),new Br([new Pr(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 EJ=new pe("applyPatchTool"),eis=`Use the \`apply_patch\` tool to edit files. +${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. 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 @@ -3488,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.`,ett=class extends Au{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:eis,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 Pr("Missing patch text")],"error");let c=zwn(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 EJ.warn(e.ctx,h),new Br([new Pr(h)],"error")}let l=cJ(o),u=nde(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 EJ.warn(e.ctx,h),new Br([new Pr(h)],"error")}let f={};try{EJ.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 rde)return EJ.warn(e.ctx,`Apply patch failed with InvalidContextError: ${h.message}, kind: ${h.kindForTelemetry}`),new Br([new Pr(`Applying patch failed: ${h.message}`)],"error");if(h instanceof QO)return EJ.warn(e.ctx,`Apply patch failed with InvalidPatchFormatError: ${h.message}, kind: ${h.kindForTelemetry}`),new Br([new Pr(`Invalid patch format: ${h.message}`)],"error");if(h instanceof em)return EJ.warn(e.ctx,`Apply patch failed with DiffError: ${h.message}`),new Br([new Pr(`Applying patch failed: ${h.message}`)],"error");let m=h instanceof Error?h.message:"An unknown error occurred";return EJ.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Br([new Pr(m)],"error")}}async buildCommit(e,r,n,o){return Ywn(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=td(c,n.uriSchemeCache),d=await n.ctx.get(ii).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new em(`File not found: ${c}`);if(d.status==="invalid")throw new em(`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.`,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: ${s.map(f=>` - ${f}`).join(` `)}`),c.length>0&&u.push(`Created files: ${c.map(f=>` - ${f}`).join(` @@ -3496,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 Br([new Pr(d)],"success")}async invokeClientEditFileTool(e,r,n,o,s,c){let l=e.ctx.get(ds).getToolByNameAndProvider("insert_edit_into_file",ep);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(ds).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(ds).getToolByNameAndProvider("create_file",ep);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(ds).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=cJ(n.input),s=nde(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=td(u,e.uriSchemeCache);return PA(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=cJ(n.input),s=nde(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=td(u,e.uriSchemeCache);return PA(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 EPn=require("path");var tis=16,Nwe=class extends Au{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 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. When to Use: - Explore unfamiliar codebases @@ -3515,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(Jk),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:rSn,maxResults:r.input.maxResults??tis,workspaceFolders:s,source:"codebaseTool"},n);if(l.chunks.length===0)return new Br([new Pr("No relevant code found")],"success");let u=l.chunks.map(f=>{let h=gn(f.chunk.file),m=IA(f.chunk.text);return new Pr(`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(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}: ${m} ${f.chunk.text} -${m}`)}),d=new lq(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,EPn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(Ck(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(Pn).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 ttt=class extends Au{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 Pr(s)],"error")}}async invokeClientCreateFileTool(e,r,n){let o=e.ctx.get(ds).getToolByNameAndProvider("create_file",ep);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(ds).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=aO({uri:td(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=BO(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 FO({code:s,languageId:o,noFilePath:!0});return c.push(...l.renderAsArray()),c.push(""),new Br([new Pr(c.join(` -`))],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running create_file tool"};let o=td(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${PA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Ld),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=td(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${PA(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();jo();function _J(){return Gt()}a(_J,"uuidV4");p();var eh={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function CPn(t){let e=[],r=[],n=[],o,s;for(let c of ris(t))switch(c.marker){case void 0:r=c.content;break;case eh.FILEPATH:o=c.content.join(` -`).trim();break;case eh.FIND:s=_Pn(c.content);break;case eh.REPLACE:if(o&&s){let l=_Pn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case eh.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(CPn,"parsePatchResponse");function _Pn(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(_Pn,"extractCodeBlock");function*ris(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(eh.FILEPATH)?s=eh.FILEPATH:o.startsWith(eh.FIND)?s=eh.FIND:o.startsWith(eh.REPLACE)?s=eh.REPLACE:o.startsWith(eh.COMPLETE)?s=eh.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(ris,"iterateSections");function nis(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=iis(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=Mwe(_);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=Mwe(_);if(v>0&&v<_.length){h=_.substring(0,v).indexOf(" ")!==-1;break}}let m=sis(o,u,f,h),g=r.slice(0,c),A=r.slice(l+1);return[...g,...m,...A].join(` -`)}a(nis,"applyPatch");function iis(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&&bPn(t.charCodeAt(n));)n--;return n<0}a(vPn,"endsWith");function ois(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}=SPn(u,n),h=f;if(hs&&rtt(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(sis,"adjustIndentation");function TPn(t,e){let r=t;for(let n of e){let o=nis(r,n);o!==void 0&&(r=o)}return r}a(TPn,"applyPatches");p();var ais="InstantApplyChat";function cis(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(cis,"isProxyModel");function lis(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(cis):[]}a(lis,"parseProxyModels");var zq=class{constructor(e){this.ctx=e;this.logger=new pe("ProxyModelService");this.models=[];Es(e,n=>{this.fetchModels(n)});let r=e.get(Ut).getLastToken();r&&this.fetchModels(r)}static{a(this,"ProxyModelService")}get instantApplyModels(){return this.models.filter(e=>e.serviceType===ais)}async fetchModels(e){try{let r=KI(this.ctx,e,"proxy","models"),n=await this.ctx.get(tr).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...Oy(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=lis(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 ntt=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var lE=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var vJ=de(xo());var hde=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=IA(d),g=IA(o);return vscpp(vscppf,null,vscpp(vJ.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 ",kA," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(vJ.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(vJ.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(vJ.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var ott=de(xo());var gWt=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 `",eh.FILEPATH,"`, `",eh.FIND,"` and `",eh.REPLACE,"`.",vscpp("br",null),"After ",eh.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",eh.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 ",eh.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 ",eh.COMPLETE,".",vscpp("br",null))}},itt=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=IA(u),h=IA(o),m=Zo(this.props.uri);return vscpp(vscppf,null,vscpp(ott.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 `",kA,"` 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(gWt,null),vscpp("br",null),vscpp(tet,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(ott.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${eh.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 Ac=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Mc(`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 Mc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Mc(`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,Xle)}static subtract(e,r){return r?e.startLineNumberr)throw new Mc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=PK(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=Tqt(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=Tqt(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 Ul(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=CKe(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=PK(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 Ul(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var VO=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 Ul.ofLength(1,this.lineCount)}addToPosition(e){return this.lineCount===0?new zo(e.lineNumber,e.column+this.columnCount):new zo(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 Owe=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 Ac(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=PK(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new zo(n,o)}getRange(e){return Ui.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return VO.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new VO(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var AWt=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new zo(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 Owe(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Ui(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return aJe(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var nF=class extends AWt{constructor(r){super();this.value=r;this._t=new Owe(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 Bwe=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Mc(`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(Ac.emptyAt(h),new Ac(0,m));s.push(E)}if(!f)throw new Mc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(Ac.ofStartAndLength(f.replaceRange.endExclusive,0),new Ac(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new Ac(h,l.replaceRange.endExclusive-c),y=l.slice(A,new Ac(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 Ac(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(Ac.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 vxe(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 Ac(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},IPn=class t extends Bwe{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 ctt=class extends Bwe{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(DA.replace(Ac.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new W_(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 W_(r)}normalizeEOL(e){return new W_(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=DA.replace(Ac.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?W_.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new nF(this.apply(e.value))}mapData(e){return new yWt(this.replacements.map(r=>new mde(r.replaceRange,r.newText,e(r))))}},ltt=class extends att{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=fue(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,Mxe(n,this.newText)),c=new Ac(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new DA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new DA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=fue(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new Ac(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=Mxe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new Ac(0,this.newText.length-o))}toEdit(){return new W_([this])}},W_=class t extends ctt{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 DA(e,r)])}static insert(e,r){return new t([new DA(Ac.emptyAt(e),r)])}static delete(e){return new t([new DA(e,"")])}static fromJson(e){return new t(e.map(DA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew DA(e.replaceRange,e.newText)))}},mde=class t extends ltt{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(Ac.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 Lwe=class t{constructor(e){this.replacements=e;kjt(()=>Fxe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>uE.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new uE(e,r)])}static insert(e,r){return new t([new uE(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 uE(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=VO.ofText(s.text);if(e.isBefore(l)){let d=new zo(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return utt(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 zo(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof zo?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof zo?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return utt(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 zo(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=utt(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=utt(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new nF(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new uE(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=VO.ofText(s.text),l=zo.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 Mc;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 nF(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Ui.fromPositions(new zo(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 zo(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(` -`)}},uE=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 Mc;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,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;cr.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>gde.deserialize(r)))}static fromEdit(e,r){let n=Lwe.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,Xle)),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 W_(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(Ul.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 Ul(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 gde(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 Pqt(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 gde(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},gde=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t(Ul.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=aJe(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Ui.fromPositions(new zo(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 zo(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 zo(s,c)}else n=new zo(1,1);let o=r.addToPosition(new zo(1,1));return new uE(Ui.fromPositions(n,o),"")}else return new uE(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=cue(r,n);r=r.substring(o),n=n.substring(o);let s=xxe(r,n);return r=r.substring(0,r.length-s),n=n.substring(0,n.length-s),r===""}};function rtt(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(rtt,"rangeFromPositions");var Ywe=class t{constructor(e){this.replacements=e;UK(Pxe(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=>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=>` `+c).join("")):(r=s,n=1,o=this.newLines.map(c=>c+` -`).join("")),new uE(Ui.fromPositions(new zo(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 uE(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new DA(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")})(uis||={});var Ade=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new dtt(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new dtt(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return xPn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return xPn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=Fwe.fromEdit(e,new nF(this.originalText)),n=vxe(r.replacements,s=>s.lineRange.length),o=vxe(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}))}}},dtt=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function xPn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(xPn,"sum");p();var yde=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=W_.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=dis(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 EWt(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(EWt,"compute4GramTextSimilarity");function dis(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(dis,"applyEditsToRanges");p();p();var Uwe=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 zo(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 ftt(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new Uwe(t),c=new Uwe(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 Ac(g,A);l.push(new DA(y,m))}return new W_(l)}a(ftt,"stringEditFromDiff");p();p();var wPn=de(require("path")),RPn=require("worker_threads");var _Wt=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 fis(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(fis,"createRpcProxy");var ptt=class{constructor(e,r,n){this.responseHandler=new _Wt;this.worker=new RPn.Worker(e,r),qIe(this.worker,wPn.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=fis((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 htt=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 Qwe=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 Ul(s,u.original.startLineNumber),new Ul(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new Ul(s,r+1),new Ul(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 WO(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Mc("not a valid diff");return new WO(new Ui(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Ui(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new WO(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(PPn(this.original.endLineNumberExclusive,e)&&PPn(this.modified.endLineNumberExclusive,r))return new WO(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 WO(Ui.fromPositions(new zo(this.original.startLineNumber,1),Ede(new zo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Ui.fromPositions(new zo(this.modified.startLineNumber,1),Ede(new zo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new WO(Ui.fromPositions(Ede(new zo(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Ede(new zo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Ui.fromPositions(Ede(new zo(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),Ede(new zo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Mc}};function Ede(t,e){if(t.lineNumber<1)return new zo(1,1);if(t.lineNumber>e.length)return new zo(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new zo(t.lineNumber,r.length+1):t}a(Ede,"normalizePosition");function PPn(t,e){return t>=1&&t<=e.length}a(PPn,"isValidLineNumber");var mtt=class t extends Qwe{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=Ul.join(e.map(o=>Ul.fromRangeInclusive(o.originalRange))),n=Ul.join(e.map(o=>Ul.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()])}},WO=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 Mc("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 uE(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var DPn=require("fs");var mw=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new yq(()=>{let e=pis([mJe(__dirname,"diffWorker.js"),mJe(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new ptt(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:kPn(o.changes),moves:o.moves.map(c=>new htt(new Qwe(new Ul(c[0],c[1]),new Ul(c[2],c[3])),kPn(c[4])))}}};function kPn(t){return t.map(e=>new mtt(new Ul(e[0],e[1]),new Ul(e[2],e[3]),e[4]?.map(r=>new WO(new Ui(r[0],r[1],r[2],r[3]),new Ui(r[4],r[5],r[6],r[7])))))}a(kPn,"toLineRangeMappings");function pis(t){for(let e of t)if((0,DPn.existsSync)(e))return e}a(pis,"firstExistingPath");var gtt=new pe("editSurvivalReporter"),vWt=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 fq;this._editSurvivalTracker=new yde(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=sf(this._document.uri),r=this.ctx.get(rw);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){gtt.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=sf(this._document.uri),n=await this.ctx.get(rw).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 gtt.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 Mc(`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 ftt(r,n,e.get(mw)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var Att=class extends vWt{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new Ade(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new lJe(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{gtt.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 yde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new Ade(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new yde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new Ade(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw gtt.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var NPn=new pe("editSurvivalTrackerService"),his=[0,30*1e3,120*1e3,300*1e3,600*1e3],KS=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n,o){NPn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let s=o?.timeouts??his,c;return{startReporter:a(l=>{(async()=>{try{let u=await ftt(r,n,this.ctx.get(mw));c=new Att(this.ctx,e,r,n,u,l,s)}catch(u){NPn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${Xu(u)}`,u)}})()},"startReporter"),cancel:a(()=>{c?.cancel()},"cancel")}}};var mis=1e3,MPn=256e3,OPn=64e3;function gis(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(gis,"makeProxyInstantApplyModelConfiguration");var Ais=8e3,BPn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:In.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},yis={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:In.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},ytt=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new pe("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new lE("No uri found in code block");if(o.isCancellationRequested)throw new ntt;e.code.includes(kA)||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 lE(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(kA))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(Ut).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)}`),Zn(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(zq).instantApplyModels[0]?.name??"unknown":"default"}),Ft(this.ctx,Ke.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=Ts("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 lE("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(KS),E=_J(),_=[],v=0,b=0,T=f.length+e.code.length+mis;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(nc).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 lE(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await ip.create(hde,{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:IA(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 lE(D)}}else{if(x.type==="canceled")throw new Nc;{let P=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,P,x),new lE(P)}}b+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",hde,e,r,n,o,s,c,l,u,d=>Eis(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",itt,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=CPn(d);if(h.patches.length===0)throw new lE(`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=TPn(f,h.patches);if(m===void 0)throw new lE(`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 lE(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await Ro.getModelConfiguration(this.ctx,"codeMapper");this.logger.info(this.ctx,`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} fallback using model: ${g.modelId} for ${n.resource}`);let A={codeBlock:n.code,uri:n.resource,existingDocument:o,markdownBeforeBlock:n.markdownBeforeBlock,...e==="full-rewrite"?{inProgressRewriteContent:void 0}:{}},_=(await ip.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(KS),b=await this.ctx.get(Ut).getToken(),T=await this.ctx.get(Zt).updateExPValuesAndAssignments(b),w=_J(),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(nc).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 lE(`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:IA(N)});let B=v.initialize(o.document,m,N);return{code:N,editSurvivalTrackingSession:B,telemetry:{requestSource:c.chatRequestSource,chatRequestModel:c.chatRequestModel,mapper:`${g.modelId}-${e}`,headerRequestId:P.requestId}}}else{if(P.type==="canceled")throw new Nc;{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 lE(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>MPn)throw new lE(`Document too large: ${l} characters (limit: ${MPn})`);let u=this.ctx.get(zq).instantApplyModels[0],d=u?gis(u.name):void 0,h=await ip.create(hde,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??BPn).renderPrompt(void 0,n),m=h.tokenCount;if(m>OPn)throw new lE(`Prompt too large: ${m} tokens (limit: ${OPn})`);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=kn(n.content);return n.role==="system"?`${r} +`).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} ${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 Eis(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(Eis,"extractCodeBlock");var Ett=class extends Au{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 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. 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... @@ -3579,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 Br([new Pr(s)],"error")}}async mapCode(e,r,n){let{filePath:o}=e,s=td(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new ytt(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(ds).getToolByNameAndProvider("insert_edit_into_file",ep);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(ds).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=aO({uri:td(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await Zc(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=BO(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 FO({code:l,languageId:c,noFilePath:!0});return u.push(...d.renderAsArray()),u.push(""),new Br([new Pr(u.join(` -`))],"success")}handleEditSurvivalTelemetry(e,r,n,o,s){Yvn(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=td(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${PA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Ld),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=td(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${PA(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 LPn=require("crypto"),YO=de(require("fs/promises")),FPn=require("os"),zO=de(require("path"));var iF=class{constructor(e){this.ctx=e;this.logger=new pe("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=zO.extname(__filename)===".ts"?zO.resolve(__dirname,"../../../packages/ripgrep/bin"):zO.resolve(__dirname,"./bin"),c=zO.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 YO.readFile(c),u=(0,LPn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||zO.join((0,FPn.homedir)(),".cache"),f=zO.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await YO.mkdir(f,{recursive:!0});let h=Ji(Ta(c)),m=zO.join(f,h);try{await YO.stat(m)}catch{await YO.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await YO.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 UPn=require("child_process"),CWt=require("perf_hooks");var oF=new pe("ripgrepProcessManager"),sF=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,oF.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){oF.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){oF.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){oF.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){oF.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}oF.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:_J(),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(` -`);oF.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=CWt.performance.now();oF.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,UPn.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=CWt.performance.now()-r;oF.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 _tt(t){return t.some(e=>!sa.isRegisteredScheme(ro(e.uri).scheme))}a(_tt,"hasRipgrepWorkspaceFolder");async function vtt(t,e){try{return{rgPath:await t.ctx.get(iF).resolvePath(),ripgrepManager:t.ctx.get(sF)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(vtt,"resolveRipgrepResources");var QPn=new pe("findFilesTool"),Ctt=class t extends Au{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 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. When to Use: - Find files by name or extension pattern @@ -3597,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 Br([new Pr("Failed to invoke tool file_search since no workspace folders found")],"error");let l,u;if(_tt(c)){if(n.isCancellationRequested)return new Br([new Pr("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await vtt(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{QPn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),sa.isRegisteredScheme(ro(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),QPn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` -`)}`)}catch(E){if(E instanceof hu){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 Pr(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 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} ${h[0]}`:`Found ${h.length} files matching query: ${o} ${h.join(` -`)}`;return new Br([new Pr(g)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Br([new Pr(s)],"error")}}async searchViaContentProvider(e,r,n,o){return(await e.ctx.get(sa).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:gn(n.uri)},t.timeOutInSeconds*1e3)).split(` -`).map(l=>l.trim()).filter(l=>l.length>0).map(l=>`${gn(Ia(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 qPn=new pe("findTextInFilesTool"),btt=class t extends Au{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 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. When to Use: - Exact text or symbol searches (function names, variable names, imports) @@ -3615,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 Br([new Pr("Failed to invoke tool grep_search since no workspace folders found")],"error");let d,f;if(_tt(u)){if(n.isCancellationRequested)return new Br([new Pr("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await vtt(e,"grep_search"))}let h={},m=u.map(async E=>{if(n.isCancellationRequested)throw new Error("Canceled");let _=E.uri.toString();try{qPn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${_}`),sa.isRegisteredScheme(ro(E.uri).scheme)?h[_]=await this.searchViaContentProvider(e,E,o,s,c,l):h[_]=await this.searchViaRipgrep(f,d,E,o,s,c,n),qPn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${_} with results: ${h[_].join(` -`)}`)}catch(v){if(v instanceof hu){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 Pr(_)],"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 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 ${g[0]}`:`Searched text for: ${o}, ${g.length} results ${g.join(` -`)}`;return new Br([new Pr(y)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Br([new Pr(s)],"error")}}async searchViaContentProvider(e,r,n,o,s,c){return(await e.ctx.get(sa).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",gn(n.uri)];return(await e.execute(r,u,l,{cwd:gn(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 Ttt=de(require("path"));var Stt=class extends Au{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=td(o,e.uriSchemeCache);if(!this.isPathWithinWorkspace(l,s,c))return new Br([new Pr("Error: Path is outside of workspace folders")],"error");let u=await HXe(e.ctx,l.toString());return u.length===0?new Br([new Pr("Folder is empty")],"success"):new Br([new Pr(u.map(([d,f])=>`${d}${f&2?"/":""}`).join(` -`))],"success")}prepareInvocation(e,r){let n=td(e.input.path,e.uriSchemeCache);return{progressMessage:`Reading directory ${PA(n)}`}}prepareCompletion(e,r){let n=td(e.input.path,e.uriSchemeCache);return{completionMessage:`Read directory ${PA(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=Zo(e),o=Zo(r);if(!n||!o)return!1;let s=Ttt.relative(o,n);return s===""?!0:!s.startsWith("..")&&!Ttt.isAbsolute(s)}static toListDirParams(e){if(typeof e.path!="string")throw new Error("path must be a string");return{path:e.path}}};p();var Itt=2e3,xtt=class t extends Au{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 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. When to Use: - Reading known files you've already located @@ -3632,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??Itt),Itt),u=Math.max(1,s??1),d=u+l-1,f=td(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 Br([new Pr(`The file \`${o}\` exists, but is empty.`)],"success");if(g.trim().length===0)return new Br([new Pr(`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 qwe=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},wtt=class extends qwe{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},Rtt=class extends qwe{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},Ptt=class extends qwe{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function _is(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(_is,"escapeRegex");function vis(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(vis,"calculateSimilarity");function bWt(t,e,r,n){let o=r.replace(/\r\n/g,` -`).replace(/\n/g,n),s=Cis(t,e,o);if(s.type!=="none")return s;let c=bis(t,e,o,n);if(c.type!=="none")return c;let l=Sis(t,e,o,n);if(l.type!=="none")return l;let u=Tis(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(bWt,"findAndReplaceOne");function Cis(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(Cis,"tryExactMatch");function bis(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(bis,"tryWhitespaceFlexibleMatch");function Sis(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??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,` `).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=_is(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(Sis,"tryFuzzyMatch");function Tis(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(Tis,"trySimilarityMatch");var jPn=new pe("replaceStringTool"),ktt=class extends Au{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{jPn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=td(o,e.uriSchemeCache);if(s===c)throw new Ptt("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=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 `)?`\r `:` -`,f=bWt(u,s,c,d);if(f.type==="none"&&s.endsWith(` +`,f=dWt(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)&&(jPn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=bWt(u,g,c,d))}if(f.type==="none")throw new wtt(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new Rtt(`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 Pr(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(ds).getToolByNameAndProvider("insert_edit_into_file",ep);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(ds).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 Pr(n)],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running replace_string_in_file tool"};let o=td(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${PA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Ld),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=td(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${PA(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 Ntt=de(fk());var sp=new pe("validateCvesTool"),Dtt=class t extends Au{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(uHt,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return sp.debug(e.ctx,"CVE validation cancelled at start"),new Br([new Pr("CVE validation cancelled")],"cancelled");let{dependencies:o,ecosystem:s}=r.input;try{if(!o?.length)return sp.debug(e.ctx,"No dependencies provided to validate"),new Br([new Pr("validate_cves: No dependencies to validate. Please provide a list of dependencies to check for CVEs.")],"success");if(sp.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return sp.debug(e.ctx,"CVE validation cancelled before GitHub API calls"),new Br([new Pr("CVE validation cancelled")],"cancelled");let c=await this.batchGetCVEs(e,o,s,n),l=this.formatCVEResults(c);if(sp.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");sp.debug(e.ctx,`CVE summary: ${u}`)}return new Br([new Pr(l)],"success")}catch(c){if(Dk(c))return sp.debug(e.ctx,"CVE validation cancelled"),new Br([new Pr("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return sp.exception(e.ctx,c,".invoke"),new Br([new Pr(`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){sp.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 sp.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw sp.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){sp.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),sp.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=Ntt.coerce(m);if(!g){f.push(h.id),sp.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}sp.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||Ntt.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return sp.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}): ${sWt(f.summary)} +`,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)} `;return h+=` - **Severity**: **${f.severity.toUpperCase()}** -`,h+=` - **Details**: ${sWt(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 Iis(t){return[new Stt,new xtt,new Ett,new ktt,new ett,new ttt,new Ctt,new btt,new Dtt]}a(Iis,"getAllClsTools");function HPn(t,e){Iis(t).forEach(e.registerTool.bind(e)),t.get(Pn).onDidSetCapabilities(r=>{t.get(Fl).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new pde):r.subAgent?e.registerTool(new pde):e.unregisterTool(new pde),r.manageTodoListTool?e.registerTool(new UO(t)):e.unregisterTool(new UO(t)),r.watchedFiles?e.registerTool(new Nwe):e.unregisterTool(new Nwe)})}a(HPn,"registerAllClsTools");var ds=class{constructor(e){this.ctx=e;this._toolRegistry=new yKe;HPn(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 Nc;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 Nc;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=>xwn.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(og.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(og.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(og.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(og.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get(ep.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get(ep.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(og.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(og.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get(ep.id)?.find(m=>m.name==="create_file");if(c){let m=e.get(ep.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(og.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(og.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(ep.id)??[],f=e.get(og.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==og.id&&m!==ep.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(Yp);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(!Exe(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===og.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===ep.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===og.id||o.toolProvider.id===ep.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===og.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===ep.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(Exe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===ep.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===og.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===og.id&&c.name==="replace_string_in_file");function s(c){return!c||c.status==="disabled"}return a(s,"isToolDisabled"),{type:"memory",tool:e,status:"disabled",shouldUpdate:a(()=>s(n)&&s(o),"shouldUpdate")}}};p();var Yq=class extends aq{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:ep,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(k_).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 Nc;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(Ld).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var k={};Ri(k,{$brand:()=>SWt,$input:()=>_Kt,$output:()=>EKt,NEVER:()=>Hwe,TimePrecision:()=>bKt,ZodAny:()=>vkn,ZodArray:()=>Tkn,ZodBase64:()=>NJt,ZodBase64URL:()=>MJt,ZodBigInt:()=>RRe,ZodBigIntFormat:()=>LJt,ZodBoolean:()=>wRe,ZodCIDRv4:()=>kJt,ZodCIDRv6:()=>DJt,ZodCUID:()=>SJt,ZodCUID2:()=>TJt,ZodCatch:()=>Qkn,ZodCustom:()=>wrt,ZodCustomStringFormat:()=>Akn,ZodDate:()=>Trt,ZodDefault:()=>Mkn,ZodDiscriminatedUnion:()=>Ikn,ZodE164:()=>OJt,ZodEmail:()=>EJt,ZodEmoji:()=>CJt,ZodEnum:()=>TRe,ZodError:()=>dss,ZodFile:()=>Dkn,ZodGUID:()=>_rt,ZodIPv4:()=>RJt,ZodIPv6:()=>PJt,ZodISODate:()=>Art,ZodISODateTime:()=>grt,ZodISODuration:()=>Ert,ZodISOTime:()=>yrt,ZodIntersection:()=>xkn,ZodIssueCode:()=>WJt,ZodJWT:()=>BJt,ZodKSUID:()=>wJt,ZodLazy:()=>Vkn,ZodLiteral:()=>kkn,ZodMap:()=>Rkn,ZodNaN:()=>jkn,ZodNanoID:()=>bJt,ZodNever:()=>bkn,ZodNonOptional:()=>GJt,ZodNull:()=>_kn,ZodNullable:()=>Nkn,ZodNumber:()=>xRe,ZodNumberFormat:()=>Nde,ZodObject:()=>Irt,ZodOptional:()=>HJt,ZodPipe:()=>$Jt,ZodPrefault:()=>Bkn,ZodPromise:()=>zkn,ZodReadonly:()=>Hkn,ZodRealError:()=>Dde,ZodRecord:()=>QJt,ZodSet:()=>Pkn,ZodString:()=>IRe,ZodStringFormat:()=>yu,ZodSuccess:()=>Ukn,ZodSymbol:()=>ykn,ZodTemplateLiteral:()=>$kn,ZodTransform:()=>qJt,ZodTuple:()=>wkn,ZodType:()=>xs,ZodULID:()=>IJt,ZodURL:()=>_Jt,ZodUUID:()=>fF,ZodUndefined:()=>Ekn,ZodUnion:()=>UJt,ZodUnknown:()=>Ckn,ZodVoid:()=>Skn,ZodXID:()=>xJt,_ZodString:()=>yJt,_default:()=>Okn,any:()=>FJt,array:()=>Fr,base64:()=>Pss,base64url:()=>kss,bigint:()=>Uss,boolean:()=>tl,catch:()=>qkn,check:()=>Ykn,cidrv4:()=>wss,cidrv6:()=>Rss,clone:()=>JS,coerce:()=>kRe,config:()=>tm,core:()=>dF,cuid:()=>vss,cuid2:()=>Css,custom:()=>VJt,date:()=>$ss,discriminatedUnion:()=>xrt,e164:()=>Dss,email:()=>pss,emoji:()=>Ess,endsWith:()=>ARe,enum:()=>z_,file:()=>Xss,flattenError:()=>Zwe,float32:()=>Oss,float64:()=>Bss,formatError:()=>Xwe,function:()=>aJt,getErrorMap:()=>las,globalRegistry:()=>JO,gt:()=>lF,gte:()=>YC,guid:()=>hss,includes:()=>mRe,instanceof:()=>oas,int:()=>AJt,int32:()=>Lss,int64:()=>Qss,intersection:()=>PRe,ipv4:()=>Iss,ipv6:()=>xss,iso:()=>kde,json:()=>aas,jwt:()=>Nss,keyof:()=>Vss,ksuid:()=>Tss,lazy:()=>Wkn,length:()=>Pde,literal:()=>Gn,locales:()=>lRe,looseObject:()=>rm,lowercase:()=>pRe,lt:()=>cF,lte:()=>gw,map:()=>Kss,maxLength:()=>Rde,maxSize:()=>wde,mime:()=>yRe,minLength:()=>Jq,minSize:()=>RJ,multipleOf:()=>wJ,nan:()=>ras,nanoid:()=>_ss,nativeEnum:()=>Zss,negative:()=>JKt,never:()=>Srt,nonnegative:()=>XKt,nonoptional:()=>Fkn,nonpositive:()=>ZKt,normalize:()=>ERe,null:()=>brt,nullable:()=>vrt,nullish:()=>eas,number:()=>wa,object:()=>zr,optional:()=>Eu,overwrite:()=>uF,parse:()=>pJt,parseAsync:()=>hJt,partialRecord:()=>Yss,pipe:()=>Crt,positive:()=>KKt,prefault:()=>Lkn,preprocess:()=>Rrt,prettifyError:()=>LWt,promise:()=>ias,property:()=>eJt,readonly:()=>Gkn,record:()=>vl,refine:()=>Kkn,regex:()=>fRe,regexes:()=>TJ,registry:()=>Wtt,safeParse:()=>mJt,safeParseAsync:()=>gJt,set:()=>Jss,setErrorMap:()=>cas,size:()=>dRe,startsWith:()=>gRe,strictObject:()=>Wss,string:()=>Je,stringFormat:()=>Mss,stringbool:()=>sas,success:()=>tas,superRefine:()=>Jkn,symbol:()=>jss,templateLiteral:()=>nas,toJSONSchema:()=>cJt,toLowerCase:()=>vRe,toUpperCase:()=>CRe,transform:()=>jJt,treeifyError:()=>BWt,trim:()=>_Re,tuple:()=>zss,uint32:()=>Fss,uint64:()=>qss,ulid:()=>bss,undefined:()=>Hss,union:()=>_l,unknown:()=>rd,uppercase:()=>hRe,url:()=>vJt,uuid:()=>mss,uuidv4:()=>gss,uuidv6:()=>Ass,uuidv7:()=>yss,void:()=>Gss,xid:()=>Sss});p();var dF={};Ri(dF,{$ZodAny:()=>lYt,$ZodArray:()=>oRe,$ZodAsyncError:()=>KO,$ZodBase64:()=>Xzt,$ZodBase64URL:()=>eYt,$ZodBigInt:()=>$tt,$ZodBigIntFormat:()=>oYt,$ZodBoolean:()=>iRe,$ZodCIDRv4:()=>Kzt,$ZodCIDRv6:()=>Jzt,$ZodCUID:()=>Uzt,$ZodCUID2:()=>Qzt,$ZodCatch:()=>wYt,$ZodCheck:()=>vf,$ZodCheckBigIntFormat:()=>mzt,$ZodCheckEndsWith:()=>xzt,$ZodCheckGreaterThan:()=>qtt,$ZodCheckIncludes:()=>Tzt,$ZodCheckLengthEquals:()=>vzt,$ZodCheckLessThan:()=>Qtt,$ZodCheckLowerCase:()=>bzt,$ZodCheckMaxLength:()=>Ezt,$ZodCheckMaxSize:()=>gzt,$ZodCheckMimeType:()=>Rzt,$ZodCheckMinLength:()=>_zt,$ZodCheckMinSize:()=>Azt,$ZodCheckMultipleOf:()=>pzt,$ZodCheckNumberFormat:()=>hzt,$ZodCheckOverwrite:()=>Pzt,$ZodCheckProperty:()=>wzt,$ZodCheckRegex:()=>Czt,$ZodCheckSizeEquals:()=>yzt,$ZodCheckStartsWith:()=>Izt,$ZodCheckStringFormat:()=>Sde,$ZodCheckUpperCase:()=>Szt,$ZodCustom:()=>MYt,$ZodCustomStringFormat:()=>nYt,$ZodDate:()=>fYt,$ZodDefault:()=>SYt,$ZodDiscriminatedUnion:()=>hYt,$ZodE164:()=>tYt,$ZodEmail:()=>Ozt,$ZodEmoji:()=>Lzt,$ZodEnum:()=>EYt,$ZodError:()=>Jwe,$ZodFile:()=>vYt,$ZodFunction:()=>mrt,$ZodGUID:()=>Nzt,$ZodIPv4:()=>zzt,$ZodIPv6:()=>Yzt,$ZodISODate:()=>$zt,$ZodISODateTime:()=>Gzt,$ZodISODuration:()=>Wzt,$ZodISOTime:()=>Vzt,$ZodIntersection:()=>mYt,$ZodJWT:()=>rYt,$ZodKSUID:()=>Hzt,$ZodLazy:()=>NYt,$ZodLiteral:()=>_Yt,$ZodMap:()=>AYt,$ZodNaN:()=>RYt,$ZodNanoID:()=>Fzt,$ZodNever:()=>uYt,$ZodNonOptional:()=>IYt,$ZodNull:()=>cYt,$ZodNullable:()=>bYt,$ZodNumber:()=>Gtt,$ZodNumberFormat:()=>iYt,$ZodObject:()=>pYt,$ZodOptional:()=>CYt,$ZodPipe:()=>aRe,$ZodPrefault:()=>TYt,$ZodPromise:()=>DYt,$ZodReadonly:()=>PYt,$ZodRealError:()=>Cde,$ZodRecord:()=>gYt,$ZodRegistry:()=>Ide,$ZodSet:()=>yYt,$ZodString:()=>IJ,$ZodStringFormat:()=>Ql,$ZodSuccess:()=>xYt,$ZodSymbol:()=>sYt,$ZodTemplateLiteral:()=>kYt,$ZodTransform:()=>sRe,$ZodTuple:()=>xJ,$ZodType:()=>fo,$ZodULID:()=>qzt,$ZodURL:()=>Bzt,$ZodUUID:()=>Mzt,$ZodUndefined:()=>aYt,$ZodUnion:()=>Vtt,$ZodUnknown:()=>Tde,$ZodVoid:()=>dYt,$ZodXID:()=>jzt,$brand:()=>SWt,$constructor:()=>ut,$input:()=>_Kt,$output:()=>EKt,Doc:()=>nRe,JSONSchema:()=>hkn,JSONSchemaGenerator:()=>SRe,NEVER:()=>Hwe,TimePrecision:()=>bKt,_any:()=>GKt,_array:()=>bRe,_base64:()=>drt,_base64url:()=>frt,_bigint:()=>LKt,_boolean:()=>OKt,_catch:()=>iss,_cidrv4:()=>lrt,_cidrv6:()=>urt,_coercedBigint:()=>FKt,_coercedBoolean:()=>BKt,_coercedDate:()=>zKt,_coercedNumber:()=>RKt,_coercedString:()=>CKt,_cuid:()=>rrt,_cuid2:()=>nrt,_custom:()=>nJt,_date:()=>WKt,_default:()=>tss,_discriminatedUnion:()=>Gos,_e164:()=>prt,_email:()=>ztt,_emoji:()=>ert,_endsWith:()=>ARe,_enum:()=>Yos,_file:()=>rJt,_float32:()=>kKt,_float64:()=>DKt,_gt:()=>lF,_gte:()=>YC,_guid:()=>uRe,_includes:()=>mRe,_int:()=>PKt,_int32:()=>NKt,_int64:()=>UKt,_intersection:()=>$os,_ipv4:()=>art,_ipv6:()=>crt,_isoDate:()=>TKt,_isoDateTime:()=>SKt,_isoDuration:()=>xKt,_isoTime:()=>IKt,_jwt:()=>hrt,_ksuid:()=>srt,_lazy:()=>css,_length:()=>Pde,_literal:()=>Jos,_lowercase:()=>pRe,_lt:()=>cF,_lte:()=>gw,_map:()=>Wos,_max:()=>gw,_maxLength:()=>Rde,_maxSize:()=>wde,_mime:()=>yRe,_min:()=>YC,_minLength:()=>Jq,_minSize:()=>RJ,_multipleOf:()=>wJ,_nan:()=>YKt,_nanoid:()=>trt,_nativeEnum:()=>Kos,_negative:()=>JKt,_never:()=>$Kt,_nonnegative:()=>XKt,_nonoptional:()=>rss,_nonpositive:()=>ZKt,_normalize:()=>ERe,_null:()=>HKt,_nullable:()=>ess,_number:()=>wKt,_optional:()=>Xos,_overwrite:()=>uF,_parse:()=>Ott,_parseAsync:()=>Btt,_pipe:()=>oss,_positive:()=>KKt,_promise:()=>lss,_property:()=>eJt,_readonly:()=>sss,_record:()=>Vos,_refine:()=>iJt,_regex:()=>fRe,_safeParse:()=>Ltt,_safeParseAsync:()=>Ftt,_set:()=>zos,_size:()=>dRe,_startsWith:()=>gRe,_string:()=>vKt,_stringFormat:()=>sJt,_stringbool:()=>oJt,_success:()=>nss,_symbol:()=>qKt,_templateLiteral:()=>ass,_toLowerCase:()=>vRe,_toUpperCase:()=>CRe,_transform:()=>Zos,_trim:()=>_Re,_tuple:()=>tJt,_uint32:()=>MKt,_uint64:()=>QKt,_ulid:()=>irt,_undefined:()=>jKt,_union:()=>Hos,_unknown:()=>xde,_uppercase:()=>hRe,_url:()=>Xtt,_uuid:()=>Ytt,_uuidv4:()=>Ktt,_uuidv6:()=>Jtt,_uuidv7:()=>Ztt,_void:()=>VKt,_xid:()=>ort,clone:()=>JS,config:()=>tm,flattenError:()=>Zwe,formatError:()=>Xwe,function:()=>aJt,globalConfig:()=>jwe,globalRegistry:()=>JO,isValidBase64:()=>Zzt,isValidBase64URL:()=>lkn,isValidJWT:()=>ukn,locales:()=>lRe,parse:()=>eRe,parseAsync:()=>tRe,prettifyError:()=>LWt,regexes:()=>TJ,registry:()=>Wtt,safeParse:()=>bde,safeParseAsync:()=>rRe,toDotPath:()=>$Pn,toJSONSchema:()=>cJt,treeifyError:()=>BWt,util:()=>qr,version:()=>kzt});p();p();var Hwe=Object.freeze({status:"aborted"});function ut(t,e,r){function n(l,u){var d;Object.defineProperty(l,"_zod",{value:l._zod??{},enumerable:!1}),(d=l._zod).traits??(d.traits=new Set),l._zod.traits.add(t),e(l,u);for(let f in c.prototype)f in l||Object.defineProperty(l,f,{value:c.prototype[f].bind(l)});l._zod.constr=c,l._zod.def=u}a(n,"init");let o=r?.Parent??Object;class s extends o{static{a(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(l){var u;let d=r?.Parent?new s:this;n(d,l),(u=d._zod).deferred??(u.deferred=[]);for(let f of d._zod.deferred)f();return d}return a(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:a(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}a(ut,"$constructor");var SWt=Symbol("zod_brand"),KO=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},jwe={};function tm(t){return t&&Object.assign(jwe,t),jwe}a(tm,"config");p();p();var qr={};Ri(qr,{BIGINT_FORMAT_RANGES:()=>MWt,Class:()=>IWt,NUMBER_FORMAT_RANGES:()=>NWt,aborted:()=>bJ,allowsEval:()=>PWt,assert:()=>kis,assertEqual:()=>xis,assertIs:()=>Ris,assertNever:()=>Pis,assertNotEqual:()=>wis,assignProp:()=>RWt,cached:()=>Vwe,captureStackTrace:()=>Mtt,cleanEnum:()=>Gis,cleanRegex:()=>Wwe,clone:()=>JS,createTransparentProxy:()=>Lis,defineLazy:()=>Tc,esc:()=>CJ,escapeRegex:()=>aF,extend:()=>Qis,finalizeIssue:()=>ZS,floatSafeRemainder:()=>wWt,getElementAtPath:()=>Dis,getEnumValues:()=>$we,getLengthableOrigin:()=>Kwe,getParsedType:()=>Bis,getSizableOrigin:()=>Ywe,isObject:()=>_de,isPlainObject:()=>vde,issue:()=>OWt,joinValues:()=>qt,jsonStringifyReplacer:()=>xWt,merge:()=>qis,normalizeParams:()=>Tr,nullish:()=>Kq,numKeys:()=>Ois,omit:()=>Uis,optionalKeys:()=>DWt,partial:()=>jis,pick:()=>Fis,prefixIssues:()=>zC,primitiveTypes:()=>kWt,promiseAllObject:()=>Nis,propertyKeyTypes:()=>zwe,randomString:()=>Mis,required:()=>His,stringifyPrimitive:()=>Qr,unwrapMessage:()=>Gwe});p();function xis(t){return t}a(xis,"assertEqual");function wis(t){return t}a(wis,"assertNotEqual");function Ris(t){}a(Ris,"assertIs");function Pis(t){throw new Error}a(Pis,"assertNever");function kis(t){}a(kis,"assert");function $we(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($we,"getEnumValues");function qt(t,e="|"){return t.map(r=>Qr(r)).join(e)}a(qt,"joinValues");function xWt(t,e){return typeof e=="bigint"?e.toString():e}a(xWt,"jsonStringifyReplacer");function Vwe(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Vwe,"cached");function Kq(t){return t==null}a(Kq,"nullish");function Wwe(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(Wwe,"cleanRegex");function wWt(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(wWt,"floatSafeRemainder");function Tc(t,e,r){Object.defineProperty(t,e,{get(){{let o=r();return t[e]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}a(Tc,"defineLazy");function RWt(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(RWt,"assignProp");function Dis(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}a(Dis,"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 _de(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(_de,"isObject");var PWt=Vwe(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function vde(t){if(_de(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(_de(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(vde,"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 Bis=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"),zwe=new Set(["string","number","symbol"]),kWt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function aF(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(aF,"escapeRegex");function JS(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(JS,"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 Lis(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(Lis,"createTransparentProxy");function Qr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Qr,"stringifyPrimitive");function DWt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(DWt,"optionalKeys");var NWt={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]},MWt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Fis(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 JS(t,{...t._zod.def,shape:r,checks:[]})}a(Fis,"pick");function Uis(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 JS(t,{...t._zod.def,shape:r,checks:[]})}a(Uis,"omit");function Qis(t,e){if(!vde(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 RWt(this,"shape",n),n},checks:[]};return JS(t,r)}a(Qis,"extend");function qis(t,e){return JS(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return RWt(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}a(qis,"merge");function jis(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 JS(e,{...e._zod.def,shape:o,checks:[]})}a(jis,"partial");function His(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 JS(e,{...e._zod.def,shape:o,checks:[]})}a(His,"required");function bJ(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(zC,"prefixIssues");function Gwe(t){return typeof t=="string"?t:t?.message}a(Gwe,"unwrapMessage");function ZS(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=Gwe(t.inst?._zod.def?.error?.(t))??Gwe(e?.error?.(t))??Gwe(r.customError?.(t))??Gwe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}a(ZS,"finalizeIssue");function Ywe(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(Ywe,"getSizableOrigin");function Kwe(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(Kwe,"getLengthableOrigin");function OWt(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(OWt,"issue");function Gis(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(Gis,"cleanEnum");var IWt=class{static{a(this,"Class")}constructor(...e){}};var GPn=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,xWt,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),Jwe=ut("$ZodError",GPn),Cde=ut("$ZodError",GPn,{Parent:Error});function Zwe(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(Zwe,"flattenError");function Xwe(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 ${$Pn(n.path)}`);return e.join(` -`)}a(LWt,"prettifyError");var Ott=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 KO;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>ZS(u,s,tm())));throw Mtt(l,o?.callee),l}return c.value},"_parse"),eRe=Ott(Cde),Btt=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=>ZS(u,s,tm())));throw Mtt(l,o?.callee),l}return c.value},"_parseAsync"),tRe=Btt(Cde),Ltt=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 KO;return s.issues.length?{success:!1,error:new(t??Jwe)(s.issues.map(c=>ZS(c,o,tm())))}:{success:!0,data:s.value}},"_safeParse"),bde=Ltt(Cde),Ftt=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=>ZS(c,o,tm())))}:{success:!0,data:s.value}},"_safeParseAsync"),rRe=Ftt(Cde);p();p();var TJ={};Ri(TJ,{_emoji:()=>VPn,base64:()=>ZWt,base64url:()=>Utt,bigint:()=>ozt,boolean:()=>czt,browserEmail:()=>Xis,cidrv4:()=>KWt,cidrv6:()=>JWt,cuid:()=>FWt,cuid2:()=>UWt,date:()=>tzt,datetime:()=>nzt,domain:()=>eos,duration:()=>GWt,e164:()=>ezt,email:()=>VWt,emoji:()=>WWt,extendedDuration:()=>Vis,guid:()=>$Wt,hostname:()=>XWt,html5Email:()=>Kis,integer:()=>szt,ipv4:()=>zWt,ipv6:()=>YWt,ksuid:()=>jWt,lowercase:()=>dzt,nanoid:()=>HWt,null:()=>lzt,number:()=>azt,rfc5322Email:()=>Jis,string:()=>izt,time:()=>rzt,ulid:()=>QWt,undefined:()=>uzt,unicodeEmail:()=>Zis,uppercase:()=>fzt,uuid:()=>SJ,uuid4:()=>Wis,uuid6:()=>zis,uuid7:()=>Yis,xid:()=>qWt});p();var FWt=/^[cC][^\s-]{8,}$/,UWt=/^[0-9a-z]+$/,QWt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qWt=/^[0-9a-vA-V]{20}$/,jWt=/^[A-Za-z0-9]{27}$/,HWt=/^[a-zA-Z0-9_-]{21}$/,GWt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Vis=/^[-+]?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)?)??$/,$Wt=/^([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})$/,SJ=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"),Wis=SJ(4),zis=SJ(6),Yis=SJ(7),VWt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kis=/^[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])?)*$/,Jis=/^(([^<>()\[\]\\.,;:\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,}))$/,Zis=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Xis=/^[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])?)*$/,VPn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function WWt(){return new RegExp(VPn,"u")}a(WWt,"emoji");var zWt=/^(?:(?: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])$/,YWt=/^(([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})$/,KWt=/^((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])$/,JWt=/^(([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])$/,ZWt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Utt=/^[A-Za-z0-9_-]*$/,XWt=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,eos=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ezt=/^\+(?:[0-9]){6,14}[0-9]$/,WPn="(?:(?:\\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])))",tzt=new RegExp(`^${WPn}$`);function zPn(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(zPn,"timeSource");function rzt(t){return new RegExp(`^${zPn(t)}$`)}a(rzt,"time");function nzt(t){let e=zPn({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(`^${WPn}T(?:${n})$`)}a(nzt,"datetime");var izt=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),ozt=/^\d+n?$/,szt=/^\d+$/,azt=/^-?\d+(?:\.\d+)?/i,czt=/true|false/i,lzt=/null/i;var uzt=/undefined/i;var dzt=/^[^A-Z]*$/,fzt=/^[^a-z]*$/;var vf=ut("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),KPn={number:"number",bigint:"bigint",object:"date"},Qtt=ut("$ZodCheckLessThan",(t,e)=>{vf.init(t,e);let r=KPn[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{vf.init(t,e);let r=KPn[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})}}),pzt=ut("$ZodCheckMultipleOf",(t,e)=>{vf.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):wWt(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})}}),hzt=ut("$ZodCheckNumberFormat",(t,e)=>{vf.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=NWt[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=szt)}),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})}}),mzt=ut("$ZodCheckBigIntFormat",(t,e)=>{vf.init(t,e);let[r,n]=MWt[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})}}),gzt=ut("$ZodCheckMaxSize",(t,e)=>{var r;vf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Kq(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:Ywe(o),code:"too_big",maximum:e.maximum,input:o,inst:t,continue:!e.abort})}}),Azt=ut("$ZodCheckMinSize",(t,e)=>{var r;vf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Kq(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:Ywe(o),code:"too_small",minimum:e.minimum,input:o,inst:t,continue:!e.abort})}}),yzt=ut("$ZodCheckSizeEquals",(t,e)=>{var r;vf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Kq(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:Ywe(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})}}),Ezt=ut("$ZodCheckMaxLength",(t,e)=>{var r;vf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Kq(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=Kwe(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),_zt=ut("$ZodCheckMinLength",(t,e)=>{var r;vf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Kq(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=Kwe(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),vzt=ut("$ZodCheckLengthEquals",(t,e)=>{var r;vf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Kq(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=Kwe(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})}}),Sde=ut("$ZodCheckStringFormat",(t,e)=>{var r,n;vf.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=()=>{})}),Czt=ut("$ZodCheckRegex",(t,e)=>{Sde.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})}}),bzt=ut("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=dzt),Sde.init(t,e)}),Szt=ut("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=fzt),Sde.init(t,e)}),Tzt=ut("$ZodCheckIncludes",(t,e)=>{vf.init(t,e);let r=aF(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})}}),Izt=ut("$ZodCheckStartsWith",(t,e)=>{vf.init(t,e);let r=new RegExp(`^${aF(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})}}),xzt=ut("$ZodCheckEndsWith",(t,e)=>{vf.init(t,e);let r=new RegExp(`.*${aF(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 YPn(t,e,r){t.issues.length&&e.issues.push(...zC(r,t.issues))}a(YPn,"handleCheckPropertyResult");var wzt=ut("$ZodCheckProperty",(t,e)=>{vf.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=>YPn(o,r,e.property));YPn(n,r,e.property)}}),Rzt=ut("$ZodCheckMimeType",(t,e)=>{vf.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})}}),Pzt=ut("$ZodCheckOverwrite",(t,e)=>{vf.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var nRe=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 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(` `).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 kzt={major:4,minor:0,patch:0};var fo=ut("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=kzt;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=bJ(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 KO;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=bJ(s,h)))});else{if(s.issues.length===h)continue;u||(u=bJ(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 KO;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=bde(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return rRe(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),IJ=ut("$ZodString",(t,e)=>{fo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??izt(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Ql=ut("$ZodStringFormat",(t,e)=>{Sde.init(t,e),IJ.init(t,e)}),Nzt=ut("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=$Wt),Ql.init(t,e)}),Mzt=ut("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=SJ(n))}else e.pattern??(e.pattern=SJ());Ql.init(t,e)}),Ozt=ut("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=VWt),Ql.init(t,e)}),Bzt=ut("$ZodURL",(t,e)=>{Ql.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:XWt.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})}}}),Lzt=ut("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=WWt()),Ql.init(t,e)}),Fzt=ut("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=HWt),Ql.init(t,e)}),Uzt=ut("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=FWt),Ql.init(t,e)}),Qzt=ut("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=UWt),Ql.init(t,e)}),qzt=ut("$ZodULID",(t,e)=>{e.pattern??(e.pattern=QWt),Ql.init(t,e)}),jzt=ut("$ZodXID",(t,e)=>{e.pattern??(e.pattern=qWt),Ql.init(t,e)}),Hzt=ut("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=jWt),Ql.init(t,e)}),Gzt=ut("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=nzt(e)),Ql.init(t,e)}),$zt=ut("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=tzt),Ql.init(t,e)}),Vzt=ut("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=rzt(e)),Ql.init(t,e)}),Wzt=ut("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=GWt),Ql.init(t,e)}),zzt=ut("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=zWt),Ql.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Yzt=ut("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=YWt),Ql.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),Kzt=ut("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=KWt),Ql.init(t,e)}),Jzt=ut("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=JWt),Ql.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Zzt(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(Zzt,"isValidBase64");var Xzt=ut("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=ZWt),Ql.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{Zzt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function lkn(t){if(!Utt.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Zzt(r)}a(lkn,"isValidBase64URL");var eYt=ut("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Utt),Ql.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{lkn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),tYt=ut("$ZodE164",(t,e)=>{e.pattern??(e.pattern=ezt),Ql.init(t,e)});function ukn(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(ukn,"isValidJWT");var rYt=ut("$ZodJWT",(t,e)=>{Ql.init(t,e),t._zod.check=r=>{ukn(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),nYt=ut("$ZodCustomStringFormat",(t,e)=>{Ql.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),Gtt=ut("$ZodNumber",(t,e)=>{fo.init(t,e),t._zod.pattern=t._zod.bag.pattern??azt,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}}),iYt=ut("$ZodNumber",(t,e)=>{hzt.init(t,e),Gtt.init(t,e)}),iRe=ut("$ZodBoolean",(t,e)=>{fo.init(t,e),t._zod.pattern=czt,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}}),$tt=ut("$ZodBigInt",(t,e)=>{fo.init(t,e),t._zod.pattern=ozt,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}}),oYt=ut("$ZodBigInt",(t,e)=>{mzt.init(t,e),$tt.init(t,e)}),sYt=ut("$ZodSymbol",(t,e)=>{fo.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}}),aYt=ut("$ZodUndefined",(t,e)=>{fo.init(t,e),t._zod.pattern=uzt,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}}),cYt=ut("$ZodNull",(t,e)=>{fo.init(t,e),t._zod.pattern=lzt,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}}),lYt=ut("$ZodAny",(t,e)=>{fo.init(t,e),t._zod.parse=r=>r}),Tde=ut("$ZodUnknown",(t,e)=>{fo.init(t,e),t._zod.parse=r=>r}),uYt=ut("$ZodNever",(t,e)=>{fo.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),dYt=ut("$ZodVoid",(t,e)=>{fo.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}}),fYt=ut("$ZodDate",(t,e)=>{fo.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 ZPn(t,e,r){t.issues.length&&e.issues.push(...zC(r,t.issues)),e.value[r]=t.value}a(ZPn,"handleArrayResult");var oRe=ut("$ZodArray",(t,e)=>{fo.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;cZPn(d,r,c))):ZPn(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function jtt(t,e,r){t.issues.length&&e.issues.push(...zC(r,t.issues)),e.value[r]=t.value}a(jtt,"handleObjectResult");function XPn(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(...zC(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}a(XPn,"handleOptionalObjectResult");var pYt=ut("$ZodObject",(t,e)=>{fo.init(t,e);let r=Vwe(()=>{let h=Object.keys(e.shape);for(let g of h)if(!(e.shape[g]instanceof fo))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);let m=DWt(e.shape);return{shape:e.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});Tc(t._zod,"propValues",()=>{let h=e.shape,m={};for(let g in h){let A=h[g]._zod;if(A.values){m[g]??(m[g]=new Set);for(let y of A.values)m[g].add(y)}}return m});let n=a(h=>{let m=new nRe(["shape","payload","ctx"]),g=r.value,A=a(v=>{let b=CJ(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=CJ(v);m.write(` +`))}};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(` if (${b}.issues.length) { if (input[${T}] === undefined) { if (${T} in input) { @@ -3680,157 +3723,162 @@ ${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${sWt(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 ? [${CJ(v)}, ...iss.path] : [${CJ(v)}] - })));`),m.write(`newResult[${CJ(v)}] = ${b}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(v,b)=>_(h,v,b)},"generateFastpass"),o,s=_de,c=!jwe.jitless,u=c&&PWt.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?XPn(P,h,T,g):jtt(P,h,T))):x?XPn(R,h,T,g):jtt(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=>jtt(w,h,b))):jtt(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 ekn(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=>ZS(s,n,tm())))}),e}a(ekn,"handleUnionResults");var Vtt=ut("$ZodUnion",(t,e)=>{fo.init(t,e),Tc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Tc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Tc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),Tc(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>Wwe(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=>ekn(c,r,t,n)):ekn(s,r,t,n)}}),hYt=ut("$ZodDiscriminatedUnion",(t,e)=>{Vtt.init(t,e);let r=t._zod.parse;Tc(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=Vwe(()=>{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(!_de(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)}}),mYt=ut("$ZodIntersection",(t,e)=>{fo.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])=>tkn(r,u,d)):tkn(r,s,c)}});function Dzt(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(vde(t)&&vde(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=Dzt(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{fo.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=>Htt(h,o,u))):Htt(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=>Htt(m,o,u))):Htt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});function Htt(t,e,r){t.issues.length&&e.issues.push(...zC(r,t.issues)),e.value[r]=t.value}a(Htt,"handleTupleResult");var gYt=ut("$ZodRecord",(t,e)=>{fo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!vde(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(...zC(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...zC(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=>ZS(d,n,tm())),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(...zC(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...zC(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),AYt=ut("$ZodMap",(t,e)=>{fo.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])=>{rkn(f,h,r,c,o,t,n)})):rkn(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function rkn(t,e,r,n,o,s,c){t.issues.length&&(zwe.has(typeof n)?r.issues.push(...zC(n,t.issues)):r.issues.push({origin:"map",code:"invalid_key",input:o,inst:s,issues:t.issues.map(l=>ZS(l,c,tm()))})),e.issues.length&&(zwe.has(typeof n)?r.issues.push(...zC(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>ZS(l,c,tm()))})),r.value.set(t.value,e.value)}a(rkn,"handleMapResult");var yYt=ut("$ZodSet",(t,e)=>{fo.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=>nkn(u,r))):nkn(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function nkn(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(nkn,"handleSetResult");var EYt=ut("$ZodEnum",(t,e)=>{fo.init(t,e);let r=$we(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>zwe.has(typeof n)).map(n=>typeof n=="string"?aF(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}}),_Yt=ut("$ZodLiteral",(t,e)=>{fo.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?aF(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}}),vYt=ut("$ZodFile",(t,e)=>{fo.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}}),sRe=ut("$ZodTransform",(t,e)=>{fo.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 KO;return r.value=o,r}}),CYt=ut("$ZodOptional",(t,e)=>{fo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Tc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Tc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Wwe(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)}),bYt=ut("$ZodNullable",(t,e)=>{fo.init(t,e),Tc(t._zod,"optin",()=>e.innerType._zod.optin),Tc(t._zod,"optout",()=>e.innerType._zod.optout),Tc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Wwe(r.source)}|null)$`):void 0}),Tc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),SYt=ut("$ZodDefault",(t,e)=>{fo.init(t,e),t._zod.optin="optional",Tc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>ikn(s,e)):ikn(o,e)}});function ikn(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(ikn,"handleDefaultResult");var TYt=ut("$ZodPrefault",(t,e)=>{fo.init(t,e),t._zod.optin="optional",Tc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),IYt=ut("$ZodNonOptional",(t,e)=>{fo.init(t,e),Tc(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>okn(s,t)):okn(o,t)}});function okn(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(okn,"handleNonOptionalResult");var xYt=ut("$ZodSuccess",(t,e)=>{fo.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)}}),wYt=ut("$ZodCatch",(t,e)=>{fo.init(t,e),t._zod.optin="optional",Tc(t._zod,"optout",()=>e.innerType._zod.optout),Tc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>ZS(c,n,tm()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>ZS(s,n,tm()))},input:r.value}),r.issues=[]),r)}}),RYt=ut("$ZodNaN",(t,e)=>{fo.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)}),aRe=ut("$ZodPipe",(t,e)=>{fo.init(t,e),Tc(t._zod,"values",()=>e.in._zod.values),Tc(t._zod,"optin",()=>e.in._zod.optin),Tc(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>skn(s,e,n)):skn(o,e,n)}});function skn(t,e,r){return bJ(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}a(skn,"handlePipeResult");var PYt=ut("$ZodReadonly",(t,e)=>{fo.init(t,e),Tc(t._zod,"propValues",()=>e.innerType._zod.propValues),Tc(t._zod,"values",()=>e.innerType._zod.values),Tc(t._zod,"optin",()=>e.innerType._zod.optin),Tc(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(akn):akn(o)}});function akn(t){return t.value=Object.freeze(t.value),t}a(akn,"handleReadonlyResult");var kYt=ut("$ZodTemplateLiteral",(t,e)=>{fo.init(t,e);let r=[];for(let n of e.parts)if(n instanceof fo){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||kWt.has(typeof n))r.push(aF(`${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)}),DYt=ut("$ZodPromise",(t,e)=>{fo.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),NYt=ut("$ZodLazy",(t,e)=>{fo.init(t,e),Tc(t._zod,"innerType",()=>e.getter()),Tc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Tc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Tc(t._zod,"optin",()=>t._zod.innerType._zod.optin),Tc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),MYt=ut("$ZodCustom",(t,e)=>{vf.init(t,e),fo.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=>ckn(s,r,n,t));ckn(o,r,n,t)}});function ckn(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(OWt(o))}}a(ckn,"handleRefineResult");var lRe={};Ri(lRe,{ar:()=>OYt,az:()=>BYt,be:()=>LYt,ca:()=>FYt,cs:()=>UYt,de:()=>QYt,en:()=>cRe,eo:()=>qYt,es:()=>jYt,fa:()=>HYt,fi:()=>GYt,fr:()=>$Yt,frCA:()=>VYt,he:()=>WYt,hu:()=>zYt,id:()=>YYt,it:()=>KYt,ja:()=>JYt,kh:()=>ZYt,ko:()=>XYt,mk:()=>eKt,ms:()=>tKt,nl:()=>rKt,no:()=>nKt,ota:()=>iKt,pl:()=>sKt,ps:()=>oKt,pt:()=>aKt,ru:()=>cKt,sl:()=>lKt,sv:()=>uKt,ta:()=>dKt,th:()=>fKt,tr:()=>pKt,ua:()=>hKt,ur:()=>mKt,vi:()=>gKt,zhCN:()=>AKt,zhTW:()=>yKt});p();p();var tos=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return o=>{switch(o.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${Qr(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${n[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${qt(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function OYt(){return{localeError:tos()}}a(OYt,"default");p();var ros=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${Qr(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function BYt(){return{localeError:ros()}}a(BYt,"default");p();function fkn(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(fkn,"getBelarusianPlural");var nos=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0456\u045E";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${Qr(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=fkn(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=fkn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${qt(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function LYt(){return{localeError:nos()}}a(LYt,"default");p();var ios=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${Qr(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${qt(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function FYt(){return{localeError:ios()}}a(FYt,"default");p();var oos=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return o=>{switch(o.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o.expected}, obdr\u017Eeno ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${Qr(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${n[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${qt(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function UYt(){return{localeError:oos()}}a(UYt,"default");p();var sos=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return o=>{switch(o.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${Qr(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${qt(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function QYt(){return{localeError:sos()}}a(QYt,"default");p();var aos=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"),cos=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 ${aos(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qr(n.values[0])}`:`Invalid option: expected one of ${qt(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${qt(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"error");function cRe(){return{localeError:cos()}}a(cRe,"default");p();var los=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"),uos=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 ${los(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Qr(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${qt(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${qt(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},"error");function qYt(){return{localeError:uos()}}a(qYt,"default");p();var dos=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return s},"parsedType"),n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${Qr(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Demasiado peque\xF1o: se esperaba que ${o.origin} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${o.origin} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function jYt(){return{localeError:dos()}}a(jYt,"default");p();var fos=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0622\u0631\u0627\u06CC\u0647";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return o=>{switch(o.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(o.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${Qr(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${qt(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${qt(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function HYt(){return{localeError:fos()}}a(HYt,"default");p();var pos=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return o=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${Qr(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${n[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${qt(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function GYt(){return{localeError:pos()}}a(GYt,"default");p();var hos=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : ${o.expected} attendu, ${r(o.input)} re\xE7u`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${Qr(o.values[0])} attendu`:`Option invalide : une valeur parmi ${qt(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${o.origin??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o.origin??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${o.origin} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${o.origin} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${qt(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function $Yt(){return{localeError:hos()}}a($Yt,"default");p();var mos=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${o.expected}, re\xE7u ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${Qr(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${qt(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function VYt(){return{localeError:mos()}}a(VYt,"default");p();var gos=a(()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return o=>{switch(o.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${o.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${Qr(o.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()} ${c.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${s.prefix}"`:s.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${s.suffix}"`:s.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${s.includes}"`:s.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${s.pattern}`:`${n[s.format]??o.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${o.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${o.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${o.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${qt(o.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function WYt(){return{localeError:gos()}}a(WYt,"default");p();var Aos=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(o))return"t\xF6mb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return o=>{switch(o.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o.expected}, a kapott \xE9rt\xE9k ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${Qr(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function zYt(){return{localeError:Aos()}}a(zYt,"default");p();var yos=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${Qr(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${n[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"error");function YYt(){return{localeError:yos()}}a(YYt,"default");p();var Eos=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input non valido: atteso ${Qr(o.values[0])}`:`Opzione non valida: atteso uno tra ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${qt(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"error");function KYt(){return{localeError:Eos()}}a(KYt,"default");p();var _os=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(o))return"\u914D\u5217";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(o.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${Qr(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${qt(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${qt(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function JYt(){return{localeError:_os()}}a(JYt,"default");p();var vos=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(o))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(o===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return o=>{switch(o.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Qr(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${qt(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function ZYt(){return{localeError:vos()}}a(ZYt,"default");p();var Cos=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return o=>{switch(o.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(o.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${Qr(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${qt(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${qt(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function XYt(){return{localeError:Cos()}}a(XYt,"default");p();var bos=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(o))return"\u043D\u0438\u0437\u0430";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return o=>{switch(o.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${Qr(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${qt(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function eKt(){return{localeError:bos()}}a(eKt,"default");p();var Sos=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${Qr(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${n[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${qt(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"error");function tKt(){return{localeError:Sos()}}a(tKt,"default");p();var Tos=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return o=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${Qr(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} bevat`:`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} bevat`:`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"error");function rKt(){return{localeError:Tos()}}a(rKt,"default");p();var Ios=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${Qr(o.values[0])}`:`Ugyldig valg: forventet en av ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${n[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${qt(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"error");function nKt(){return{localeError:Ios()}}a(nKt,"default");p();var xos=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return o=>{switch(o.code){case"invalid_type":return`F\xE2sit giren: umulan ${o.expected}, al\u0131nan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${Qr(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function iKt(){return{localeError:xos()}}a(iKt,"default");p();var wos=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0627\u0631\u06D0";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return o=>{switch(o.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(o.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${Qr(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${qt(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${qt(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function oKt(){return{localeError:wos()}}a(oKt,"default");p();var Ros=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return o=>{switch(o.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Qr(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function sKt(){return{localeError:Ros()}}a(sKt,"default");p();var Pos=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${Qr(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${n[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"error");function aKt(){return{localeError:Pos()}}a(aKt,"default");p();function pkn(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(pkn,"getRussianPlural");var kos=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Qr(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=pkn(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=pkn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function cKt(){return{localeError:kos()}}a(cKt,"default");p();var Dos=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return o=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${Qr(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${n[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${qt(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"error");function lKt(){return{localeError:Dos()}}a(lKt,"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 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${n[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${qt(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function uKt(){return{localeError:Nos()}}a(uKt,"default");p();var Mos=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(o))return"\u0B85\u0BA3\u0BBF";if(o===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Qr(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${qt(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function dKt(){return{localeError:Mos()}}a(dKt,"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 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${qt(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function fKt(){return{localeError:Oos()}}a(fKt,"default");p();var Bos=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"),Los=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 ${Bos(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Qr(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${qt(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${qt(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function pKt(){return{localeError:Los()}}a(pKt,"default");p();var Fos=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Qr(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function hKt(){return{localeError:Fos()}}a(hKt,"default");p();var Uos=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(o))return"\u0622\u0631\u06D2";if(o===null)return"\u0646\u0644";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return o=>{switch(o.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(o.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${Qr(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${qt(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${qt(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function mKt(){return{localeError:Uos()}}a(mKt,"default");p();var Qos=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(o))return"m\u1EA3ng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return o=>{switch(o.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Qr(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${n[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${qt(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function gKt(){return{localeError:Qos()}}a(gKt,"default");p();var qos=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(o))return"\u6570\u7EC4";if(o===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Qr(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${n[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${qt(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function AKt(){return{localeError:qos()}}a(AKt,"default");p();var jos=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o.expected}\uFF0C\u4F46\u6536\u5230 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${Qr(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${qt(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function yKt(){return{localeError:jos()}}a(yKt,"default");p();var EKt=Symbol("ZodOutput"),_Kt=Symbol("ZodInput"),Ide=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 Wtt(){return new Ide}a(Wtt,"registry");var JO=Wtt();p();p();function vKt(t,e){return new t({type:"string",...Tr(e)})}a(vKt,"_string");function CKt(t,e){return new t({type:"string",coerce:!0,...Tr(e)})}a(CKt,"_coercedString");function ztt(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Tr(e)})}a(ztt,"_email");function uRe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Tr(e)})}a(uRe,"_guid");function Ytt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Tr(e)})}a(Ytt,"_uuid");function Ktt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tr(e)})}a(Ktt,"_uuidv4");function Jtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tr(e)})}a(Jtt,"_uuidv6");function Ztt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tr(e)})}a(Ztt,"_uuidv7");function Xtt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Tr(e)})}a(Xtt,"_url");function ert(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Tr(e)})}a(ert,"_emoji");function trt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tr(e)})}a(trt,"_nanoid");function rrt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Tr(e)})}a(rrt,"_cuid");function nrt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tr(e)})}a(nrt,"_cuid2");function irt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Tr(e)})}a(irt,"_ulid");function ort(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Tr(e)})}a(ort,"_xid");function srt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tr(e)})}a(srt,"_ksuid");function art(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tr(e)})}a(art,"_ipv4");function crt(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tr(e)})}a(crt,"_ipv6");function lrt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tr(e)})}a(lrt,"_cidrv4");function urt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tr(e)})}a(urt,"_cidrv6");function drt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Tr(e)})}a(drt,"_base64");function frt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Tr(e)})}a(frt,"_base64url");function prt(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Tr(e)})}a(prt,"_e164");function hrt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Tr(e)})}a(hrt,"_jwt");var bKt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function SKt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tr(e)})}a(SKt,"_isoDateTime");function TKt(t,e){return new t({type:"string",format:"date",check:"string_format",...Tr(e)})}a(TKt,"_isoDate");function IKt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Tr(e)})}a(IKt,"_isoTime");function xKt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Tr(e)})}a(xKt,"_isoDuration");function wKt(t,e){return new t({type:"number",checks:[],...Tr(e)})}a(wKt,"_number");function RKt(t,e){return new t({type:"number",coerce:!0,checks:[],...Tr(e)})}a(RKt,"_coercedNumber");function PKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Tr(e)})}a(PKt,"_int");function kKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Tr(e)})}a(kKt,"_float32");function DKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Tr(e)})}a(DKt,"_float64");function NKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Tr(e)})}a(NKt,"_int32");function MKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Tr(e)})}a(MKt,"_uint32");function OKt(t,e){return new t({type:"boolean",...Tr(e)})}a(OKt,"_boolean");function BKt(t,e){return new t({type:"boolean",coerce:!0,...Tr(e)})}a(BKt,"_coercedBoolean");function LKt(t,e){return new t({type:"bigint",...Tr(e)})}a(LKt,"_bigint");function FKt(t,e){return new t({type:"bigint",coerce:!0,...Tr(e)})}a(FKt,"_coercedBigint");function UKt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Tr(e)})}a(UKt,"_int64");function QKt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Tr(e)})}a(QKt,"_uint64");function qKt(t,e){return new t({type:"symbol",...Tr(e)})}a(qKt,"_symbol");function jKt(t,e){return new t({type:"undefined",...Tr(e)})}a(jKt,"_undefined");function HKt(t,e){return new t({type:"null",...Tr(e)})}a(HKt,"_null");function GKt(t){return new t({type:"any"})}a(GKt,"_any");function xde(t){return new t({type:"unknown"})}a(xde,"_unknown");function $Kt(t,e){return new t({type:"never",...Tr(e)})}a($Kt,"_never");function VKt(t,e){return new t({type:"void",...Tr(e)})}a(VKt,"_void");function WKt(t,e){return new t({type:"date",...Tr(e)})}a(WKt,"_date");function zKt(t,e){return new t({type:"date",coerce:!0,...Tr(e)})}a(zKt,"_coercedDate");function YKt(t,e){return new t({type:"nan",...Tr(e)})}a(YKt,"_nan");function cF(t,e){return new Qtt({check:"less_than",...Tr(e),value:t,inclusive:!1})}a(cF,"_lt");function gw(t,e){return new Qtt({check:"less_than",...Tr(e),value:t,inclusive:!0})}a(gw,"_lte");function lF(t,e){return new qtt({check:"greater_than",...Tr(e),value:t,inclusive:!1})}a(lF,"_gt");function YC(t,e){return new qtt({check:"greater_than",...Tr(e),value:t,inclusive:!0})}a(YC,"_gte");function KKt(t){return lF(0,t)}a(KKt,"_positive");function JKt(t){return cF(0,t)}a(JKt,"_negative");function ZKt(t){return gw(0,t)}a(ZKt,"_nonpositive");function XKt(t){return YC(0,t)}a(XKt,"_nonnegative");function wJ(t,e){return new pzt({check:"multiple_of",...Tr(e),value:t})}a(wJ,"_multipleOf");function wde(t,e){return new gzt({check:"max_size",...Tr(e),maximum:t})}a(wde,"_maxSize");function RJ(t,e){return new Azt({check:"min_size",...Tr(e),minimum:t})}a(RJ,"_minSize");function dRe(t,e){return new yzt({check:"size_equals",...Tr(e),size:t})}a(dRe,"_size");function Rde(t,e){return new Ezt({check:"max_length",...Tr(e),maximum:t})}a(Rde,"_maxLength");function Jq(t,e){return new _zt({check:"min_length",...Tr(e),minimum:t})}a(Jq,"_minLength");function Pde(t,e){return new vzt({check:"length_equals",...Tr(e),length:t})}a(Pde,"_length");function fRe(t,e){return new Czt({check:"string_format",format:"regex",...Tr(e),pattern:t})}a(fRe,"_regex");function pRe(t){return new bzt({check:"string_format",format:"lowercase",...Tr(t)})}a(pRe,"_lowercase");function hRe(t){return new Szt({check:"string_format",format:"uppercase",...Tr(t)})}a(hRe,"_uppercase");function mRe(t,e){return new Tzt({check:"string_format",format:"includes",...Tr(e),includes:t})}a(mRe,"_includes");function gRe(t,e){return new Izt({check:"string_format",format:"starts_with",...Tr(e),prefix:t})}a(gRe,"_startsWith");function ARe(t,e){return new xzt({check:"string_format",format:"ends_with",...Tr(e),suffix:t})}a(ARe,"_endsWith");function eJt(t,e,r){return new wzt({check:"property",property:t,schema:e,...Tr(r)})}a(eJt,"_property");function yRe(t,e){return new Rzt({check:"mime_type",mime:t,...Tr(e)})}a(yRe,"_mime");function uF(t){return new Pzt({check:"overwrite",tx:t})}a(uF,"_overwrite");function ERe(t){return uF(e=>e.normalize(t))}a(ERe,"_normalize");function _Re(){return uF(t=>t.trim())}a(_Re,"_trim");function vRe(){return uF(t=>t.toLowerCase())}a(vRe,"_toLowerCase");function CRe(){return uF(t=>t.toUpperCase())}a(CRe,"_toUpperCase");function bRe(t,e,r){return new t({type:"array",element:e,...Tr(r)})}a(bRe,"_array");function Hos(t,e,r){return new t({type:"union",options:e,...Tr(r)})}a(Hos,"_union");function Gos(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Tr(n)})}a(Gos,"_discriminatedUnion");function $os(t,e,r){return new t({type:"intersection",left:e,right:r})}a($os,"_intersection");function tJt(t,e,r,n){let o=r instanceof fo,s=o?n:r,c=o?r:null;return new t({type:"tuple",items:e,rest:c,...Tr(s)})}a(tJt,"_tuple");function Vos(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Tr(n)})}a(Vos,"_record");function Wos(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Tr(n)})}a(Wos,"_map");function zos(t,e,r){return new t({type:"set",valueType:e,...Tr(r)})}a(zos,"_set");function Yos(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(Yos,"_enum");function Kos(t,e,r){return new t({type:"enum",entries:e,...Tr(r)})}a(Kos,"_nativeEnum");function Jos(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Tr(r)})}a(Jos,"_literal");function rJt(t,e){return new t({type:"file",...Tr(e)})}a(rJt,"_file");function Zos(t,e){return new t({type:"transform",transform:e})}a(Zos,"_transform");function Xos(t,e){return new t({type:"optional",innerType:e})}a(Xos,"_optional");function ess(t,e){return new t({type:"nullable",innerType:e})}a(ess,"_nullable");function tss(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}a(tss,"_default");function rss(t,e,r){return new t({type:"nonoptional",innerType:e,...Tr(r)})}a(rss,"_nonoptional");function nss(t,e){return new t({type:"success",innerType:e})}a(nss,"_success");function iss(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(iss,"_catch");function oss(t,e,r){return new t({type:"pipe",in:e,out:r})}a(oss,"_pipe");function sss(t,e){return new t({type:"readonly",innerType:e})}a(sss,"_readonly");function ass(t,e,r){return new t({type:"template_literal",parts:e,...Tr(r)})}a(ass,"_templateLiteral");function css(t,e){return new t({type:"lazy",getter:e})}a(css,"_lazy");function lss(t,e){return new t({type:"promise",innerType:e})}a(lss,"_promise");function nJt(t,e,r){let n=Tr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a(nJt,"_custom");function iJt(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Tr(r)})}a(iJt,"_refine");function oJt(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??aRe,u=t.Boolean??iRe,d=t.String??IJ,f=t.Transform??sRe,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(oJt,"_stringbool");function sJt(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(sJt,"_stringFormat");var mrt=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?eRe(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?eRe(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 tRe(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?tRe(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 xJ({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 aJt(t){return new mrt({type:"function",input:Array.isArray(t?.input)?tJt(xJ,t?.input):t?.input??bRe(oRe,xde(Tde)),output:t?.output??xde(Tde)})}a(aJt,"_function");p();var SRe=class{static{a(this,"JSONSchemaGenerator")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??JO,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=$we(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"&&l0(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 ? [${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("/")}/ -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 cJt(t,e){if(t instanceof Ide){let n=new SRe(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 SRe(e);return r.process(t),r.emit(t,e)}a(cJt,"toJSONSchema");function l0(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 l0(o.element,r);case"object":{for(let s in o.shape)if(l0(o.shape[s],r))return!0;return!1}case"union":{for(let s of o.options)if(l0(s,r))return!0;return!1}case"intersection":return l0(o.left,r)||l0(o.right,r);case"tuple":{for(let s of o.items)if(l0(s,r))return!0;return!!(o.rest&&l0(o.rest,r))}case"record":return l0(o.keyType,r)||l0(o.valueType,r);case"map":return l0(o.keyType,r)||l0(o.valueType,r);case"set":return l0(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return l0(o.innerType,r);case"lazy":return l0(o.getter(),r);case"default":return l0(o.innerType,r);case"prefault":return l0(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return l0(o.in,r)||l0(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}a(l0,"isTransforming");var hkn={};p();p();p();var kde={};Ri(kde,{ZodISODate:()=>Art,ZodISODateTime:()=>grt,ZodISODuration:()=>Ert,ZodISOTime:()=>yrt,date:()=>uJt,datetime:()=>lJt,duration:()=>fJt,time:()=>dJt});p();var grt=ut("ZodISODateTime",(t,e)=>{Gzt.init(t,e),yu.init(t,e)});function lJt(t){return SKt(grt,t)}a(lJt,"datetime");var Art=ut("ZodISODate",(t,e)=>{$zt.init(t,e),yu.init(t,e)});function uJt(t){return TKt(Art,t)}a(uJt,"date");var yrt=ut("ZodISOTime",(t,e)=>{Vzt.init(t,e),yu.init(t,e)});function dJt(t){return IKt(yrt,t)}a(dJt,"time");var Ert=ut("ZodISODuration",(t,e)=>{Wzt.init(t,e),yu.init(t,e)});function fJt(t){return xKt(Ert,t)}a(fJt,"duration");p();p();var gkn=a((t,e)=>{Jwe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>Xwe(t,r),"value")},flatten:{value:a(r=>Zwe(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"),dss=ut("ZodError",gkn),Dde=ut("ZodError",gkn,{Parent:Error});var pJt=Ott(Dde),hJt=Btt(Dde),mJt=Ltt(Dde),gJt=Ftt(Dde);var xs=ut("ZodType",(t,e)=>(fo.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)=>JS(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>pJt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>mJt(t,r,n),t.parseAsync=async(r,n)=>hJt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>gJt(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Kkn(r,n)),t.superRefine=r=>t.check(Jkn(r)),t.overwrite=r=>t.check(uF(r)),t.optional=()=>Eu(t),t.nullable=()=>vrt(t),t.nullish=()=>Eu(vrt(t)),t.nonoptional=r=>Fkn(t,r),t.array=()=>Fr(t),t.or=r=>_l([t,r]),t.and=r=>PRe(t,r),t.transform=r=>Crt(t,jJt(r)),t.default=r=>Okn(t,r),t.prefault=r=>Lkn(t,r),t.catch=r=>qkn(t,r),t.pipe=r=>Crt(t,r),t.readonly=()=>Gkn(t),t.describe=r=>{let n=t.clone();return JO.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return JO.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return JO.get(t);let n=t.clone();return JO.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),yJt=ut("_ZodString",(t,e)=>{IJ.init(t,e),xs.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(fRe(...n)),t.includes=(...n)=>t.check(mRe(...n)),t.startsWith=(...n)=>t.check(gRe(...n)),t.endsWith=(...n)=>t.check(ARe(...n)),t.min=(...n)=>t.check(Jq(...n)),t.max=(...n)=>t.check(Rde(...n)),t.length=(...n)=>t.check(Pde(...n)),t.nonempty=(...n)=>t.check(Jq(1,...n)),t.lowercase=n=>t.check(pRe(n)),t.uppercase=n=>t.check(hRe(n)),t.trim=()=>t.check(_Re()),t.normalize=(...n)=>t.check(ERe(...n)),t.toLowerCase=()=>t.check(vRe()),t.toUpperCase=()=>t.check(CRe())}),IRe=ut("ZodString",(t,e)=>{IJ.init(t,e),yJt.init(t,e),t.email=r=>t.check(ztt(EJt,r)),t.url=r=>t.check(Xtt(_Jt,r)),t.jwt=r=>t.check(hrt(BJt,r)),t.emoji=r=>t.check(ert(CJt,r)),t.guid=r=>t.check(uRe(_rt,r)),t.uuid=r=>t.check(Ytt(fF,r)),t.uuidv4=r=>t.check(Ktt(fF,r)),t.uuidv6=r=>t.check(Jtt(fF,r)),t.uuidv7=r=>t.check(Ztt(fF,r)),t.nanoid=r=>t.check(trt(bJt,r)),t.guid=r=>t.check(uRe(_rt,r)),t.cuid=r=>t.check(rrt(SJt,r)),t.cuid2=r=>t.check(nrt(TJt,r)),t.ulid=r=>t.check(irt(IJt,r)),t.base64=r=>t.check(drt(NJt,r)),t.base64url=r=>t.check(frt(MJt,r)),t.xid=r=>t.check(ort(xJt,r)),t.ksuid=r=>t.check(srt(wJt,r)),t.ipv4=r=>t.check(art(RJt,r)),t.ipv6=r=>t.check(crt(PJt,r)),t.cidrv4=r=>t.check(lrt(kJt,r)),t.cidrv6=r=>t.check(urt(DJt,r)),t.e164=r=>t.check(prt(OJt,r)),t.datetime=r=>t.check(lJt(r)),t.date=r=>t.check(uJt(r)),t.time=r=>t.check(dJt(r)),t.duration=r=>t.check(fJt(r))});function Je(t){return vKt(IRe,t)}a(Je,"string");var yu=ut("ZodStringFormat",(t,e)=>{Ql.init(t,e),yJt.init(t,e)}),EJt=ut("ZodEmail",(t,e)=>{Ozt.init(t,e),yu.init(t,e)});function pss(t){return ztt(EJt,t)}a(pss,"email");var _rt=ut("ZodGUID",(t,e)=>{Nzt.init(t,e),yu.init(t,e)});function hss(t){return uRe(_rt,t)}a(hss,"guid");var fF=ut("ZodUUID",(t,e)=>{Mzt.init(t,e),yu.init(t,e)});function mss(t){return Ytt(fF,t)}a(mss,"uuid");function gss(t){return Ktt(fF,t)}a(gss,"uuidv4");function Ass(t){return Jtt(fF,t)}a(Ass,"uuidv6");function yss(t){return Ztt(fF,t)}a(yss,"uuidv7");var _Jt=ut("ZodURL",(t,e)=>{Bzt.init(t,e),yu.init(t,e)});function vJt(t){return Xtt(_Jt,t)}a(vJt,"url");var CJt=ut("ZodEmoji",(t,e)=>{Lzt.init(t,e),yu.init(t,e)});function Ess(t){return ert(CJt,t)}a(Ess,"emoji");var bJt=ut("ZodNanoID",(t,e)=>{Fzt.init(t,e),yu.init(t,e)});function _ss(t){return trt(bJt,t)}a(_ss,"nanoid");var SJt=ut("ZodCUID",(t,e)=>{Uzt.init(t,e),yu.init(t,e)});function vss(t){return rrt(SJt,t)}a(vss,"cuid");var TJt=ut("ZodCUID2",(t,e)=>{Qzt.init(t,e),yu.init(t,e)});function Css(t){return nrt(TJt,t)}a(Css,"cuid2");var IJt=ut("ZodULID",(t,e)=>{qzt.init(t,e),yu.init(t,e)});function bss(t){return irt(IJt,t)}a(bss,"ulid");var xJt=ut("ZodXID",(t,e)=>{jzt.init(t,e),yu.init(t,e)});function Sss(t){return ort(xJt,t)}a(Sss,"xid");var wJt=ut("ZodKSUID",(t,e)=>{Hzt.init(t,e),yu.init(t,e)});function Tss(t){return srt(wJt,t)}a(Tss,"ksuid");var RJt=ut("ZodIPv4",(t,e)=>{zzt.init(t,e),yu.init(t,e)});function Iss(t){return art(RJt,t)}a(Iss,"ipv4");var PJt=ut("ZodIPv6",(t,e)=>{Yzt.init(t,e),yu.init(t,e)});function xss(t){return crt(PJt,t)}a(xss,"ipv6");var kJt=ut("ZodCIDRv4",(t,e)=>{Kzt.init(t,e),yu.init(t,e)});function wss(t){return lrt(kJt,t)}a(wss,"cidrv4");var DJt=ut("ZodCIDRv6",(t,e)=>{Jzt.init(t,e),yu.init(t,e)});function Rss(t){return urt(DJt,t)}a(Rss,"cidrv6");var NJt=ut("ZodBase64",(t,e)=>{Xzt.init(t,e),yu.init(t,e)});function Pss(t){return drt(NJt,t)}a(Pss,"base64");var MJt=ut("ZodBase64URL",(t,e)=>{eYt.init(t,e),yu.init(t,e)});function kss(t){return frt(MJt,t)}a(kss,"base64url");var OJt=ut("ZodE164",(t,e)=>{tYt.init(t,e),yu.init(t,e)});function Dss(t){return prt(OJt,t)}a(Dss,"e164");var BJt=ut("ZodJWT",(t,e)=>{rYt.init(t,e),yu.init(t,e)});function Nss(t){return hrt(BJt,t)}a(Nss,"jwt");var Akn=ut("ZodCustomStringFormat",(t,e)=>{nYt.init(t,e),yu.init(t,e)});function Mss(t,e,r={}){return sJt(Akn,t,e,r)}a(Mss,"stringFormat");var xRe=ut("ZodNumber",(t,e)=>{Gtt.init(t,e),xs.init(t,e),t.gt=(n,o)=>t.check(lF(n,o)),t.gte=(n,o)=>t.check(YC(n,o)),t.min=(n,o)=>t.check(YC(n,o)),t.lt=(n,o)=>t.check(cF(n,o)),t.lte=(n,o)=>t.check(gw(n,o)),t.max=(n,o)=>t.check(gw(n,o)),t.int=n=>t.check(AJt(n)),t.safe=n=>t.check(AJt(n)),t.positive=n=>t.check(lF(0,n)),t.nonnegative=n=>t.check(YC(0,n)),t.negative=n=>t.check(cF(0,n)),t.nonpositive=n=>t.check(gw(0,n)),t.multipleOf=(n,o)=>t.check(wJ(n,o)),t.step=(n,o)=>t.check(wJ(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 wa(t){return wKt(xRe,t)}a(wa,"number");var Nde=ut("ZodNumberFormat",(t,e)=>{iYt.init(t,e),xRe.init(t,e)});function AJt(t){return PKt(Nde,t)}a(AJt,"int");function Oss(t){return kKt(Nde,t)}a(Oss,"float32");function Bss(t){return DKt(Nde,t)}a(Bss,"float64");function Lss(t){return NKt(Nde,t)}a(Lss,"int32");function Fss(t){return MKt(Nde,t)}a(Fss,"uint32");var wRe=ut("ZodBoolean",(t,e)=>{iRe.init(t,e),xs.init(t,e)});function tl(t){return OKt(wRe,t)}a(tl,"boolean");var RRe=ut("ZodBigInt",(t,e)=>{$tt.init(t,e),xs.init(t,e),t.gte=(n,o)=>t.check(YC(n,o)),t.min=(n,o)=>t.check(YC(n,o)),t.gt=(n,o)=>t.check(lF(n,o)),t.gte=(n,o)=>t.check(YC(n,o)),t.min=(n,o)=>t.check(YC(n,o)),t.lt=(n,o)=>t.check(cF(n,o)),t.lte=(n,o)=>t.check(gw(n,o)),t.max=(n,o)=>t.check(gw(n,o)),t.positive=n=>t.check(lF(BigInt(0),n)),t.negative=n=>t.check(cF(BigInt(0),n)),t.nonpositive=n=>t.check(gw(BigInt(0),n)),t.nonnegative=n=>t.check(YC(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(wJ(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function Uss(t){return LKt(RRe,t)}a(Uss,"bigint");var LJt=ut("ZodBigIntFormat",(t,e)=>{oYt.init(t,e),RRe.init(t,e)});function Qss(t){return UKt(LJt,t)}a(Qss,"int64");function qss(t){return QKt(LJt,t)}a(qss,"uint64");var ykn=ut("ZodSymbol",(t,e)=>{sYt.init(t,e),xs.init(t,e)});function jss(t){return qKt(ykn,t)}a(jss,"symbol");var Ekn=ut("ZodUndefined",(t,e)=>{aYt.init(t,e),xs.init(t,e)});function Hss(t){return jKt(Ekn,t)}a(Hss,"_undefined");var _kn=ut("ZodNull",(t,e)=>{cYt.init(t,e),xs.init(t,e)});function brt(t){return HKt(_kn,t)}a(brt,"_null");var vkn=ut("ZodAny",(t,e)=>{lYt.init(t,e),xs.init(t,e)});function FJt(){return GKt(vkn)}a(FJt,"any");var Ckn=ut("ZodUnknown",(t,e)=>{Tde.init(t,e),xs.init(t,e)});function rd(){return xde(Ckn)}a(rd,"unknown");var bkn=ut("ZodNever",(t,e)=>{uYt.init(t,e),xs.init(t,e)});function Srt(t){return $Kt(bkn,t)}a(Srt,"never");var Skn=ut("ZodVoid",(t,e)=>{dYt.init(t,e),xs.init(t,e)});function Gss(t){return VKt(Skn,t)}a(Gss,"_void");var Trt=ut("ZodDate",(t,e)=>{fYt.init(t,e),xs.init(t,e),t.min=(n,o)=>t.check(YC(n,o)),t.max=(n,o)=>t.check(gw(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 $ss(t){return WKt(Trt,t)}a($ss,"date");var Tkn=ut("ZodArray",(t,e)=>{oRe.init(t,e),xs.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(Jq(r,n)),t.nonempty=r=>t.check(Jq(1,r)),t.max=(r,n)=>t.check(Rde(r,n)),t.length=(r,n)=>t.check(Pde(r,n)),t.unwrap=()=>t.element});function Fr(t,e){return bRe(Tkn,t,e)}a(Fr,"array");function Vss(t){let e=t._zod.def.shape;return Gn(Object.keys(e))}a(Vss,"keyof");var Irt=ut("ZodObject",(t,e)=>{pYt.init(t,e),xs.init(t,e),qr.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>z_(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:rd()}),t.loose=()=>t.clone({...t._zod.def,catchall:rd()}),t.strict=()=>t.clone({...t._zod.def,catchall:Srt()}),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(HJt,t,r[0]),t.required=(...r)=>qr.required(GJt,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 Irt(r)}a(zr,"object");function Wss(t,e){return new Irt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:Srt(),...qr.normalizeParams(e)})}a(Wss,"strictObject");function rm(t,e){return new Irt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:rd(),...qr.normalizeParams(e)})}a(rm,"looseObject");var UJt=ut("ZodUnion",(t,e)=>{Vtt.init(t,e),xs.init(t,e),t.options=e.options});function _l(t,e){return new UJt({type:"union",options:t,...qr.normalizeParams(e)})}a(_l,"union");var Ikn=ut("ZodDiscriminatedUnion",(t,e)=>{UJt.init(t,e),hYt.init(t,e)});function xrt(t,e,r){return new Ikn({type:"union",options:e,discriminator:t,...qr.normalizeParams(r)})}a(xrt,"discriminatedUnion");var xkn=ut("ZodIntersection",(t,e)=>{mYt.init(t,e),xs.init(t,e)});function PRe(t,e){return new xkn({type:"intersection",left:t,right:e})}a(PRe,"intersection");var wkn=ut("ZodTuple",(t,e)=>{xJ.init(t,e),xs.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function zss(t,e,r){let n=e instanceof fo,o=n?r:e,s=n?e:null;return new wkn({type:"tuple",items:t,rest:s,...qr.normalizeParams(o)})}a(zss,"tuple");var QJt=ut("ZodRecord",(t,e)=>{gYt.init(t,e),xs.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function vl(t,e,r){return new QJt({type:"record",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(vl,"record");function Yss(t,e,r){return new QJt({type:"record",keyType:_l([t,Srt()]),valueType:e,...qr.normalizeParams(r)})}a(Yss,"partialRecord");var Rkn=ut("ZodMap",(t,e)=>{AYt.init(t,e),xs.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function Kss(t,e,r){return new Rkn({type:"map",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(Kss,"map");var Pkn=ut("ZodSet",(t,e)=>{yYt.init(t,e),xs.init(t,e),t.min=(...r)=>t.check(RJ(...r)),t.nonempty=r=>t.check(RJ(1,r)),t.max=(...r)=>t.check(wde(...r)),t.size=(...r)=>t.check(dRe(...r))});function Jss(t,e){return new Pkn({type:"set",valueType:t,...qr.normalizeParams(e)})}a(Jss,"set");var TRe=ut("ZodEnum",(t,e)=>{EYt.init(t,e),xs.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 TRe({...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 TRe({...e,checks:[],...qr.normalizeParams(o),entries:s})}});function z_(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new TRe({type:"enum",entries:r,...qr.normalizeParams(e)})}a(z_,"_enum");function Zss(t,e){return new TRe({type:"enum",entries:t,...qr.normalizeParams(e)})}a(Zss,"nativeEnum");var kkn=ut("ZodLiteral",(t,e)=>{_Yt.init(t,e),xs.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 kkn({type:"literal",values:Array.isArray(t)?t:[t],...qr.normalizeParams(e)})}a(Gn,"literal");var Dkn=ut("ZodFile",(t,e)=>{vYt.init(t,e),xs.init(t,e),t.min=(r,n)=>t.check(RJ(r,n)),t.max=(r,n)=>t.check(wde(r,n)),t.mime=(r,n)=>t.check(yRe(Array.isArray(r)?r:[r],n))});function Xss(t){return rJt(Dkn,t)}a(Xss,"file");var qJt=ut("ZodTransform",(t,e)=>{sRe.init(t,e),xs.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 jJt(t){return new qJt({type:"transform",transform:t})}a(jJt,"transform");var HJt=ut("ZodOptional",(t,e)=>{CYt.init(t,e),xs.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Eu(t){return new HJt({type:"optional",innerType:t})}a(Eu,"optional");var Nkn=ut("ZodNullable",(t,e)=>{bYt.init(t,e),xs.init(t,e),t.unwrap=()=>t._zod.def.innerType});function vrt(t){return new Nkn({type:"nullable",innerType:t})}a(vrt,"nullable");function eas(t){return Eu(vrt(t))}a(eas,"nullish");var Mkn=ut("ZodDefault",(t,e)=>{SYt.init(t,e),xs.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Okn(t,e){return new Mkn({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(Okn,"_default");var Bkn=ut("ZodPrefault",(t,e)=>{TYt.init(t,e),xs.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Lkn(t,e){return new Bkn({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(Lkn,"prefault");var GJt=ut("ZodNonOptional",(t,e)=>{IYt.init(t,e),xs.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Fkn(t,e){return new GJt({type:"nonoptional",innerType:t,...qr.normalizeParams(e)})}a(Fkn,"nonoptional");var Ukn=ut("ZodSuccess",(t,e)=>{xYt.init(t,e),xs.init(t,e),t.unwrap=()=>t._zod.def.innerType});function tas(t){return new Ukn({type:"success",innerType:t})}a(tas,"success");var Qkn=ut("ZodCatch",(t,e)=>{wYt.init(t,e),xs.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function qkn(t,e){return new Qkn({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(qkn,"_catch");var jkn=ut("ZodNaN",(t,e)=>{RYt.init(t,e),xs.init(t,e)});function ras(t){return YKt(jkn,t)}a(ras,"nan");var $Jt=ut("ZodPipe",(t,e)=>{aRe.init(t,e),xs.init(t,e),t.in=e.in,t.out=e.out});function Crt(t,e){return new $Jt({type:"pipe",in:t,out:e})}a(Crt,"pipe");var Hkn=ut("ZodReadonly",(t,e)=>{PYt.init(t,e),xs.init(t,e)});function Gkn(t){return new Hkn({type:"readonly",innerType:t})}a(Gkn,"readonly");var $kn=ut("ZodTemplateLiteral",(t,e)=>{kYt.init(t,e),xs.init(t,e)});function nas(t,e){return new $kn({type:"template_literal",parts:t,...qr.normalizeParams(e)})}a(nas,"templateLiteral");var Vkn=ut("ZodLazy",(t,e)=>{NYt.init(t,e),xs.init(t,e),t.unwrap=()=>t._zod.def.getter()});function Wkn(t){return new Vkn({type:"lazy",getter:t})}a(Wkn,"lazy");var zkn=ut("ZodPromise",(t,e)=>{DYt.init(t,e),xs.init(t,e),t.unwrap=()=>t._zod.def.innerType});function ias(t){return new zkn({type:"promise",innerType:t})}a(ias,"promise");var wrt=ut("ZodCustom",(t,e)=>{MYt.init(t,e),xs.init(t,e)});function Ykn(t){let e=new vf({check:"custom"});return e._zod.check=t,e}a(Ykn,"check");function VJt(t,e){return nJt(wrt,t??(()=>!0),e)}a(VJt,"custom");function Kkn(t,e={}){return iJt(wrt,t,e)}a(Kkn,"refine");function Jkn(t){let e=Ykn(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(Jkn,"superRefine");function oas(t,e={error:`Input not instance of ${t.name}`}){let r=new wrt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...qr.normalizeParams(e)});return r._zod.bag.Class=t,r}a(oas,"_instanceof");var sas=a((...t)=>oJt({Pipe:$Jt,Boolean:wRe,String:IRe,Transform:qJt},...t),"stringbool");function aas(t){let e=Wkn(()=>_l([Je(t),wa(),tl(),brt(),Fr(e),vl(Je(),e)]));return e}a(aas,"json");function Rrt(t,e){return Crt(jJt(t),e)}a(Rrt,"preprocess");p();var WJt={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 cas(t){tm({customError:t})}a(cas,"setErrorMap");function las(){return tm().customError}a(las,"getErrorMap");var kRe={};Ri(kRe,{bigint:()=>pas,boolean:()=>fas,date:()=>has,number:()=>das,string:()=>uas});p();function uas(t){return CKt(IRe,t)}a(uas,"string");function das(t){return RKt(xRe,t)}a(das,"number");function fas(t){return BKt(wRe,t)}a(fas,"boolean");function pas(t){return FKt(RRe,t)}a(pas,"bigint");function has(t){return zKt(Trt,t)}a(has,"date");tm(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"},Cf={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"},Prt=1;p();var gas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminal:k.boolean().optional().default(!1)}),Aas=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)}),yas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),name:k.string()}),Eas=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(Aas)}),_as=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()}),vas=k.union([Eas.and(k.object({type:k.literal("env_var")})),_as.and(k.object({type:k.literal("terminal")})),yas]),YJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),methodId:k.string()}),Cas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),bas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),blob:k.string(),mimeType:k.string().nullish(),uri:k.string()}),Sas=k.object({default:k.boolean().nullish(),description:k.string().nullish(),title:k.string().nullish()}),Tas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ias=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),xas=k.object({amount:k.number(),currency:k.string()}),was=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Ras=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Pas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),newText:k.string(),oldText:k.string().nullish(),path:k.string()}),KJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string()}),kas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Das=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())]),Mas=k.object({content:k.record(k.string(),Nas).nullish()}),Oas=k.intersection(k.union([Mas.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()})),Bas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Zkn=k.string(),JJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),elicitationId:Zkn}),Las=k.literal("object"),Fas=k.literal("string"),Uas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Qas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),form:Bas.nullish(),url:Uas.nullish()}),Xkn=k.object({const:k.string(),title:k.string()}),e2n=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),qas=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"})]),t2n=k.object({code:qas,data:k.unknown().optional(),message:k.string()}),r2n=k.unknown(),n2n=k.unknown(),i2n=k.unknown(),jas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),readTextFile:k.boolean().optional().default(!1),writeTextFile:k.boolean().optional().default(!1)}),o2n=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),s2n=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),title:k.string().nullish(),version:k.string()}),Has=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),Gas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ZJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),XJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cursor:k.string().nullish(),cwd:k.string().nullish()}),eZt=k.union([k.literal("anthropic"),k.literal("openai"),k.literal("azure"),k.literal("vertex"),k.literal("bedrock"),k.string()]),$as=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Vas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),logout:$as.nullish()}),tZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Was=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),zas=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)}),krt=k.string(),Yas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:krt}),Kas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:krt}),a2n=k.string(),Jas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acpId:a2n}),Zas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:a2n,name:k.string()}),Xas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(o2n),name:k.string(),url:k.string()}),ecs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(o2n),name:k.string(),url:k.string()}),tcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()),command:k.string(),env:k.array(e2n),name:k.string()}),Drt=k.union([Xas.and(k.object({type:k.literal("http")})),ecs.and(k.object({type:k.literal("sse")})),Zas.and(k.object({type:k.literal("acp")})),tcs]),c2n=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:krt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),l2n=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:krt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),u2n=k.unknown(),rZt=k.string(),rcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),modelId:rZt,name:k.string()}),ncs=k.union([k.literal("error"),k.literal("warning"),k.literal("information"),k.literal("hint")]),ics=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ocs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),scs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),acs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ccs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),lcs=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()}),ucs=k.object({diff:k.string(),uri:k.string()}),dcs=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()}),fcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),pcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),hcs=k.object({languageId:k.string(),text:k.string(),uri:k.string()}),mcs=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()}),gcs=k.union([k.literal("rejected"),k.literal("ignored"),k.literal("replaced"),k.literal("cancelled")]),Acs=k.object({excerpts:k.array(dcs),uri:k.string()}),ycs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ecs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),_cs=k.object({name:k.string(),owner:k.string(),remoteUrl:k.string()}),vcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ccs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),jump:fcs.nullish(),rename:Ecs.nullish(),searchAndReplace:vcs.nullish()}),bcs=k.object({id:k.string(),isRegex:k.boolean().nullish(),replace:k.string(),search:k.string(),uri:k.string()}),Scs=k.union([k.literal("automatic"),k.literal("diagnostic"),k.literal("manual")]),Tcs=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()}),Ics=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:ics.nullish(),editHistory:lcs.nullish(),openFiles:pcs.nullish(),recentFiles:mcs.nullish(),relatedSnippets:ycs.nullish(),userActions:Tcs.nullish()}),nZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Drt)}),xcs=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),d2n=k.string(),wcs=k.union([k.literal("allow_once"),k.literal("allow_always"),k.literal("reject_once"),k.literal("reject_always")]),Rcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),kind:wcs,name:k.string(),optionId:d2n}),Pcs=k.union([k.literal("high"),k.literal("medium"),k.literal("low")]),kcs=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed")]),Dcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),priority:Pcs,status:kcs}),Ncs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),entries:k.array(Dcs)}),Zq=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"})}),Mcs=k.object({id:k.string(),position:Zq,uri:k.string()}),Ocs=k.object({id:k.string(),newName:k.string(),position:Zq,uri:k.string()}),Bcs=k.object({action:k.string(),position:Zq,timestampMs:k.number(),uri:k.string()}),f2n=k.union([k.literal("utf-16"),k.literal("utf-32"),k.literal("utf-8")]),Lcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:gas.optional().default({terminal:!1}),elicitation:Qas.nullish(),fs:jas.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Ccs.nullish(),positionEncodings:k.array(f2n).optional(),terminal:k.boolean().optional().default(!1)}),Fcs=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)}),p2n=k.number().int().gte(0).lte(65535),iZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),clientCapabilities:Lcs.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:s2n.nullish(),protocolVersion:p2n}),Ucs=k.object({apiType:eZt,baseUrl:k.string()}),Qcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),current:Ucs.nullish(),id:k.string(),required:k.boolean(),supported:k.array(eZt)}),qcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),providers:k.array(Qcs)}),jcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Mde=k.object({end:Zq,start:Zq}),Hcs=k.object({message:k.string(),range:Mde,severity:ncs,uri:k.string()}),Gcs=k.object({languageId:k.string(),lastFocusedMs:k.number().nullish(),uri:k.string(),visibleRange:Mde.nullish()}),$cs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:k.array(Hcs).nullish(),editHistory:k.array(ucs).nullish(),openFiles:k.array(Gcs).nullish(),recentFiles:k.array(hcs).nullish(),relatedSnippets:k.array(Acs).nullish(),userActions:k.array(Bcs).nullish()}),Vcs=k.object({newText:k.string(),range:Mde}),Wcs=k.object({cursorPosition:Zq.nullish(),edits:k.array(Vcs),id:k.string(),uri:k.string()}),zcs=k.union([Wcs.and(k.object({kind:k.literal("edit")})),Mcs.and(k.object({kind:k.literal("jump")})),Ocs.and(k.object({kind:k.literal("rename")})),bcs.and(k.object({kind:k.literal("searchAndReplace")}))]),Ycs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string()}),Kcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Xq=k.union([k.number(),k.string()]).nullable(),mYd=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),requestId:Xq}),h2n=k.object({requestId:Xq}),Jcs=k.enum(["assistant","user"]),DRe=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audience:k.array(Jcs).nullish(),lastModified:k.string().nullish(),priority:k.number().nullish()}),Zcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:DRe.nullish(),data:k.string(),mimeType:k.string()}),Xcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:DRe.nullish(),data:k.string(),mimeType:k.string(),uri:k.string().nullish()}),els=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:DRe.nullish(),description:k.string().nullish(),mimeType:k.string().nullish(),name:k.string(),size:k.number().nullish(),title:k.string().nullish(),uri:k.string()}),tls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),optionId:d2n}),rls=k.union([k.object({outcome:k.literal("cancelled")}),tls.and(k.object({outcome:k.literal("selected")}))]),nls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),outcome:rls}),ils=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ols=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),sls=k.object({currentValue:k.boolean()}),als=k.string(),m2n=k.string(),cls=k.union([k.literal("mode"),k.literal("model"),k.literal("thought_level"),k.string()]),oZt=k.string(),g2n=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),name:k.string(),value:oZt}),lls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),group:als,name:k.string(),options:k.array(g2n)}),uls=k.union([k.array(g2n),k.array(lls)]),dls=k.object({currentValue:oZt,options:uls}),Ode=k.intersection(k.union([dls.and(k.object({type:k.literal("select")})),sls.and(k.object({type:k.literal("boolean")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),category:cls.nullish(),description:k.string().nullish(),id:m2n,name:k.string()})),fls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Ode)}),pls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),hls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ic=k.string(),sZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),sessionId:ic}),aZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ic}),cZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ic}),lZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ic}),uZt=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(e2n).optional(),outputByteLimit:k.number().nullish(),sessionId:ic}),dZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ic}),fZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ic,uri:k.string()}),pZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),position:Zq,sessionId:ic,uri:k.string(),version:k.number(),visibleRange:Mde}),hZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),languageId:k.string(),sessionId:ic,text:k.string(),uri:k.string(),version:k.number()}),mZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ic,uri:k.string()}),gZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Drt).optional(),sessionId:ic}),AZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ic,terminalId:k.string()}),yZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Drt),sessionId:ic}),EZt=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:ic}),_Zt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),reason:gcs.nullish(),sessionId:ic}),vZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ic,terminalId: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(Drt).optional(),sessionId:ic}),mls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),sessionId:ic,title:k.string().nullish(),updatedAt:k.string().nullish()}),gls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),nextCursor:k.string().nullish(),sessions:k.array(mls)}),Als=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),title:k.string().nullish(),updatedAt:k.string().nullish()}),yls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Nrt=k.string(),Els=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),currentModeId:Nrt}),_ls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:Nrt,name:k.string()}),Mrt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModes:k.array(_ls),currentModeId:Nrt}),Ort=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModels:k.array(rcs),currentModelId:rZt}),vls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Ode).nullish(),models:Ort.nullish(),modes:Mrt.nullish(),sessionId:ic}),Cls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Ode).nullish(),models:Ort.nullish(),modes:Mrt.nullish()}),bls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Ode).nullish(),models:Ort.nullish(),modes:Mrt.nullish(),sessionId:ic}),Sls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Ode).nullish(),models:Ort.nullish(),modes:Mrt.nullish()}),Tls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ils=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:ils.nullish(),close:ols.nullish(),delete:pls.nullish(),fork:hls.nullish(),list:yls.nullish(),resume:Tls.nullish()}),bZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),apiType:eZt,baseUrl:k.string(),headers:k.record(k.string(),k.string()).optional(),id:k.string()}),xls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),SZt=k.intersection(k.union([k.object({type:k.literal("boolean"),value:k.boolean()}),k.object({value:oZt})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configId:m2n,sessionId:ic})),wls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Ode)}),TZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modeId:Nrt,sessionId:ic}),Rls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),IZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modelId:rZt,sessionId:ic}),Pls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),kls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ic}),Dls=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")]),Mls=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(Xkn).nullish(),pattern:k.string().nullish(),title:k.string().nullish()}),xZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:$cs.nullish(),position:Zq,selection:Mde.nullish(),sessionId:ic,triggerKind:Scs,uri:k.string(),version:k.number()}),Ols=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),suggestions:k.array(zcs)}),Bls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Lls=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()}),wZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ic,terminalId:k.string()}),Fls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitStatus:Lls.nullish(),output:k.string(),truncated:k.boolean()}),Uls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:DRe.nullish(),text:k.string()}),Qls=k.object({range:Mde.nullish(),text:k.string()}),RZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),contentChanges:k.array(Qls),sessionId:ic,uri:k.string(),version:k.number()}),gYd=k.object({method:k.string(),params:k.union([aZt,hZt,RZt,fZt,mZt,pZt,sZt,_Zt,c2n,r2n]).nullish()}),qls=k.union([k.literal("full"),k.literal("incremental")]),jls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),syncKind:qls}),Hls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),didChange:jls.nullish(),didClose:ocs.nullish(),didFocus:scs.nullish(),didOpen:acs.nullish(),didSave:ccs.nullish()}),Gls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),document:Hls.nullish()}),$ls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:Ics.nullish(),events:Gls.nullish()}),Vls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:Vas.optional().default({}),loadSession:k.boolean().optional().default(!1),mcpCapabilities:zas.optional().default({acp:!1,http:!1,sse:!1}),nes:$ls.nullish(),positionEncoding:f2n.nullish(),promptCapabilities:Fcs.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:jcs.nullish(),sessionCapabilities:Ils.optional().default({})}),Wls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),agentCapabilities:Vls.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:s2n.nullish(),authMethods:k.array(vas).optional().default([]),protocolVersion:p2n}),zls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),mimeType:k.string().nullish(),text:k.string(),uri:k.string()}),Yls=k.union([zls,bas]),Kls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:DRe.nullish(),resource:Yls}),PZt=k.union([Uls.and(k.object({type:k.literal("text")})),Xcs.and(k.object({type:k.literal("image")})),Zcs.and(k.object({type:k.literal("audio")})),els.and(k.object({type:k.literal("resource_link")})),Kls.and(k.object({type:k.literal("resource")}))]),Jls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:PZt}),zJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:PZt,messageId:k.string().nullish()}),kZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),messageId:k.string().nullish(),prompt:k.array(PZt),sessionId:ic}),Zls=k.object({anyOf:k.array(Xkn)}),A2n=k.union([Jls.and(k.object({type:k.literal("content")})),Pas.and(k.object({type:k.literal("diff")})),Bls.and(k.object({type:k.literal("terminal")}))]),DZt=k.string(),y2n=k.object({sessionId:ic,toolCallId:DZt.nullish()}),Xls=k.intersection(k.union([y2n,h2n]),k.object({elicitationId:Zkn,url:k.string().url()})),E2n=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()}),_2n=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed"),k.literal("failed")]),v2n=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")]),eus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(A2n).optional(),kind:v2n.optional(),locations:k.array(E2n).optional(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:_2n.optional(),title:k.string(),toolCallId:DZt}),C2n=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(A2n).nullish(),kind:v2n.nullish(),locations:k.array(E2n).nullish(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:_2n.nullish(),title:k.string().nullish(),toolCallId:DZt}),NZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),options:k.array(Rcs),sessionId:ic,toolCall:C2n}),tus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),hint:k.string()}),rus=tus,nus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string(),input:rus.nullish(),name:k.string()}),ius=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableCommands:k.array(nus)}),ous=k.object({enum:k.array(k.string()),type:Fas}),sus=k.union([ous,Zls]),aus=k.object({default:k.array(k.string()).nullish(),description:k.string().nullish(),items:sus,maxItems:k.number().nullish(),minItems:k.number().nullish(),title:k.string().nullish()}),cus=k.union([Mls.and(k.object({type:k.literal("string")})),xcs.and(k.object({type:k.literal("number")})),Has.and(k.object({type:k.literal("integer")})),Sas.and(k.object({type:k.literal("boolean")})),aus.and(k.object({type:k.literal("array")}))]),lus=k.object({description:k.string().nullish(),properties:k.record(k.string(),cus).optional().default({}),required:k.array(k.string()).nullish(),title:k.string().nullish(),type:Las.optional().default("object")}),uus=k.intersection(k.union([y2n,h2n]),k.object({requestedSchema:lus})),MZt=k.intersection(k.union([uus.and(k.object({mode:k.literal("form")})),Xls.and(k.object({mode:k.literal("url")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),message:k.string()})),dus=k.object({cachedReadTokens:k.number().nullish(),cachedWriteTokens:k.number().nullish(),inputTokens:k.number(),outputTokens:k.number(),thoughtTokens:k.number().nullish(),totalTokens:k.number()}),fus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),stopReason:Dls,usage:dus.nullish(),userMessageId:k.string().nullish()}),AYd=k.union([k.object({id:Xq,result:k.union([Wls,Cas,qcs,xls,kas,Was,bls,Cls,gls,Ras,vls,Sls,Ias,Rls,wls,fus,Pls,kls,Ols,Tas,i2n,u2n])}),k.object({error:t2n,id:Xq})]),pus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cost:xas.nullish(),size:k.number(),used:k.number()}),hus=k.union([zJt.and(k.object({sessionUpdate:k.literal("user_message_chunk")})),zJt.and(k.object({sessionUpdate:k.literal("agent_message_chunk")})),zJt.and(k.object({sessionUpdate:k.literal("agent_thought_chunk")})),eus.and(k.object({sessionUpdate:k.literal("tool_call")})),C2n.and(k.object({sessionUpdate:k.literal("tool_call_update")})),Ncs.and(k.object({sessionUpdate:k.literal("plan")})),ius.and(k.object({sessionUpdate:k.literal("available_commands_update")})),Els.and(k.object({sessionUpdate:k.literal("current_mode_update")})),fls.and(k.object({sessionUpdate:k.literal("config_option_update")})),Als.and(k.object({sessionUpdate:k.literal("session_info_update")})),pus.and(k.object({sessionUpdate:k.literal("usage_update")}))]),OZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ic,update:hus}),yYd=k.object({method:k.string(),params:k.union([OZt,JJt,c2n,r2n]).nullish()}),BZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ic,terminalId:k.string()}),mus=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()}),gus=k.object({name:k.string(),uri:k.string()}),LZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),repository:_cs.nullish(),workspaceFolders:k.array(gus).nullish(),workspaceUri:k.string().nullish()}),EYd=k.object({id:Xq,method:k.string(),params:k.union([iZt,YJt,ZJt,bZt,KJt,tZt,nZt,yZt,XJt,dZt,gZt,CZt,lZt,TZt,SZt,kZt,IZt,LZt,xZt,cZt,l2n,n2n]).nullish()}),FZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),path:k.string(),sessionId:ic}),_Yd=k.object({id:Xq,method:k.string(),params:k.union([FZt,EZt,NZt,uZt,wZt,vZt,BZt,AZt,MZt,Jas,l2n,Kas,n2n]).nullish()}),Aus=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),vYd=k.union([k.object({id:Xq,result:k.union([Aus,Ycs,nls,was,Fls,Kcs,mus,Gas,Oas,Yas,Das,i2n,u2n])}),k.object({error:t2n,id:Xq})]);p();function NRe(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 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(` `);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(NRe,"ndJsonStream");function Aw(t){return t??{}}a(Aw,"emptyObjectResponse");function b2n(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(b2n,"rejectedPromise");var MRe=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=iZt.parse(l);return n.initialize(u)}case ci.session_new:{let u=nZt.parse(l);return n.newSession(u)}case ci.session_load:{if(!n.loadSession)throw po.methodNotFound(c);let u=yZt.parse(l);return n.loadSession(u)}case ci.session_list:{if(!n.listSessions)throw po.methodNotFound(c);let u=XJt.parse(l);return n.listSessions(u)}case ci.session_delete:{if(!n.unstable_deleteSession)throw po.methodNotFound(c);let u=dZt.parse(l);return await n.unstable_deleteSession(u)??{}}case ci.session_fork:{if(!n.unstable_forkSession)throw po.methodNotFound(c);let u=gZt.parse(l);return n.unstable_forkSession(u)}case ci.session_resume:{if(!n.resumeSession)throw po.methodNotFound(c);let u=CZt.parse(l);return n.resumeSession(u)}case ci.session_close:{if(!n.closeSession)throw po.methodNotFound(c);let u=lZt.parse(l);return await n.closeSession(u)??{}}case ci.session_set_mode:{if(!n.setSessionMode)throw po.methodNotFound(c);let u=TZt.parse(l);return await n.setSessionMode(u)??{}}case ci.authenticate:{let u=YJt.parse(l);return await n.authenticate(u)??{}}case ci.providers_list:{if(!n.unstable_listProviders)throw po.methodNotFound(c);let u=ZJt.parse(l);return n.unstable_listProviders(u)}case ci.providers_set:{if(!n.unstable_setProvider)throw po.methodNotFound(c);let u=bZt.parse(l);return await n.unstable_setProvider(u)??{}}case ci.providers_disable:{if(!n.unstable_disableProvider)throw po.methodNotFound(c);let u=KJt.parse(l);return await n.unstable_disableProvider(u)??{}}case ci.logout:{if(!n.unstable_logout)throw po.methodNotFound(c);let u=tZt.parse(l);return await n.unstable_logout(u)??{}}case ci.session_prompt:{let u=kZt.parse(l);return n.prompt(u)}case ci.session_set_model:{if(!n.unstable_setSessionModel)throw po.methodNotFound(c);let u=IZt.parse(l);return await n.unstable_setSessionModel(u)??{}}case ci.session_set_config_option:{if(!n.setSessionConfigOption)throw po.methodNotFound(c);let u=SZt.parse(l);return n.setSessionConfigOption(u)}case ci.nes_start:{if(!n.unstable_startNes)throw po.methodNotFound(c);let u=LZt.parse(l);return n.unstable_startNes(u)}case ci.nes_suggest:{if(!n.unstable_suggestNes)throw po.methodNotFound(c);let u=xZt.parse(l);return n.unstable_suggestNes(u)}case ci.nes_close:{if(!n.unstable_closeNes)throw po.methodNotFound(c);let u=cZt.parse(l);return await n.unstable_closeNes(u)??{}}default:if(n.extMethod)return n.extMethod(c,l);throw po.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case ci.session_cancel:{let u=aZt.parse(l);return n.cancel(u)}case ci.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=hZt.parse(l);return n.unstable_didOpenDocument(u)}case ci.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=RZt.parse(l);return n.unstable_didChangeDocument(u)}case ci.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=fZt.parse(l);return n.unstable_didCloseDocument(u)}case ci.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=mZt.parse(l);return n.unstable_didSaveDocument(u)}case ci.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=pZt.parse(l);return n.unstable_didFocusDocument(u)}case ci.nes_accept:{if(!n.unstable_acceptNes)return;let u=sZt.parse(l);return n.unstable_acceptNes(u)}case ci.nes_reject:{if(!n.unstable_rejectNes)return;let u=_Zt.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw po.methodNotFound(c)}},"notificationHandler");this.connection=new Lrt(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(Cf.session_update,e)}requestPermission(e){return this.connection.sendRequest(Cf.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(Cf.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(Cf.fs_write_text_file,e,Aw)}createTerminal(e){return this.connection.sendRequest(Cf.terminal_create,e,r=>new UZt(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(Cf.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(Cf.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}},UZt=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(Cf.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(Cf.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(Cf.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},Aw)}release(){return this.connection.sendRequest(Cf.terminal_release,{sessionId:this.sessionId,terminalId:this.id},Aw)}async[Symbol.asyncDispose](){await this.release()}},Brt=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case Cf.fs_write_text_file:{let u=FZt.parse(l);return await n.writeTextFile?.(u)??{}}case Cf.fs_read_text_file:{let u=EZt.parse(l);return n.readTextFile?.(u)}case Cf.session_request_permission:{let u=NZt.parse(l);return n.requestPermission(u)}case Cf.terminal_create:{let u=uZt.parse(l);return n.createTerminal?.(u)}case Cf.terminal_output:{let u=wZt.parse(l);return n.terminalOutput?.(u)}case Cf.terminal_release:{let u=vZt.parse(l);return await n.releaseTerminal?.(u)??{}}case Cf.terminal_wait_for_exit:{let u=BZt.parse(l);return n.waitForTerminalExit?.(u)}case Cf.terminal_kill:{let u=AZt.parse(l);return await n.killTerminal?.(u)??{}}case Cf.elicitation_create:{if(!n.unstable_createElicitation)throw po.methodNotFound(c);let u=MZt.parse(l);return n.unstable_createElicitation(u)}default:if(n.extMethod)return n.extMethod(c,l);throw po.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case Cf.session_update:{let u=OZt.parse(l);return n.sessionUpdate(u)}case Cf.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=JJt.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw po.methodNotFound(c)}},"notificationHandler");this.connection=new Lrt(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,Aw)}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,Aw)}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,Aw)}unstable_setSessionModel(e){return this.connection.sendRequest(ci.session_set_model,e,Aw)}setSessionConfigOption(e){return this.connection.sendRequest(ci.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(ci.authenticate,e,Aw)}unstable_listProviders(e){return this.connection.sendRequest(ci.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(ci.providers_set,e,Aw)}unstable_disableProvider(e){return this.connection.sendRequest(ci.providers_disable,e,Aw)}unstable_logout(e){return this.connection.sendRequest(ci.logout,e,Aw)}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,Aw)}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}},Lrt=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 po)return n.toResult();if(n instanceof k.ZodError)return po.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 po.internalError(o?JSON.parse(o):{}).toResult()}catch{return po.internalError({details:o}).toResult()}}}async tryCallNotificationHandler(e,r){try{return await this.notificationHandler(e,r),{result:null}}catch(n){if(n instanceof po)return n.toResult();if(n instanceof k.ZodError)return po.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 po.internalError(o?JSON.parse(o):{}).toResult()}catch{return po.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 po(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 b2n(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?b2n(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}},po=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 Gve=require("node:stream");p();jo();p();var KC=class extends SY{constructor(r){super(new Kce,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}${Eus(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(Ke[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 Eus(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a(Eus,"camelCaseToSnakeCaseAllCaps");var _us="unknown-editor",S2n="unknown-editor-plugin",ej=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:_us,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:S2n,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}isEditorPluginInfoKnown(){return this._editorPluginInfo!==void 0&&this._editorPluginInfo.name!==S2n}};p();p();var Frt=new pe("agenticTurnProcessor"),BRe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Sc),this.chatFetcher=this.chatFetcher??new nc(e.ctx),this.turnSuggestions=new Sq(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new s0(e.ctx),this.hookTrigger=new Vue(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:uq.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 Zc(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!uvn(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),WI(this.turnContext.ctx,"customAgent.turn",h)}r.onCancellationRequested(async()=>{Frt.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let u=Xk().find(h=>h.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let f=(await Zx(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 AO(this.turnContext.ctx,m,h):await Ro.getModelConfigurationById(this.turnContext.ctx,h,this.conversation.id.toString(),gq(this.conversation.turns));Ro.applyModelConfigurationOverrides(this.turnContext.ctx,g,c),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(VC).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 fde(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 qq)Frt.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,h),this.turn.status="cancelled",await this.cancelProgress();else if(h instanceof Nc)Frt.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 Z3)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:{message:h.message,code:uq.ToolRoundExceedError,responseIsIncomplete:!0}});else if(h instanceof RA)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:h.conversationError});else throw Frt.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 mue(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=Aq(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=vXe(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=Hue(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 QZt="collect-context",qZt="generate-response",Urt=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Sc),this.chatFetcher=this.chatFetcher??new nc(e.ctx),this.postProcessor=new Cue(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new s0(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:uq.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 Zc(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=Xk().find(A=>A.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let d=(await Zx(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(QZt,"Collecting context"),await this.collectContext(n,r,l,this.strategy.uiKind,u,d);let f=c?.id,h=c?.providerName,m;h?m="customized":f?m=(await Ro.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),gq(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(QZt,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(QZt),await n.steps.start(qZt,"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 mue(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 Pq((E,_,v,b,T,w)=>{let R=E.trim(),x=R.match(Kxe)!==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=gZe(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 AO(this.turnContext.ctx,h,f):await Ro.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),Kvn(e));Ro.applyModelConfigurationOverrides(this.turnContext.ctx,m,c),e=Ro.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(VC).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:kn(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,kn(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",Hvn(this.turnContext.ctx,this.conversation,this.strategy.uiKind,kn(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=wxe(this.conversation,this.strategy.uiKind,kn(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=wxe(this.conversation,this.strategy.uiKind,kn(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(qZt,e.error.message):await r.steps.finish(qZt)}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=vXe(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=Hue(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();jo();p();var Szi=de(Kc()),Tzi=de(Bk());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 NA=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(T2n(e))}};function Oe(t,e){let r=Fu.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=T2n(r.Errors(s));return[null,{code:Ze.InvalidParams,message:c}]}return e(n,o,s)}}a(Oe,"addMethodHandlerValidation");function T2n(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(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: ${Array.from(t).map(r=>`- ${r.path}: ${r.message}`).join(` -`)}`}a(T2n,"createErrorMessage");p();p();p();p();function Qrt(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:yO(e)}:{}}}a(Qrt,"toAgentModelInfo");p();var I2n=new pe("BackgroundAgent.AuthBinding"),qrt=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(Ut).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 vus=new pe("BackgroundAgent.Attachments");function x2n(t,e){let r=[];for(let n of t){let o=Cus(n);o?r.push(o):vus.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(x2n,"convertReferencesToAttachments");function Cus(t){switch(t.type){case"file":{let e=ro(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=ro(t.uri).fsPath;return{type:"directory",path:e,displayName:e}}default:return null}}a(Cus,"convertReferenceToAttachment");p();function w2n(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(w2n,"routeInteraction");p();var R2n=new pe("BackgroundAgent.OTelEnv"),jZt=new Map,HZt=new Set;function jrt(t,e){process.env[t]||(jZt.has(t)||jZt.set(t,process.env[t]),process.env[t]=e,HZt.add(t))}a(jrt,"setEnvIfAbsent");function P2n(){for(let t of HZt){let e=jZt.get(t);e===void 0?delete process.env[t]:process.env[t]=e}HZt.clear()}a(P2n,"restoreOTelEnvironment");function k2n(t){if(!t.get(Pn).getCapabilities().agentDebugLog)return;process.env.COPILOT_OTEL_ENABLED&&process.env.COPILOT_OTEL_ENABLED!=="true"&&R2n.info(t,"COPILOT_OTEL_ENABLED already set by user, skipping OTel env setup",{value:process.env.COPILOT_OTEL_ENABLED}),jrt("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&&(jrt("COPILOT_OTEL_EXPORTER_TYPE","file"),jrt("COPILOT_OTEL_FILE_EXPORTER_PATH",process.platform==="win32"?"NUL":"/dev/null"),jrt("OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT","true")),R2n.info(t,"Applied OTel environment for SDK bridge",{userConfiguredOtlpEndpoint:e,userConfiguredFileExporter:r})}a(k2n,"applyOTelEnvironment");p();p();var I8n=de(require("crypto")),x8n=de(require("fs")),yot=de(S8n()),w8n=require("tls"),R8n=de(T8n());var Vfe=new pe("certificates"),lp=class{static{a(this,"RootCertificateReader")}};function Eot(t,e=process.platform){return new gnr(t,[new Anr,new ynr,vTs(t,e)])}a(Eot,"getRootCertificateReader");function vTs(t,e){switch(e){case"linux":return new Enr(t);case"darwin":return new _nr(t);case"win32":return new vnr(t);default:return new Cnr}}a(vTs,"createPlatformReader");var mnr=class extends lp{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 Vfe.warn(this.ctx,"Failed to read root certificates:",r),[]}}},gnr=class extends lp{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new mnr(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 Vfe.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&Vfe.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},Anr=class extends lp{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return w8n.rootCertificates}},ynr=class extends lp{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await P8n(e):[]}},Enr=class extends lp{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);Vfe.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},_nr=class extends lp{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=yot.get({excludeBundled:!1,format:yot.Format.pem});return Vfe.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},vnr=class extends lp{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=R8n.all();return Vfe.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},Cnr=class extends lp{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 x8n.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 tH=de(rcr());var icr=new pe("BackgroundAgent.ProxyEnv"),ocr=new Map,scr=new Set,i2e;function acr(){for(let t of scr){let e=ocr.get(t);e===void 0?delete process.env[t]:process.env[t]=e}scr.clear(),i2e&&((0,tH.setGlobalDispatcher)(i2e),i2e=void 0)}a(acr,"restoreProxyEnvironment");function ncr(t,e,r){process.env[t]||process.env[e]||(ocr.has(t)||ocr.set(t,process.env[t]),process.env[t]=r,scr.add(t))}a(ncr,"setEnvIfAbsent");function k3s(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(k3s,"buildProxyUrl");async function D3s(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(lp).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{icr.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(D3s,"buildTlsOptions");async function Aat(t){try{acr();let e=t.get(Mo).getHttpSettings();if(!e.proxy)return;let r=k3s(e.proxy,e.proxyAuthorization);ncr("HTTPS_PROXY","https_proxy",r),ncr("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&ncr("NO_PROXY","no_proxy",n),i2e||(i2e=(0,tH.getGlobalDispatcher)());let o=await D3s(t,e.proxyStrictSSL);(0,tH.setGlobalDispatcher)(new tH.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),icr.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,tH.getGlobalDispatcher)().constructor.name})}catch(e){icr.warn(t,"Failed to apply proxy settings to environment:",e)}}a(Aat,"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"],yat=["get_errors"],ccr=[...yat,"edit","str_replace_editor","apply_patch"],M3s=["ask","inline-ask","inline"];function Eat(t){return t!==void 0&&M3s.includes(t)}a(Eat,"isClampedChatMode");var O3s={ask:N3s,inline:ccr,"inline-ask":yat};async function r$n(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(r$n,"applyChatMode");p();var vT=de(require("node:path"));var o$n="copilot-language-server:inline-chat",B3s=["file","path","filePath","file_path"],L3s=new Set(["edit","create","str_replace_editor","write"]),F3s=new Set(["git_apply_patch"]),n$n=/^\*\*\* (?:Add File|Delete File|Update File|Move to): (.+)$/gm;function U3s(t){let e=vT.dirname(t);return{confinedFsPath:t,confinedName:vT.basename(t),baseDir:e,confinedComparable:lcr(t,e)}}a(U3s,"buildContext");function Q3s(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(Q3s,"parseToolArgs");function q3s(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(q3s,"extractApplyPatchBody");function j3s(t){if(!t.includes("*** Begin Patch"))return;let e=[];n$n.lastIndex=0;for(let r of t.matchAll(n$n)){let n=r[1].trim();n.length>0&&e.push(n)}return e}a(j3s,"extractApplyPatchPaths");function H3s(t){for(let e of B3s){let r=t[e];if(typeof r=="string"&&r.trim().length>0)return r}}a(H3s,"extractTargetPath");function lcr(t,e){let r=t.startsWith("file:")?gn(t):t,n=vT.isAbsolute(r)?vT.normalize(r):vT.resolve(e,r);return process.platform==="win32"||process.platform==="darwin"?n.toLowerCase():n}a(lcr,"toComparablePath");function i$n(t,e){return vT.isAbsolute(t)?vT.normalize(t):vT.resolve(e,t)}a(i$n,"resolveTargetPath");function G3s(t,e,r){if(F3s.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=q3s(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=j3s(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(lcr(c,r.baseDir)!==r.confinedComparable)return{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${i$n(c,r.baseDir)} (apply_patch header: ${c}).`};return{allowed:!0}}if(!L3s.has(t))return{allowed:!0};let n=H3s(Q3s(e));return n?lcr(n,r.baseDir)!==r.confinedComparable?{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${i$n(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(G3s,"evaluateWithContext");function s$n(t){let e=0;return{hook:{source:o$n,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(s$n,"createInlineTurnLimitHook");function a$n(t){let e=t.startsWith("file:")?gn(t):t,r=U3s(e);return{source:o$n,handler:a(n=>{let o=G3s(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(a$n,"createInlineEditConfinementHook");p();var ucr=de(require("fs"));var Mpe=new pe("BackgroundAgent.InlineFileContext"),$3s=50*1024,_at=100,V3s=.4,c$n=25;async function l$n(t,e,r){let n;try{n=ro(t).fsPath}catch{return Mpe.debug(r,`buildInlineFileContext: failed to parse URI ${t}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let o;try{o=await ucr.promises.stat(n)}catch{return Mpe.debug(r,`buildInlineFileContext: failed to stat ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let s=o.size>$3s,c;try{c=await ucr.promises.readFile(n,"utf-8")}catch{return Mpe.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(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=` Here is the current content of \`${n}\`: \`\`\` ${c} -\`\`\``,f=!0;else if(l)d=z3s(c,n,l),Mpe.debug(r,`buildInlineFileContext: cropped large file around selection: ${n}`);else if(u)d=Y3s(c,n,u),Mpe.debug(r,`buildInlineFileContext: cropped large file around cursor: ${n}`);else return Mpe.debug(r,`buildInlineFileContext: large file (${o.size} bytes), no cursor or selection: ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!0};if(l)d+=W3s(c,n,l);else if(u){let h=Math.min(u.line,c.split(` +\`\`\``,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(` `).length-1);d+=` -The cursor is at 1-based line ${h+1}.`}return{promptFragment:d,isFullContent:f,isLargeFile:s}}a(l$n,"buildInlineFileContext");function W3s(t,e,r){let n=t.split(` +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(` `),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(W3s,"buildSelectionFragment");function z3s(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-c$n),u=Math.min(o-1,c+c$n),f=n.slice(l,u+1).map((h,m)=>`${l+m+1} | ${h}`).join(` +\`\`\``}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(` `);return` Here is a portion of \`${e}\` (1-based lines ${l+1}-${u+1} of ${o}): \`\`\` ${f} -\`\`\``}a(z3s,"buildCropAroundSelectionFragment");function Y3s(t,e,r){let n=t.split(` -`),o=n.length,s=Math.min(r.line,o-1),c=Math.floor(_at*V3s),l=_at-c,u=Math.max(0,s-c),d=Math.min(o,s+l);u===0?d=Math.min(o,_at):d>=o&&(u=Math.max(0,o-_at));let h=n.slice(u,d).map((m,g)=>`${u+g+1} | ${m}`).join(` +\`\`\``}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(` `);return` Here is a portion of \`${e}\` (1-based lines ${u+1}-${d} of ${o}, cursor at line ${s+1}): \`\`\` ${h} -\`\`\``}a(Y3s,"buildCursorCropFragment");p();p();var u$n=require("node:crypto"),vat=de(require("node:fs")),qw=de(require("node:fs/promises")),d$n=require("node:os"),O5=de(require("node:path"));var WZ=new pe("BackgroundAgent.SandboxBinaryResolver");async function f$n(t){if(!process.env.MXC_BIN_DIR)try{let e=O5.join(__dirname,"node_modules","@github","copilot","mxc-bin");if(!vat.existsSync(e)){WZ.debug(t,`Local sandbox binaries not found at ${e}; sandbox will be unavailable`);return}if(!("pkg"in process)){process.env.MXC_BIN_DIR=e,WZ.debug(t,`Local sandbox binaries located; MXC_BIN_DIR=${e}`);return}let r=await J3s(t,e);r&&(process.env.MXC_BIN_DIR=r,WZ.debug(t,`Local sandbox binaries extracted; MXC_BIN_DIR=${r}`))}catch(e){WZ.warn(t,"Failed to resolve MXC_BIN_DIR for the local sandbox",{error:e instanceof Error?e.message:String(e)})}}a(f$n,"ensureSandboxBinDirEnv");function K3s(){switch(process.platform){case"win32":return"wxc-exec.exe";case"darwin":return"mxc-exec-mac";default:return"lxc-exec"}}a(K3s,"sandboxMainBinaryName");async function J3s(t,e){if(process.arch!=="x64"&&process.arch!=="arm64"){WZ.debug(t,`Local sandbox unsupported on architecture ${process.arch}; sandbox will be unavailable`);return}let r=process.arch,n=O5.join(e,r),o=K3s(),s=O5.join(n,o);if(!vat.existsSync(s)){WZ.warn(t,`Local sandbox binary ${r}/${o} not embedded; sandbox will be unavailable`);return}let c=(0,u$n.createHash)("sha256").update(await qw.readFile(s)).digest("hex"),l=process.env.PKG_NATIVE_CACHE_PATH||O5.join((0,d$n.homedir)(),".cache"),u=O5.join(l,"pkg",`mxc-bin-${c}`),d=O5.join(u,r),f=O5.join(d,".extraction-complete");if(vat.existsSync(f))return u;await qw.mkdir(d,{recursive:!0});let h=await qw.readdir(n,{withFileTypes:!0});for(let m of h){if(!m.isFile())continue;let g=O5.join(d,m.name);await qw.copyFile(O5.join(n,m.name),g),process.platform!=="win32"&&await qw.chmod(g,493).catch(A=>WZ.warn(t,`Failed to set executable permission for ${g}`,{error:A instanceof Error?A.message:String(A)}))}return await qw.writeFile(f,""),u}a(J3s,"extractSandboxBinDirFromPkg");p();function p$n(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(p$n,"setPermissionsRequired");function h$n(t,e){let r=t;return typeof r.setRemoteDelegate!="function"?!1:(r.setRemoteDelegate(e),!0)}a(h$n,"setRemoteDelegate");function dcr(t,e,r){let n=t;return typeof n.emit!="function"?!1:(n.emit(e,r),!0)}a(dcr,"emitSessionEvent");function fcr(t){let r=t.remote;if(!(!r||typeof r.enable!="function"||typeof r.disable!="function"))return r}a(fcr,"getRemoteHandle");function m$n(t){let e=t.AutoModeSessionManager;if(typeof e=="function")try{return new e}catch{return}}a(m$n,"createAutoModeSessionManager");function g$n(t){if(t)try{t.clear()}catch{}}a(g$n,"clearAutoModeManager");p();p();p();var Cat=require("fs"),bat=de(require("path"));var pcr=new pe("OtelSpanFilePersistence"),Z3s="debug.jsonl",CT=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=Ft(this.ctx,Ke.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=X3s(n);if(!o){pcr.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 Cat.promises.mkdir(bat.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` +\`\`\``}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(` `)+` -`;await Cat.promises.appendFile(s,c,{encoding:"utf8",mode:384})}catch(s){pcr.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 Cat.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"?[]:(pcr.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 bat.join(r,eFs(e),Z3s)}};function X3s(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(X3s,"conversationIdOf");function eFs(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(eFs,"sanitizeForPath");p();var tFs={0:1,1:2,2:3,3:4,4:5};function hcr(t){return String(BigInt(t[0])*BigInt(1e9)+BigInt(t[1]))}a(hcr,"hrTimeToNano");function A$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=>A$n(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a(A$n,"encodeAnyValue");function Sat(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=A$n(n);o!==void 0&&e.push({key:r,value:o})}return e}a(Sat,"encodeAttributes");function y$n(t){let e=t.spanContext(),r={traceId:e.traceId,spanId:e.spanId,name:t.name,kind:tFs[t.kind]??1,startTimeUnixNano:hcr(t.startTime),endTimeUnixNano:hcr(t.endTime),attributes:Sat(t.attributes),events:t.events.map(n=>({name:n.name,timeUnixNano:hcr(n.time),attributes:Sat(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(y$n,"encodeSpan");function rFs(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(rFs,"wrapInResourceSpans");function E$n(t,e){let r=rFs(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(E$n,"buildChatDebugLogExport");var h2e=new pe("OtelBridge"),zFs=1e3,m2e=class t{constructor(e){this.pending=[];this.flushTimer=null;this.disposed=!1;this.ctx=e,this.persistence=e.get(CT)}static{a(this,"BridgeSpanProcessor")}static installInto(e){try{let n=(lo(),_a(F5)).trace.getTracerProvider(),o=n._delegate??n,c=o._activeSpanProcessor?._spanProcessors;if(!Array.isArray(c)){let u=o?Object.keys(o).join(", "):"null";return h2e.warn(e,`Could not access SDK TracerProvider internals. delegate keys: [${u}]`),{installed:!1}}let l=new t(e);return c.push(l),h2e.info(e,`Bridge SpanProcessor installed (total processors=${c.length}).`),{installed:!0,processor:l}}catch(r){return h2e.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()},zFs)))}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(y$n)}catch(n){h2e.warn(this.ctx,`Failed to encode spans: ${String(n)}`);return}try{await this.persistence.appendSpans(r)}catch(n){h2e.warn(this.ctx,`Failed to persist otel spans: ${String(n)}`)}}};var xVn=require("node:module");var IVn=new pe("BackgroundAgent.ManagerLifecycle");async function YFs(){return"pkg"in process?(0,xVn.createRequire)(__filename)("./node_modules/@github/copilot/sdk/index.cjs"):import("@github/copilot/sdk")}a(YFs,"importSdk");var Fat=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(Pn).getCapabilities().agentDebugLog)return;let e=m2e.installInto(this.ctx);this.installedBridge=e.processor}clearAutoMode(){g$n(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)..."),k2n(this.ctx);let e=performance.now();try{this.sdk=await YFs(),yt(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-e})}catch(o){throw Zn(this.ctx,"backgroundAgent.importSdk",o,{status_text:"failure"},{duration_ms:performance.now()-e}),o}await f$n(this.ctx),await Aat(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=m$n(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 U5(t){try{return Ft(t,Ke.EnablePlugins)===!0}catch{return!1}}a(U5,"pluginsEnabled");var TT=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=U5(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 jl={ToolsListChanged:"tools/listChanged",ResourcesListChanged:"resources/listChanged",PromptsListChanged:"prompts/listChanged",LoggingMessage:"logging/message"};p();p();var Lcr;Lcr=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto);async function KFs(t){return(await Lcr).getRandomValues(new Uint8Array(t))}a(KFs,"getRandomValues");async function JFs(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await KFs(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await ZFs(t),r=await XFs(e);return{code_verifier:e,code_challenge:r}}a(Fcr,"pkceChallenge");p();var jw="2025-11-25";var Qat=[jw,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],iH="io.modelcontextprotocol/related-task",qat="2.0",d0=VJt(t=>t!==null&&(typeof t=="object"||typeof t=="function")),wVn=_l([Je(),wa().int()]),RVn=Je(),e0f=rm({ttl:wa().optional(),pollInterval:wa().optional()}),t8s=zr({ttl:wa().optional()}),r8s=zr({taskId:Je()}),Qcr=rm({progressToken:wVn.optional(),[iH]:r8s.optional()}),IT=zr({_meta:Qcr.optional()}),g2e=IT.extend({task:t8s.optional()}),PVn=a(t=>g2e.safeParse(t).success,"isTaskAugmentedRequestParams"),QA=zr({method:Je(),params:IT.loose().optional()}),Hw=zr({_meta:Qcr.optional()}),Gw=zr({method:Je(),params:Hw.loose().optional()}),qA=rm({_meta:Qcr.optional()}),jat=_l([Je(),wa().int()]),kVn=zr({jsonrpc:Gn(qat),id:jat,...QA.shape}).strict(),A2e=a(t=>kVn.safeParse(t).success,"isJSONRPCRequest"),DVn=zr({jsonrpc:Gn(qat),...Gw.shape}).strict(),NVn=a(t=>DVn.safeParse(t).success,"isJSONRPCNotification"),qcr=zr({jsonrpc:Gn(qat),id:jat,result:qA}).strict(),XZ=a(t=>qcr.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 jcr=zr({jsonrpc:Gn(qat),id:jat.optional(),error:zr({code:wa().int(),message:Je(),data:rd().optional()})}).strict();var MVn=a(t=>jcr.safeParse(t).success,"isJSONRPCErrorResponse");var oH=_l([kVn,DVn,qcr,jcr]),t0f=_l([qcr,jcr]),eX=qA.strict(),n8s=Hw.extend({requestId:jat.optional(),reason:Je().optional()}),Hat=Gw.extend({method:Gn("notifications/cancelled"),params:n8s}),i8s=zr({src:Je(),mimeType:Je().optional(),sizes:Fr(Je()).optional(),theme:z_(["light","dark"]).optional()}),y2e=zr({icons:Fr(i8s).optional()}),Upe=zr({name:Je(),title:Je().optional()}),OVn=Upe.extend({...Upe.shape,...y2e.shape,version:Je(),websiteUrl:Je().optional(),description:Je().optional()}),o8s=PRe(zr({applyDefaults:tl().optional()}),vl(Je(),rd())),s8s=Rrt(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,PRe(zr({form:o8s.optional(),url:d0.optional()}),vl(Je(),rd()).optional())),a8s=rm({list:d0.optional(),cancel:d0.optional(),requests:rm({sampling:rm({createMessage:d0.optional()}).optional(),elicitation:rm({create:d0.optional()}).optional()}).optional()}),c8s=rm({list:d0.optional(),cancel:d0.optional(),requests:rm({tools:rm({call:d0.optional()}).optional()}).optional()}),l8s=zr({experimental:vl(Je(),d0).optional(),sampling:zr({context:d0.optional(),tools:d0.optional()}).optional(),elicitation:s8s.optional(),roots:zr({listChanged:tl().optional()}).optional(),tasks:a8s.optional(),extensions:vl(Je(),d0).optional()}),u8s=IT.extend({protocolVersion:Je(),capabilities:l8s,clientInfo:OVn}),d8s=QA.extend({method:Gn("initialize"),params:u8s});var f8s=zr({experimental:vl(Je(),d0).optional(),logging:d0.optional(),completions:d0.optional(),prompts:zr({listChanged:tl().optional()}).optional(),resources:zr({subscribe:tl().optional(),listChanged:tl().optional()}).optional(),tools:zr({listChanged:tl().optional()}).optional(),tasks:c8s.optional(),extensions:vl(Je(),d0).optional()}),Hcr=qA.extend({protocolVersion:Je(),capabilities:f8s,serverInfo:OVn,instructions:Je().optional()}),BVn=Gw.extend({method:Gn("notifications/initialized"),params:Hw.optional()}),LVn=a(t=>BVn.safeParse(t).success,"isInitializedNotification"),Gat=QA.extend({method:Gn("ping"),params:IT.optional()}),p8s=zr({progress:wa(),total:Eu(wa()),message:Eu(Je())}),h8s=zr({...Hw.shape,...p8s.shape,progressToken:wVn}),$at=Gw.extend({method:Gn("notifications/progress"),params:h8s}),m8s=IT.extend({cursor:RVn.optional()}),E2e=QA.extend({params:m8s.optional()}),_2e=qA.extend({nextCursor:RVn.optional()}),g8s=z_(["working","input_required","completed","failed","cancelled"]),v2e=zr({taskId:Je(),status:g8s,ttl:_l([wa(),brt()]),createdAt:Je(),lastUpdatedAt:Je(),pollInterval:Eu(wa()),statusMessage:Eu(Je())}),tX=qA.extend({task:v2e}),A8s=Hw.merge(v2e),C2e=Gw.extend({method:Gn("notifications/tasks/status"),params:A8s}),Vat=QA.extend({method:Gn("tasks/get"),params:IT.extend({taskId:Je()})}),Wat=qA.merge(v2e),zat=QA.extend({method:Gn("tasks/result"),params:IT.extend({taskId:Je()})}),r0f=qA.loose(),Yat=E2e.extend({method:Gn("tasks/list")}),Kat=_2e.extend({tasks:Fr(v2e)}),Jat=QA.extend({method:Gn("tasks/cancel"),params:IT.extend({taskId:Je()})}),FVn=qA.merge(v2e),UVn=zr({uri:Je(),mimeType:Eu(Je()),_meta:vl(Je(),rd()).optional()}),QVn=UVn.extend({text:Je()}),Gcr=Je().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),qVn=UVn.extend({blob:Gcr}),b2e=z_(["user","assistant"]),Qpe=zr({audience:Fr(b2e).optional(),priority:wa().min(0).max(1).optional(),lastModified:kde.datetime({offset:!0}).optional()}),jVn=zr({...Upe.shape,...y2e.shape,uri:Je(),description:Eu(Je()),mimeType:Eu(Je()),size:Eu(wa()),annotations:Qpe.optional(),_meta:Eu(rm({}))}),y8s=zr({...Upe.shape,...y2e.shape,uriTemplate:Je(),description:Eu(Je()),mimeType:Eu(Je()),annotations:Qpe.optional(),_meta:Eu(rm({}))}),E8s=E2e.extend({method:Gn("resources/list")}),$cr=_2e.extend({resources:Fr(jVn)}),_8s=E2e.extend({method:Gn("resources/templates/list")}),Vcr=_2e.extend({resourceTemplates:Fr(y8s)}),Wcr=IT.extend({uri:Je()}),v8s=Wcr,C8s=QA.extend({method:Gn("resources/read"),params:v8s}),zcr=qA.extend({contents:Fr(_l([QVn,qVn]))}),WF=Gw.extend({method:Gn("notifications/resources/list_changed"),params:Hw.optional()}),b8s=Wcr,S8s=QA.extend({method:Gn("resources/subscribe"),params:b8s}),T8s=Wcr,I8s=QA.extend({method:Gn("resources/unsubscribe"),params:T8s}),x8s=Hw.extend({uri:Je()}),Ycr=Gw.extend({method:Gn("notifications/resources/updated"),params:x8s}),w8s=zr({name:Je(),description:Eu(Je()),required:Eu(tl())}),R8s=zr({...Upe.shape,...y2e.shape,description:Eu(Je()),arguments:Eu(Fr(w8s)),_meta:Eu(rm({}))}),P8s=E2e.extend({method:Gn("prompts/list")}),Kcr=_2e.extend({prompts:Fr(R8s)}),k8s=IT.extend({name:Je(),arguments:vl(Je(),Je()).optional()}),D8s=QA.extend({method:Gn("prompts/get"),params:k8s}),Jcr=zr({type:Gn("text"),text:Je(),annotations:Qpe.optional(),_meta:vl(Je(),rd()).optional()}),Zcr=zr({type:Gn("image"),data:Gcr,mimeType:Je(),annotations:Qpe.optional(),_meta:vl(Je(),rd()).optional()}),Xcr=zr({type:Gn("audio"),data:Gcr,mimeType:Je(),annotations:Qpe.optional(),_meta:vl(Je(),rd()).optional()}),N8s=zr({type:Gn("tool_use"),name:Je(),id:Je(),input:vl(Je(),rd()),_meta:vl(Je(),rd()).optional()}),M8s=zr({type:Gn("resource"),resource:_l([QVn,qVn]),annotations:Qpe.optional(),_meta:vl(Je(),rd()).optional()}),O8s=jVn.extend({type:Gn("resource_link")}),elr=_l([Jcr,Zcr,Xcr,O8s,M8s]),B8s=zr({role:b2e,content:elr}),tlr=qA.extend({description:Je().optional(),messages:Fr(B8s)}),zF=Gw.extend({method:Gn("notifications/prompts/list_changed"),params:Hw.optional()}),L8s=zr({title:Je().optional(),readOnlyHint:tl().optional(),destructiveHint:tl().optional(),idempotentHint:tl().optional(),openWorldHint:tl().optional()}),F8s=zr({taskSupport:z_(["required","optional","forbidden"]).optional()}),HVn=zr({...Upe.shape,...y2e.shape,description:Je().optional(),inputSchema:zr({type:Gn("object"),properties:vl(Je(),d0).optional(),required:Fr(Je()).optional()}).catchall(rd()),outputSchema:zr({type:Gn("object"),properties:vl(Je(),d0).optional(),required:Fr(Je()).optional()}).catchall(rd()).optional(),annotations:L8s.optional(),execution:F8s.optional(),_meta:vl(Je(),rd()).optional()}),U8s=E2e.extend({method:Gn("tools/list")}),rlr=_2e.extend({tools:Fr(HVn)}),sH=qA.extend({content:Fr(elr).default([]),structuredContent:vl(Je(),rd()).optional(),isError:tl().optional()}),n0f=sH.or(qA.extend({toolResult:rd()})),Q8s=g2e.extend({name:Je(),arguments:vl(Je(),rd()).optional()}),q8s=QA.extend({method:Gn("tools/call"),params:Q8s}),YF=Gw.extend({method:Gn("notifications/tools/list_changed"),params:Hw.optional()}),GVn=zr({autoRefresh:tl().default(!0),debounceMs:wa().int().nonnegative().default(300)}),$Vn=z_(["debug","info","notice","warning","error","critical","alert","emergency"]),j8s=IT.extend({level:$Vn}),H8s=QA.extend({method:Gn("logging/setLevel"),params:j8s}),G8s=Hw.extend({level:$Vn,logger:Je().optional(),data:rd()}),rX=Gw.extend({method:Gn("notifications/message"),params:G8s}),$8s=zr({name:Je().optional()}),V8s=zr({hints:Fr($8s).optional(),costPriority:wa().min(0).max(1).optional(),speedPriority:wa().min(0).max(1).optional(),intelligencePriority:wa().min(0).max(1).optional()}),W8s=zr({mode:z_(["auto","required","none"]).optional()}),z8s=zr({type:Gn("tool_result"),toolUseId:Je().describe("The unique identifier for the corresponding tool call."),content:Fr(elr).default([]),structuredContent:zr({}).loose().optional(),isError:tl().optional(),_meta:vl(Je(),rd()).optional()}),Y8s=xrt("type",[Jcr,Zcr,Xcr]),Uat=xrt("type",[Jcr,Zcr,Xcr,N8s,z8s]),K8s=zr({role:b2e,content:_l([Uat,Fr(Uat)]),_meta:vl(Je(),rd()).optional()}),J8s=g2e.extend({messages:Fr(K8s),modelPreferences:V8s.optional(),systemPrompt:Je().optional(),includeContext:z_(["none","thisServer","allServers"]).optional(),temperature:wa().optional(),maxTokens:wa().int(),stopSequences:Fr(Je()).optional(),metadata:d0.optional(),tools:Fr(HVn).optional(),toolChoice:W8s.optional()}),S2e=QA.extend({method:Gn("sampling/createMessage"),params:J8s}),nlr=qA.extend({model:Je(),stopReason:Eu(z_(["endTurn","stopSequence","maxTokens"]).or(Je())),role:b2e,content:Y8s}),ilr=qA.extend({model:Je(),stopReason:Eu(z_(["endTurn","stopSequence","maxTokens","toolUse"]).or(Je())),role:b2e,content:_l([Uat,Fr(Uat)])}),Z8s=zr({type:Gn("boolean"),title:Je().optional(),description:Je().optional(),default:tl().optional()}),X8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),minLength:wa().optional(),maxLength:wa().optional(),format:z_(["email","uri","date","date-time"]).optional(),default:Je().optional()}),e6s=zr({type:z_(["number","integer"]),title:Je().optional(),description:Je().optional(),minimum:wa().optional(),maximum:wa().optional(),default:wa().optional()}),t6s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),enum:Fr(Je()),default:Je().optional()}),r6s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),oneOf:Fr(zr({const:Je(),title:Je()})),default:Je().optional()}),n6s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),enum:Fr(Je()),enumNames:Fr(Je()).optional(),default:Je().optional()}),i6s=_l([t6s,r6s]),o6s=zr({type:Gn("array"),title:Je().optional(),description:Je().optional(),minItems:wa().optional(),maxItems:wa().optional(),items:zr({type:Gn("string"),enum:Fr(Je())}),default:Fr(Je()).optional()}),s6s=zr({type:Gn("array"),title:Je().optional(),description:Je().optional(),minItems:wa().optional(),maxItems:wa().optional(),items:zr({anyOf:Fr(zr({const:Je(),title:Je()}))}),default:Fr(Je()).optional()}),a6s=_l([o6s,s6s]),c6s=_l([n6s,i6s,a6s]),l6s=_l([c6s,Z8s,X8s,e6s]),u6s=g2e.extend({mode:Gn("form").optional(),message:Je(),requestedSchema:zr({type:Gn("object"),properties:vl(Je(),l6s),required:Fr(Je()).optional()})}),d6s=g2e.extend({mode:Gn("url"),message:Je(),elicitationId:Je(),url:Je().url()}),f6s=_l([u6s,d6s]),T2e=QA.extend({method:Gn("elicitation/create"),params:f6s}),p6s=Hw.extend({elicitationId:Je()}),h6s=Gw.extend({method:Gn("notifications/elicitation/complete"),params:p6s}),olr=qA.extend({action:z_(["accept","decline","cancel"]),content:Rrt(t=>t===null?void 0:t,vl(Je(),_l([Je(),wa(),tl(),Fr(Je())])).optional())}),m6s=zr({type:Gn("ref/resource"),uri:Je()});var g6s=zr({type:Gn("ref/prompt"),name:Je()}),A6s=IT.extend({ref:_l([g6s,m6s]),argument:zr({name:Je(),value:Je()}),context:zr({arguments:vl(Je(),Je()).optional()}).optional()}),y6s=QA.extend({method:Gn("completion/complete"),params:A6s});var slr=qA.extend({completion:rm({values:Fr(Je()).max(100),total:Eu(wa().int()),hasMore:Eu(tl())})}),E6s=zr({uri:Je().startsWith("file://"),name:Je().optional(),_meta:vl(Je(),rd()).optional()}),alr=QA.extend({method:Gn("roots/list"),params:IT.optional()}),_6s=qA.extend({roots:Fr(E6s)}),v6s=Gw.extend({method:Gn("notifications/roots/list_changed"),params:Hw.optional()}),i0f=_l([Gat,d8s,y6s,H8s,D8s,P8s,E8s,_8s,C8s,S8s,I8s,q8s,U8s,Vat,zat,Yat,Jat]),o0f=_l([Hat,$at,BVn,v6s,C2e]),s0f=_l([eX,nlr,ilr,olr,_6s,Wat,Kat,tX]),a0f=_l([Gat,S2e,T2e,alr,Vat,zat,Yat,Jat]),c0f=_l([Hat,$at,rX,Ycr,WF,YF,zF,C2e,h6s]),l0f=_l([eX,Hcr,slr,tlr,Kcr,$cr,Vcr,zcr,sH,rlr,Wat,Kat,tX]),Fn=class t extends Error{static{a(this,"McpError")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===ei.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Ucr(o.elicitations,r)}return new t(e,r,n)}},Ucr=class extends Fn{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 jA=vJt().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:WJt.custom,message:"URL must be parseable",fatal:!0}),Hwe}).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"}),WVn=rm({resource:Je().url(),authorization_servers:Fr(jA).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:tl().optional(),authorization_details_types_supported:Fr(Je()).optional(),dpop_signing_alg_values_supported:Fr(Je()).optional(),dpop_bound_access_tokens_required:tl().optional()}),clr=rm({issuer:Je(),authorization_endpoint:jA,token_endpoint:jA,registration_endpoint:jA.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:jA.optional(),revocation_endpoint:jA.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:tl().optional()}),C6s=rm({issuer:Je(),authorization_endpoint:jA,token_endpoint:jA,userinfo_endpoint:jA.optional(),jwks_uri:jA,registration_endpoint:jA.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:tl().optional(),request_parameter_supported:tl().optional(),request_uri_parameter_supported:tl().optional(),require_request_uri_registration:tl().optional(),op_policy_uri:jA.optional(),op_tos_uri:jA.optional(),client_id_metadata_document_supported:tl().optional()}),zVn=zr({...C6s.shape,...clr.pick({code_challenge_methods_supported:!0}).shape}),YVn=zr({access_token:Je(),id_token:Je().optional(),token_type:Je(),expires_in:kRe.number().optional(),scope:Je().optional(),refresh_token:Je().optional()}).strip(),KVn=zr({error:Je(),error_description:Je().optional(),error_uri:Je().optional()}),VVn=jA.optional().or(Gn("").transform(()=>{})),b6s=zr({redirect_uris:Fr(jA),token_endpoint_auth_method:Je().optional(),grant_types:Fr(Je()).optional(),response_types:Fr(Je()).optional(),client_name:Je().optional(),client_uri:jA.optional(),logo_uri:VVn,scope:Je().optional(),contacts:Fr(Je()).optional(),tos_uri:VVn,policy_uri:Je().optional(),jwks_uri:jA.optional(),jwks:FJt().optional(),software_id:Je().optional(),software_version:Je().optional(),software_statement:Je().optional()}).strip(),S6s=zr({client_id:Je(),client_secret:Je().optional(),client_id_issued_at:wa().optional(),client_secret_expires_at:wa().optional()}).strip(),JVn=b6s.merge(S6s),p0f=zr({error:Je(),error_description:Je().optional()}).strip(),h0f=zr({token:Je(),token_type_hint:Je().optional()}).strip();p();function ZVn(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(ZVn,"resourceUrlFromServerUrl");function XVn({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(M6s,"shouldAttemptFallback");async function O6s(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??jw,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 tWn(c,s,r);if(!n?.metadataUrl&&M6s(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await tWn(u,s,r)}return l}a(O6s,"discoverMetadataWithFallback");function B6s(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(B6s,"buildDiscoveryUrls");async function iWn(t,{fetchFn:e=fetch,protocolVersion:r=jw}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=B6s(t);for(let{url:s,type:c}of o){let l=await plr(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"?clr.parse(await l.json()):zVn.parse(await l.json())}}}a(iWn,"discoverAuthorizationServerMetadata");async function L6s(t,e){let r,n;try{r=await nWn(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 iWn(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a(L6s,"discoverOAuthServerInfo");async function F6s(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(llr))throw new Error(`Incompatible auth server: does not support response type ${llr}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(ulr))throw new Error(`Incompatible auth server: does not support code challenge method ${ulr}`)}else l=new URL("/authorize",t);let u=await Fcr(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",llr),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",ulr),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(F6s,"startAuthorization");function U6s(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a(U6s,"prepareAuthorizationCodeRequest");async function oWn(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=I6s(n,f);x6s(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await rWn(d);return YVn.parse(await d.json())}a(oWn,"executeTokenRequest");async function Q6s(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 oWn(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(Q6s,"refreshAuthorization");async function q6s(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=U6s(o,d,t.redirectUrl)}let u=await t.clientInformation();return oWn(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(q6s,"fetchToken");async function j6s(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 rWn(c);return JVn.parse(await c.json())}a(j6s,"registerClient");p();p();p();p();function jpe(t){return!!t._zod}a(jpe,"isZ4Schema");function I2(t,e){return jpe(t)?bde(t,e):t.safeParse(e)}a(I2,"safeParse");function Zat(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(Zat,"getObjectShape");function sWn(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(sWn,"getLiteralValue");p();function aH(t){return t==="completed"||t==="failed"||t==="cancelled"}a(aH,"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 Jgf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function hlr(t){let r=Zat(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=sWn(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(hlr,"getMethodLiteral");function mlr(t,e){let r=I2(t,e);if(!r.success)throw r.error;return r.data}a(mlr,"parseWithCompat");var z6s=6e4,Xat=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(Hat,r=>{this._oncancel(r)}),this.setNotificationHandler($at,r=>{this._onprogress(r)}),this.setRequestHandler(Gat,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Vat,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Fn(ei.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(zat,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new Fn(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new Fn(ei.InvalidParams,`Task not found: ${s}`);if(!aH(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(aH(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[iH]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(Yat,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new Fn(ei.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Jat,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Fn(ei.InvalidParams,`Task not found: ${r.params.taskId}`);if(aH(o.status))throw new Fn(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 Fn(ei.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Fn?o:new Fn(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),Fn.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),XZ(s)||MVn(s)?this._onresponse(s):A2e(s)?this._onrequest(s,c):NVn(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=Fn.fromError(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?.[iH]?.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=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 Fn(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),XZ(e))n(e);else{let c=new Fn(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(XZ(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),XZ(e))o(e);else{let c=Fn.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof Fn?c:new Fn(ei.InternalError,String(c))}}return}let s;try{let c=await this.request(e,tX,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Fn(ei.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},aH(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Fn(ei.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Fn(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 Fn?c:new Fn(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||{},[iH]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(new Error(`Failed to send cancellation: ${T}`)));let b=v instanceof Fn?v:new Fn(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=I2(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??z6s,E=a(()=>A(Fn.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},Wat,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},Kat,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},FVn,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||{},[iH]: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||{},[iH]: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||{},[iH]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=hlr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=mlr(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=hlr(e);this._notificationHandlers.set(n,o=>{let s=mlr(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"&&A2e(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Fn(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 Fn(ei.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Fn(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 Fn(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=C2e.parse({method:"notifications/tasks/status",params:l});await this.notification(u),aH(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new Fn(ei.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(aH(l.status))throw new Fn(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=C2e.parse({method:"notifications/tasks/status",params:u});await this.notification(d),aH(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function aWn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(aWn,"isPlainObject");function cWn(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];aWn(c)&&aWn(s)?r[o]={...c,...s}:r[o]=s}return r}a(cWn,"mergeCapabilities");p();var XYn=de(tdr(),1),eKn=de(ZYn(),1);function Jjs(){let t=new XYn.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,eKn.default)(t),t}a(Jjs,"createDefaultAjvInstance");var Mct=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??Jjs()}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 Oct=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=sH,n){let o=this._client,s={...n,task:n?.task??(o.isToolTask(e.name)?{}:void 0)},c=o.requestStream({method:"tools/call",params:e},r,s),l=o.getToolOutputValidator(e.name);for await(let u of c){if(u.type==="result"&&l){let d=u.result;if(!d.structuredContent&&!d.isError){yield{type:"error",error:new Fn(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 Fn(ei.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Fn){yield{type:"error",error:f};return}yield{type:"error",error:new Fn(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 tKn(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(tKn,"assertToolsCallTaskCapability");function rKn(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(rKn,"assertClientRequestTaskCapability");function Bct(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&&Bct(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&Bct(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&Bct(r,e)}}a(Bct,"applyElicitationDefaults");function Zjs(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(Zjs,"getSupportedElicitationModes");var gH=class extends Xat{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 Mct,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",YF,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",zF,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",WF,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Oct(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=cWn(this._capabilities,e)}setRequestHandler(e,r){let o=Zat(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=I2(T2e,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Fn(ei.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=Zjs(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Fn(ei.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Fn(ei.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=I2(tX,A);if(!v.success){let b=v.error instanceof Error?v.error.message:String(v.error);throw new Fn(ei.InvalidParams,`Invalid task creation result: ${b}`)}return v.data}let y=I2(olr,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Fn(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{Bct(_,E.content)}catch{}return E},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=I2(S2e,u);if(!f.success){let E=f.error instanceof Error?f.error.message:String(f.error);throw new Fn(ei.InvalidParams,`Invalid sampling request: ${E}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let E=I2(tX,m);if(!E.success){let _=E.error instanceof Error?E.error.message:String(E.error);throw new Fn(ei.InvalidParams,`Invalid task creation result: ${_}`)}return E.data}let A=h.tools||h.toolChoice?ilr:nlr,y=I2(A,m);if(!y.success){let E=y.error instanceof Error?y.error.message:String(y.error);throw new Fn(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:jw,capabilities:this._capabilities,clientInfo:this._clientInfo}},Hcr,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!Qat.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){tKn(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&rKn(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},eX,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},slr,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},eX,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},tlr,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Kcr,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},$cr,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},Vcr,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},zcr,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},eX,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},eX,r)}async callTool(e,r=sH,n){if(this.isToolTaskRequired(e.name))throw new Fn(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 Fn(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 Fn(ei.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Fn?c:new Fn(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},rlr,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=GVn.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 Lct=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 ldr(t){}a(ldr,"noop");function Fct(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=ldr,onError:r=ldr,onRetry:n=ldr,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let E=c?y.replace(/^\xEF\xBB\xBF/,""):y,[_,v]=Xjs(`${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 Lct(`Invalid \`retry\` value: "${E}"`,{type:"invalid-retry",value:E,line:_}));break;default:r(new Lct(`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(Fct,"createParser");function Xjs(t){let e=[],r="",n=0;for(;n0)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(;n{throw TypeError(t)},"__typeError"),ydr=a((t,e,r)=>e.has(t)||oKn("Cannot "+r),"__accessCheck"),Xs=a((t,e,r)=>(ydr(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),f0=a((t,e,r)=>e.has(t)?oKn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),jd=a((t,e,r,n)=>(ydr(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),n8=a((t,e,r)=>(ydr(t,e,"access private method"),r),"__privateMethod"),vb,yX,ahe,Uct,qct,gDe,uhe,ADe,AH,che,dhe,lhe,hDe,D2,ddr,fdr,pdr,iKn,hdr,mdr,mDe,gdr,Adr,EX=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),f0(this,D2),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,f0(this,vb),f0(this,yX),f0(this,ahe),f0(this,Uct),f0(this,qct),f0(this,gDe),f0(this,uhe),f0(this,ADe,null),f0(this,AH),f0(this,che),f0(this,dhe,null),f0(this,lhe,null),f0(this,hDe,null),f0(this,fdr,async s=>{var c;Xs(this,che).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){n8(this,D2,mDe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?jd(this,ahe,new URL(s.url)):jd(this,ahe,void 0),d!==200){n8(this,D2,mDe).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){n8(this,D2,mDe).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(Xs(this,vb)===this.CLOSED)return;jd(this,vb,this.OPEN);let h=new Event("open");if((c=Xs(this,hDe))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){n8(this,D2,mDe).call(this,"Invalid response body, expected a web ReadableStream",d),this.close();return}let m=new TextDecoder,g=l.getReader(),A=!0;do{let{done:y,value:E}=await g.read();E&&Xs(this,che).feed(m.decode(E,{stream:!y})),y&&(A=!1,Xs(this,che).reset(),n8(this,D2,gdr).call(this))}while(A)}),f0(this,pdr,s=>{jd(this,AH,void 0),!(s.name==="AbortError"||s.type==="aborted")&&n8(this,D2,gdr).call(this,udr(s))}),f0(this,hdr,s=>{typeof s.id=="string"&&jd(this,ADe,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:Xs(this,ahe)?Xs(this,ahe).origin:Xs(this,yX).origin,lastEventId:s.id||""});Xs(this,lhe)&&(!s.event||s.event==="message")&&Xs(this,lhe).call(this,c),this.dispatchEvent(c)}),f0(this,mdr,s=>{jd(this,gDe,s)}),f0(this,Adr,()=>{jd(this,uhe,void 0),Xs(this,vb)===this.CONNECTING&&n8(this,D2,ddr).call(this)});try{if(e instanceof URL)jd(this,yX,e);else if(typeof e=="string")jd(this,yX,new URL(e,tHs()));else throw new Error("Invalid URL")}catch{throw eHs("An invalid or illegal string was specified")}jd(this,che,Fct({onEvent:Xs(this,hdr),onRetry:Xs(this,mdr)})),jd(this,vb,this.CONNECTING),jd(this,gDe,3e3),jd(this,qct,(n=r?.fetch)!=null?n:globalThis.fetch),jd(this,Uct,(o=r?.withCredentials)!=null?o:!1),n8(this,D2,ddr).call(this)}get readyState(){return Xs(this,vb)}get url(){return Xs(this,yX).href}get withCredentials(){return Xs(this,Uct)}get onerror(){return Xs(this,dhe)}set onerror(e){jd(this,dhe,e)}get onmessage(){return Xs(this,lhe)}set onmessage(e){jd(this,lhe,e)}get onopen(){return Xs(this,hDe)}set onopen(e){jd(this,hDe,e)}addEventListener(e,r,n){let o=r;super.addEventListener(e,o,n)}removeEventListener(e,r,n){let o=r;super.removeEventListener(e,o,n)}close(){Xs(this,uhe)&&clearTimeout(Xs(this,uhe)),Xs(this,vb)!==this.CLOSED&&(Xs(this,AH)&&Xs(this,AH).abort(),jd(this,vb,this.CLOSED),jd(this,AH,void 0))}};vb=new WeakMap,yX=new WeakMap,ahe=new WeakMap,Uct=new WeakMap,qct=new WeakMap,gDe=new WeakMap,uhe=new WeakMap,ADe=new WeakMap,AH=new WeakMap,che=new WeakMap,dhe=new WeakMap,lhe=new WeakMap,hDe=new WeakMap,D2=new WeakSet,ddr=a(function(){jd(this,vb,this.CONNECTING),jd(this,AH,new AbortController),Xs(this,qct)(Xs(this,yX),n8(this,D2,iKn).call(this)).then(Xs(this,fdr)).catch(Xs(this,pdr))},"connect_fn"),fdr=new WeakMap,pdr=new WeakMap,iKn=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Xs(this,ADe)?{"Last-Event-ID":Xs(this,ADe)}:void 0},cache:"no-store",signal:(t=Xs(this,AH))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),hdr=new WeakMap,mdr=new WeakMap,mDe=a(function(t,e){var r;Xs(this,vb)!==this.CLOSED&&jd(this,vb,this.CLOSED);let n=new Qct("error",{code:e,message:t});(r=Xs(this,dhe))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),gdr=a(function(t,e){var r;if(Xs(this,vb)===this.CLOSED)return;jd(this,vb,this.CONNECTING);let n=new Qct("error",{code:e,message:t});(r=Xs(this,dhe))==null||r.call(this,n),this.dispatchEvent(n),jd(this,uhe,setTimeout(Xs(this,Adr),Xs(this,gDe)))},"scheduleReconnect_fn"),Adr=new WeakMap,EX.CONNECTING=0,EX.OPEN=1,EX.CLOSED=2;function tHs(){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(tHs,"getBaseURL");p();function fhe(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(fhe,"normalizeHeaders");function jct(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{...fhe(e.headers),...fhe(n.headers)}:e.headers};return t(r,o)}:t}a(jct,"createFetchWithInit");var yDe=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},phe=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=jct(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new HA("No auth provider");let e;try{e=await JF(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 HA;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=fhe(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 EX(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}=qpe(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 yDe(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=oH.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 HA("No auth provider");if(await JF(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new HA("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}=qpe(o);if(this._resourceMetadataUrl=c,this._scope=l,await JF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new HA;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 Hct=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=Fct({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 rHs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Yw=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},hhe=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=jct(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??rHs}async _authThenStart(){if(!this._authProvider)throw new HA("No auth provider");let e;try{e=await JF(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 HA;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=fhe(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 Yw(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 Hct({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=oH.parse(JSON.parse(g.data));XZ(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 HA("No auth provider");if(await JF(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new HA("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:A2e(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 Yw(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=qpe(l);if(this._resourceMetadataUrl=g,this._scope=A,await JF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new HA;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=qpe(l);if(y==="insufficient_scope"){let E=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new Yw(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=E??void 0,await JF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new HA;return this.send(e)}}throw new Yw(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),LVn(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=>oH.parse(A)):[oH.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new Yw(-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 Yw(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 cKn=require("events");var mhe=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},EDe=class{constructor(e){this._transport=null;this._emitter=new cKn.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 gH({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=nHs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!sKn(l))throw l}}throw sKn(n)?new mhe: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 phe(r,aKn(this._options.sseOptions,e)):new hhe(r,aKn(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(YF,()=>{this._emitter.emit(jl.ToolsListChanged)}),this._client.setNotificationHandler(WF,()=>{this._emitter.emit(jl.ResourcesListChanged)}),this._client.setNotificationHandler(zF,()=>{this._emitter.emit(jl.PromptsListChanged)}),this._client.setNotificationHandler(rX,o=>{this._emitter.emit(jl.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 sKn(t){if(t instanceof HA)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(sKn,"isUnauthorized");function nHs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof Yw||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(nHs,"httpFallbackCode");function aKn(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(aKn,"withBearer");p();function Gct(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(Gct,"isJsonRpcRequest");function lKn(t){return typeof t=="object"&&t!==null&&t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}a(lKn,"isJsonRpcNotification");var Jw={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603},Kw=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 N2=class{static{a(this,"McpRuntimeNotifier")}},$ct=class extends N2{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var sr=new pe("CopilotMCP");async function Edr(t,e){await t.get(N2).notifyLog(e)}a(Edr,"notifyMCPRuntimeLog");async function p0(t,e){await Edr(t,{...e,level:"error"})}a(p0,"notifyMCPRuntimeError");async function _X(t,e){await Edr(t,{...e,level:"warning"})}a(_X,"notifyMCPRuntimeWarning");async function ac(t,e){await Edr(t,{...e,level:"info"})}a(ac,"notifyMCPRuntimeInfo");p();async function vX(t,e,r,n,o){return await t.get(tr).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(vX,"fetchOauthServer");async function _dr(t){try{return await t.text()}catch{return t.statusText}}a(_dr,"getErrText");p();var uKn="/.well-known",vdr=`${uKn}/oauth-protected-resource`,dKn=`${uKn}/oauth-authorization-server`,fKn=" ";function pKn(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a(pKn,"isAuthorizationProtectedResourceMetadata");function hKn(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(hKn,"isAuthorizationServerMetadata");function Vct(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(Vct,"parseWWWAuthenticateHeader");function mKn(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(mKn,"getMetadataWithDefaultValues");function gKn(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(gKn,"getDefaultMetadataForUrl");function AKn(t){let e=new URL(t);if(!e.pathname.startsWith(vdr))throw new Error(`Invalid discovery URL: expected path to start with ${vdr}`);let r=e.pathname.substring(vdr.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(AKn,"getResourceServerBaseUrlFromDiscoveryUrl");function yKn(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(yKn,"isAuthorizationDynamicClientRegistrationResponse");function Wct(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a(Wct,"isAuthorizationTokenResponse");function Cdr(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(eVt(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(eVt(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(Cdr,"getClaimsFromJWT");var bdr=class{static{a(this,"AuthMetadata")}},ghe=class extends bdr{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=mKn(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=gKn(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 vX(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}=Vct(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 vX(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":jw});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await _dr(c)}`);let l=await c.json();if(pKn(l)){let u=AKn(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(dKn,e).toString()+o,c=await vX(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":jw});if(c.status!==200&&(c=await vX(this.ctx,Ia(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":jw}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await _dr(c)}`);let l=await c.json();if(hKn(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var Cb=class{static{a(this,"McpAuthService")}};var $5=new pe("mcpGateway");async function EKn(t,e,r){$5.info(t,`OAuth discovery: probing ${e}`);try{let n=await new ghe(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return $5.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),yt(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){$5.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),Zn(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(EKn,"discoverAuthMetadata");async function zct(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=vKn(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return yt(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return yt(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(zct,"acquireSilent");async function _Kn(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=iHs(t),d=vKn(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"){$5.warn(t,`mount '${o}': user cancelled the account selection`),yt(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){$5.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),yt(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}yt(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){$5.error(t,`mount '${o}': failed during account selection`,h),Zn(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"){$5.warn(t,`mount '${o}': user declined OAuth confirmation`),yt(t,"mcpGateway.oauth.interactive",{result:"declined"});return}yt(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){$5.error(t,`mount '${o}': failed to show auth confirmation`,f),Zn(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||$5.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}.`),yt(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){$5.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)}`),Zn(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(_Kn,"acquireInteractive");function iHs(t){try{return t.get(_s)}catch{return}}a(iHs,"tryGetNotificationSender");function vKn(t){try{return t.get(Cb)}catch{return}}a(vKn,"tryGetMcpAuthService");p();var M2=new pe("mcpGateway"),vDe="Copilot MCP Gateway",CDe="0.1.0",_De=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(jl.ToolsListChanged,this._onToolsListChanged),this._invoker.on(jl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(jl.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(jl.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(cjs,"splitLines");var Dct=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(OYn(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e(OYn(this),r)}};function ljs(t){let e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}a(ljs,"syntaxError");function Xur(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(Xur).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${Xur(t.cause)}`:t.message:`${t}`}a(Xur,"flattenError");function OYn(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}a(OYn,"inspectableError");var BYn=a(t=>{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 + +`),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(` +`));return[`Here are nested ${e} files that contain additional agent instructions.`,...n].join(` -`),this._sseClients.add(e),M2.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),M2.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)Gct(o)?n.push(await this._dispatchRequest(o)):lKn(o)?this._dispatchNotification(o):M2.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0,M2.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(jl.ToolsListChanged,this._onToolsListChanged),this._invoker.off(jl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(jl.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(jl.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){M2.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 Kw?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(M2.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:Jw.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 Kw(Jw.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 Kw(Jw.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&&Qat.includes(n)?n:jw;return M2.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&M2.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:vDe,version:CDe}}}_handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Kw(Jw.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 Kw(Jw.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Kw(Jw.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 Kw(Jw.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new Kw(Jw.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){M2.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,M2.info(this._ctx,`[session ${this.id}] initialized`))}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){M2.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 CKn(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(CKn,"isInitializeMessage");p();p();var fJn=de(uJn(),1),Jct=de(require("node:process"),1),pJn=require("node:stream");p();var Kct=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),kHs(r)}clear(){this._buffer=void 0}};function kHs(t){return oH.parse(JSON.parse(t))}a(kHs,"deserializeMessage");function dJn(t){return JSON.stringify(t)+` -`}a(dJn,"serializeMessage");var DHs=Jct.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 DHs){let r=Jct.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(NHs,"getDefaultEnvironment");var Ehe=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new Kct,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new pJn.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,fJn.default)(this._serverParams.command,this._serverParams.args??[],{env:{...NHs(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:Jct.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=dJn(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var hJn=require("child_process"),mJn=require("events"),gJn=require("util");var Ndr=1e4,MHs=(0,gJn.promisify)(hJn.exec),bDe=class{constructor(e){this._transport=null;this._emitter=new mJn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new gH({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 Ehe(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(YF,()=>{this._emitter.emit(jl.ToolsListChanged)}),this._client.setNotificationHandler(WF,()=>{this._emitter.emit(jl.ResourcesListChanged)}),this._client.setNotificationHandler(zF,()=>{this._emitter.emit(jl.PromptsListChanged)}),this._client.setNotificationHandler(rX,n=>{this._emitter.emit(jl.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),Ndr))]),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 MHs(`taskkill /pid ${o} /t /f`,{timeout:Ndr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,Ndr));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 cm=class{static{a(this,"AuthenticationService")}};var xT=new pe("mcpGateway.manager"),EH=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},OHs={tools:[],resources:[],resourceTemplates:[],prompts:[]},WA=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())FHs(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(yH(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=yH(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=BHs(n),c=s!==this._lastUserHash;c&&(await this._applyScope({kind:"user"},n),this._lastUserHash=s),await this._applyScope({kind:"project",workspaceFolder:r},o),yt(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=QHs(l,u);if(!d){o.push(l);continue}n.set(yH({source:e,name:l}),{classified:d,hash:AJn(u)})}o.length>0&&xT.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries in ${UHs(e)}: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)LHs(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(V5(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=yH(e),o=this._entries.get(n);if(!o)throw new EH("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new EH("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new EH("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(V5(n.key.source));return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(V5(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(yH(e),o),o}async _removeEntry(e){let r=this._entries.get(e);if(!r)return;let n=V5(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(V5(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 xT.error(this._ctx,`failed to register mount for '${r.key.name}'`,o),o}if(r.invoker!==n){this._service.unregisterMount(yH(r.key)),await n.stop().catch(()=>{});return}if(await this._refreshContents(r).catch(o=>{xT.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(o)}`)}),r.invoker!==n)return;this._sender.serversChanged(V5(r.key.source)),this._sender.serverDetailsChanged(r.key)}catch(o){if(r.invoker!==n){await n.stop().catch(()=>{});return}o instanceof mhe?(r.status="unauthorized",r.error=void 0,xT.warn(this._ctx,`server '${r.key.name}' requires authorization`)):(r.status="error",r.error=o instanceof Error?o.message:String(o),xT.error(this._ctx,`server '${r.key.name}' failed to start`,o)),await n.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged(V5(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(yH(e.key)),this._sender.serversChanged(V5(e.key.source)),n&&await n.stop().catch(o=>{xT.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(jl.ToolsListChanged,n.toolsChanged),r.on(jl.ResourcesListChanged,n.resourcesChanged),r.on(jl.PromptsListChanged,n.promptsChanged),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(jl.ToolsListChanged,n.toolsChanged),r.off(jl.ResourcesListChanged,n.resourcesChanged),r.off(jl.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){xT.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=yH(e.key),o=e.key.name;return r.kind==="stdio"?new bDe({id:n,label:o,params:r.params,clientInfo:{name:vDe,version:CDe}}):new EDe({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:vDe,version:CDe},authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:s})=>{xT.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${s}, falling back to legacy SSE`),yt(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(s)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(cm)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await EKn(this._ctx,r,n);if(!s){xT.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await zct(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){xT.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 zct(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 zct(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 _Kn(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(V5(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=>xT.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){xT.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){xT.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged(V5(e.key.source))}};function yH(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(yH,"serializeKey");function AJn(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(AJn,"canonicalEntryHash");function BHs(t){let e=Object.keys(t).sort(),r={};for(let n of e)r[n]=AJn(t[n]);return JSON.stringify(r)}a(BHs,"canonicalConfigHash");function V5(t){return t.kind==="project"?{kind:"project",workspaceFolder:t.workspaceFolder}:{kind:"user"}}a(V5,"notificationScopeFor");function LHs(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(LHs,"sameScope");function FHs(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(FHs,"entryInScope");function UHs(t){switch(t.kind){case"user":return"user";case"project":return`project<${t.workspaceFolder}>`;case"plugin":return`plugin<${t.pluginId}>`}}a(UHs,"describeScope");function QHs(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(QHs,"classifyEntry");p();var Mdr=require("crypto"),yJn=require("events"),EJn=de(require("http"));var _H=new pe("mcpGateway"),qHs="mcp-session-id",jHs=1024*1024,HHs=5e3,_Jn={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},CX={MountsChanged:"mountsChanged"},vH=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new yJn.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,_H.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),yt(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(CX.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=_Jn.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,Mdr.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 _H.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),yt(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(CX.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),_H.info(this._ctx,`unregistered mount '${n.label}' (${e})`),yt(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(CX.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=EJn.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")),HHs);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),_H.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){_H.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:Jw.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){_H.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(!CKn(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,Mdr.randomUUID)(),c=new _De(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&_H.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),_H.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(Gct)}_getSessionId(e){let r=e.headers[qHs];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>jHs)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 Odr=new pe("BackgroundAgent.McpSync"),Zct=class{constructor(e,r){this.ctx=e;this.registry=r;this.syncScheduled=!1;try{let n=e.get(TT);this.host=n,this.mountsChangedListener=()=>this.schedule(),n.service.on(CX.MountsChanged,this.mountsChangedListener)}catch(n){if(!(n instanceof hu))throw n}}static{a(this,"McpSync")}dispose(){this.host&&this.mountsChangedListener&&(this.host.service.off(CX.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(TT)}catch(r){r instanceof hu||Odr.warn(this.ctx,"Failed to read MCP gateway host for active-session sync",{error:r instanceof Error?r.message:String(r)});return}Odr.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){Odr.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:c instanceof Error?c.message:String(c)})}}))}};p();p();var Xct="/agents/sessions",elt=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(Xct),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 vJn(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(`${Xct}/${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 vJn(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(`${Xct}/${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(`${Xct}/${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 vJn(t){try{return await t.text()}catch{return""}}a(vJn,"safeReadText");p();p();var tlt=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 GHs=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 CJn(t){return!(!t.type||GHs.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(CJn,"shouldForwardMissionControlEvent");function Bdr(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a(Bdr,"getMissionControlEventData");function bJn(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(bJn,"maybeAcknowledgeMissionControlCommandFromEvent");var IJn=require("node:crypto");var $Hs=500,VHs=3e3,WHs=1e4,zHs=500,SDe=2e3,YHs=256,SJn=80,rlt=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new tlt({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 cEn(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await lEn(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=JHs(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: ${bX(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: ${bX(A)}`)}try{dcr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!0})}catch(A){o.warn(s,`sdk.emit(remote_steerable_changed=true) failed: ${bX(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}`))},$Hs),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},VHs),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{dcr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!1})}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`sdk.emit(remote_steerable_changed=false) failed: ${bX(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(!CJn(r))return;bJn(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:Bdr(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",Bdr(r))),e.eventBuffer.length>SDe&&e.eventBuffer.splice(0,e.eventBuffer.length-SDe)}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=KHs(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>=YHs){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>SDe&&e.eventBuffer.splice(0,e.eventBuffer.length-SDe);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=WHs;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,zHs);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<=SDe&&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: ${bX(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=TJn(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}): ${bX(c)}`)}return}case"ask_user_response":{let n=TJn(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}): ${bX(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 TJn(t){try{return JSON.parse(t)}catch{return}}a(TJn,"safeJsonParse");function bX(t){return t instanceof Error?t.message:String(t)}a(bX,"errMsg");function KHs(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>SJn?e.slice(0,SJn-1).trimEnd()+"\u2026":e:""}a(KHs,"deriveTitleFromMessage");function JHs(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(JHs,"toVscodeUriShape");var Ldr=new pe("BackgroundAgent.RemoteController"),nlt=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 elt(this.ctx,Ldr,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new rlt(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:Ldr,ctx:this.ctx,injectUserMessage:a((l,u,d)=>this.deps.injectUserMessage(l,u,d),"injectUserMessage")});if(!h$n(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=fcr(r);if(!n)throw new Error("Remote steering not supported by this SDK version");return n.enable()}async disableForSession(e){let r=fcr(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){Ldr.warn(this.ctx,"Mission Control deleteSession failed during destroySession",{sessionId:e,error:n instanceof Error?n.message:String(n)})}this.delegates.delete(e)}}async getMissionControlApiBase(){let n=(await this.ctx.get(Ut).getToken()).endpoints.api;if(!n)throw new Error("Copilot API endpoint not available");return n}async getGithubAccessToken(){let e=await this.ctx.get(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 Fdr=new pe("BackgroundAgent.CustomAgents");async function ilt(t,e){try{if(Ft(t,Ke.EnableCustomAgents)===!1)return Fdr.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get(Yp).listCustomAgents([e],{includePlugins:!0});return o.length>0&&Fdr.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>ZHs(s))}catch(r){return Fdr.warn(t,"Failed to load custom agents:",r),[]}}a(ilt,"loadCustomAgents");function ZHs(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(ZHs,"toSweCustomAgent");p();var Udr=new pe("BackgroundAgent.Hooks"),Qdr="copilot-language-server";function xJn(t,e){return{preToolUse:[XHs(t,e)],postToolUse:[eGs(t,e)],userPromptSubmitted:[tGs(t,e)]}}a(xJn,"buildSessionHooks");function XHs(t,e){return{source:Qdr,handler:a(async r=>{try{let o=await t.get(cE).hook(t,t2,{timestamp:r.timestamp,cwd:gn(e.uri),toolName:r.toolName,toolArgs:TDe(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===$ue.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){Udr.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(XHs,"createPreToolUseHandler");function eGs(t,e){return{source:Qdr,handler:a(async r=>{try{await t.get(cE).hook(t,e2,{timestamp:r.timestamp,cwd:gn(e.uri),toolName:r.toolName,toolArgs:TDe(r.toolArgs),toolResult:{resultType:qdr(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){Udr.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(eGs,"createPostToolUseHandler");function tGs(t,e){return{source:Qdr,handler:a(async r=>{try{await t.get(cE).hook(t,r2,{timestamp:r.timestamp,cwd:gn(e.uri),prompt:r.prompt},e);return}catch(n){Udr.error(t,"Failed to execute UserPromptSubmitted hook",n);return}},"handler")}}a(tGs,"createUserPromptSubmittedHandler");function TDe(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(TDe,"safeStringifyToolArgs");function qdr(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a(qdr,"toClsToolResultType");p();var rGs=["model-agents-md","cwd-model-agents-md"],nGs=["model-claude-md","cwd-model-claude-md"],iGs="nested-agents";function RJn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of rGs)e.add(r);if(t.useClaudeMdFile===!1)for(let r of nGs)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(iGs),e}a(RJn,"computeDisabledInstructionSources");var oGs=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),sGs=2,wJn="CLAUDE.md";function aGs(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(aGs,"joinPath");async function cGs(t,e){let r=[],n=a(async(o,s)=>{let c;try{c=await t(aGs(e,o))}catch{return}for(let[l,u]of c){let d=(u&1)!==0,f=(u&2)!==0;d&&l===wJn&&o.length>0?r.push([...o,wJn].join("/")):f&&s{let n=r.lastIndexOf("/"),o=n===-1?".":r.slice(0,n);return`| ${o}/ | '${r}' | Agent instructions for ${o}/**/* |`})].join(` -`)}a(lGs,"buildNestedClaudeInstructionsSection");async function PJn(t,e){let r=await cGs(t,e);return lGs(r)}a(PJn,"scanNestedClaudeInstructions");function kJn(t){let e=[];if(t.gitCommitInstructions&&e.push(t.gitCommitInstructions),t.globalAgentsMdInstructions&&e.push(t.globalAgentsMdInstructions),t.globalClaudeMdInstructions&&e.push(t.globalClaudeMdInstructions),t.nestedClaudeInstructions&&e.push(t.nestedClaudeInstructions),e.length!==0)return e.join(` +`)}a(_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(kJn,"composeBackgroundAgentSystemMessage");p();p();p();p();var IDe=(n=>(n.Copilot="copilot",n.Claude="claude",n.OpenPlugin="openPlugin",n))(IDe||{});var SX=(n=>(n.GitHubShorthand="githubShorthand",n.GitUri="gitUri",n.LocalFileUri="localFileUri",n))(SX||{});p();p();var TX=require("fs"),_he=de(require("path"));var uGs=32,dGs=5e3,fGs=5*1024*1024,pGs=32,hGs=jen(pGs);async function wT(t,e){return hGs.run(()=>WL(t(),dGs,e))}a(wT,"boundedFsOp");async function jdr(t){let e=await wT(()=>TX.promises.stat(t),void 0);if(e)return{path:t,isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:!1}}a(jdr,"statEntry");async function xDe(t){let e=await wT(()=>TX.promises.readdir(t,{withFileTypes:!0}),void 0);return e?gx(e,uGs,async r=>{let n=_he.join(t,r.name);if(r.isSymbolicLink()){let o=await jdr(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(xDe,"readChildren");var DJn=process.platform==="linux";function vE(t,e){let r=DJn?t:t.toLowerCase(),n=DJn?e:e.toLowerCase(),o=_he.relative(r,n);return o===""||!o.startsWith("..")&&!_he.isAbsolute(o)}a(vE,"isAtOrUnder");async function Zw(t,e){if(t===void 0)return!0;let r=await wT(()=>TX.promises.realpath(e),void 0);return r!==void 0&&vE(t,r)}a(Zw,"withinRealBoundary");async function IX(t){if(t!==void 0)return wT(()=>TX.promises.realpath(t),t)}a(IX,"resolveRealBoundary");async function olt(t){let e=await wT(()=>TX.promises.stat(t),void 0);if(!(!e||!e.isFile()||e.size>fGs))return wT(()=>TX.promises.readFile(t,"utf8"),void 0)}a(olt,"readTextFileCapped");var NJn=require("fs"),Hdr=de(require("path"));function RT(t){let e=t.replace(/[\\/:*?"<>|]/g,"_");return/^\.+$/.test(e)?e.replace(/\./g,"_"):e}a(RT,"sanitizeCacheSegment");function vhe(t){return t?[`ref_${encodeURIComponent(t)}`]:[]}a(vhe,"refCacheSegment");function slt(t,e){return e?[`sha_${encodeURIComponent(e)}`]:vhe(t)}a(slt,"gitRevisionCacheSuffix");function MJn(t,e,r){try{let n=new URL(t),o=RT((n.host||"unknown").toLowerCase()),s=n.pathname.replace(/\/+/g,"/").replace(/^\/+/,"").replace(/\/+$/g,"").replace(/\.git$/i,""),c=s?s.split("/").map(RT):[];return[o,...c,...slt(e,r)]}catch{return["git",RT(t),...slt(e,r)]}}a(MJn,"gitUrlToCacheSegments");async function Hd(t){return wT(()=>NJn.promises.stat(t).then(()=>!0,()=>!1),!1)}a(Hd,"exists");function wDe(t,e){let r=Hdr.join(t,...e);if(!vE(t,r))throw new Error(`plugin cache path escapes the cache root: ${e.join("/")}`);return r}a(wDe,"joinCacheSegments");function RDe(t,e){if(!e)return t;let r=e.trim().replace(/^\.?\/+|\/+$/g,"");if(!r)return t;let n=Hdr.join(t,r);return vE(t,n)?n:t}a(RDe,"joinContained");var alt=require("node:url");function OJn(t){let e=new Map;for(let r of t){let n=PT(r);n&&!e.has(n.canonicalId)&&e.set(n.canonicalId,n)}return[...e.values()]}a(OJn,"parseMarketplaceReferences");function PT(t){let e=t.trim();if(e)return gGs(e)??AGs(e)??mGs(e)}a(PT,"parseMarketplaceReference");function mGs(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:LJn(r,n,o),cacheSegments:["github.com",RT(r),RT(n),...vhe(o)],kind:"githubShorthand",ref:o,githubRepo:`${r}/${n}`}}a(mGs,"parseShorthandMarketplaceReference");function gGs(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,alt.fileURLToPath)(e)}catch{return}return{rawValue:t,displayLabel:y,cloneUrl:t,canonicalId:`file:${(0,alt.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=yGs(e),s=e.host.toLowerCase(),c=RT(s),l=e.pathname.replace(/\/+/g,"/").replace(/\/+$/g,"").replace(/^\/+/,"");if(!l)return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:Gdr(`git:${s}/`,n),cacheSegments:[c,...vhe(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(RT),m=d?l.toLowerCase():`${l.toLowerCase()}${u}`,g=BJn(s,f),A=FJn(g,n,`git:${s}/${m}`);return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:A,cacheSegments:[c,...h,...vhe(n)],kind:"gitUri",ref:n,githubRepo:g}}a(gGs,"parseUriMarketplaceReference");function AGs(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(RT),f=BJn(o,u),h=FJn(f,c,`git:${o.toLowerCase()}/${l.toLowerCase()}`);return{rawValue:t,displayLabel:t,cloneUrl:`${n}@${o}:${l}`,canonicalId:h,cacheSegments:[RT(o.toLowerCase()),...d,...vhe(c)],kind:"gitUri",ref:c,githubRepo:f}}a(AGs,"parseScpMarketplaceReference");function yGs(t){if(!t.hash)return t.toString();let e=new URL(t.toString());return e.hash="",e.toString()}a(yGs,"refStrippedUrl");function BJn(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(BJn,"extractGitHubRepo");function LJn(t,e,r){return Gdr(`github:${t.toLowerCase()}/${e.toLowerCase()}`,r)}a(LJn,"getGitHubCanonicalId");function FJn(t,e,r){if(t){let[n,o]=t.split("/");return LJn(n,o,e)}return Gdr(r,e)}a(FJn,"gitCanonicalId");function Gdr(t,e){return e?`${t}#${encodeURIComponent(e)}`:t}a(Gdr,"appendRefSuffix");p();p();p();p();function UJn(t,e){return/^~(?=$|[/\\])/.test(t)?e+t.slice(1):t}a(UJn,"untildify");var EGs=200;function clt(t,e){return $dr(t,e,new Set,0)}a(clt,"cloneAndChange");function $dr(t,e,r,n){if(t==null)return t;let o=e(t);if(o!==void 0)return o;if(n>=EGs)throw new Error("Cannot clone: structure nested too deeply");if(Array.isArray(t))return t.map(s=>$dr(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]=$dr(t[c],e,r,n+1);return r.delete(t),s}return t}a($dr,"cloneAndChangeInner");function PDe(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(PDe,"toStringRecord");var llt=de(require("path"));var vGs=/[\s&|<>()^;!`"'$]/;function CGs(t){return t.replace(/(\\*)("|$)/g,(e,r,n)=>r+r+(n?'\\"':""))}a(CGs,"escapeWindowsDoubleQuoted");function bGs(t,e,r){if(!t.includes(r))return t;if(!vGs.test(e))return t.replaceAll(r,e);let n=process.platform==="win32",o=new RegExp(`(["']?)${aoe(r)}([\\w./\\\\~:@-]*)`,"g");return t.replace(o,(s,c,l)=>{let u=e+l;if(c==="'")return c+u.replace(/'/g,"'\\''");let d=n?CGs(u):u.replace(/([\\"$`])/g,"\\$&");return c?c+d:'"'+d+'"'})}a(bGs,"shellQuotePluginRootInCommand");var SGs={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 TGs(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=PDe(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(TGs,"normalizeHookCommand");function QJn(t,e){let r=TGs(t);if(!r)return;let n,o=typeof t.cwd=="string"?t.cwd:void 0;if(o){let s=UJn(o,e);n=llt.isAbsolute(s)?llt.normalize(s):s}return{...r,...n!==void 0&&{cwd:n}}}a(QJn,"resolveHookCommand");function IGs(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=QJn(s,e);c&&n.push(c)}}else{let s=QJn(r,e);s&&n.push(s)}return n}a(IGs,"extractHookCommands");function Wdr(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=SGs[l];if(!u)continue;let d=s[l];if(!Array.isArray(d))continue;let f=[];for(let h of d)f.push(...IGs(h,r));f.length>0&&c.push({type:u,hooks:f,uri:t,originalId:l})}return c}a(Wdr,"parseHooksJson");function Vdr(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]=bGs(f,c,o))}(!u.env||typeof u.env!="object")&&(u.env={}),u.env[s]=c},"mutateHookCommand");try{let u=clt(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 Vdr(u,o,c),Wdr(t,u,n)}catch{return[]}}a(zdr,"interpolateHookPluginRoot");p();var sfr=require("fs");ofr();function BDe(t){try{return ifr(t)}catch{return}}a(BDe,"parseJsonc");async function LDe(t,e){let r=await wT(()=>sfr.promises.stat(t),void 0);if(!r||!r.isFile()||e!==void 0&&r.size>e)return;let n=await wT(()=>sfr.promises.readFile(t,"utf8"),void 0);if(n!==void 0)return BDe(n)}a(LDe,"readJsoncFile");var CH=de(require("path"));var WGs={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 Wdr(t,e,n)}},zGs={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 zdr(t,e,r,n,"${CLAUDE_PLUGIN_ROOT}","CLAUDE_PLUGIN_ROOT")}},YGs={format:2,manifestPath:".plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${PLUGIN_ROOT}",pluginRootEnvVar:"PLUGIN_ROOT",parseHooks(t,e,r,n){return zdr(t,e,r,n,"${PLUGIN_ROOT}","PLUGIN_ROOT")}};async function ZJn(t){return await Hd(CH.join(t,".plugin","plugin.json"))?YGs:t.split(/[/\\]/).includes(".claude")||await Hd(CH.join(t,".claude-plugin","plugin.json"))?zGs:WGs}a(ZJn,"detectPluginFormat");async function XJn(t,e,r){let n=await IX(r);for(let o of[e.manifestPath,...e.altManifestPaths??[]]){let s=CH.join(t,o);if(!await Zw(n,s))continue;let c=await olt(s),l=c===void 0?void 0:BDe(c);if(l&&typeof l=="object"&&!Array.isArray(l))return{manifest:l,manifestUri:s}}}a(XJn,"readPluginManifest");function eZn(t){return[t.hookConfigPath,...t.altHookConfigPaths??[]]}a(eZn,"defaultHookConfigPaths");var afr={paths:[],exclusive:!1};function The(t){if(t==null)return afr;if(typeof t=="string"){let e=t.trim();return e?{paths:[e],exclusive:!1}:afr}if(Array.isArray(t))return{paths:JJn(t),exclusive:!1};if(typeof t=="object"){let e=t;if(Array.isArray(e.paths))return{paths:JJn(e.paths),exclusive:e.exclusive===!0}}return afr}a(The,"parseComponentPathConfig");function JJn(t){return t.filter(e=>typeof e=="string").map(e=>e.trim()).filter(e=>e.length>0)}a(JJn,"cleanPaths");function mlt(t,e,r,n){let o=n&&vE(n,t)?n:t,s=[];r.exclusive||s.push(CH.join(t,e));for(let c of r.paths){let l=CH.normalize(CH.join(t,c));vE(o,l)&&s.push(l)}return s}a(mlt,"resolveComponentDirs");p();p();var DT=de(require("path"));var KGs=new hO,glt=16,tZn=".md",JGs=[".instructions.md",".mdc",".md"];async function ZGs(t){let e=DT.basename(t).replace(/(\.agent)?\.md$/i,"");return rZn(t,e)}a(ZGs,"parseAgentFile");async function XGs(t){return rZn(t,DT.basename(DT.dirname(t)))}a(XGs,"parseSkillFile");async function rZn(t,e){let r=await olt(t);if(r===void 0)return{name:e};try{let n=KGs.parse(t,r).header,o=n?.name?.trim()||e,s=n?.description?.trim();return{name:o,...s&&{description:s}}}catch{return{name:e}}}a(rZn,"readNameDescription");async function nZn(t,e,r){let n=await IX(r),s=(await gx(e,glt,async d=>{if(!await Zw(n,d))return[];let f=DT.join(d,"SKILL.md");if(await Hd(f)&&await Zw(n,f))return[f];let h=(await xDe(d)).filter(g=>g.isDirectory);return h.sort((g,A)=>g.path.localeCompare(A.path)),(await gx(h,glt,async g=>{if(g.isSymlink&&!await Zw(n,g.path))return;let A=DT.join(g.path,"SKILL.md");if(!(!await Hd(A)||!await Zw(n,A)))return A})).filter(g=>g!==void 0)})).flat();if(s.length===0){let d=DT.join(t,"SKILL.md");await Hd(d)&&await Zw(n,d)&&s.push(d)}let c=await gx(s,glt,async d=>({uri:d,...await XGs(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(nZn,"readSkills");async function iZn(t,e,r){let n=await IX(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 Zw(n,l))continue;let u=await jdr(l);if(!u)continue;if(u.isFile){c(l);continue}if(!u.isDirectory)continue;let d=await xDe(l);d.sort((f,h)=>f.path.localeCompare(h.path));for(let f of d)f.isFile&&(f.isSymlink&&!await Zw(n,f.path)||c(f.path))}return s.sort((l,u)=>l.name.localeCompare(u.name)),s}a(iZn,"scanComponentFiles");function e$s(t){return DT.extname(t).toLowerCase()===tZn?DT.basename(t).slice(0,-tZn.length):void 0}a(e$s,"getMarkdownComponentName");function cfr(t,e){return iZn(t,e$s,e)}a(cfr,"readMarkdownComponents");async function oZn(t,e){let r=await cfr(t,e);if(r.length===0)return r;let n=await gx(r,glt,async c=>{let{name:l,description:u}=await ZGs(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(oZn,"readAgentComponents");function t$s(t){let e=DT.basename(t),r=e.toLowerCase(),n=JGs.find(o=>r.endsWith(o));return n?e.slice(0,-n.length):void 0}a(t$s,"getInstructionFileName");function sZn(t,e){return iZn(t,t$s,e)}a(sZn,"readInstructionComponents");p();function r$s(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(r$s,"resolveMcpServersMap");function n$s(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=PDe(e.env,!0),u=r(e.envFile),d=r(e.cwd),f=PDe(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(n$s,"normalizeMcpServerConfiguration");function i$s(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(i$s,"interpolateMcpPluginRoot");var o$s=/\$\{(?![A-Za-z]+:)([A-Z_][A-Z0-9_]*)\}/g;function s$s(t){return clt(t,e=>{if(typeof e=="string"){let r=e.replace(o$s,"${env:$1}");return r!==e?r:void 0}})}a(s$s,"convertBareEnvVarsToVsCodeSyntax");function lfr(t,e,r,n){let o=r$s(e);if(!o)return[];let s=[];for(let[c,l]of Object.entries(o)){let u=n$s(l);if(!u)continue;let d={name:c,configuration:u,uri:t};n.pluginRootToken&&n.pluginRootEnvVar&&(d=i$s(d,r,n.pluginRootToken,n.pluginRootEnvVar)),d=s$s(d),s.push(d)}return s}a(lfr,"parseMcpServerDefinitionMap");p();var RX=require("fs"),bb=de(require("path"));var dfr=".copilot",ffr="installed-plugins",ZRf=bb.join(dfr,ffr),aZn="config.json",Alt=5e3,ylt=16,pfr=5*1024*1024;async function Ihe(t){return wT(()=>t().then(e=>({ok:!0,value:e}),e=>({ok:!1,code:e.code??"error"})),{ok:!1,code:"timeout"})}a(Ihe,"boundedFsResult");function ufr(t){return t==="ENOENT"||t==="ENOTDIR"}a(ufr,"isAbsentCode");async function cZn(t){let e=await Ihe(()=>RX.promises.stat(bb.dirname(t)));return e.ok&&e.value.isDirectory()}a(cZn,"parentDirSurvives");async function hfr(t){let e=await Ihe(()=>RX.promises.stat(t));return e.ok||e.code!=="ENOENT"?!1:cZn(t)}a(hfr,"isDefinitivelyGone");var a$s={name:"marketplace",discover:l$s},c$s={name:"copilotCli",discover:u$s,changeSignal:{dir:a(t=>t.copilotHome,"dir"),files:new Set([aZn]),createDir:!1,listing:a(t=>d$s(t.copilotHome),"listing")}},xhe=[a$s,c$s];async function lZn(t){let e=await Promise.all(xhe.map(o=>o.discover(t))),r=new Set,n=[];for(let o of e)for(let s of o){let c=M_(s.fsPath);r.has(c)||(r.add(c),n.push(s))}return n}a(lZn,"discoverPlugins");async function l$s(t){return(await gx(t.installed,ylt,async r=>{let n;if(bb.isAbsolute(r.pluginUri))n=r.pluginUri;else{let u=bb.resolve(t.sharedContentDir,r.pluginUri);if(!vE(t.sharedContentDir,u))return;n=u}let o=await Ihe(()=>RX.promises.stat(n));if(o.ok){if(!o.value.isDirectory())return}else if(o.code==="ENOENT"&&await cZn(n))return;let s=PT(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:mfr(n,t.copilotHome),...l&&{fromMarketplace:l},...c!==void 0&&{repositoryBoundary:c}}})).filter(r=>r!==void 0)}a(l$s,"discoverMarketplace");async function u$s(t){return(await uZn(t.copilotHome)??[]).map(r=>({uri:r.fsPath,fsPath:r.fsPath,readOnly:!0,...r.displayName!==void 0&&{displayName:r.displayName}}))}a(u$s,"discoverCopilotCli");async function uZn(t){return WL(f$s(t),Alt,void 0)}a(uZn,"listCopilotCliInstalls");async function d$s(t){return(await uZn(t))?.map(e=>e.fsPath)}a(d$s,"listCopilotCliPluginDirs");async function f$s(t){let e=bb.join(t,ffr),[r,n]=await Promise.all([p$s(t),h$s(e)]);if(r===void 0&&n===void 0)return;let o=[];for(let u of r??[]){let f=(u.cachePath!==void 0&&bb.isAbsolute(u.cachePath)?u.cachePath:void 0)??(u.name!==void 0&&u.marketplace!==void 0?bb.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 gx(o,ylt,async u=>await hfr(u.fsPath)?void 0:u),c=[],l=new Set;for(let u of s){if(u===void 0)continue;let d=M_(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=M_(u);l.has(d)||(l.add(d),c.push({fsPath:u}))}return c}a(f$s,"collectCopilotCliInstalls");async function p$s(t){let e=bb.join(t,aZn),r=await Ihe(()=>RX.promises.stat(e));if(!r.ok)return ufr(r.code)?[]:void 0;if(!r.value.isFile()||r.value.size>pfr)return;let n=await Ihe(()=>RX.promises.readFile(e,"utf8"));if(!n.ok)return ufr(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(p$s,"readCliInstalledPlugins");async function h$s(t){let e=await Ihe(()=>RX.promises.readdir(t,{withFileTypes:!0}));if(!e.ok)return ufr(e.code)?[]:void 0;let r=e.value,n=[];for(let o of r)if(o.isDirectory())for(let s of await xDe(bb.join(t,o.name)))s.isDirectory&&n.push(s.path);return n}a(h$s,"scanCopilotCliPluginDirs");function mfr(t,e){return vE(bb.join(e,ffr),t)}a(mfr,"isCopilotCliPath");var gfr=de(require("path"));var m$s="commands",g$s="skills",A$s="agents",y$s="rules",E$s=".mcp.json";async function fZn(t,e,r){let n=r.repositoryBoundary,o=n&&vE(n,t)?n:t,s=await IX(o),c=await XJn(t,e,s),l=c?.manifest,u=c?.manifestUri??gfr.join(t,e.manifestPath),d=a((v,b)=>mlt(t,b,The(l?.[v]),n),"dirsFor"),[f,h,m,g,A,y]=await Promise.all([cfr(d("commands",m$s),s),nZn(t,d("skills",g$s),s),oZn(d("agents",A$s),s),sZn(d("rules",y$s),s),_$s(t,l,u,e,n,s,r),C$s(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(fZn,"readPluginContributions");function Elt(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&!Object.hasOwn(t,"paths")}a(Elt,"isEmbeddedSection");async function pZn(t,e){if(await Zw(e,t))return LDe(t,pfr)}a(pZn,"readJsoncWithinBoundary");async function _$s(t,e,r,n,o,s,c){let l=e?.hooks;if(Elt(l)){let h=Object.hasOwn(l,"hooks")||Object.hasOwn(l,"disableAllHooks")?l:{hooks:l},m=dZn(n,r,h,t,c);if(m.length>0)return m}let u=Elt(l)?The(void 0):The(l),d=v$s(t,n,u,o);for(let f of d){let h=await pZn(f,s);if(h)return dZn(n,f,h,t,c)}return[]}a(_$s,"readHooks");function dZn(t,e,r,n,o){try{return t.parseHooks(e,r,n,o.userHome)}catch{return[]}}a(dZn,"parseHooksSafely");function v$s(t,e,r,n){let o=[];if(!r.exclusive)for(let s of eZn(e))o.push(gfr.join(t,s));for(let s of mlt(t,"",{paths:r.paths,exclusive:!0},n))o.includes(s)||o.push(s);return o}a(v$s,"resolveHookConfigPaths");async function C$s(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(Elt(u)&&l(lfr(r,{mcpServers:u},t,n)),c.size===0){let d=Elt(u)?The(void 0):The(u),f=mlt(t,E$s,d,o);for(let h of f){let m=await pZn(h,s);m&&l(lfr(h,m,t,n))}}return[...c.values()].sort((d,f)=>d.name.localeCompare(f.name))}a(C$s,"readMcpServers");p();function FDe(t){return t.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)[^/@\s]*@/g,"$1")}a(FDe,"redactUrlCredentials");var bH=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredPluginError"}static{a(this,"StructuredPluginError")}},_lt=class extends bH{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"}},whe=class extends bH{static{a(this,"PluginCloneError")}constructor(e,r){let n=FDe(e),o=FDe(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"}},Rhe=class extends bH{static{a(this,"LocalMarketplaceMissingError")}constructor(e){let r={kind:"localMarketplaceMissing",repositoryPath:e};super(`Local marketplace repository does not exist: ${e}`,r),this.name="LocalMarketplaceMissingError"}},Phe=class extends bH{static{a(this,"InvalidPluginSourceError")}constructor(e,r="plugin source"){let n=FDe(e),o={kind:"invalidPluginSource",source:n};super(`Invalid ${r}: ${n}`,o),this.name="InvalidPluginSourceError"}};p();var hZn=require("fs"),Afr=de(require("path"));var b$s=new Set(["installed.json","enablement.json"]);function yfr(t){return(e,r)=>{let n=M_(e.path);return Afr.posix.dirname(n)===r&&t.has(Afr.posix.basename(n))}}a(yfr,"matchNamedFiles");var mZn=yfr(b$s),UDe=class{constructor(e,r,n,o,s=50){this.ctx=e;this.dir=r;this.debounceMs=s;this.logger=new pe("PluginFileWatcher");this._onDidChange=new Xf;this.onDidChange=this._onDidChange.event;this._disposed=!1;this._dirKey=M_(r),this._recursive=n.recursive??!1,this._createDir=n.createDir??!0,this._matches=n.matches,this._watcher=o??uKe(e),this._ownsWatcher=o===void 0}static{a(this,"PluginFileWatcher")}async start(){if(!this._disposed)try{if(this._createDir)await hZn.promises.mkdir(this.dir,{recursive:!0,mode:448});else if(!await Hd(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 gZn=require("fs"),AZn=de(require("path"));var S$s=new pe("plugins.git"),T$s=12e4,vlt=class{constructor(e){this.ctx=e;this.gitInstances=new Map}static{a(this,"PluginGitService")}async cloneRepository(e,r,n){try{let o=AZn.dirname(r);await gZn.promises.mkdir(o,{recursive:!0,mode:448}),await(await this.instanceFor(o)).clone(e,r)}catch(o){throw S$s.warn(this.ctx,`clone failed for ${FDe(e)}`,o),new whe(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 pO()).path),r=Bue({baseDir:e,binary:this._binary,unsafe:{allowUnsafeCustomBinary:!0},timeout:{block:T$s}}),this.gitInstances.set(e,r)),r}forget(e){this.gitInstances.delete(e)}dispose(){this.gitInstances.clear()}};p();var Clt=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 Hd(r))throw new whe(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=PT(e.marketplace);if(!r)return;let n=this.repository.getRepositoryUri(r);if(await Hd(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 yZn({kind:"github",repo:r.githubRepo},r,e.name);if(r.kind==="gitUri")return yZn({kind:"url",url:r.cloneUrl},r,e.name)}};function yZn(t,e,r){return{name:r,description:"",version:"",sourceDescriptor:t,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:"openPlugin"}}a(yZn,"synthesizePlugin");p();p();var I$s=new pe("plugins.catalog");function vZn(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=x$s(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(vZn,"parseMarketplaceCatalog");function x$s(t,e,r,n){let o=a(s=>{n&&I$s.warn(n,`skipping plugin '${r}': ${s}`)},"skip");if(t==null||typeof t=="string"){let c=w$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"):P$s(t.repo)?!khe(t.ref)||!khe(t.path)?o("github source 'ref'/'path' must be strings when provided"):_Zn(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'"):khe(t.ref)?_Zn(t.sha)?t.source==="git-subdir"&&(typeof t.path!="string"||!t.path)?o("git-subdir source is missing required 'path' field"):t.source==="url"&&!khe(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`):!khe(t.version)||!khe(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(x$s,"parsePluginSource");function w$s(t,e){let r=EZn(t??""),n=EZn(e);return r&&(n===r||n.startsWith(`${r}/`))?n:R$s(`/${r}/${n}`).replace(/^\/+/,"")}a(w$s,"resolvePluginSource");function EZn(t){return t.trim().replace(/\\/g,"/").replace(/^\.?\/+/,"").replace(/\/+$/g,"")}a(EZn,"normalizeMarketplacePath");function R$s(t){let e=[];for(let r of t.split("/"))r===""||r==="."||(r===".."?e.pop():e.push(r));return`/${e.join("/")}`}a(R$s,"posixNormalize");function khe(t){return t===void 0||typeof t=="string"}a(khe,"isOptionalString");function _Zn(t){return t===void 0||typeof t=="string"&&/^[0-9a-fA-F]{40}$/.test(t)}a(_Zn,"isOptionalGitSha");function P$s(t){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(t)}a(P$s,"isValidGitHubRepo");var blt=de(require("path"));var Dhe=new pe("plugins.marketplace"),k$s=480*60*1e3,D$s=3e4,N$s=15e4,M$s=[{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"}],O$s=[{type:"openPlugin",path:".plugin/plugin.json"},{type:"claude",path:".claude-plugin/plugin.json"},{type:"copilot",path:"plugin.json"}],Slt=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(()=>{Dhe.debug(this.ctx,"marketplace fetch exceeded deadline",{reference:r.rawValue}),c({plugins:[],error:L$s(r)})},N$s);l.unref?.();let u=n?.onCancellationRequested(()=>c({plugins:[]}));n?.isCancellationRequested&&c({plugins:[]}),e.then(c,d=>c({plugins:[],error:CZn(r,d)}))})}async readPluginsFromDirectory(e,r,n){return this.readPluginsFromDefinitions(r,async o=>{if(!n?.isCancellationRequested)return LDe(blt.join(e,o))},e)}async readSinglePluginManifest(e,r){if(!(r.kind!=="githubShorthand"&&r.kind!=="gitUri")){for(let n of O$s){let o=await LDe(blt.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?TZn(r.githubRepo,""):SZn(e,"")}}Dhe.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=>F$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=B$s(n);try{let m=await this.ctx.get(tr).fetch(f,{method:"GET",timeout:D$s,signal:h.signal});if(m.status!==200){m.status>=500&&(c=m.status),s&&=m.status>=400&&m.status<500;return}return BDe(await m.text())}catch(m){Dhe.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?(Dhe.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 Dhe.debug(this.ctx,"failed to prepare marketplace repository",{reference:e.rawValue,err:String(o)}),{plugins:[],error:CZn(e,o)}}return{plugins:await this.readPluginsFromDirectory(n,e,r)}}async readPluginsFromDefinitions(e,r,n){for(let o of M$s){let s=await r(o.path);if(!(!s?.plugins||!Array.isArray(s.plugins)))return vZn(s,e,o.type,this.ctx).map(c=>U$s(c,n))}return Dhe.debug(this.ctx,"no marketplace catalog found",{reference:e.rawValue}),[]}now(){return this.ctx.get(Ax).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()+k$s})}};function B$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(B$s,"abortSignalFor");function L$s(t){return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:"unavailable",message:`Marketplace '${t.displayLabel}' did not respond in time`}}a(L$s,"deadlineError");function CZn(t,e){let r=e instanceof Error?e.message:String(e),n=e instanceof Rhe?"localMissing":"cloneFailed";return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:n,message:r}}a(CZn,"toFetchError");function F$s(t,e){return{...t,marketplace:e.displayLabel,marketplaceReference:e}}a(F$s,"restamp");function U$s(t,e){let r=t.sourceDescriptor.kind==="relativePath"?t.sourceDescriptor.path:"",n=e?SZn(e,r):TZn(t.marketplaceReference.githubRepo??"",r);return{...t,readmeUri:n}}a(U$s,"withReadme");function bZn(t){let e=t.trim().replace(/^\.?\/+|\/+$/g,"");return e?`${e}/README.md`:"README.md"}a(bZn,"readmeRelPath");function SZn(t,e){return blt.join(t,bZn(e))}a(SZn,"fileReadmeUri");function TZn(t,e){return`https://github.com/${t}/blob/main/${bZn(e)}`}a(TZn,"githubBlobReadmeUri");p();p();var Nhe=require("fs"),IZn=de(require("path"));var Q$s=1e4,q$s=3e4,j$s=25;async function Mhe(t,e){await Nhe.promises.mkdir(IZn.dirname(t),{recursive:!0,mode:448});let r=Date.now()+q$s;for(;;)try{await Nhe.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 H$s(t)>Q$s&&await Nhe.promises.rm(t,{force:!0}).catch(()=>{}),await AC(j$s)}try{return await e()}finally{await Nhe.promises.rm(t,{force:!0}).catch(()=>{})}}a(Mhe,"withFileLock");async function H$s(t){try{let e=await Nhe.promises.stat(t);return Date.now()-e.mtimeMs}catch{return 1/0}}a(H$s,"lockAgeMs");p();var Ohe=require("fs"),PX=de(require("path"));var G$s=new pe("plugins.source"),$$s=0,xZn=".clone-tmp";function V$s(t){try{return process.kill(t,0),!0}catch(e){return e.code==="EPERM"}}a(V$s,"isProcessAlive");async function W$s(t){let e=PX.dirname(t),r=`${PX.basename(t)}.`,n;try{n=await Ohe.promises.readdir(e)}catch{return}await Promise.all(n.map(async o=>{if(!o.startsWith(r)||!o.endsWith(xZn))return;let s=Number.parseInt(o.slice(r.length).split(".")[0],10);!Number.isInteger(s)||s<=0||s===process.pid||V$s(s)||await Ohe.promises.rm(PX.join(e,o),{recursive:!0,force:!0}).catch(()=>{})}))}a(W$s,"sweepOrphanedCloneTemps");async function Efr(t,e,r,n,o){if(await Hd(r))return;await W$s(r);let s=`${r}.${process.pid}.${$$s++}${xZn}`;try{await t.git.cloneRepository(e,s,n),o?await t.git.checkout(s,o,!0):n&&await t.git.checkout(s,n),await Mhe(`${r}.lock`,async()=>{await Hd(r)||(await Ohe.promises.mkdir(PX.dirname(r),{recursive:!0,mode:448}),await Ohe.promises.rename(s,r))})}finally{t.git.forget(s),await Ohe.promises.rm(s,{recursive:!0,force:!0}).catch(()=>{})}}a(Efr,"cloneIntoPlace");var Tlt=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||"."}},Ilt=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 Hd(o)?await this.checkoutRevision(o,n):await Efr(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 Hd(o))return G$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)}},xlt=class extends Ilt{constructor(){super(...arguments);this.kind="github"}static{a(this,"GitHubPluginSource")}getInstallUri(r,n){let o=n;return RDe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n,[s,c]=o.repo.split("/");return wDe(r,["github.com",RT(s),RT(c),...slt(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`}},wlt=class extends Ilt{constructor(){super(...arguments);this.kind="url"}static{a(this,"GitUrlPluginSource")}getInstallUri(r,n){let o=n;return RDe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n;return wDe(r,MJn(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 qDe=require("fs"),kX=de(require("path"));var z$s=0,Rlt=class{constructor(e,r,n){this.ctx=e;this.store=r;this.git=n;this.logger=new pe("plugins.repository");this.cloneSequencer=new Gx;this.cacheRoot=r.sharedContentDir;let o={ctx:e,git:n};this.sources=new Map([["relativePath",new Tlt],["github",new xlt(o)],["url",new wlt(o)]])}static{a(this,"PluginRepositoryService")}getPluginSource(e){let r=this.sources.get(e);if(!r)throw new _lt(e);return r}getRepositoryUri(e){return e.kind==="localFileUri"&&e.localRepositoryUri?e.localRepositoryUri:wDe(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 RDe(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 Hd(r))return r;if(e.kind==="localFileUri")throw new Rhe(r);return await Efr({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 Hd(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 Hd(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||!vE(this.cacheRoot,n))return;let o=!1,s=`${n}.gc-${process.pid}-${z$s++}`;if(await Mhe(`${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 Hd(n)&&await qDe.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 qDe.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=kX.isAbsolute(n.pluginUri)?n.pluginUri:kX.resolve(this.cacheRoot,n.pluginUri);return vE(e,o)})}async pruneEmptyParents(e){let r=kX.dirname(e);for(;vE(this.cacheRoot,r)&&r!==this.cacheRoot;){try{if((await qDe.promises.readdir(r)).length>0)break;await qDe.promises.rmdir(r)}catch{break}r=kX.dirname(r)}}};p();p();function wZn(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(wZn,"isInstalledEntry");var SH=require("fs"),O2=de(require("path"));var RZn="plugins",Z$s="plugins",X$s="installed.json",eVs="enablement.json",tVs="marketplaces.json",rVs=".lock",nVs=0,PZn=a(t=>typeof t=="string","isString"),jDe=class t{constructor(e){this.rootDir=e}static{a(this,"PluginStore")}get sharedContentDir(){return O2.join(this.rootDir,RZn)}editorPluginsDir(e){return O2.join(this.rootDir,this.safeEditorSegment(e),Z$s)}installedJsonPath(e){return O2.join(this.editorPluginsDir(e),X$s)}enablementJsonPath(e){return O2.join(this.editorPluginsDir(e),eVs)}marketplacesJsonPath(e){return O2.join(this.editorPluginsDir(e),tVs)}async readInstalled(e){let{version:r,items:n}=await this.readManifest(this.installedJsonPath(e),"installed",1,wZn);return{version:r,installed:n}}async readEnablement(e){let{version:r,items:n}=await this.readManifest(this.enablementJsonPath(e),"disabled",1,PZn);return{version:r,disabled:n}}async readMarketplaces(e){let{version:r,items:n}=await this.readManifest(this.marketplacesJsonPath(e),"marketplaces",1,PZn);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=O2.join(this.editorPluginsDir(e),rVs);return Mhe(n,r)}async listEditorIds(){let e;try{e=await SH.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=>SH.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()===RZn||e!==O2.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 SH.promises.readFile(e,{encoding:"utf8"});return JSON.parse(r)}catch{return}}async writeJsonAtomic(e,r){let n=O2.dirname(e);await SH.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${nVs++}.tmp`,s=JSON.stringify(r,null,2)+` -`;try{await SH.promises.writeFile(o,s,{encoding:"utf8",mode:384}),await SH.promises.rename(o,e)}catch(c){throw await SH.promises.rm(o,{force:!0}).catch(()=>{}),c}}};var NZn=require("os"),Bhe=de(require("path"));var kZn={hooks:[],commands:[],skills:[],agents:[],instructions:[],mcpServerDefinitions:[]},DZn=new Set,iVs=new Set(xhe.filter(t=>t.changeSignal).map(t=>t.name)),cc=class{constructor(e,r,n=50,o=(0,NZn.homedir)(),s=process.env.COPILOT_HOME||Bhe.join(o,dfr)){this.ctx=e;this.watchDebounceMs=n;this.userHome=o;this.copilotHome=s;this.logger=new pe("AgentPluginService");this._onDidChangePlugins=new Xf;this.onDidChangePlugins=a((e,r,n)=>(this.ensureWatching(),this._onDidChangePlugins.event(e,r,n)),"onDidChangePlugins");this.mutationSequencer=new Gx;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 jDe(this.ctx.get(zn).directory)),this._store}get repository(){return this._repository||(this._git??=new vlt(this.ctx),this._repository=new Rlt(this.ctx,this.store,this._git)),this._repository}get marketplace(){return this._marketplace||(this._marketplace=new Slt(this.ctx,this.repository)),this._marketplace}get install(){return this._install||(this._install=new Clt(this.repository,this.marketplace)),this._install}get editorId(){return this.ctx.get(Ir).getEditorIdentity().editorId}guardEditorId(e){let r=this.editorId;if(jDe.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 lZn(this.discoveryDeps(r)),c=await gx(s,ylt,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||Bhe.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 ZJn(e.fsPath);return fZn(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)}),kZn));return WL(r,Alt,kZn)}discoveryRoots(){return{sharedContentDir:this.store.sharedContentDir,copilotHome:this.copilotHome}}isReadOnlyPlugin(e){return mfr(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=PT(e.marketplace);if(!n)return Promise.resolve(void 0);let o=(async()=>{let s=this.repository.getRepositoryUri(n);if(!await Hd(s))return;let c=r.get(s);c||(c=this.marketplace.readPluginsFromDirectory(s,n),r.set(s,c));let u=(await c).find(d=>d.name===e.name);return u||(await this.marketplace.readSinglePluginManifest(s,n)??void 0)})().catch(s=>{this.logger.debug(this.ctx,"listPlugins: resolving marketplace metadata failed",{pluginUri:e.pluginUri,err:String(s)})});return WL(o,Alt,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(DZn)}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 Bhe.isAbsolute(e.pluginUri)?hfr(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 UDe(this.ctx,r,{matches:mZn},this._injectedWatcher,this.watchDebounceMs),this._watchSubscription=this._fileWatcher.onDidChange(()=>{this.refreshAndMaybeFire(DZn)});let n=this.discoveryRoots();for(let o of xhe){let s=o.changeSignal;if(!s)continue;let c=new UDe(this.ctx,s.dir(n),{createDir:s.createDir,matches:yfr(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(iVs)}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 xhe){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 xhe)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=PT(e);if(!n)throw new Phe(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=>PT(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 OJn(r)}async addMarketplace(e){let r=PT(e);if(!r)throw new Phe(e,"marketplace source");await this.addMarketplaceReference(r)}async removeMarketplace(e){let r=PT(e);await this.mutate(async n=>{let o=await this.store.readMarketplaces(n),s=o.marketplaces.filter(c=>c===e?!1:r?PT(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=PT(e);if(!n)throw new Phe(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 Plt=de(require("path"));var DX=new pe("BackgroundAgent.PluginHooks"),Lhe="copilot-plugin",_fr={SessionStart:"sessionStart",SessionEnd:"sessionEnd",UserPromptSubmit:"userPromptSubmitted",PreToolUse:"preToolUse",PostToolUse:"postToolUse",ErrorOccurred:"errorOccurred"};function oVs(t,e){let r={};for(let o of t)for(let s of o.hooks){let c=_fr[s.type];if(c!==void 0)for(let l of s.hooks){let u=vfr(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(oVs,"groupPluginHooksBySource");async function MZn(t,e){if(!U5(t)||!nJ(t))return{};let r;try{r=(await t.get(cc).listPlugins()).filter(c=>c.enabled)}catch(c){return c instanceof hu?{}:(DX.warn(t,"failed to list plugins for hook injection",{err:String(c)}),{})}if(r.length===0)return{};let n=gn(e.uri),o=oVs(r,n),s={};return o.preToolUse&&(s.preToolUse=[aVs(t,n,o.preToolUse)]),o.postToolUse&&(s.postToolUse=[cVs(t,n,o.postToolUse)]),o.userPromptSubmitted&&(s.userPromptSubmitted=[lVs(t,n,o.userPromptSubmitted)]),o.sessionStart&&(s.sessionStart=[uVs(t,n,o.sessionStart)]),o.sessionEnd&&(s.sessionEnd=[dVs(t,n,o.sessionEnd)]),o.errorOccurred&&(s.errorOccurred=[fVs(t,n,o.errorOccurred)]),s}a(MZn,"buildPluginHookHandlers");function OZn(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(OZn,"mergePluginHooks");function vfr(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=sVs(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(vfr,"toCommandHook");function sVs(t,e){if(t!==void 0)return Plt.isAbsolute(t)?t:Plt.join(e,t)}a(sVs,"resolveHookCwd");function Fhe(t,e){return async r=>{if(nJ(t))return e(r)}}a(Fhe,"gated");function aVs(t,e,r){return{source:Lhe,handler:Fhe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:TDe(n.toolArgs)};for(let s of r){let c=await new t2(s.source,s.hooks).fire(t,o);for(let l of c){let u=l.output;if(u&&u.permissionDecision===$ue.deny)return{permissionDecision:"deny",permissionDecisionReason:u.permissionDecisionReason||"Tool execution denied by plugin hook"}}}return}catch(o){DX.error(t,`Failed to execute plugin PreToolUse hook for tool ${n.toolName}`,o);return}})}}a(aVs,"pluginPreToolUseHandler");function cVs(t,e,r){return{source:Lhe,handler:Fhe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:TDe(n.toolArgs),toolResult:{resultType:qdr(n.toolResult.resultType),textResultForLlm:n.toolResult.textResultForLlm}};for(let s of r)await new e2(s.source,s.hooks).fire(t,o)}catch(o){DX.error(t,`Failed to execute plugin PostToolUse hook for tool ${n.toolName}`,o)}})}}a(cVs,"pluginPostToolUseHandler");function lVs(t,e,r){return{source:Lhe,handler:Fhe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,prompt:n.prompt};for(let s of r)await new r2(s.source,s.hooks).fire(t,o)}catch(o){DX.error(t,"Failed to execute plugin UserPromptSubmitted hook",o)}})}}a(lVs,"pluginUserPromptSubmittedHandler");function uVs(t,e,r){return{source:Lhe,handler:Fhe(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 tJ(s.source,s.hooks).fire(t,o)}catch(o){DX.error(t,"Failed to execute plugin SessionStart hook",o)}})}}a(uVs,"pluginSessionStartHandler");function dVs(t,e,r){return{source:Lhe,handler:Fhe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,reason:n.reason};for(let s of r)await new eJ(s.source,s.hooks).fire(t,o)}catch(o){DX.error(t,"Failed to execute plugin SessionEnd hook",o)}})}}a(dVs,"pluginSessionEndHandler");function fVs(t,e,r){return{source:Lhe,handler:Fhe(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 J3(s.source,s.hooks).fire(t,o)}catch(o){DX.error(t,"Failed to execute plugin ErrorOccurred hook",o)}})}}a(fVs,"pluginErrorOccurredHandler");p();var BZn=de(require("node:path"));function LZn(t){let e="";for(let r of t){let n=r.codePointAt(0)??0;n>=32&&n!==127&&(e+=r)}return e.trim()}a(LZn,"sanitizeForPrompt");function pVs(t){let e=t.startsWith("file:")?gn(t):t;return LZn(BZn.basename(e))}a(pVs,"confinedBasename");function hVs(t){let e=t.startsWith("file:")?gn(t):t;return LZn(e)}a(hVs,"confinedAbsolutePath");function FZn(t){let e=pVs(t),r=hVs(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(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(FZn,"buildInlineSystemPrompt");p();function Cfr(t){return Ft(t,Ke.EnableSandbox)===!0}a(Cfr,"isSandboxEnabled");function UZn(t){return Cfr(t)?{enabled:!0}:void 0}a(UZn,"getSandboxConfig");p();jo();var mVs={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 bfr(t,e){return t.get(Ef).getInstructions(t,e,mVs)}a(bfr,"getGitCommitInstructions");var NX=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(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(` 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")}],i8=class{constructor(e,r){this.ctx=e;this.service=r;this.logger=new pe("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(Mo);return this.lastPluginsEnabled=U5(this.ctx),e.onDidChangeCopilotSettings(()=>{let r=U5(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(!U5(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=gVs(r),s=AVs(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 QZn)for(let l of c(r))o.push(n.register(s,[yVs(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=EVs(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(bA)}tryManager(){return this.tryGet(WA)}tryGet(e){try{return this.ctx.get(e)}catch(r){if(r instanceof hu)return;throw r}}dispose(){this.disposed||(this.disposed=!0,this.changeSubscription.dispose(),this.gateSubscription?.dispose(),this.teardownAll())}};function gVs(t){let e=QZn.flatMap(({pick:r})=>r(t).map(n=>JSON.stringify([n.uri,n.name,n.description??""]))).sort();return JSON.stringify(e)}a(gVs,"fileContentHash");function AVs(t){let e=t.mcpServerDefinitions.map(r=>JSON.stringify([r.name,r.configuration])).sort();return JSON.stringify(e)}a(AVs,"mcpContentHash");function yVs(t){return t.includes("://")?gn(t):t}a(yVs,"toPathPattern");function EVs(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(EVs,"toMcpServersConfig");var Sfr=new pe("BackgroundAgent.SessionOptionsBuilder"),_Vs=5e3;async function qZn(t,e,r,n){let o=WL((async()=>{try{await t.get(i8).ensureInitialSync()}catch(A){if(!(A instanceof hu))throw A}})(),_Vs,void 0),s=await n.buildAuthInfo(),c=ro(r.workspaceFolder.uri).fsPath;await o;let l;try{l=t.get(a0).getSkillDirectories(c),l.length===0&&(l=void 0)}catch{}let u={clientName:t.get(Ir).getEditorPluginInfo().name,integrationId:a$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(D3)._handleWorkspaceAdded({uri:r.workspaceFolder.uri,name:r.workspaceFolder.name??""})}catch{}let d=await ilt(t,r.workspaceFolder);d.length>0&&(u.customAgents=d);let f=r.mcpDirectory??r.workspaceFolder.uri;try{let A=t.get(TT).buildMcpServers(f);Sfr.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 hu))throw A}u.hooks=xJn(t,r.workspaceFolder);let h=await MZn(t,r.workspaceFolder);if(u.hooks=OZn(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:FZn(r.inlineConfinedFile)}}else{let A=await bfr(t,[r.workspaceFolder]).catch(_=>{Sfr.warn(t,"Failed to load git commit instructions for systemMessage",_)}),y=r.useNestedClaudeMdFiles===!0?await vVs(t,c):void 0,E=kJn({gitCommitInstructions:A,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:y});E!==void 0&&(u.systemMessage={mode:"append",content:E})}r.externalToolDefinitions?.length&&(u.externalToolDefinitions=r.externalToolDefinitions);let m=RJn(r);m.size>0&&(u.disabledInstructionSources=m);let g=UZn(t);return g&&(u.sandboxConfig=g),u}a(qZn,"buildSessionOptions");async function vVs(t,e){let r;try{r=t.get($o)}catch{return}try{return await PJn(async n=>r.readDirectory(Ta(n)),e)}catch(n){Sfr.warn(t,"Failed to scan nested CLAUDE.md files",n);return}}a(vVs,"scanNestedClaudeSection");p();var CVs=20,klt=new pe("BackgroundAgent.SessionRegistry"),Dlt=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.sandboxEnabled=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>CVs){let n=this.sessions.keys().next().value;n!==void 0&&n!==e&&(klt.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.remove(n).catch(o=>klt.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)}setSandboxEnabled(e,r){this.sandboxEnabled.set(e,r)}getSandboxEnabled(e){return this.sandboxEnabled.get(e)}deleteSandboxEnabled(e){this.sandboxEnabled.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){klt.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){klt.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.sandboxEnabled.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.sandboxEnabled.clear(),this.confinedFiles.clear(),this.turnLimiters.clear(),this.children.clear()}};p();p();var Tfr=require("node:fs"),MX=de(require("node:path"));function jZn(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(jZn,"sanitizePathSegment");function Mlt(t){return typeof t=="string"?t:void 0}a(Mlt,"asString");function Nlt(t){return typeof t=="number"?t:void 0}a(Nlt,"asNumber");function bVs(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:Mlt(r.toolCallId),tool:Mlt(r.name)}}):[]}a(bVs,"asToolCallArray");function SVs(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(SVs,"toToolResultText");function TVs(t){try{return JSON.stringify(t)}catch{return}}a(TVs,"safeStringify");var Ifr=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=ljt(new Date),s=jZn(r);this.sessionDir=MX.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?MX.join(this.sessionDir,"runSubAgent",jZn(e)):this.sessionDir}appendJsonl(e,r){let n=TVs(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await Tfr.promises.mkdir(MX.dirname(e),{recursive:!0}),await Tfr.promises.appendFile(e,`${n} -`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:Nlt(e.data.inputTokens),outputTokens:Nlt(e.data.outputTokens),cacheReadTokens:Nlt(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=bVs(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl(MX.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:Nlt(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=Mlt(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=Mlt(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(MX.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:SVs(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function HZn(t,e,r){let n=Ft(t,Ke.PromptPersistBasePath)?.trim()||void 0;if(n)return new Ifr(n,e,r)}a(HZn,"createBackgroundAgentPersistence");p();var Olt=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}}}};jo();var Uhe=new pe("BackgroundAgent.TurnDriver"),GZn="backgroundAgent",Blt=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=HZn(this.ctx,e,`bg-turn-${Gt()}`);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 d=a(()=>{},"noop"),f=r.on("user_input.requested",d),h=r.on("permission.requested",d),m=r.on("exit_plan_mode.requested",d);p$n(r,!0);let g=new Olt,A=r.on("*",T=>{if(T.type==="assistant.turn_start"&&this.registry.getTurnLimiter(e)?.onTurnStart(),u)try{u.persistEvent(T)}catch(w){Uhe.warn(this.ctx,"Failed to persist background-agent event",{eventType:T.type,error:w instanceof Error?w.message:String(w)})}g.trackEvent(T),this.handleSessionEvent(e,T,o)}),y=!1,E=a(()=>{y||(y=!0,this.emitTurnCompleteTelemetry(e,r,l,g.data,o),this.emitSessionMetricsTelemetry(e,r,o,c)),b?.dispose(),f(),h(),m(),A(),_(),v(),this.forget(e)},"cleanup"),_=r.on("session.idle",()=>{E()}),v=r.on("session.error",()=>{E()}),b;s&&(b=s.onCancellationRequested(()=>{Uhe.info(this.ctx,"Cancellation requested, aborting session:",e),r.clearPendingItems(),r.abort()})),r.send(n).catch(T=>{E();let w={type:"session.error",id:Gt(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:T instanceof Error?T.message:String(T)}};this.sendSessionUpdateNotification(e,w,o)})}forget(e){this.processedEventIds.delete(e)}processedEventIdsForTesting(){return this.processedEventIds}seedProcessedEventIdsForTesting(e){this.processedEventIds.set(e,new Set),this.registeredBackstops.has(e)||(this.registeredBackstops.add(e),this.registry.registerChild(e,{dispose:a(()=>{this.registeredBackstops.delete(e),this.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)){Uhe.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){Uhe.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;yt(this.ctx,"backgroundAgent.turn.complete",{requestSource:GZn,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){Uhe.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}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);yt(this.ctx,"backgroundAgent.session.metrics",{requestSource:GZn,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){Uhe.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}};p();function $Zn(t,e,r){e.agentMode&&(t.currentMode=e.agentMode,r.agentMode=e.agentMode)}a($Zn,"applyAgentModeOverride");p();async function VZn(t,e,r,n,o){let s=n.chatMode??"agent",c=Eat(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:Ta(u)};o.deleteChatMode(e),await r$n(r,c,{loadCustomAgents:a(()=>ilt(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(a0)}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(TT).buildMcpServers(f))}catch(h){if(h instanceof hu)return Promise.resolve({});throw h}},"getMcpServers")}),o.setChatMode(e,c)}a(VZn,"applyChatModeOverride");p();var WZn=new pe("BackgroundAgent.applyChatModeSelection");async function zZn(t,e,r){if(r.chatMode===void 0||Eat(r.chatMode))return;let n=r.chatMode==="agent";try{n?(await e.agent.deselect(),WZn.info(t,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:r.chatMode}),WZn.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(zZn,"applyChatModeSelection");p();function YZn(t,e,r,n){let o=Cfr(t);if(n.getSandboxEnabled(e)===o)return;let c={enabled:o};r.updateOptions({sandboxConfig:c}),n.setSandboxEnabled(e,o)}a(YZn,"applySandboxOverride");p();p();var OX=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}},HDe=class extends OX{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},GDe=class extends OX{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();var BX=new pe("BackgroundAgent.ProviderConfig");async function KZn(t,e,r){if(!e)return;let n=await _Ke(t,e,r);if(!n){BX.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let d=await new ca(t.get(zn)).getStoredModelConfigs(e),f=r?d[r]:void 0;o=f?.deploymentUrl,s=f?.modelCapabilities?.maxInputTokens,c=f?.modelCapabilities?.maxOutputTokens}catch(u){BX.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===oo.Anthropic)return{type:"anthropic",baseUrl:o??rue[e],apiKey:n,modelId:r,wireModel:r,...l};if(e===oo.Azure){if(!o){BX.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return xVs(t,o,n,r,l)}if(Kle(e))return{type:"openai",baseUrl:o??rue[e],apiKey:n,modelId:r,wireModel:r,...l};if(RK(e))return IVs(t,e,n,r,o,l);BX.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}a(KZn,"buildProviderConfig");async function IVs(t,e,r,n,o,s){if(!o){BX.warn(t,`Custom endpoint '${e}' has no configured URL; skipping provider config.`);return}let u=(await new ca(t.get(zn)).getProviderConfig(e))?.apiType,d=u==="chatCompletions"||u==="responses"||u==="messages"?u:_xe,f=EKe(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(IVs,"buildCustomEndpointProviderConfig");function xVs(t,e,r,n,o){let s;try{s=new URL(e)}catch{BX.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};BX.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(xVs,"buildAzureProviderConfig");var xfr=new pe("BackgroundAgent.applyTurnOverrides");async function JZn(t,e,r,n){let o=r.providerName?r.providerName:void 0;if(o!==void 0&&!dq(await t.get(Ut).getToken()))throw new GDe(`BYOK is disabled for this account. Provider '${o}' cannot be used for model '${r.model??""}'.`,o,r.model);let s=await KZn(t,o,r.model);if(o!==void 0&&s===void 0)throw new HDe(`BYOK provider '${o}' is misconfigured for model '${r.model??""}'. Verify the API key`+(o===oo.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){xfr.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)));xfr.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}),xfr.info(t,`Rebound session ${r.sessionId} for this turn: provider=${o??"(built-in)"}, model=${l??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),h}a(JZn,"applyTurnOverrides");p();async function ZZn(t,e,r,n,o){let s=RVs(e,n),c=o==="inline"||o==="inline-ask";await t.get(fg).applyPromptTemplateToRequest(r,s?[s]:[],c,{includePlugins:!0})||wVs(t,r)}a(ZZn,"expandPromptTemplate");function wVs(t,e){let r=e.message.trim();if(!r.startsWith("/"))return!1;let[n,...o]=r.split(" "),s=n.slice(1);if(!swn.has(s))return!1;let c=Xk().find(l=>l.id===s);return c?.instructions?(e.message=c.instructions(t,o.join(" ")),!0):!1}a(wVs,"applyBuiltinCreateTemplate");function RVs(t,e){let r=e.getWorkingDir(t);return r?{uri:Ta(r)}:void 0}a(RVs,"getWorkspaceFolderForSession");jo();var zA=new pe("BackgroundAgent"),TH="backgroundAgent",PVs="backgroundAgent.remote",kVs=new Set(["system.message","hook.start","hook.end"]),qs=class{constructor(e){this.ctx=e;this.pendingExternalToolDefs=new Map;this.notificationSender=e.get(_s),this.managerLifecycle=new Fat(e),this.authBinding=new qrt(e),this.registry=new Dlt(e),this.mcpSync=new Zct(e,this.registry),this.remoteController=new nlt(e,{registry:this.registry,injectUserMessage:a((n,o,s)=>this.injectRemoteUserMessage(n,o,s),"injectUserMessage")}),this.turnDriver=new Blt(e,this.registry,this.notificationSender),e.get(Mo).onDidChangeHttpSettings(()=>{Aat(this.ctx)}),Es(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(a0).onDidChangeSkillsEnabled(()=>{this.registry.clearChatMode()})}catch(n){if(!(n instanceof hu))throw n}}static{a(this,"BackgroundAgentService")}async handleAuthStateChange(){let{changed:e,hadPrevious:r,hasCurrent:n}=await this.authBinding.detectIdentityChange();e&&(zA.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=w2n(n,e);return yt(this.ctx,"backgroundAgent.interaction",{requestSource:TH,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 JZn(this.ctx,e,r,{registry:this.registry,managerLifecycle:this.managerLifecycle,getOrResumeSession:a(n=>this.getOrResumeSession(n),"getOrResumeSession")})}applyChatModeSelection(e,r){return zZn(this.ctx,e,r)}buildSessionOptions(e,r){return qZn(this.ctx,e,r,{buildAuthInfo:a(()=>this.buildAuthInfo(),"buildAuthInfo")})}async createSession(e){let r=performance.now();zA.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??Gt(),s=e.inlineConfinedFile?s$n(2):void 0,c=e.inlineConfinedFile?a$n(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),zA.info(this.ctx,"Session created:",o),this.installBridgeSpanProcessor(),yt(this.ctx,"backgroundAgent.create",{requestSource:TH,reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.registry.set(o,u),this.registry.setWorkingDir(o,ro(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),zA.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}),zA.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:Ta(m)},zA.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.deleteSandboxEnabled(e),this.installBridgeSpanProcessor();let f=s?.uri?ro(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=x2n(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 l$n(m,g,this.ctx);if(A.promptFragment&&(c.prompt=`${c.prompt}${A.promptFragment}`),A.isLargeFile){let y=e.chatMode==="inline-ask"?yat:ccr;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:TH,chatMode:this.registry.getChatMode(e.sessionId)??"agent",sessionId:e.sessionId,safeModelId:DVs(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 yt(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 yt(this.ctx,"backgroundAgent.truncateHistory",{requestSource:TH,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 VZn(this.ctx,e,r,n,this.registry)}applySandboxOverride(e,r){YZn(this.ctx,e,r,this.registry)}applyAgentModeOverride(e,r,n){$Zn(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),yt(this.ctx,"backgroundAgent.send",{requestSource:PVs,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 ZZn(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 zA.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);zA.info(this.ctx,"Stopping session via abort:",e),n.abortManualCompaction()&&zA.info(this.ctx,"Aborted in-progress manual compaction:",e),n.clearPendingItems(),await n.abort(),yt(this.ctx,"backgroundAgent.stop",{requestSource:TH,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);zA.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return yt(this.ctx,"backgroundAgent.compactHistory",{requestSource:TH,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);zA.info(this.ctx,"Aborting manual compaction for session:",e);let o=n.abortManualCompaction();return yt(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:TH,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();zA.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());yt(this.ctx,"backgroundAgent.resume",{requestSource:TH,reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!kVs.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){zA.info(this.ctx,"listModels called",{forceRefresh:e}),await this.managerLifecycle.ensureManager();try{let r=await this.ctx.get(Ss).getMetadata(e),n=this.sdk?.EXCLUDED_MODELS,o=r.filter(l=>l.model_picker_enabled===!0).filter(l=>l.capabilities.type==="chat").filter(l=>!n?.has(l.id)).map(Qrt);o.length===0?zA.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):zA.info(this.ctx,`Successfully retrieved ${o.length} models`);let s=[];this.ctx.get(Fl).getPolicyValue("autoModel.enabled")!==!1&&s.push(this.buildAutoModelEntry());let c=[...s,...o];return zA.debug(this.ctx,"Models retrieved:",c.map(l=>l.id)),{models:c}}catch(r){let n=r instanceof Error?r.message:String(r);throw zA.error(this.ctx,"listModels failed",{error:n,stack:r instanceof Error?r.stack:void 0}),new Error(`Failed to retrieve models: ${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(),acr(),P2n(),await this.managerLifecycle.dispose()}};function DVs(t,e){return e?"byok models":t??""}a(DVs,"safeModelId");p();p();var sh=(n=>(n.Background="BACKGROUND",n.Claude="CLAUDE",n.Codex="CODEX",n))(sh||{});p();async function Sb(t,e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return XZn(t,e,n,o),s}catch(s){throw o.error??=s,XZn(t,e,n,o),s}}a(Sb,"runWithTelemetry");function XZn(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?Zn(t,`${e}.failure`,n.error,s,c):yt(t,e,s,c)}a(XZn,"flushTelemetry");p();var eXn=de(require("path"));p();var wfr=["default","acceptEdits","bypassPermissions","plan","auto"];function LX(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(LX,"assertClaudeProvider");function Qhe(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(Qhe,"assertNonEmptyString");function NVs(t,e,r){if(r===void 0)throw new Error(`${t}: ${e} is required`);try{ro(r)}catch(n){throw new Error(`${t}: ${e} is not a valid URI: ${r}`,{cause:n})}}a(NVs,"assertFsUri");function MVs(t,e,r){if(!eXn.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(MVs,"assertAbsolutePath");function OVs(t,e){if(e!==void 0&&!wfr.includes(e))throw new Error(`${t}: agentMode must be one of ${wfr.join(", ")}, got '${e}'`)}a(OVs,"assertAllowedAgentMode");async function $De(t,e){if(e===void 0)return;let n=(await t.get(Ss).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!d$e(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a($De,"validateClaudeModel");async function tXn(t,e){LX("createSession",e.agentProvider),NVs("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await $De(t,e.model)}a(tXn,"validateAgentCreate");async function rXn(t,e){LX("resumeSession",e.agentProvider),Qhe("resumeSession","sessionId",e.sessionId),await $De(t,e.model)}a(rXn,"validateAgentResume");async function nXn(t,e){LX("sendMessage",e.agentProvider),Qhe("sendMessage","sessionId",e.sessionId),Qhe("sendMessage","message",e.message),OVs("sendMessage",e.agentMode),await $De(t,e.model)}a(nXn,"validateAgentSend");function iXn(t,e){LX("stopSession",e.agentProvider),Qhe("stopSession","sessionId",e.sessionId)}a(iXn,"validateAgentStop");function oXn(t,e){LX("destroySession",e.agentProvider),Qhe("destroySession","sessionId",e.sessionId)}a(oXn,"validateAgentDestroy");function sXn(t,e){LX("listSessions",e.agentProvider),Qhe("listSessions","cwd",e.cwd),MVs("listSessions","cwd",e.cwd)}a(sXn,"validateAgentListSessions");function aXn(t,e){LX("listModels",e.agentProvider)}a(aXn,"validateAgentListModels");p();p();p();var dXn=require("child_process"),qhe=de(require("path")),fXn=de(fk()),pXn=require("util");var cXn=5e3,lXn=200,jhe=class{constructor(e){this.execFile=(0,pXn.promisify)(dXn.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=qhe.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(qhe.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:cXn,windowsHide:!0})).stdout}catch(c){return{severity:"error",message:this.formatSpawnError(e,c)}}let o=fXn.coerce(n);if(!o)return{severity:"error",message:`Could not parse ${this.config.displayName} version from "${e}" --version output: "${uXn(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=qhe.basename(e).toLowerCase();if(!r.includes(n))return`${this.config.displayName} path "${e}" must point at the "${r[0]}" executable, but the basename is "${qhe.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 ${cXn/1e3}s.`;let o=typeof n?.stderr=="string"?uXn(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 uXn(t){let e=t.trim();return e.length<=lXn?e:`${e.slice(0,lXn)}\u2026`}a(uXn,"truncate");var Llt=de(fk());function BVs(){let t=jTe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(BVs,"getExpectedVersionRaw");var Rfr=class extends jhe{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=BVs(),o=Llt.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(!Llt.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.`}}})}},Hhe=new Rfr;p();var Ghe=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 hXn(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(hXn,"buildPermissionRequest");function mXn(t,e){return t.kind==="approve-once"?{behavior:"allow",updatedInput:e}:{behavior:"deny",message:LVs(t)}}a(mXn,"translatePermissionResult");function LVs(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(LVs,"formatDenyMessage");function gXn(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(gXn,"buildPreparedQuestions");function AXn(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(AXn,"buildUserInputRequest");p();p();var YA={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",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"};var yXn=require("crypto");var FVs=new pe("ClaudeOTelTracker");function Pfr(t){return(0,yXn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(Pfr,"generateHexId");function Flt(){return BigInt(Date.now())*1000000n}a(Flt,"nowNano");var Ult=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=Pfr(16),n=Pfr(8);this._rootSpan={traceId:r,spanId:n,name:"invoke_agent claude",startNano:Flt(),attributes:{[YA.OPERATION_NAME]:"invoke_agent",[YA.AGENT_NAME]:"claude",[YA.SYSTEM]:"anthropic",[YA.CONVERSATION_ID]:this._sessionId,...e?{[YA.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[YA.RESPONSE_MODEL]=n[0])}typeof e.num_turns=="number"&&(this._rootSpan.attributes[YA.TURN_COUNT]=e.num_turns),typeof e.total_cost_usd=="number"&&(this._rootSpan.attributes[YA.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:Pfr(8),parentSpanId:this._rootSpan.spanId,name:`execute_tool ${r}`,startNano:Flt(),attributes:{[YA.OPERATION_NAME]:"execute_tool",[YA.TOOL_NAME]:r,[YA.TOOL_CALL_ID]:e,[YA.CONVERSATION_ID]:this._sessionId}})}_endToolSpan(e,r){let n=this._toolSpans.get(e);if(!n)return;this._toolSpans.delete(e);let o=Flt(),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[YA.USAGE_INPUT_TOKENS]=this._inputTokens),this._outputTokens>0&&(n.attributes[YA.USAGE_OUTPUT_TOKENS]=this._outputTokens),this._cacheReadTokens>0&&(n.attributes[YA.USAGE_CACHE_READ_INPUT_TOKENS]=this._cacheReadTokens),this._cacheCreationTokens>0&&(n.attributes[YA.USAGE_CACHE_CREATION_INPUT_TOKENS]=this._cacheCreationTokens);let o=Flt(),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:Sat(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=>{FVs.warn(this._ctx,`Failed to persist OTel spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)})}};p();var kfr=require("fs"),_Xn=de(require("path"));var VDe=new pe("ClaudeCode.ReferenceFormatter"),UVs={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},EXn=5*1024*1024;async function vXn(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=Zo(s.uri);if(!c){VDe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=qVs(c);if(l){let u=await QVs(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=Zo(s.uri);if(!c){VDe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:VDe.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:jVs(n)}),o}a(vXn,"buildReferences");async function QVs(t,e,r){try{let n=await kfr.promises.stat(t);if(n.size>EXn){VDe.debug(r,`Skipping oversize image reference (${n.size} > ${EXn} bytes): ${t}`);return}let o=(await kfr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){VDe.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(QVs,"tryReadImageBlock");function qVs(t){return UVs[_Xn.extname(t).toLowerCase()]}a(qVs,"imageMediaTypeForPath");function jVs(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")}],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` 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(jVs,"wrapInSystemReminder");p();var SXn=require("crypto");var HVs=new Set(["ExitPlanMode"]);function Dfr(t,e={}){let r=e.timestamp??new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[xXn(r,"synthetic",t.error)];switch(t.type){case"system":return GVs(t,r);case"assistant":return CXn($Vs(t,r,e.streamingEnabled===!0,e.blockCursor,e.interactionId,e.mapModelId),e.suppressedToolUseIds);case"user":return CXn(e.includeUserText===!0?WVs(t,r):VVs(t,r),e.suppressedToolUseIds);case"result":return KVs(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(Dfr,"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&&HVs.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 TXn(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:Ig(),timestamp:o,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${n.index}`,deltaContent:s.text}}];case"thinking_delta":return[{id:Ig(),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(TXn,"translatePartial");function GVs(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:Ig(),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:Ig(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:Ig(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(GVs,"translateSystem");function $Vs(t,e,r,n,o,s){let c=t.message?.id??Ig(),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:Ig(),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:Ig(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${c}:${A}`,content:y}});break}case"tool_use":{let y=g;l.push({id:Ig(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof y.id=="string"?y.id:Ig(),toolName:typeof y.name=="string"?y.name:"unknown",arguments:y.input}});break}default:break}}),h.set(c,m),l}a($Vs,"translateAssistant");function VVs(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(IXn(o,e));return n}a(VVs,"translateUserLive");function WVs(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=Qlt(n);return o.length>0&&r.push(bXn(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(IXn(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=Qlt(s);c.length>0&&r.push(bXn(e,c))}}}return r}a(WVs,"translateUserHistory");function IXn(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=JVs(t.content);return{id:Ig(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:Ig(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(IXn,"buildToolExecutionComplete");function bXn(t,e){return{id:Ig(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(bXn,"buildUserMessage");function zVs(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(zVs,"stripSystemReminders");var YVs=/^\[Request interrupted by user[^\]]*\]$/;function Qlt(t){let e=zVs(t);return YVs.test(e)?"":e}a(Qlt,"sanitizeUserText");function KVs(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:Ig(),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(xXn(e,typeof l=="string"?l:"error",f))}return o.push({id:Ig(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(KVs,"translateResult");function xXn(t,e,r){return{id:Ig(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(xXn,"buildSessionError");function JVs(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(JVs,"flattenToolResultContent");function Ig(){return(0,SXn.randomUUID)()}a(Ig,"newId");function wXn(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"&&ZVs(l)||l.type==="assistant"&&s===void 0)&&(s=Ig());let u=l.type==="assistant"?s:void 0,d=c.timestamp,f=typeof d=="string"?d:void 0;try{r.push(...Dfr(l,{streamingEnabled:!1,includeUserText:!0,blockCursor:n,suppressedToolUseIds:o,timestamp:f,interactionId:u,mapModelId:e}))}catch{}}return r}a(wXn,"translateHistory");function ZVs(t){let e=(t.message??{}).content;if(typeof e=="string")return Qlt(e).length>0;if(!Array.isArray(e))return!1;for(let r of e)if(r.type==="text"&&typeof r.text=="string"&&Qlt(r.text).length>0)return!0;return!1}a(ZVs,"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"&&eWs(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 eWs(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a(eWs,"isSyntheticReplayUserMessage");p();var lm=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 qlt=de(require("path"));jo();var Gl=new pe("ClaudeCodeAgent.session"),$l="ClaudeCodeSession",WDe=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 Ghe;this._userInputRegistry=new Ghe;this._exitPlanModeRegistry=new Ghe;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(lm);if(s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode),this.ctx.get(Pn).getCapabilities().agentDebugLog){let c=new CT(this.ctx);c.isEnabled()&&(this._otelTracker=new Ult(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(lm).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){Gl.warn(this.ctx,`${$l}: setModel on active query failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async setPermissionMode(e){if(e===void 0&&this._permissionMode!==void 0){Gl.info(this.ctx,`${$l}: setPermissionMode skipped (undefined preserves existing)`,{sessionId:this.sessionId,existingMode:this._permissionMode});return}let r=e??"default";if(this._permissionMode=r,this.ctx.get(lm).setPermissionModeForSession(this.sessionId,r),this._query)try{await this._query.setPermissionMode(r),Gl.info(this.ctx,`${$l}: setPermissionMode propagated to live Query`,{sessionId:this.sessionId,effectiveMode:r})}catch(n){Gl.warn(this.ctx,`${$l}: 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){Gl.warn(this.ctx,`${$l}: 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(lm).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=>{Gl.warn(this.ctx,`${$l}: 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(lm).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(lm).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new dA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1,this._currentTurnInteractionId=Gt();let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{Gl.info(this.ctx,`${$l}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),Gl.info(this.ctx,`${$l}.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 vXn(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??Gt()};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,Ke.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await Hhe.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(Gl.warn(this.ctx,`${$l}: ${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"],...z$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,Gl.info(this.ctx,`${$l}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(c).catch(l=>{Gl.error(this.ctx,`${$l}: consume loop crashed`,{sessionId:this.sessionId,error:l instanceof Error?l.message:String(l)})})}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(iF).resolvePath();return`${qlt.dirname(e)}${qlt.delimiter}${process.env.PATH??""}`}catch(e){return Gl.warn(this.ctx,`${$l}: 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 dA;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){Gl.error(this.ctx,`${$l}: 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&&Gl.error(this.ctx,`${$l}: 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(lm).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=Dfr(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){Gl.error(this.ctx,`${$l}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=TXn(e,r,this._currentTurnInteractionId);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){Gl.error(this.ctx,`${$l}: 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 Gl.warn(this.ctx,`${$l}: 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 Gl.warn(this.ctx,`${$l}: 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||Gl.warn(this.ctx,`${$l}: 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??Gt();if(n.signal.aborted)return Promise.resolve({behavior:"deny",message:"Permission request aborted"});let s=hXn(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=gXn(e);if(!n)return{behavior:"deny",message:"AskUserQuestion: invalid input"};try{let o=await Promise.all(n.map(async c=>{let l=Gt(),u=await this._requestUserInputFromIde(l,AXn(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??Gt();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()||(Gl.error(this.ctx,`${$l}: 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 Gl.info(this.ctx,`${$l}: 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=>{Gl.warn(this.ctx,`${$l}: 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(lm).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()||(Gl.error(this.ctx,`${$l}: 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=mXn(h,n);Gl.info(this.ctx,`${$l}: 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=>{Gl.warn(this.ctx,`${$l}: 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()||(Gl.error(this.ctx,`${$l}: 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=>{Gl.warn(this.ctx,`${$l}: 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:Gt(),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:Gt(),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:Gt(),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:Gt(),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:Gt(),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:Gt(),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 kXn=de(require("http")),DXn=require("node:stream"),Mfr=require("node:stream/promises"),NXn=require("node:string_decoder");jo();var xg=new pe("ClaudeMessagesProxyServer"),tWs=["interleaved-thinking","context-management","advanced-tool-use"],Nfr="cls_claude_agent",wg={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"},rWs=new Map([[400,wg.InvalidRequest],[401,wg.Authentication],[402,wg.Permission],[403,wg.Permission],[404,wg.NotFound],[413,wg.RequestTooLarge],[424,wg.InvalidRequest],[429,wg.RateLimit],[466,wg.InvalidRequest],[529,wg.Overloaded]]),RXn=1024,nWs=32e3,FX=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-${Gt()}`,r=kXn.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},xg.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(xg.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,wg.NotFound,"Not found")}catch(o){xg.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,wg.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=iWs(e.headers,n);if(!o.valid){xg.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,wg.Authentication,"Invalid authentication");return}o.sessionId&&xg.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await hWs(e),c;try{c=JSON.parse(s)}catch(l){xg.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,wg.InvalidRequest,"Request body is not valid JSON");return}await this._forwardToCAPI(c,s,e.headers,r,o.sessionId)}async _forwardToCAPI(e,r,n,o,s){let c=this.ctx.get(Ut),l=this.ctx.get(tr),u;try{u=await c.getToken()}catch(_){xg.exception(this.ctx,_,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,wg.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=qce(this.ctx,u,"v1/messages"),g=sWs(this.ctx,n,d),A;try{({headers:A}=await Qce(this.ctx,g,u.token))}catch(_){xg.exception(this.ctx,_,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,wg.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,E=a(()=>{y.signal.aborted||(xg.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(jce(this.ctx,_,"v1/messages"),!_.ok){let w=await _.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";xg.error(this.ctx,`upstream CAPI returned ${_.status} ${_.statusText}: ${R}`),this._sendErrorResponse(o,_.status,mWs(_.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(lm),R=gWs(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,Mfr.pipeline)(b,R,o)}else await(0,Mfr.pipeline)(b,o)}catch(_){if(y.signal.aborted){xg.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(xg.exception(this.ctx,_,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,wg.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(Ss).getMetadata()).find(s=>s.id===r)}catch(n){xg.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 Ofr(e)?(xg.debug(this.ctx,"stripped output_config.effort for request with unresolved model metadata"),JSON.stringify(e)):r;let s=o?this.ctx.get(lm).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&xg.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return lWs(e,n,s)?(xg.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 cWs(e)?(xg.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:AWs(r),copilotPlan:n.userInfo?.copilotPlan,suggestSwitchToAuto:!1}:void 0;return U_.translateErrorMessage(o,s,void 0,vU(e),void 0,c)}_buildReasonForStatus(e,r,n){let o=e.status;if(o===402)try{let s=this.ctx.get(pu).overageEnabled;return U_.translate402Reason(r,{retryAfterHeader:e.headers.get("retry-after")??void 0,retryAfterSeconds:vU(e),copilotPlan:n.userInfo?.copilotPlan,isTBBEnabled:n.userInfo?.isTBBEnabled,canUpgradePlan:n.userInfo?.canUpgradePlan,overageEnabled:s})}catch(s){return xg.exception(this.ctx,s,"._buildReasonForStatus/402"),PXn(r)??"Quota Exceeded."}if(o===400){let s=U_.translate400Reason(r);if(s!==void 0)return s}return PXn(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 iWs(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(iWs,"extractSessionId");function oWs(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&tWs.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(oWs,"filterSupportedBetas");function sWs(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...Zm(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?oWs(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=aWs(u,d?RKe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Nfr}/${h}`:`${Nfr}${h.substring(m)}`}else s["User-Agent"]=Nfr;return s}a(sWs,"buildUpstreamHeaders");function aWs(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(aWs,"mergeBetas");function cWs(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(cWs,"sanitizeCacheControl");function lWs(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?uWs(t,n,e,r):pWs(t,n):dWs(t,e)}a(lWs,"normalizeThinkingForModel");function uWs(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"},Ofr(t),!0)}let u=fWs(n,o),d=yO(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(uWs,"_writeAdaptiveShape");function Ofr(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(Ofr,"_deleteEffortKey");function dWs(t,e){let r=e.capabilities?.supports?.reasoning_effort;return!!r&&r.length>0?!1:Ofr(t)}a(dWs,"_stripUnsupportedThinkingEffort");function fWs(t,e){if(t&&!(!e||!e.includes(t)))return t}a(fWs,"_normaliseUserEffortForCapi");function pWs(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:RXn,o=Math.min(nWs,Math.max(RXn,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(pWs,"_writeLegacyShape");function hWs(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(hWs,"readRequestBody");function mWs(t){return rWs.get(t)??wg.Api}a(mWs,"mapStatusToAnthropicErrorType");function gWs(t){let e=new NXn.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 DXn.Transform({transform(s,c,l){try{r+=e.write(s);let u=r.indexOf(` +`}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(` `);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(gWs,"createCopilotUsageSniffer");function PXn(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(PXn,"extractErrorMessage");function AWs(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(AWs,"extractErrorCode");p();function MXn(t){return t.replace(/[-.]/g,"").toLowerCase()}a(MXn,"normalizeModelId");function OXn(t,e){if(!t||e.some(s=>s.id===t))return t;let r=t.replace(/-\d{8}$/,""),n=MXn(r);return e.find(s=>MXn(s.id)===n)?.id??t}a(OXn,"mapCapiModelIdToPickerId");jo();var Rg=new pe("ClaudeCodeAgent"),Pg="ClaudeCodeAgentService",o8=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this.notificationSender=e.get(_s)}static{a(this,"ClaudeCodeAgentService")}async createSession(e){return Sb(this.ctx,"claudeCodeAgent.createSession",async r=>{await tXn(this.ctx,e);let n=e.sessionId??Gt(),o=this._sessions.get(n);if(o)return Rg.info(this.ctx,`${Pg}.createSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="idempotentHit",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:o.cwd};let s=gn(e.workspaceFolder.uri),c=await this._ensureProxyConfig(),l=new WDe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,isNewSession:!0,proxyConfig:c});return this._sessions.set(n,l),Rg.info(this.ctx,`${Pg}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return Sb(this.ctx,"claudeCodeAgent.resumeSession",async r=>{await rXn(this.ctx,e);let{sessionId:n}=e,o,s,c=this._sessions.get(n);if(c)Rg.info(this.ctx,`${Pg}.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 WDe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:d,model:e.model,isNewSession:!1,proxyConfig:f});this._sessions.set(n,h),Rg.info(this.ctx,`${Pg}.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(Ss).getMetadata().catch(m=>(Rg.debug(this.ctx,`${Pg}.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=wXn(f,m=>OXn(m,h)),r.properties.transcriptOk="true"}catch(u){Rg.warn(this.ctx,`${Pg}.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 Sb(this.ctx,"claudeCodeAgent.sendMessage",async n=>{await nXn(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:Ta(s.cwd)};await this.ctx.get(fg).applyPromptTemplateToRequest(e,[c]);let l=Gt(),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=>{Rg.warn(this.ctx,`${Pg}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),Zn(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 Sb(this.ctx,"claudeCodeAgent.listSessions",async r=>{sXn(this.ctx,e),Rg.info(this.ctx,`${Pg}.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 Rg.info(this.ctx,`${Pg}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return Sb(this.ctx,"claudeCodeAgent.listModels",async r=>{aXn(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),Rg.info(this.ctx,`${Pg}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(Ss).getMetadata(e)).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>d$e(c.capabilities.family)).map(Qrt);return Rg.info(this.ctx,`${Pg}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await Sb(this.ctx,"claudeCodeAgent.stopSession",async r=>{iXn(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){Rg.info(this.ctx,`${Pg}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return Sb(this.ctx,"claudeCodeAgent.destroySession",r=>{oXn(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this._sessions.delete(n),Rg.info(this.ctx,`${Pg}.destroySession`,{sessionId:n}),{success:!0}):(Rg.info(this.ctx,`${Pg}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return Rg.error(this.ctx,`${Pg}.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 Sb(this.ctx,"claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){Rg.info(this.ctx,`${Pg}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await $De(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await Sb(this.ctx,"claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){Rg.info(this.ctx,`${Pg}.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 Rg.warn(this.ctx,`${Pg}.handleInteraction: unknown session`,{sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type}),Promise.resolve({success:!1});let n=r.respondToInteraction(e);return Promise.resolve({success:n})}getPlanPath(){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(){throw this.unsupported("getRemoteStatus")}compactHistory(){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(){return Promise.reject(this.unsupported("stopCompactHistory"))}dispose(){for(let e of this._sessions.values())e.dispose();this._sessions.clear()}async _ensureProxyConfig(){return this.ctx.get(FX).start()}};p();var Bfr=new En;function BXn(t){return[...t].sort((e,r)=>{let n=Bfr.get(e.uri)??0;return(Bfr.get(r.uri)??0)-n})}a(BXn,"sortByAccessTimes");var LXn=a(t=>t.get($r).onDidFocusTextDocument(e=>{e.document&&Bfr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var FXn=de(require("events"));var jlt="CompletionRequested",W5=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new FXn.default;notifyRequest(e,r,n,o,s){return this.#e.emit(jlt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=U0(this.ctx,e,`event.${jlt}`);return this.#e.on(jlt,r),jn.Disposable.create(()=>this.#e.off(jlt,r))}};p();p();var Lfr=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?.()}},Hlt=class extends Lfr{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 Tb=class{constructor(e){this.ctx=e;this.#e=new pe("AsyncCompletionManager");this.requests=new En(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(Ffr(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 Hlt;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 dA,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(Ffr(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)Ffr(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 Ffr(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(Ffr,"isCandidate");p();p();var YDe=class{constructor(e){this.maxSize=e;this.root=new zDe;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 zDe;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 zDe;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 YDe(100)}};p();var Ib=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&&UXn(this.choices[0].completionText,n))return yWs(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 yWs(t,e){return t.filter(r=>UXn(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(yWs,"adjustChoicesStart");function UXn(t,e){return t.startsWith(e)&&t.length>e.length}a(UXn,"startsWithAndExceeds");p();p();var s8={" ":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 QXn(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let P;t[306]>1e-35?t[149]>1e-35?P=-.1389218965136736:P=-.032218642644416894:t[13]>1e-35?P=.006465035217331847:t[50]>1e-35?P=-.1381687930130022:t[179]>1e-35?P=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?P=-.03262719498763048:P=.023342916702125613:t[191]>1e-35?P=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?P=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?P=-.09989343595668776:P=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?P=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?P=-.09165257825246746:t[9]>32.50000000000001?P=.02484870392366004:P=-.008499493096971395:t[8]>24.500000000000004?P=.02459679192828244:P=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?P=.0015644546318714849:P=-.06579524865022705:P=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?P=.03331853632960164:P=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?P=-.019091477207111116:P=.037878468575478504:t[94]>1e-35?P=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?P=.16919658785098224:t[243]>1e-35?P=-.06580584936754524:P=.01567555159935563:t[129]>1e-35?P=.06721746994993226:t[10]>32.50000000000001?P=-.046394462507797975:P=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let B;t[308]>1e-35?B=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?B=.023223358334607133:B=-.04383410185346742:B=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?B=.023406489302867494:B=-.085521220804058:B=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?B=.028120059780969632:B=-.04211009474298743:t[294]>1e-35?B=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?B=-.0993035220737934:B=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?B=.029770210551187937:B=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?B=.06421359317599738:B=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?B=.024368404612215164:B=-.04045232374803373:t[131]>1e-35?B=.017372701982485795:t[120]>1e-35?B=.08812710275150198:t[18]>1e-35?t[90]>1e-35?B=.18451364351180236:t[7]>33.50000000000001?B=-.03850813130183531:t[195]>1e-35?B=.06966114053446336:t[3]>16.500000000000004?B=-.0012869181693341211:t[0]>4242.500000000001?B=-.054625548611291035:B=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?B=.006302103427145562:B=.13967622319898698:t[121]>1e-35?B=-.038798585213145644:t[5]>4544.500000000001?B=-.08050498033009466:B=-.002986974112681435;let L;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?L=-.03461119351456781:L=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?L=-.12404435523286539:L=-.0034376913880382956:L=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?L=.0037507103585310234:L=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?L=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?L=-.04832024079663151:t[37]>1e-35?L=-.037103393468366934:L=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?L=.032539071163832034:t[5]>1643.5000000000002?L=.036408625378035665:t[0]>1500.5000000000002?L=-.1346358322854993:L=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?L=-.1133991164577881:t[9]>52.50000000000001?L=-.024478640359723122:L=.03673777861098756:L=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?L=.002583438691776944:L=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?L=-.02141222346712401:L=.06392462314316179:t[4]>12.500000000000002?L=.08700122294434816:t[8]>267.50000000000006?L=.056923170082743224:L=-.07716309825583327:t[32]>1e-35?L=-.03961343943752142:L=.002674914122888783:t[1]>42.50000000000001?L=-.05217539654421676:t[145]>1e-35?L=.09553630282946368:L=-.009424791262477729;let j;t[183]>1e-35?j=-.05753337139158443:t[308]>1e-35?j=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?j=-.10477869875380448:j=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?j=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?j=-.04442302951713574:j=.00012409888451734224:j=-.092199119633697:t[225]>1e-35?j=.13773072450201831:t[0]>2882.5000000000005?j=.0028540012229920533:t[298]>1e-35?j=.07134486044361629:j=.014297412329837425:t[145]>1e-35?j=.05608385321902638:t[92]>1e-35?j=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?j=-.0039957800609801315:j=.0776927564241081:t[203]>1e-35?j=-.05502900859432093:t[105]>1e-35?j=.06062892720841595:j=-.009574839629252128:t[31]>1e-35?j=.009488858841144216:t[23]>1e-35?t[20]>1e-35?j=.08818126313644752:t[8]>161.50000000000003?j=.014353968957885408:j=-.022240738532827903:t[210]>1e-35?j=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?j=-.043902062079383485:j=-.014741559220396223:j=-.00934935734853194:t[6]>32.50000000000001?j=.1514593126307404:j=.010771222510801532:t[10]>22.500000000000004?j=.01412495209334078:j=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let q;t[0]>384.50000000000006?t[84]>1e-35?q=-.06088131453064195:t[147]>1e-35?q=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?q=.04219361472548491:q=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?q=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?q=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?q=-.11431764534511478:q=.013549717238356157:q=-.020987333767091276:t[6]>2.5000000000000004?q=-.02914877855133127:q=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?q=-.10087072787978416:t[37]>1e-35?q=-.030467397753331196:t[229]>1e-35?q=-.1017559811057469:t[4]>20.500000000000004?q=-.00413177742240167:t[20]>1e-35?q=.05213315982685969:q=.0037921635866823133:t[8]>51.50000000000001?q=.07327913092421544:t[6]>49.50000000000001?q=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?q=.02744420891894289:q=.11288946357194463:q=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?q=-.012329314369909049:q=.026816658655600168:q=-.0872405354618811:q=.007872673500247845:t[1]>42.50000000000001?q=-.04309044198258254:t[145]>1e-35?q=.07572529147860785:t[7]>5.500000000000001?q=-.013837187093264945:t[1]>17.500000000000004?q=.04208698439539668:q=-.06284346769019863;let Q;t[294]>1e-35?Q=-.0384794324818203:t[266]>1e-35?Q=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?Q=.07432960094940501:Q=-.035248735855751855:t[134]>1e-35?Q=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?Q=-.01706896375068821:Q=.08212247914968074:t[2]>59.50000000000001?Q=-.09546478958824225:t[6]>53.50000000000001?Q=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?Q=.02816463285971267:Q=.15449139016588445:Q=-.10199787406123524:Q=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?Q=-.13924786681478077:Q=-.0072772442570213335:t[39]>1e-35?Q=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?Q=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?Q=-.11174465335620831:Q=.00013144040097180107:Q=-.08493919336681105:t[42]>1e-35?Q=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?Q=-.015540659878839153:Q=-.14442609417300142:t[21]>1e-35?Q=-.025251979447574083:Q=.0023698372645272847:t[18]>1e-35?Q=.07269739695712212:t[8]>2592.5000000000005?Q=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?Q=-.01835130329646532:t[9]>45.50000000000001?Q=.02023047454629885:Q=.16469378262221102:Q=-.042975030085836426;let U;t[8]>2915.5000000000005?t[297]>1e-35?U=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?U=-.01034964686484714:U=-.07357437440667927:U=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?U=-.09476398869062203:t[9]>72.50000000000001?U=-.0757383854264379:U=.02806542779508718:U=-.05147742568418084:U=.10212721564444344:U=.0518263760642861:U=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?U=-.10669213185972036:U=.027050434286384796:t[302]>1e-35?U=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?U=.06354599160071946:t[1]>67.50000000000001?U=.05317447949011187:U=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?U=-.09369289448773599:t[0]>2215.5000000000005?U=.04077965380363924:t[0]>807.5000000000001?U=-.0591771776458298:U=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?U=-.016323380219241672:U=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?U=.03720704290087811:U=-.008730548158766654:t[4]>80.50000000000001?U=-.05346644687473197:U=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?U=.019984510398089086:U=-.03917825025861855:t[9]>170.50000000000003?U=-.09759719821334525:U=-.0023586682752856298;let z;t[183]>1e-35?t[17]>1e-35?z=.030100940443356424:t[10]>1.5000000000000002?z=-.10861112216742408:z=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?z=-.032062878390325456:z=-.10808232631806887:t[8]>1641.5000000000002?z=-.06147013392655731:t[4]>12.500000000000002?z=.03324767551088266:t[145]>1e-35?z=.028851633810612017:z=-.054871239091792784:t[134]>1e-35?z=-.023813968121342108:t[266]>1e-35?z=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?z=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?z=-.025350325484720576:z=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?z=.056817276537534815:z=-.07674158463557636:z=-.06335553143454145:t[1]>56.50000000000001?z=.16390494217299284:z=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?z=.041717597065890205:z=-.10357913492269129:t[10]>29.500000000000004?z=.1365512866715726:z=.020600048310575665:z=.09708785634773187:z=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?z=-.03146213719547347:z=.11784024316238083:z=-.050940520532045355:z=-.047988344143075616:t[191]>1e-35?z=.028764654731460032:z=.0011911575567860023;let $;t[294]>1e-35?t[10]>50.50000000000001?$=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?$=-.05103908560370243:$=.05002066201169583:$=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?$=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?$=.127983140816313:$=-.05436534163636867:$=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?$=-.009504203657088933:t[8]>819.5000000000001?$=.18689664822602375:$=.03635576744011826:$=-.029862411809998525:t[223]>1e-35?$=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?$=-.09405026597863717:t[0]>4153.500000000001?$=.053577663326799765:$=-.05062127873995668:$=.06512222894425874:t[39]>1e-35?$=-.04985311717827547:t[51]>1e-35?$=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?$=-.02860634573675884:$=.08863753005590103:$=.11158892111063744:t[0]>655.5000000000001?$=-.031005736641654926:$=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?$=-.00843386136334982:$=-.05273594615999777:$=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?$=-.015774115523598486:$=.10147367091236065:$=-.048307000563071016:$=.002118376117677254;let W;t[8]>1014.5000000000001?t[9]>137.50000000000003?W=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?W=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?W=.07211107542565391:W=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?W=-.0751486415451188:t[1]>59.50000000000001?W=.13459005084554104:W=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?W=.06715575425741895:W=-.005895690393702183:t[8]>2915.5000000000005?W=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?W=-.00029068886245881074:W=.0613467393188786:t[148]>1e-35?W=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?W=.003887223773199377:W=-.08553893131979015:W=.025654192706396767:W=-.05651733979610658:W=-.02039913645229667:t[2]>7.500000000000001?W=-.1058450646728524:W=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?W=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?W=.1283258201586378:W=-.01718135372229775:W=-.07702452408491414:t[125]>1e-35?W=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?W=.04273051857848212:W=-.04533122948101463:t[2]>196.50000000000003?W=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?W=.0231032972703664:W=-.04807386814498683:W=.002729435991332102;let J;t[179]>1e-35?J=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?J=.026484626664041125:t[10]>1.5000000000000002?J=-.10187000872941615:J=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?J=.09574540795390041:J=-.06454986703691233:J=-.11411849349353141:t[266]>1e-35?J=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?J=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?J=-.04403391373512386:J=.1132928075412222:t[2]>47.50000000000001?J=-.09700191391838056:J=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?J=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?J=-.001668912999010927:J=-.02363511102970245:t[8]>58.50000000000001?J=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?J=.0911011436534449:t[1]>28.500000000000004?J=-.07192390493729035:J=.06913818091291246:J=-.012312625373699222:J=.06784496312307986:J=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?J=.0026564453057705273:J=-.025425772389361445:t[122]>1e-35?J=-.12046786388602149:t[0]>3183.5000000000005?J=.01162092842804907:t[91]>1e-35?J=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?J=-.0001647792543020228:J=-.023664538532907665:J=.01609078206180752;let ne;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ne=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ne=-.017696526862422682:ne=.1450050954613223:ne=-.05406930069823832:ne=-.08308700260259043:t[120]>1e-35?ne=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ne=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ne=.038431826961746934:ne=-.05937462906539856:t[9]>65.50000000000001?ne=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ne=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ne=-.09579030954062734:ne=.025064711572811746:ne=.02579440518821548:ne=.1044440128091862:ne=-.058348633139536844:ne=.07766788227934436:ne=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ne=.07463684068207214:ne=.18244269035484484:t[6]>39.50000000000001?ne=-.06050050067471004:ne=.05787759066913493:ne=.010783225857972171:ne=.1674891243602606:t[4]>9.500000000000002?ne=-.004814132027475892:ne=-.14543299413454813:ne=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ne=-.07634466313617769:ne=.0287825335169114:ne=-.06894721943300268:ne=-.00023988459059521937;let H;t[131]>1e-35?t[1]>93.50000000000001?H=-.05706887458825395:t[2]>1.5000000000000002?H=.011446637886629108:H=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?H=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?H=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?H=.026278724448495064:H=.17053138400480508:t[0]>4463.500000000001?H=-.06482289890096041:H=.03026516489536295:H=-.031785170717683144:H=.1312690622980455:t[13]>1e-35?H=.14336922540461444:H=.03523850945454039:H=-.015407465968975714:t[39]>1e-35?H=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?H=-.0659975068798723:H=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?H=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?H=.057409156184759516:H=.2024322059866388:H=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?H=.010648654146284154:t[308]>1e-35?H=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?H=.12364025998551711:H=-.02247495081065243:t[1]>22.500000000000004?H=-.0726295464624251:H=.03481895086048152:t[0]>4331.500000000001?H=-.04775443357020673:H=.07172377425057568:t[2]>89.50000000000001?H=-.11782645274716962:H=.00010092665257989378;let re;t[147]>1e-35?re=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?re=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?re=-.016101990375700172:t[0]>2579.5000000000005?re=-.13045089661551845:re=-.02874367814784938:re=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?re=.17084176915326055:re=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?re=.10591712319944074:re=-.024082167264285:re=.16497698867036126:re=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?re=-.021012910475524206:re=-.13058422554298485:t[0]>1102.5000000000002?re=.10955864175201457:re=-.03566689354348996:t[1]>11.500000000000002?re=-.02093884208606101:re=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?re=-.013861861436128482:re=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?re=.10163873449625677:re=-.02779270277623805:t[1]>26.500000000000004?re=-.08035058228527389:re=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?re=-.007028075523033826:re=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?re=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?re=-.0032075580718124892:re=-.04442829143298883:re=-.06597073245775804:re=.0015594090939337751;let ae;t[223]>1e-35?t[8]>668.5000000000001?ae=-.12803889879260094:ae=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?ae=.08967966612917375:t[1]>39.50000000000001?ae=-.059791671514498074:ae=.05648934961902822:t[2]>59.50000000000001?ae=-.08633234097449628:t[6]>53.50000000000001?ae=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?ae=.025606129643140924:ae=.13835395886271978:ae=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?ae=-.09975506556937946:t[10]>36.50000000000001?ae=-.09427724661655643:t[10]>24.500000000000004?ae=.07329330653410447:ae=-.02271182965807972:ae=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?ae=-.05082091374050816:ae=.1687114435254966:t[0]>2314.5000000000005?ae=-.06422664016383926:ae=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ae=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?ae=-.1274167728754332:ae=.01308079126447365:t[4]>73.50000000000001?ae=.13854015371106546:t[4]>48.50000000000001?ae=-.03684255740123261:t[6]>45.50000000000001?ae=.10329912215813097:t[10]>77.50000000000001?ae=-.08630788656925215:ae=.031022006843800853:t[1]>25.500000000000004?ae=-.08278381528048026:ae=.06664374548141594:t[84]>1e-35?ae=-.05624227409079396:ae=.00012184182357340415;let Be;t[179]>1e-35?Be=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Be=-.07595415373151816:Be=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Be=.022822510448266862:Be=.17491569312933697:Be=-.058362287133533565:t[2]>2.5000000000000004?Be=-.03633895806364428:Be=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Be=-.07294848747514579:Be=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Be=-.07009535282685533:t[8]>2640.0000000000005?Be=-.051761240111316276:t[131]>1e-35?Be=-.06245774419231631:Be=.03495606662854905:Be=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Be=.0015036626973581122:Be=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Be=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Be=.022343994371919224:Be=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Be=.07724450228328664:t[0]>3853.5000000000005?Be=-.15671707454435677:t[10]>28.500000000000004?Be=-.10179090671841723:Be=.014878216919760927:Be=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Be=.14054154485273487:Be=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Be=-.08632985141410315:Be=.005524157938954954:Be=-.08802502622523681:Be=-.0004649168897260341;let ve;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ve=-.007458687464321174:ve=-.09444966249102484:t[1]>23.500000000000004?ve=.08564129697360716:ve=-.07105002902845851:ve=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ve=-.10326216566705966:t[1]>26.500000000000004?ve=.0050539832484585365:ve=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ve=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ve=.05783632021087773:t[10]>17.500000000000004?ve=-.06720598671764105:t[1]>47.50000000000001?ve=.097495825172558:ve=-.013372242800584872:ve=-.06463226787713715:t[42]>1e-35?ve=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ve=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ve=.11051270080118503:ve=.027719462817590454:t[8]>597.5000000000001?ve=-.08441503592016869:ve=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ve=-.12190088985091102:ve=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ve=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ve=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ve=.016585157185448045:ve=-.11032043771149425:ve=.01586986028570486:t[8]>388.50000000000006?ve=-.10592413013261853:ve=.04930703248769364:t[13]>1e-35?ve=.003621937787920821:ve=-.0013786331198611841;let 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 Pe;t[183]>1e-35?Pe=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Pe=-.11753465135886734:Pe=-.007515490299047085:Pe=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Pe=-.12371142493530439:t[1]>36.50000000000001?Pe=.032189417575190435:Pe=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Pe=-.0784518658439288:t[2]>54.50000000000001?Pe=.12477882322370665:Pe=.000313468482399738:Pe=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Pe=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Pe=.0353146070135579:Pe=-.06327619611098285:Pe=.02813577701641991:Pe=-.12354390728506215:t[34]>1e-35?Pe=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Pe=-.01245803535276381:Pe=-.07169472553475001:t[1]>11.500000000000002?Pe=.12989984824561698:Pe=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Pe=.010390226893521422:t[10]>14.500000000000002?Pe=.16790888126487719:Pe=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Pe=-.043398307129729134:Pe=.09963544907820426:t[9]>30.500000000000004?Pe=-.13540713124984502:t[9]>17.500000000000004?Pe=.0509435850590757:Pe=-.04761897852404613:t[4]>78.50000000000001?Pe=.09197086656470652:Pe=.0006771050176682337;let Z;t[122]>1e-35?t[6]>36.50000000000001?Z=.05686884451670743:Z=-.05334759543084309:t[266]>1e-35?Z=-.08603579519816038:t[157]>1e-35?Z=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?Z=-.0499592651503952:t[0]>725.5000000000001?Z=.11780353905132664:Z=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?Z=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Z=-.03190157229022304:Z=.07985197845805492:Z=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?Z=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?Z=-.027174047777029083:Z=.057117284879796476:t[3]>43.50000000000001?Z=-.0016147040913107311:Z=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?Z=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?Z=-.01466076988151239:Z=.13375695925484857:Z=-.04885873081899647:t[0]>5566.500000000001?Z=.11086813028591343:t[8]>992.5000000000001?Z=-.07622304217072383:Z=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?Z=.03285858361708423:Z=-.12354858211764992:Z=.0672788301823281:t[15]>1e-35?Z=.08658836986585006:Z=-.02741484278509758:t[290]>1e-35?Z=-.08161310335133287:t[135]>1e-35?Z=-.04824156054814152:Z=.0009156904299554183;let ee;t[3]>7.500000000000001?ee=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ee=.03642374718166293:ee=.16379973756366603:ee=-.03946685266127979:t[186]>1e-35?ee=.07618896623420895:t[96]>1e-35?ee=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?ee=-.022822371600847505:ee=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?ee=.044416424920571296:ee=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?ee=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?ee=.1061937286809567:t[7]>54.50000000000001?ee=.11487507743121311:t[8]>819.5000000000001?ee=-.07181278009001418:t[10]>25.500000000000004?ee=.13499019430369633:t[1]>31.500000000000004?ee=.09032979489780704:ee=-.12754166393372374:t[9]>37.50000000000001?ee=-.05093963635361407:ee=-.005026651151683848:t[9]>2.5000000000000004?ee=.07619735785573735:ee=.012363301341532136:t[26]>1e-35?ee=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?ee=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?ee=-.10764172927882483:ee=.01890760098464703:ee=.06573095405846417:t[8]>634.5000000000001?ee=-.00783575973273707:ee=-.050612689680229306:t[1]>22.500000000000004?ee=-.0016842490401359626:ee=.0738227088444087:ee=-.02663970950432175;let K;t[31]>1e-35?t[8]>17.500000000000004?K=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?K=.007191286124908192:K=-.09347881647636902:t[10]>1.5000000000000002?K=.07938758708008091:K=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?K=.12321804057595996:K=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?K=-.04644244754790671:K=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?K=.0706108609273337:t[2]>40.50000000000001?K=-.028046629962303716:K=-.06497613993109329:K=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?K=-.03056331974267756:K=-.11886389712497057:K=.053364962175658184:t[8]>2233.5000000000005?K=-.0448152521157682:K=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?K=.03818796510453344:K=.23673992112982362:K=.02858814226507374:t[10]>44.50000000000001?K=-.1125863771551199:K=.009129996952394916:t[1]>7.500000000000001?K=-.004374525302461639:K=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?K=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?K=-.13677189943034931:t[10]>2.5000000000000004?K=.039591891437078086:K=-.09312596849507347:K=-.02423172142089822:K=.0009836986075266283;let 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 X;t[179]>1e-35?X=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?X=.1470294450403005:X=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?X=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?X=.07965955447707423:t[10]>10.500000000000002?X=-.09236156404262426:X=.03396273196231458:X=-.13246465021467432:X=.07092822261735353:X=-.08753829085942:X=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?X=.004705878789890202:X=.13775378964952867:X=-.04770928980587811:t[10]>29.500000000000004?X=.011221519891071544:t[0]>3853.5000000000005?X=.06365381191628273:X=.15506252245336827:t[1]>37.50000000000001?X=-.07254777021042061:X=.026514587757252385:t[308]>1e-35?X=.04115804816617256:t[10]>26.500000000000004?X=.02077721353011946:t[5]>3548.5000000000005?X=-.1280907116663952:X=-.021974774274438:t[306]>1e-35?X=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?X=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?X=-.005710865560475598:t[94]>1e-35?X=-.06751507982853555:X=.027250040757588703:t[9]>52.50000000000001?X=.07060357924595577:X=-.030297760713011795:X=-.0006005400085266517;let ue;t[113]>1e-35?ue=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ue=-.06996356565314456:ue=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ue=-.08317707559926495:t[21]>1e-35?ue=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ue=-.010538203005984922:ue=.08454819465349446:t[9]>124.50000000000001?ue=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ue=-.08542251249346582:t[9]>50.50000000000001?ue=-.023428882537657472:ue=.010042500833979073:ue=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ue=.03006025206979096:t[9]>108.50000000000001?ue=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ue=.04222035773042132:ue=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ue=-.07209095448054853:ue=.028065954981903313:ue=.08714651929917122:ue=-.006678820669279169:t[10]>40.50000000000001?ue=.006982396294941626:ue=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ue=-.09351114982645548:t[4]>3.5000000000000004?ue=-.004837550129223451:ue=-.08324141237464677:t[303]>1e-35?ue=.10703037493990825:t[9]>156.50000000000003?ue=-.10803018621648303:t[116]>1e-35?ue=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ue=.10261721665006701:ue=.018994509090668264:ue=.0011244262442038839;let je;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?je=-.08404263465005328:t[0]>3682.5000000000005?je=.041259223920298876:t[1]>29.500000000000004?je=-.09541257493441671:je=.001482192721625409:je=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?je=-.08268996098437432:t[230]>1e-35?je=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?je=-913218977737457e-19:t[4]>10.500000000000002?je=-.056334165674005156:t[127]>1e-35?je=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?je=-.04231200150318989:t[10]>42.50000000000001?je=.10182973257894812:je=.015934763950068445:je=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?je=-.041117068322885315:je=.1167767830037126:je=.13611206992387337:t[10]>41.50000000000001?je=-.07120286010564107:je=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?je=-.07702290997669524:t[198]>1e-35?je=.08776558554437136:je=-.008290740324975692:t[2]>32.50000000000001?je=.07198457624219955:je=.005463113714361629:je=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?je=.03295785445437507:je=.15140250150674536:je=-.035613213948910254:t[186]>1e-35?je=.06849425535860769:t[96]>1e-35?je=.06028225812727254:je=-.007582543288662308;let ie;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ie=.08396556264106572:ie=-.0562516995099192:ie=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ie=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ie=.0052017514017035915:ie=-.11194119432743639:ie=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ie=-.025692451287403446:ie=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ie=-.11892250746801664:t[10]>22.500000000000004?ie=.07548493166973796:ie=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ie=.13750699058082427:t[18]>1e-35?ie=.06535408879552801:ie=-.054118179035040674:ie=.1344282838979622:t[0]>3982.5000000000005?ie=-.10409582202467015:t[19]>1e-35?ie=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ie=.012705935670766466:ie=.14149359442527545:ie=-.047977876173706004:t[20]>1e-35?ie=.057945228080337946:t[0]>3642.5000000000005?ie=-.008726535792122467:ie=-.08424769891378858:t[34]>1e-35?ie=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ie=.01196849566739346:ie=.1614642278429876:ie=-.043022338150701625:t[3]>5.500000000000001?ie=-.03907848255033881:ie=.018280601026175593:ie=.0006654540402589085;let le;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?le=-.01386103677247845:le=.11386694333005128:t[4]>27.500000000000004?le=-.021862617610091336:t[2]>31.500000000000004?le=.0828858469030438:le=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?le=.11303635767048735:le=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?le=-.04238798044549342:le=.022091190130494303:t[5]>5082.500000000001?le=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?le=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?le=-.04291104140431434:t[17]>1e-35?le=.11256797532342613:le=-.017206916368289193:le=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?le=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?le=.03581712466863222:le=.14770264307668884:t[8]>73.50000000000001?le=-.13093289429740068:le=.042461737442702936:t[52]>1e-35?le=.0501831919044939:le=-.010450249720465756:le=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?le=.0005381332165438493:le=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?le=.04849637311285226:le=-.036671377119808564:t[0]>421.50000000000006?le=.00020968499911058945:le=.11636422423182405:le=-.12687837788222575:le=.0012774367867215346;let Ne;t[120]>1e-35?Ne=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ne=-.042799574885345304:Ne=.07412430171193245:Ne=-.11248270469336048:t[193]>1e-35?Ne=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ne=.028911612178122104:Ne=.12326369727728437:t[0]>4091.5000000000005?Ne=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ne=.1159839898100149:Ne=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ne=-.0216343737351583:Ne=-.1220272260878369:t[2]>18.500000000000004?Ne=.09152924475072398:t[8]>55.50000000000001?Ne=.039508716651005665:Ne=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ne=.06793009902674053:Ne=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ne=-.04391068849624096:Ne=.04009967593394672:t[8]>1085.5000000000002?Ne=-.024773826356034825:Ne=-.13919707884246582:Ne=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ne=-.11567917501901476:Ne=-.006813640337684114:t[3]>7.500000000000001?Ne=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ne=-.001754586408351048:Ne=-.055422422450722056:Ne=-.06090032532532226:t[0]>5269.500000000001?Ne=.11787981735983527:Ne=-.00198119768540783:Ne=.00210412924303036;let we;t[294]>1e-35?t[10]>50.50000000000001?we=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?we=-.06063239096209816:we=.03317022411417386:we=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?we=-.013608609329298802:we=.09078000157330264:t[99]>1e-35?we=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?we=-.07536137260189814:we=.006253266595455118:t[10]>28.500000000000004?we=-.006106041147592768:t[9]>156.50000000000003?we=-.11828932797811101:t[94]>1e-35?we=-.02566078479505714:t[303]>1e-35?we=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?we=-.08401252789168523:t[5]>4244.500000000001?we=.026372887658499107:t[1]>16.500000000000004?we=-.027836756345634026:we=.09205362097909099:we=.00934612788718244:t[203]>1e-35?we=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?we=-.09580979052540028:t[1]>50.50000000000001?we=-.06402211827281554:we=.08342858760095972:t[2]>36.50000000000001?we=.008114897658204584:t[92]>1e-35?we=.09541587072672864:we=-.022342147210555434:we=-.01660492519175128:we=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?we=.15846731118501817:we=.039498507912023195:t[245]>1e-35?we=.07008718676813333:we=.0019806389728814727;let Le;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Le=-.01192072916082109:Le=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Le=.06874032717466054:t[4]>40.50000000000001?Le=-.07752510020707537:t[1]>76.50000000000001?Le=-.09944032260703917:t[8]>1381.5000000000002?Le=-.054466635810800745:t[1]>32.50000000000001?Le=.05974084520839573:Le=-.0384718740755954:Le=-.11374190719134032:t[0]>2151.5000000000005?Le=-.13703645155803298:Le=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Le=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Le=.013539805885738608:Le=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Le=.09941880179344399:Le=-.01608127391210995:Le=.08025226531247417:t[9]>67.50000000000001?Le=.13525448212444113:t[6]>61.50000000000001?Le=-.05511099182158894:t[94]>1e-35?Le=-.06821509831783572:t[128]>1e-35?Le=.11361314817714643:Le=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Le=-.09954181329804547:t[197]>1e-35?Le=.10102833149755386:t[188]>1e-35?Le=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Le=-.03781554214742005:Le=.09927933385592314:Le=-.020006000056720083:Le=-.10520473615957895:Le=-.12006990846253787:Le=-.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 kt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?kt=.0011484728213539738:kt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?kt=-.09828874964938798:t[8]>1586.5000000000002?kt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?kt=.011938269926919522:kt=.17541983715953954:t[19]>1e-35?kt=.023002786011088672:kt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?kt=.06508934844183291:kt=-.10168553534835639:kt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?kt=.021140806225203937:kt=-.1167833342453639:t[2]>33.50000000000001?kt=.13163585734056618:kt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?kt=.06314479201263888:kt=-.09639088327091713:t[10]>29.500000000000004?kt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?kt=40577156464836036e-21:kt=.12322387121810757:kt=-.03697224045046014:t[1]>22.500000000000004?kt=.016474835887320276:kt=.16919298733903063:kt=.07633203630214054:kt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?kt=.14150493354700563:kt=-.01831155354975749:t[1]>28.500000000000004?kt=-.07952557178685365:t[10]>28.500000000000004?kt=.0665695554984927:kt=-.053640139319277094:kt=.0004754840665898665;let $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 Ht;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?Ht=.018337297491457794:Ht=-.05926206443180149:Ht=.024026520855881126:t[288]>1e-35?t[184]>1e-35?Ht=.10747078482128616:t[126]>1e-35?Ht=-.10550625192391357:t[7]>71.50000000000001?Ht=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?Ht=.1317396472229434:Ht=-.025035791351328947:Ht=-.0728334305864372:t[8]>963.5000000000001?Ht=.023642201723096064:Ht=.183010326734258:t[128]>1e-35?Ht=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?Ht=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?Ht=-.1088876900335281:Ht=.02758317023002635:Ht=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?Ht=-.01928020117446408:Ht=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?Ht=.07893723375925096:Ht=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?Ht=-.10301657587280551:Ht=.005787463140224318:Ht=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?Ht=-.019296977889522397:Ht=-.07274529751752634:t[1]>30.500000000000004?Ht=-.050368901143148286:Ht=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?Ht=.0015332402792773946:Ht=.09930153676749967:Ht=-.06370844564357069:Ht=.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 fe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?fe=.07554189644995735:fe=-.052089349455904946:fe=-.10148206848169845:t[113]>1e-35?fe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?fe=.07172653627995676:fe=-.07602959317610998:fe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?fe=-.0399322883690891:fe=.06523495517476098:fe=-.10358715295743802:t[193]>1e-35?fe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?fe=.015928764772252406:fe=.1341513061552287:fe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?fe=-.033592997607280156:fe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?fe=-.08402551858097379:fe=.017401984506038796:t[1]>25.500000000000004?fe=.13337205393591278:fe=-.01160208350090984:fe=.06708317942315471:t[8]>227.50000000000003?fe=-.08486943882418681:fe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?fe=-.10496268177586783:fe=-.020921489532370493:fe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?fe=.11639296062157028:fe=-.004275784356569115:t[32]>1e-35?fe=-.07297384970166025:fe=.006026841626381599:fe=.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 Y;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?Y=-.07583539600416284:t[188]>1e-35?Y=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?Y=-.011038193049597113:Y=.08154028164397753:t[1]>85.50000000000001?Y=.10259361975201933:Y=.011640408330521594:Y=-.00023319159023748508:t[92]>1e-35?Y=.13771692859530546:Y=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?Y=.09967230141007705:t[30]>1e-35?Y=-.08888529037551285:Y=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?Y=.08284665960761373:Y=-.029292565021289504:t[7]>7.500000000000001?Y=-.09945093355204493:Y=-.008381393701708593:t[20]>1e-35?Y=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?Y=.07585582641438211:t[8]>284.50000000000006?Y=-.029387993239886723:Y=.07716738177321587:t[1]>18.500000000000004?Y=.026745348497993746:Y=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?Y=.02337306890530338:Y=-.10390355904767366:Y=.07390521199638532:Y=-.06788247515155237:Y=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?Y=-.06360325615644084:Y=.04342192339836601:Y=-.10598779152030145:Y=.05253384605768211;let se;t[3]>7.500000000000001?t[157]>1e-35?se=-.07514182877923786:se=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?se=.028692053800951845:se=.14081686716133598:se=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?se=.0037139292567243084:se=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?se=.01202688580305612:se=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?se=.043935495082738626:se=-.05639305759669704:t[247]>1e-35?se=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?se=.10331836202616368:se=.0006926658459781341:t[96]>1e-35?se=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?se=-.0741403257305367:se=.022900127535540854:t[7]>3.5000000000000004?se=.038110741403836294:se=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?se=-.09552842289807008:t[1]>27.500000000000004?se=.012505935885798007:se=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?se=-.1046104767723845:se=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?se=.023466328488582572:se=.11730925774586994:se=-.04771965631104874:se=.17059689880751394:se=-.08181850955999449:t[26]>1e-35?se=-.12727482696678769:se=-.014343123272734182;let 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 ce;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ce=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ce=.020637047900190317:ce=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?ce=-.04632587527094407:ce=.08603684785510396:ce=-.05101401015448496:ce=.025466432054358498:ce=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ce=.020385355430046367:ce=.12032592051335252:ce=-.012387370292173013:t[2]>23.500000000000004?ce=-.12568545484492677:ce=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ce=.043528764484784536:ce=.14352071657196003:ce=-.009332833816977268:ce=.11186782227735846:ce=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ce=-.05649104643152564:ce=.03884200719305747:t[42]>1e-35?ce=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ce=-.04103416502526736:ce=.04881823954656287:t[4]>15.500000000000002?ce=.009342724662897898:t[0]>3969.5000000000005?ce=-.025637309961309498:ce=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ce=-.08185697075265091:t[0]>2215.5000000000005?ce=.030063975892297354:t[0]>807.5000000000001?ce=-.03924325550733229:ce=.0415330999189793:ce=-.00024374664461674863;let Re;t[3]>7.500000000000001?Re=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Re=.025798416259686565:Re=.13251610353146012:Re=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Re=-.11098564237775424:Re=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Re=.15347826616466054:t[3]>4.500000000000001?Re=.10379320730958941:Re=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Re=.03159791088468647:Re=-.10612873364104258:Re=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Re=-.02335760775001469:Re=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Re=-.011164334474672973:Re=-.06594044410501655:t[207]>1e-35?Re=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Re=-.01725821503981916:Re=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Re=-.04226531631656534:Re=-.14409800530171432:Re=-.03245576341206398:t[8]>4214.500000000001?Re=.0895409165534886:t[247]>1e-35?Re=-.06506383629143335:t[118]>1e-35?Re=-.07214270121257443:t[8]>546.5000000000001?Re=-.004385020865473831:Re=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Re=.046278501133958524:Re=-.030835570926968044:t[0]>493.50000000000006?Re=-.12794504651610425:Re=.009415039807550776;let Me;t[304]>1e-35?Me=-.04717777269217453:t[76]>1e-35?Me=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Me=-.09648224457374217:t[132]>1e-35?Me=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Me=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Me=.10838431695638147:t[230]>1e-35?Me=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Me=.050071316251979:Me=-.006356941111525215:t[6]>8.500000000000002?Me=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Me=.10217402850540398:Me=-.048840949025349197:Me=-.03668313197909846:t[7]>39.50000000000001?Me=-.0562642841496003:t[10]>2.5000000000000004?Me=.09749777369987417:Me=-.04848223121417616:t[0]>5453.500000000001?Me=.08316648226133942:Me=-.0261979698267618:t[212]>1e-35?Me=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Me=.04837009746506856:Me=-.09184360565631328:Me=.0032411047845613606:t[0]>4733.500000000001?Me=.0977378556864798:Me=.010776545559325588:Me=-.012483310473120218:Me=-.049284121449103935:Me=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Me=-.08380361910948711:Me=.07375088778585813:Me=-.1084864186071348:Me=.0007819503469605476;let Ae;t[7]>17.500000000000004?t[115]>1e-35?Ae=.08741852531696623:t[167]>1e-35?Ae=.10078975495600809:Ae=-.0018324767784017562:t[290]>1e-35?Ae=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?Ae=.1379733311640402:Ae=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?Ae=-.09360083033774169:Ae=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?Ae=-.015599362579530679:t[0]>4593.500000000001?Ae=-.12029549262691491:Ae=-.018917032256501397:Ae=.04632831686576592:Ae=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?Ae=-.05894883236412263:Ae=.05213944998315824:Ae=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?Ae=.07577412405680808:Ae=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?Ae=-.0277076900736147:t[1]>65.50000000000001?Ae=-.023587471585763506:Ae=.10184896592433082:Ae=-.057699270527916825:Ae=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?Ae=.06566902102799584:t[10]>25.500000000000004?Ae=-.07033633753181047:Ae=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?Ae=-.08108035861059537:Ae=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?Ae=-.12431182772561139:Ae=.01886235886984271:Ae=.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 B0=EWs(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+P+D+N+B+L+j+M+O+q+Q+U+z+$+W+J+ne+H+re+ae+Be+ve+Ue+Pe+Z+ee+K+he+X+ue+je+ie+le+Ne+we+Le+rt+st+_t+kt+$t+Ht+Ie+F+be+Qe+fe+Se+Fe+te+Te+Ge+Y+se+me+Ce+He+$e+et+ct+bt+ht+We+ce+Re+Me+Ae+oe+ze+at+Vt+gr+cr+Mr+Hr+Gr+Yt+_r);return[1-B0,B0]}a(QXn,"multilineModelPredict");function EWs(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(EWs,"sigmoid");var _Ws={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},qXn={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function jXn(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(_Ws[r]??[]).some(l=>s.includes(l))}a(jXn,"hasComment");var Glt=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=jXn(e,-2,r),this.rstripSecondToLastLineHasComment=jXn(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(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(` `),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]}},Ufr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Glt(e,n),this.suffixFeatures=new Glt(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(qXn).length+1).fill(0);r[qXn[this.language]??0]=1;let n=new Array(Object.keys(s8).length+1).fill(0);n[s8[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(s8).length+1).fill(0);o[s8[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(s8).length+1).fill(0);s[s8[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(s8).length+1).fill(0);return c[s8[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function vWs(t,e){return new Ufr(t.prefix,t.suffix,e)}a(vWs,"constructMultilineFeatures");function HXn(t,e){let r=vWs(t,e).constructFeatures();return QXn(r)[1]}a(HXn,"requestMultilineScore");p();var Qfr=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}},$lt=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 Qfr(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 L$e(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=OKe(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 KA=class{static{a(this,"InlineCompletionManager")}};var Vlt=new pe("getCompletions"),KDe="legacy",JDe=["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 Wlt(t,e,r){t.get(KA).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=Vhe(r.resultType),n.properties.completionsImplementation??=KDe,Et(t,o,n),yt(t,o,Z9(n.properties,JDe),n.measurements)}a(Wlt,"telemetryShown");function GXn(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=KDe,Et(t,n,r),yt(t,n,Z9(r.properties,JDe),r.measurements)}a(GXn,"telemetryAccepted");function $Xn(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=KDe,Et(t,n,r),yt(t,n,Z9(r.properties,JDe),r.measurements)}a($Xn,"telemetryRejected");function IH(t,e={}){return t.properties.completionsImplementation??=KDe,{...e,telemetryBlob:t}}a(IH,"mkCanceledResultTelemetry");function pp(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??KDe};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(TP).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(pp,"mkBasicResultTelemetry");function VXn(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=pl()-e.telemetryBlob.issuedTime,n=Vhe(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 Vlt.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),nse(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(Vlt.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}nse(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(VXn,"handleGhostTextResultTelemetry");function Vhe(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(Vhe,"resultTypeToString");p();p();p();var CWs={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},bWs="ms-vscode.cpptools",SWs="CppCompletionContextProvider";function WXn(t,e,r,n){(e.includes(SWs)||e.length===1&&e[0]==="*")&&YXn(t,r,n)}a(WXn,"fillInCppVSActiveExperiments");function zXn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(bWs))&&YXn(t,r,n)}a(zXn,"fillInCppVSCodeActiveExperiments");function YXn(t,e,r){try{let n=CWs,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(YXn,"addActiveExperiments");p();function zlt(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(zlt,"fillInCSharpActiveExperiments");p();var qfr="fallbackContextProvider",jfr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function KXn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(qfr))&&TWs(t,r,n)}a(KXn,"fillInMultiLanguageActiveExperiments");function TWs(t,e,r){try{let n=IWs(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Nr.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(TWs,"addActiveExperiments");function IWs(t,e){let r=jfr,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(IWs,"getMultiLanguageContextProviderParamsFromExp");p();var xWs="typescript-ai-context-provider";function JXn(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(xWs)))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(JXn,"fillInTsActiveExperiments");p();jo();var ZXn=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")]))}),XXn=S.Intersect([S.Object({name:S.String(),value:S.String()}),ZXn]),eei=S.Intersect([S.Object({uri:S.String(),value:S.String(),additionalUris:S.Optional(S.Array(S.String()))}),ZXn]),wWs=[XXn,eei],RWs=S.Union(wWs),PWs=new Map([["Trait",Fu.Compile(XXn)],["CodeSnippet",Fu.Compile(eei)]]),kWs=a(t=>t,"ensureTypesAreEqual");kWs(!0);var DWs=S.Object({contextItems:S.Array(RWs)}),NWs=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())})]))}),Hfr=S.Object({id:S.String()}),MWs=S.Intersect([Hfr,NWs]),OWs=S.Intersect([Hfr,DWs]),tei=S.Object({providers:S.Array(MWs)}),rei=S.Object({providers:S.Array(Hfr)}),Gfr=S.Object({providers:S.Array(OWs),updating:S.Optional(S.Array(S.String()))}),nei=S.Intersect([Cbn,S.Object({contextItems:S.Optional(Gfr)})]);function Ylt(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(Ylt,"filterContextItemsByType");function iei(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of PWs.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(iei,"filterSupportedContextItems");function BWs(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(BWs,"validateContextItemId");function oei(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??Gt();if(!BWs(s)){let c=Gt();Nr.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=Gt();Nr.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a(oei,"addOrValidateContextItemsIDs");p();var um=class{constructor(e=()=>new $fr){this.createStatistics=e;this.statistics=new En(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)}}},$fr=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 Klt(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(Klt,"componentStatisticsToPromptMatcher");var sei=de(ri());var dm=class{static{a(this,"ContextProviderRegistry")}},z5=class{static{a(this,"DefaultContextProviders")}},Whe=class extends z5{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},Vfr=class extends dm{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;zlt(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"),[];zXn(this.ctx,h.map(T=>T[0].id),u,s),KXn(this.ctx,h.map(T=>T[0].id),u,s),JXn(this.ctx,h.map(T=>T[0].id),u,s);let g=new sei.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=pCe(this.ctx)&&!b9e(this.ctx)?0:LWs(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(um).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);_.set(T.id,R)}let b=await Gmn(_,g.token);E&&clearTimeout(E);for(let[T,w]of h){let R=b.get(T.id);if(R){if(R.status==="error")Dk(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 L=T.resolver.resolveOnTimeout(v);n7t(L)?x.push(...L):L&&x.push(L),x.length>0&&(R.status="partial")}catch(L){Nr.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,L)}let[P,D]=iei(x);D&&Nr.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=oei(this.ctx,P),B={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(B)}this.ctx.get(um).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=aei(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}},Wfr=class extends dm{constructor(r){super();this.delegate=r;this._cachedContextItems=new En(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 Jlt(t,e){return new Wfr(new Vfr(t,e))}a(Jlt,"getContextProviderRegistry");function Zlt(t,e,r){let n=t.get(um).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(Zlt,"telemetrizeContextItems");function Xlt(t){return t.matchScore>0&&t.resolution!=="error"}a(Xlt,"matchContextItems");function aei(t,e){let r=zfr(t,e),n=Ft(t,Ke.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(z5).getIds();return Array.from(new Set([...o,...r,...n]))}a(aei,"getActiveContextProviders");function zfr(t,e){return pCe(t)?["*"]:t.get(Zt).contextProviders(e)}a(zfr,"getExpContextProviders");function zhe(t,e){return aei(t,e).length>0}a(zhe,"useContextProviderAPI");function LWs(t,e){let r=Ft(t,Ke.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(Zt).contextProviderTimeBudget(e)}a(LWs,"getContextProviderTimeBudget");var xb=class{constructor(e){this.ctx=e;this.scheduledResolutions=new En(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(dm),{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 eut=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 rQ(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)}},tut=class extends eut{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]}},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.startIndex0&&/\s/.test(t.charAt(r-1));)r--;return r}a(lei,"rewindToNearestNonWs");function cei(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(cei,"indent");function UWs(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=cei(t,r),o=cei(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(UWs,"outdented");var Y5=class extends eut{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&&Wun(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()}}},QWs={python:new Y5("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 Y5("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 Y5("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 Y5("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 tut("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 tut("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 Y5("csharp",{},new Map([]),[],"block",null,!0),java:new Y5("java",{},new Map([]),[],"block",null,!0),php:new Y5("php",{},new Map([]),[],"block",null,!0),cpp:new Y5("cpp",{},new Map([]),[],"block",null,!0)};function Yfr(t){if(!bS(t))throw new Error(`Language ${t} is not supported`);return QWs[O$e(t)]}a(Yfr,"getBlockParser");async function uei(t,e,r){return bS(t)?Yfr(t).isEmptyBlockStart(e,r):!1}a(uei,"isEmptyBlockStart");async function dei(t,e,r,n){if(bS(t))return Yfr(t).isBlockBodyFinished(e,r,n)}a(dei,"isBlockBodyFinished");async function fei(t,e,r){if(bS(t))return Yfr(t).getNodeStart(e,r)}a(fei,"getNodeStart");var wLf=new pe("parseBlock");function ZDe(t,e,r){let n=e.getText(fu.range(fu.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>dei(s,n,c,o)}a(ZDe,"parsingBlockFinished");function nut(t,e){return uei(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(nut,"isEmptyBlockStartUtil");async function pei(t,e,r,n){let s=e.getText(fu.range(fu.position(0,0),r))+n,c=await fei(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(pei,"getNodeStartUtil");var qWs=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),jWs=new RegExp(`^(${qWs.join("|")})`);function HWs(t){return jWs.test(t.trimLeft().toLowerCase())}a(HWs,"isContinuationLine");function rut(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(rut,"indentationOfLine");function iut(t,e){let r=t.getText(),n=t.offsetAt(e);return Kfr(r,n,t.detectedLanguageId)}a(iut,"contextIndentation");function Kfr(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(JVs,"getLineAtOffset");function YXn(t,e){let r=e;for(;r>0&&/\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(` `),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=rut(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=rut(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=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{let n=$Ws(r,t,e);return n==="continue"?void 0:n}}a(hei,"indentationBlockFinished");p();p();p();p();p();p();var VWs={tokenizerName:"o200k_base"};function WWs(t){return{...VWs,...t}}a(WWs,"cursorContextOptions");function XDe(t,e={}){let r=WWs(e),n=Ts(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&&nWs&&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=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(` `).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(XDe,"getCursorContext");p();p();var zWs={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 mei(t){let e=zWs[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(mei,"announceSnippet");var Jfr=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 Zfr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=ZWs.get(e.languageId)??JWs}tokenize(e){return new Set(YWs(e).filter(r=>!this.stopsForLanguage.has(r)))}},gei=new Jfr(20),Yhe=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=gei.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 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].scoree.length>0)}a(YWs,"splitIntoWords");var KWs=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"]),JWs=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",...KWs]),ZWs=new Map([]);p();function sut(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 sut(this.windowLength,e)}_getCursorContextInfo(e){return XDe(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return XWs(e,r)}};function XWs(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(XWs,"computeScore");p();var cut=class t extends Yhe{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 sut(this.windowLength,e)}_getCursorContextInfo(e){return XDe(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):XDe(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return ezs(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await rQ(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 ezs(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(ezs,"computeScore");var tzs=0,rzs=60,nzs=4,izs=1,ozs=20,szs=1e4,Aei={snippetLength:rzs,threshold:tzs,maxTopSnippets:nzs,maxCharPerFile:szs,maxNumberOfFiles:ozs,maxSnippetsPerFile:izs,useSubsetMatching:!1};var Xfr={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function azs(t,e){return(e.useSubsetMatching?cut.FACTORY(e.snippetLength):aut.FACTORY(e.snippetLength)).to(t)}a(azs,"getMatcher");async function yei(t,e,r){let n=azs(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(yei,"getSimilarSnippets");function Eei(t,e){return{...Xfr,useSubsetMatching:epr(t,e)}}a(Eei,"getCppSimilarFilesOptions");function _ei(t){return Xfr.maxTopSnippets}a(_ei,"getCppNumberOfSnippets");var czs=new Map([["cpp",Eei]]);function lut(t,e,r){let n=czs.get(r);return n?n(t,e):{...Aei,useSubsetMatching:epr(t,e)}}a(lut,"getSimilarFilesOptions");var lzs=new Map([["cpp",_ei]]);function vei(t,e){let r=lzs.get(e);return r?r(t):jun}a(vei,"getNumberOfSnippets");function epr(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||Ft(t,Ke.UseSubsetMatching))??!1}a(epr,"useSubsetMatching");p();p();p();p();var uzs="content_excluded";async function uut(t,e,r,n){let o=Ylt(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(um).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,uzs]]),m}).map(f=>f.data)}a(uut,"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 hp(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(hp,"Text");function xH(t){return t.children}a(xH,"Chunk");p();function Yn(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(Yn,"functionComponentFunction");function L2(t){return{type:"f",children:t}}a(L2,"fragmentFunction");L2.isFragmentFunction=!0;var dut=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(wb,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(Yn(hp,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push(Yn(hp,{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=ipr(c);return Yn(L2,{children:[Yn(UX,{document:r,position:o,maxCharacters:m}),Yn(hut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(tNe,"CurrentFile");function UX(t){if(t.document===void 0||t.position===void 0)return Yn(hp,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),Yn(hp,{children:e})}a(UX,"BeforeCursor");function hut(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return Yn(hp,{});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 Yn(hp,{});if(r===s)return Yn(hp,{children:r});let c=s;if(r!==""){let l=Ts(t.tokenizer),u=l.takeFirstTokens(s,eNe);u.tokens.length>0&&100*put(u.tokens,l.takeFirstTokens(r,eNe).tokens)?.score<(t.suffixMatchThreshold??k$e)*u.tokens.length&&(c=r)}return c!==r&&n(c),Yn(hp,{children:c})}a(hut,"AfterCursor");function bei(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(wb,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=ipr(c);return Yn(UX,{document:r,position:o,maxCharacters:u})}a(bei,"DocumentPrefix");function Sei(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(wb,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=ipr(c);return Yn(hut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(Sei,"DocumentSuffix");p();var mut=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 Tei(t){return t.map(e=>e.elidedValue).join("")}a(Tei,"makePrompt");function Iei(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(Iei,"makePrefixPrompt");function xei(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(xei,"makeContextPrompt");p();var Khe=class{constructor(e,r=opr()){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 opr(){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===xH.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(opr,"defaultTransformers");p();var spr={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"]}},wei={};for(let[t,e]of Object.entries(spr))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)wei[r]=t;else wei[t]=t;var dzs={start:"//",end:""},fzs=["php","plaintext"],apr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function Rei(t){return Object.values(apr).includes(t.trim())}a(Rei,"isShebangLine");function pzs({source:t}){return t.startsWith("#!")||t.startsWith("e.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("hzs(s,e)).join(` +`).map(s=>xWs(s,e)).join(` `);return r?o+` -`:o}a(K5,"commentBlockAsSingles");function gut(t){let{languageId:e}=t;return fzs.indexOf(e)===-1&&!pzs(t)?e in apr?apr[e]:`Language: ${e}`:""}a(gut,"getLanguageMarker");function Aut(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(Aut,"getPathMarker");function rNe(t){return t===""||t.endsWith(` +`: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(` `)?t:t+` -`}a(rNe,"newLineEnded");var mzs=5,Jhe=class{constructor(){this.renderId=0;this.formatPrefix=Tei}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 mut,{blocks:[y,...E]}=A.elide(u,h,d,m,Ts(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(...gzs([...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-mzs: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 Khe(e,cpr).walkSnapshot((f,h,m)=>{if(f===e||(f.name===tNe.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:nNe(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:Rei(f.value)?y=A:y=K5(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:nNe(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${tNe.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}}},cpr=[...opr(),(t,e,r)=>fut(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===UX.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===hut.name?{...r,type:"suffix"}:r];function gzs(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(gzs,"computeComponentStatistics");function nNe(t){return t.replace(/\r\n?/g,` -`)}a(nNe,"normalizeLineEndings");p();var yut=a((t,e)=>{let[r,n]=e.useState();if(e.useData(wb,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?Yn(Azs,{docInfo:c}):Yn(yzs,{docInfo:c})}},"DocumentMarker"),Azs=a(t=>Yn(hp,{children:Aut(t.docInfo)}),"PathMarker"),yzs=a(t=>Yn(hp,{children:gut(t.docInfo)}),"LanguageMarker");p();p();p();var yJs=de(ZX()),EJs=de(s4()),_ri=de(Io()),_Js=de(Uut());var a4=class extends _ri.Disposable{static{a(this,"RecentEditsProvider")}};function vJs(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(vJs,"editIsTooCloseToCursor");var fdt=a((t,e)=>{let[r,n]=e.useState();return e.useData(wb,async o=>{if(!o.document)return;let s=t.ctx.get(a4);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(vJs(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(rNe(`File: ${T}`)+rNe(b))}}if(f.length===0){n(void 0);return}let h=rNe("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+rNe("End of recent edits");n(h)}),r?Yn(xH,{children:Yn(hp,{children:r})}):void 0},"RecentEdits");p();p();p();var pdt=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>tee.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&hdt(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(BXn(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 vri(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(vri,"shortCircuit");p();function bJs(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(bJs,"defaultHash");function dhr(t,e={}){let{hash:r=bJs,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(dhr,"memoize");var Cri={entries:[],traits:[]},mdt={entries:new Map,traits:[]},fhr=class extends En{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=TJs?c=mdt:c=void 0);let l=performance.now()-s;if(h0.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 gdt;return c}a(Sri,"getRelatedFiles");var phr=dhr(Sri,{cache:bri,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});phr=vri(phr,200,mdt);async function Adt(t,e,r,n,o,s=!1){let c=t.get(ree),l=mdt;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await Sri(t,u,r,n,c):await phr(t,u,r,n,c)}catch(u){l=mdt,u instanceof gdt&&Et(t,"getRelatedFilesList",r)}return h0.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(Adt,"getRelatedFilesAndTraits");function hdt(t,e){return MTe(t)===MTe(e)}a(hdt,"considerNeighborFile");var tee=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 pdt(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(IJs(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return h0.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 h0.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await Adt(e,f,o,s,c,l);return m.entries.size===0?(h0.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 IJs(t,e){return t.get(Zt).excludeRelatedFiles(e)||Ft(t,Ke.ExcludeRelatedFiles)}a(IJs,"isExcludeRelatedFilesActive");function Tri(t,e){return t.get(Zt).includeNeighboringFiles(e)||Ft(t,Ke.IncludeNeighboringFiles)}a(Tri,"isIncludeNeighborFilesActive");var ydt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(wb,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=tee.defaultEmptyResult();u.turnOffSimilarFiles||(d=await tee.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=Ame(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=>({...mei(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||lut(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 yei(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),Yn(L2,{children:[...o.map((u,d)=>Yn(xJs,{snippet:u}))]})},"SimilarFiles"),xJs=a((t,e)=>Yn(xH,{children:[Yn(hp,{children:t.snippet.headline}),Yn(hp,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var Edt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(wb,c=>{c.traits!==r&&n(c.traits);let l=MTe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return Yn(L2,{children:[Yn(hp,{children:`Consider this related information: -`}),...r.map(c=>Yn(hp,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function Iri(t,e){return Ft(t,Ke.UseSplitContextPrompt)??t.get(Zt).enablePromptContextProxyField(e)}a(Iri,"shouldUseSplitContextPrompt");function xri(t){return Yn(L2,{children:[Yn(rpr,{children:[Yn(yut,{ctx:t,weight:.7}),Yn(Edt,{weight:.6}),Yn(dut,{ctx:t,weight:.9}),Yn(ydt,{ctx:t,weight:.8})]}),Yn(Sei,{weight:1}),Yn(npr,{children:Yn(fdt,{ctx:t,weight:.99})}),Yn(bei,{weight:1})]})}a(xri,"splitContextCompletionsPrompt");p();var wri=0;function wJs(){wri=0}a(wJs,"resetContextIndex");function RJs(){return wri++}a(RJs,"getNextContextIndex");var _dt=class extends Jhe{constructor(){super(...arguments);this.formatPrefix=Iei;this.formatContext=xei}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if(wJs(),new Khe(r,PJs).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===UX.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:nNe(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:nNe(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 ${UX.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}}},PJs=[...cpr,(t,e,r)=>fut(t)?{...r,index:RJs()}:r];p();function vdt(t,e,r){let n=Ylt(r,"Trait");for(let s of n)kJs(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(vdt,"getTraitsFromContextItems");function kJs(t,e,r,n){let o=t.get(um).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(kJs,"setupExpectationsForTraits");var DJs=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Cdt(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=DJs.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return Et(e,t,l)}}a(Cdt,"ReportTraitsTelemetry");p();p();p();var bdt=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}},Sdt=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 Tdt=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(NJs(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 mhr(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 hhr([])),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)}},hhr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},mhr=class{constructor(e){this.lifecycleData=e;this.stateHook=new bdt(e.state),this.dataHook=new Sdt(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 NJs(t){return typeof t=="function"&&"isFragmentFunction"in t}a(NJs,"isFragmentFunction");var CNe=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new Tdt(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 wb(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(wb,"isCompletionRequestData");var ghr={default:{promptFunction:Rri,renderer:Jhe},splitContext:{promptFunction:xri,renderer:_dt}};function Rri(t){return Yn(L2,{children:[Yn(tpr,{children:[Yn(yut,{ctx:t,weight:.7}),Yn(Edt,{weight:.6}),Yn(dut,{ctx:t,weight:.9}),Yn(ydt,{ctx:t,weight:.8}),Yn(fdt,{ctx:t,weight:.99})]}),Yn(tNe,{weight:1})]})}a(Rri,"defaultCompletionsPrompt");var Idt=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new CNe(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}=Ame(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 d8;let E=this.virtualPrompt.snapshot(s),_=E.status;if(_==="cancelled")return d8;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 d8;if(v.status==="error")return this.errorPrompt(v.error);let[b,T]=MH(v.prefix),w={...v,prefix:b},R;if(zhe(this.ctx,n)){let P=Klt(v.metadata.componentStatistics);this.ctx.get(um).getStatisticsForCompletion(e).computeMatch(P),R=Zlt(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(zhe(this.ctx,n)){c=await this.ctx.get(xb).resolution(e);let{textDocument:f}=r,h=c.filter(Xlt);OJs(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=vdt(this.ctx,e,h),Cdt("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await uut(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 d8;if((await this.ctx.get(tc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Rdt;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(),yme}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new CNe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(ghr[this.promptOrdering]?.promptFunction??Rri)(this.ctx)}getRenderer(){let e=ghr[this.promptOrdering]??ghr.default;return new e.renderer}};function OJs(t,e,r,n){let o=["cpp","c"];return Tri(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(OJs,"similarFilesEnabled");p();p();p();var Nri=2e4,Pri=0,kri=new En;function Mri(t,e,r,n){Pri++;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=kri?.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=Ts(o);m=zmn(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),kri.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:Pri,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(Mri,"renderWithMetadata");function Ori(t,e){return r=>{let n=r.text.join("")+` -`;return e0(e,n,()=>t.tokenLength(n)+1)}}a(Ori,"cachedLineCostFunction");function Bri(t,e,r){let o=t.split(` -`).map(f=>({id:gf(),text:[f],children:[],canMerge:!0})),s=[""];o.length>=1&&s.push(...Array(o.length-1).fill(` -`),"");let c={id:gf(),text:s,children:o,canMerge:!0},u=FIe(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(Bri,"getLinewiseNode");var Pdt=class{constructor(){this.name="basicPrefix";this.costCache=new En(Nri)}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=Ts(n?.tokenizer),c=Ori(s,this.costCache);return{root:Bri(o,c,!1)}}},Dri={root:FQ,text:"",cost:0},kdt=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new En(5);this.costCache=new En(Nri)}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 Dri;let l=this.cache.get(r.textDocument.uri)||Dri;if(l.text===c)return l;let u=this.ctx.get(Zt).suffixMatchThreshold(n);if(l.text!==""){let g=new Gce,A=g.takeFirstTokens(c,eNe);if(A.tokens.length>0&&100*put(A.tokens,g.takeFirstTokens(l.text,eNe).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},Ddt=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Ts(n?.tokenizer);if(!r||r.traits.length===0)return{root:FQ};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=gf(),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(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: `,...new Array(l.length).fill(` -`)],h={id:gf(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return LIe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},Ndt=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Ts(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:FQ};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;e0(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: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}: `,...new Array(A.length).fill(` -`)],v=[];for(let b of A){let T=gf();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:gf(),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:gf(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return LIe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},Mdt=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!==FQ.id);if(o.length===0)return{root:FQ};let s=["",...Array(o.length-1).fill(` -`),""],c={id:gf(),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 BJs=.8,Odt=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;zhe(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}=Ame(this.ctx,s,g),y=this.getComponentAllocation(s),E=y.suffix*A,_=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];E>BJs*(_??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let b=0;for(let N of v){let B=b+A*y[N],L=Mri(this.components[N],B,e,d);b=B-L.cost,h[N]=L,LJs(m,L.metadata)}let[T,w]=MH(h.prefix.text),R=performance.now(),x=zhe(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:K5(P.join(` +`)],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(` `),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(xb).resolution(e),{textDocument:c}=r,l=s.filter(Xlt),u=vdt(this.ctx,e,l);Cdt("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await uut(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=Klt(r);this.ctx.get(um).getStatisticsForCompletion(e).computeMatch(o);let s=Zlt(this.ctx,e,n);return Nr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return d8;if((await this.ctx.get(tc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Rdt;if(e.getText().length{this.nextRequest.changedFiles===void 0&&(this.nextRequest.changedFiles=[]),this.nextRequest.changedFiles.push(r.document.uri)}),this.deferredStart.resolve(),this.loop())}dispose(){this.isActive()&&(this.didDispose=!0,this.emitter.emit(t.DisposeEventName),this.fileChangeDisposable?.dispose(),this.client?.exit())}pushWorkspaceContext(e,r){this.nextRequest.sources={...this.nextRequest.sources,[e]:r}}recordWorkspaceContextActivity(e,r,n){this.nextRequest.recentActivity===void 0&&(this.nextRequest.recentActivity=[]),this.nextRequest.recentActivity.push({sourceId:e,locations:r,timestamp:n})}getLastEvent(){return this.lastEvent}onUpdate(e){return this.emitter.on(t.UpdateEventName,e),jn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),jn.Disposable.create(()=>this.emitter.off(t.DisposeEventName,e))}setContextLanguages(e){this.nextRequest.languages=e}async loop(){let e=0;for(;this.isActive();){try{let r=this.nextRequest;this.nextRequest={},this.lastEvent=await this.client.updateContext(r),this.emitter.emit(t.UpdateEventName,this.lastEvent),e=0}catch(r){if(TY(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=UJs){this.dispose();break}}await AC(this.config.UpdateInterval)}}};function Fri(t,e){let r=U0(t,e,"event.WorkspaceContextUpdate");return t.get(H2).onUpdate(r)}a(Fri,"onWorkspaceContextUpdate");p();var Bdt=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=FQ;this.disposables=[];this.rootWithPathCache=new En;this.disposables.push(Fri(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=e0(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:gf(),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?K5(Aut(s),s.languageId):K5(gut(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:gf(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=aO({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:gf(),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(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,` -`],children:[r],cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}getDocumentAnnotation(e,r){let o=this.ctx.get($r).getRelativePath({uri:e});return K5(`Related portions of ${o??e}: -`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var Ldt=class extends Odt{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new Bdt(e),prefix:new Pdt,suffix:new kdt(e),volatileContext:new Mdt("volatileContext",[new Ddt,new Ndt(e)])};super(e,r)}};var Uri=de(ri());var f8=class{static{a(this,"CompletionsPromptFactory")}};function Fdt(t,e,r){return new Ahr(new yhr(new Ehr(t,new Idt(t,e,r),new Ldt(t),qJs)))}a(Fdt,"createCompletionsPromptFactory");var Ahr=class extends f8{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 d8;try{return await this.delegate.prompt(r,n)}catch{return yme}}},QJs=1200,yhr=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new Uri.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(Qri)},QJs)})])}},Ehr=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 qJs(t,e){let r=t.get(H2);return r.isEnabled(e)&&r.isActive()}a(qJs,"workspaceContextEnabledAndActive");var xdt=10,wdt={type:"contextTooShort"},Rdt={type:"copilotContentExclusion"},yme={type:"promptError"},d8={type:"promptCancelled"},Qri={type:"promptTimeout"};function MH(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(MH,"trimLastLine");function Eme(t,e,r,n,o,s={}){let l=t.get($r).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=HJs(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=Iri(t,n);return t.get(f8).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(Eme,"extractPrompt");function jJs(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:K5(n,e)}a(jJs,"addNeighboringCellsToPrompt");function HJs(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>jJs(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 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(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(HJs,"applyEditsForNotebook");function Ame(t,e,r){let o=t.get(Zt).maxPromptCompletionTokens(e)-BKe(t),s=vei(e,r),c=lut(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(Ame,"getPromptOptions");p();p();var qri=2.98410452738298,jri=-.838732736843507,Hri=1.50314646255716,Gri=-.237798634012662,Udt={python:.314368072478742},$ri={"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 GJs={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)}},_hr=class{constructor(e,r,n){this.link=GJs;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)}},Vri=new _hr(qri,[new _me("compCharLen",jri,t=>Math.log(1+t)),new _me("meanLogProb",Hri),new _me("meanAlternativeLogProb",Gri)].concat(Object.entries(Udt).map(t=>new _me(t[0],t[1]))),$ri);function Wri(t,e){let r={...e.measurements};return Object.keys(Udt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),Vri.predict(t,r)}a(Wri,"ghostTextScoreConfidence");function zri(t,e){let r={...e.measurements};return Object.keys(Udt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),Vri.quantile(t,r)}a(zri,"ghostTextScoreQuantile");p();function VJs(t,e,r,n){let o="}";try{o=Vun(e.detectedLanguageId)??"}"}catch{}return WJs({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(VJs,"maybeSnipCompletion");function WJs(t,e,r,n){let o=zJs(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(WJs,"maybeSnipCompletionImpl");function zJs(t){let e=t.includes(`\r +`:"",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 `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(zJs,"splitByNewLine");function YJs(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(Yri,"checkSuffix");var Xri=de(J9());jo();var sl=new pe("ghostText");var Kri=20;async function eni(t,e,r,n,o,s,c){sl.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=nue(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:Jun(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,Ke.ModelAlwaysTerminatesSingleline)??t.get(Zt).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&zM.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(_O).fetchAndStreamCompletions(t,y,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:pp(r,t)}:E.type==="canceled"?(sl.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:IH(r)}):c(g,E.getProcessingTime(),E.choices)}catch(y){if(Lm(y))return{type:"canceled",reason:"network request aborted",telemetryData:IH(r,{cancelledNetworkRequest:!0})};if(sl.exception(t,y,"Error on ghost text request"),t.get(gC).notifyUser(t,y),fCe(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:pp(r,t)}}}a(eni,"genericGetCompletionsFromNetwork");function vhr(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(vhr,"postProcessChoices");async function JJs(t,e,r,n,o){return eni(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return sl.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:pp(r,t)};if(n?.isCancellationRequested)return sl.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:IH(r)};let f=d.value;if(f===void 0)return sl.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:pp(r,t)};rni(t,"performance",f,s,c),sl.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=vhr(f,e);h&&(Qdt(t,e,h),sl.debug(t,`GhostText first completion (index ${h?.choiceIndex}): ${JSON.stringify(h?.completionText)}`));let m=(async()=>{let g=h!==void 0?[h]:[];for await(let A of l){if(A===void 0)continue;sl.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=vhr(A,e,g);y&&(g.push(y),Qdt(t,e,y))}})();return w1(t)&&await m,h?{type:"success",value:[Chr(h,{forceSingleLine:!1}),m],telemetryData:pp(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:pp(r,t)}})}a(JJs,"getCompletionsFromNetwork");async function ZJs(t,e,r,n,o){return eni(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return sl.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:IH(r)};let f=vhr(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)Qdt(t,e,d);rni(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:pp(r,t),telemetryBlob:r,resultType:3}})}a(ZJs,"getAllCompletionsFromNetwork");function Chr(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(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(` `)[1]:r.completionText=n.split(` -`)[0]}return r}a(Chr,"makeGhostAPIChoice");function Jri(t){return e=>{let r=e?.split(` +`)[0]}return r}a(hhr,"makeGhostAPIChoice");function Bri(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(Jri,"takeNLines");async function XJs(t,e,r,n,o,s,c,l){let u=t.get(Zt).multilineAfterAcceptLines(l),d=t.get(vk).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:Jri(u),stop:[` +`).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:[` -`],maxTokens:Kri*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await cZs(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=fu.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):h=e.position,{blockMode:d,requestMultiline:!0,...Zri(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:Jri(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:Kri*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...Zri(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a(XJs,"getGhostTextStrategy");function Zri(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&zM.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(Zt).longLookaheadSize(u):t.get(Zt).shortLookaheadSize(u);return{finishedCb:new $lt(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};Qdt(t,g,m)}).getFinishedCallback(),maxTokens:t.get(Zt).maxMultilineTokens(u)}}return{finishedCb:c?ZDe(t,r,n):d=>{}}}a(Zri,"buildFinishedCallback");var eZs={isCycling:!1,promptOnly:!1,isSpeculative:!1};function tZs(t,e,r){let n=Ft(t,Ke.CompletionsDebounce)??t.get(Zt).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=pl()-r.issuedTime;return Math.max(0,n-o)}a(tZs,"getRemainingDebounceMs");function SNe(t,e,r){return r?.isCancellationRequested||e!==t.get(Ib).currentRequestId}a(SNe,"inlineCompletionRequestCancelled");async function rZs(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(E){let _=pl();l.push([E,_-c]),c=_}a(u,"recordPerformance"),u("telemetry");let d=t.get(Zt);if(SNe(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:pp(n,t)};let f=iZs(e.textDocument,e.position);if(f===void 0)return sl.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:pp(n,t)};let h=eQ(t,n),m={...eZs,...s,tokenizer:h.tokenizer},g=await Eme(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return sl.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:pp(n,t)};if(g.type==="contextTooShort")return sl.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:pp(n,t)};if(g.type==="promptError")return sl.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:pp(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return sl.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:pp(n,t)};if(g.type==="promptTimeout")return sl.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:pp(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return sl.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:pp(n,t)};let A=tZs(t,m,n);return A>0&&(sl.debug(t,`Debouncing ghost text request for ${A}ms`),await AC(A),SNe(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:pp(n,t)}:t.get(cs).trackCompletionJob(async()=>{let[E]=MH(e.textDocument.getText(fu.range(fu.position(0,0),e.position))),_=t.get(Ib).hasAcceptedCurrentCompletion(E,g.prompt.suffix),v=g.prompt,b=await XJs(t,e,E,g,m.isCycling,f,_,n);u("strategy");let T=nZs(t,E,v,b.requestMultiline);u("cache");let w=tQ(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:iut(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=pZs(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(Tb).shouldWaitForAsyncCompletions(E,g.prompt)){let q=await t.get(Tb).getFirstMatchingRequestWithTimeout(r,E,g.prompt,m.isSpeculative,x);if(u("asyncWait"),q){let Q=!b.requestMultiline;T=[[Chr(q[0],{forceSingleLine:Q})],4]}if(SNe(t,r,o))return sl.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:pp(x,t)}}let P=b.blockMode==="moremultiline"&&zM.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(q=>bNe(t,e.textDocument,e.position,q,P,sl)).filter(q=>q!==void 0)),T!==void 0&&T[0].length===0)return sl.debug(t,`Found empty inline suggestions locally via ${Vhe(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:pp(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))sl.debug(t,`Found inline suggestions locally via ${Vhe(T[1])}`);else{if(m.isCycling){let q=await ZJs(t,R,x,o,b.finishedCb);if(q.type==="success"){let Q=T?.[0]??[];q.value[0].forEach(U=>{Q.findIndex(z=>z.completionText.trim()===U.completionText.trim())===-1&&Q.push(U)}),T=[Q,3]}else if(T===void 0)return q}else{let q=a(($,W)=>(t.get(Tb).updateCompletion(r,$),b.finishedCb($,W)),"finishedCb"),Q=new jn.CancellationTokenSource,U=JJs(t,R,x,Q.token,q);t.get(Tb).queueCompletionRequest(r,E,g.prompt,Q,U);let z=await t.get(Tb).getFirstMatchingRequest(r,E,g.prompt,m.isSpeculative);if(z===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:pp(x,t)};T=[[z[0]],4]}u("network")}if(T===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:pp(x,t)};let[D,N]=T,B=D.map(q=>bNe(t,e.textDocument,e.position,q,P,sl)).filter(q=>q!==void 0),L=Ft(t,Ke.CompletionsDelay)??d.completionsDelay(n),j=pl()-n.issuedTime,M=Math.max(L-j,0);if(N!==2&&!m.isCycling&&M>0&&(sl.debug(t,`Waiting ${M}ms before returning completion`),await AC(M),SNe(t,r,o)))return sl.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:IH(x)};let O=[];for(let q of B){let Q=fZs(t,e.textDocument,R,q,x),U=f?Yri(e.textDocument,e.position,q):0,$={completion:lZs(q.choiceIndex,q.completionText,g.trailingWs),telemetry:Q,isMiddleOfTheLine:f,suffixCoverage:U,copilotAnnotations:q.copilotAnnotations,clientCompletionId:q.clientCompletionId};O.push($)}return x.properties.clientCompletionId=O[0]?.clientCompletionId,x.measurements.foundOffset=O?.[0]?.telemetry?.measurements?.foundOffset??-1,sl.debug(t,`Produced ${O.length} results from ${Vhe(N)} at ${x.measurements.foundOffset} offset`),SNe(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:IH(x)}:(m.isSpeculative||t.get(Ib).setGhostText(E,g.prompt.suffix,B,N),u("complete"),{type:"success",value:[O,N],telemetryData:pp(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(rZs,"getGhostTextWithoutAbortHandling");async function bhr(t,e,r,n){let o=Gt();t.get(Ib).currentRequestId=o;let s=await dZs(t,e.textDocument,o,n);await X7().catch(()=>{});try{return t.get(xb).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(W5).notifyRequest(e,o,s,r,n),await rZs(t,e,o,s,r,n)}catch(c){if(Lm(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:IH(s,{cancelledNetworkRequest:!0})};throw c}}a(bhr,"getGhostText");function nZs(t,e,r,n){let o=t.get(Ib).getCompletionsForUserTyping(e,r.suffix),s=uZs(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(nZs,"getLocalInlineSuggestion");function iZs(t,e){let r=oZs(e,t),n=sZs(e,t);return r&&!n?void 0:r&&n}a(iZs,"isInlineSuggestion");function oZs(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(oZs,"isMiddleOfTheLine");function sZs(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(sZs,"isValidMiddleOfTheLinePosition");function aZs(t,e){return e.lineAt(t).text.trim().length===0}a(aZs,"isNewLine");var p8=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function cZs(t,e,r,n,o,s,c){if(t.get(p8).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"&&zM.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await zun(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&aZs(n,r))return{requestMultiline:!0};let u=!1;return!o&&bS(r.detectedLanguageId)?u=await nut(r,n):o&&bS(r.detectedLanguageId)&&(u=await nut(r,n)||await nut(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=HXn(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(cZs,"shouldRequestMultiline");function Qdt(t,e,r){t.get(B2).append(e.prefix,e.prompt.suffix,r)}a(Qdt,"appendToCache");function lZs(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(lZs,"adjustLeadingWhitespace");function uZs(t,e,r,n){let o=t.get(B2).findAll(e,r);return o.length===0?(sl.debug(t,"Found no completions in cache"),[]):(sl.debug(t,`Found ${o.length} completions in cache`),o.map(s=>Chr(s,{forceSingleLine:!n})))}a(uZs,"getCompletionsFromCache");async function dZs(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(dZs,"createTelemetryWithExp");function fZs(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,tni(u,e),u.extendWithRequestId(s),u.measurements.confidence=Wri(t,u),u.measurements.quantile=zri(t,u),sl.debug(t,`Extended telemetry for ${n.telemetryData.properties.headerRequestId} with retention confidence ${u.measurements.confidence} (expected as good or better than about ${u.measurements.quantile} of all suggestions)`),u}a(fZs,"telemetryWithAddData");function pZs(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);tni(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(fu.range(h.range.start,n)),g=e.getText(fu.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Xri.SHA256)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...tse(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(pZs,"telemetryIssued");function tni(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(tni,"addDocumentTelemetry");function rni(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(rni,"telemetryPerformance");p();p();var nee=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 BT=class{static{a(this,"CitationManager")}},qdt=class extends BT{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var Shr=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??jn.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}static{a(this,"CompletionState")}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{let v=Hdt.indexOf(_);v!==-1&&Hdt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of Hdt)_()}a(e,"afterUpdateConnection");function r(_){G2.connection!==_&&(G2.connection=_,e())}a(r,"updateConnection");function n(){return G2.connection==="connected"}a(n,"isConnected");function o(){return G2.connection==="disconnected"}a(o,"isDisconnected");function s(){return G2.connection==="retry"}a(s,"isRetrying");function c(){return G2.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(_){G2.initialWait!==_&&(G2.initialWait=_)}a(h,"setInitialWait");function m(_,v=hZs){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return G2.initialWait}a(g,"isInitialWait");async function A(_,v){Rb.info(_,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let b=_.get(tr);function T(w,R){if(w>ini){Rb.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{G2.retryAttempts=Math.min(G2.retryAttempts+1,oni);try{Rb.info(R,`Pinging service after ${w} second(s)`);let P=await b.fetch(new URL("_ping",dL(R)["origin-tracker"]).href,{method:"GET",headers:{"content-type":"application/json"}});if(P.status!==200||!P.ok)T(w**2,R);else{Rb.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),Rb.info(_,"Attempting to reconnect."),T(Thr,_)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),jdt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},jdt}a(mZs,"registerConnectionState");var oee=mZs();p();var kg={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},TNe={[kg.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[kg.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[kg.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function Ihr(t){return t===401?kg.Unauthorized:t===400?kg.BadArguments:t===404?kg.NotFound:t===429?kg.RateLimit:t>=500&&t<600?kg.InternalError:t>=600?kg.ConnectionError:kg.Unknown}a(Ihr,"getErrorType");function c4(t,e,r={}){return{kind:"failure",reason:Ihr(Number(t)),code:Number(t),msg:e,meta:r}}a(c4,"createErrorResponse");p();var gZs=/^[1-6][0-9][0-9]$/,AZs=/([A-Z][a-z]+)/,yZs="code_referencing",INe=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[yZs,this.baseKey,...e].join(".")}},xhr=class extends INe{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)}},SGf=new xhr,whr=class extends INe{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)}},TGf=new whr,Rhr=class extends INe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=Wt.createAndMarkAsIssued({origin:r,reason:n});$0(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=Wt.createAndMarkAsIssued({origin:r,reason:n});$0(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match(gZs)){Rb.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(AZs).filter(l=>!!l).join("_").toLowerCase(),c=Wt.createAndMarkAsIssued({message:o});$0(e,this.buildKey(s,r),c)}},Gdt=new Rhr;var EZs="twirp/github.snippy.v1.SnippyAPI";async function Phr(t,e,r,n){let o;try{o=await t.get(Ut).getToken()}catch{return oee.setDisconnected(),c4(401,TNe[kg.Unauthorized])}if(Rb.info(t,`Calling ${e}`),oee.isRetrying())return c4(600,"Attempting to reconnect to the public code matching service.");if(oee.isDisconnected())return c4(601,"The public code matching service is offline.");let s;try{s=await t.get(tr).fetch(KI(t,o,"origin-tracker",`${EZs}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...Oy(t)},signal:n})}catch{return oee.enableRetry(t),c4(602,"Network error detected. Check your internet connection.")}!s.ok&&(s.status===401||s.status===403)&&t.get(Ut).resetToken("snippy",s.status);let c;try{c=await s.json()}catch(A){let y=A.message;throw Gdt.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=Ihr(h),g=d||"unknown error";switch(m){case kg.Unauthorized:return c4(u,TNe[kg.Unauthorized],f);case kg.BadArguments:return c4(u,g,f);case kg.RateLimit:return oee.enableRetry(t,60*1e3),c4(u,TNe.RateLimitError,f);case kg.InternalError:return oee.enableRetry(t),c4(u,TNe[kg.InternalError],f);default:return c4(u,g,f)}}a(Phr,"call");p();var $dt=S.Object({kind:S.Literal("failure"),reason:S.String(),code:S.Number(),msg:S.String(),meta:S.Optional(S.Any())}),vZs=S.Object({matched_source:S.String(),occurrences:S.String(),capped:S.Boolean(),cursor:S.String(),github_url:S.String()}),sni=S.Object({source:S.String()}),CZs=S.Object({snippets:S.Array(vZs)}),ani=S.Union([CZs,$dt]),cni=S.Object({cursor:S.String()}),bZs=S.Object({commit_id:S.String(),license:S.String(),nwo:S.String(),path:S.String(),url:S.String()}),SZs=S.Object({has_next_page:S.Boolean(),cursor:S.String()}),TZs=S.Object({count:S.Record(S.String(),S.String())}),IZs=S.Object({file_matches:S.Array(bZs),page_info:SZs,license_stats:TZs}),lni=S.Union([IZs,$dt]);async function uni(t,e,r){let n=await Phr(t,"Match",{method:"POST",body:bK(sni,{source:e})},r);return bK(ani,n)}a(uni,"Match");async function dni(t,{cursor:e},r){let n=await Phr(t,"FilesForMatch",{method:"POST",body:bK(cni,{cursor:e})},r);return bK(lni,n)}a(dni,"FilesForMatch");p();var xNe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),Vdt=65;function RZs(t){let e=0,r;xNe.lastIndex=0;do if(r=xNe.exec(t),r&&(e+=1),e>=Vdt)break;while(r);return e}a(RZs,"lexemeLength");function PZs(t,e){let r=0,n;xNe.lastIndex=0;do if(n=xNe.exec(t),n&&(r+=1,r>=e))return xNe.lastIndex;while(n);return t.length}a(PZs,"offsetFirstLexemes");function fni(t,e){let r=t.split("").reverse().join(""),n=PZs(r,e);return r.length-n}a(fni,"offsetLastLexemes");function wNe(t){return RZs(t)>=Vdt}a(wNe,"hasMinLexemeLength");function DZs(t){return VM.Check($dt,t)}a(DZs,"isError");async function pni(t,e){let r=await e();if(DZs(r)){Gdt.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(pni,"snippyRequest");function hni(t){return"kind"in t&&t.kind==="failure"}a(hni,"isMatchError");async function mni(t,e,r,n){let s=await t.get($r).getTextDocument({uri:e});if(!s){Rb.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!wNe(c)||!wNe(c))return;let l=r;if(!wNe(r)){let g=c.slice(0,n),A=fni(g,Vdt);l=c.slice(A,n+r.length)}if(!wNe(l))return;let u=await pni(t,()=>uni(t,l));if(!u||hni(u)||!u.snippets.length){Rb.info(t,"No match found");return}Rb.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await pni(t,()=>dni(t,{cursor:g.cursor}));if(!A||hni(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(BT).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(mni,"fetchCitations");p();function khr(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(OZs,"lexGeneratorWords");function gni(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(gni,"lexicalAnalyzer");function Ani(t){return t!==" "}a(Ani,"notSingleSpace");function yni(t,e,r=OZs){let[n,o]=gni(t,NZs(),r,Ani),[s,c]=gni(e,o,r,Ani);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=MZs(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=khr(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(yni,"lexEditDistance");p();function OH(t){return t.length===0?0:t.split(` -`).length}a(OH,"countLines");function Eni(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(Eni,"computeCompletionText");var BH=new pe("postInsertion"),_ni=[{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}],vni=50,BZs=1500,LZs=.5,FZs=500,Dhr={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 BH.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 Eme(t,r.properties.headerRequestId,iee(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=Kfr(u,n,c.detectedLanguageId),y=hei(g,void 0)(m),E=Math.min(l.length,n+(y?y*2:FZs)),_=l.substring(n,E);return{prompt:h,capturedCode:_,terminationOffset:y??-1}}}a(Cni,"captureCode");function Wdt(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{BH.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),$Xn(t,e,d)});let s=new nee(t,n,r-1),c=new nee(t,n,r),l=a(async u=>{BH.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});BH.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),Et(t,e+".capturedAfterRejected",A,1)},"checkInCode");_ni.filter(u=>u.captureRejection).map(u=>s.push(U0(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(Wdt,"postRejectionTasks");function RNe(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});BH.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),GXn(t,e,u);let d=r;r=Eni(r,c);let f=r.trim(),h=new nee(t,o,n),m=new nee(t,o,n+r.length),g=a(async A=>{await jZs(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(Dhr.triggerPostInsertionSynchroneously&&w1(t)){let A=g({seconds:0,captureCode:Dhr.captureCode,captureRejection:Dhr.captureRejection});t.get(Td).register(A)}else _ni.map(A=>h.push(U0(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));U0(t,UZs,"post insertion citation check")(t,o,d,r,n,l)}a(RNe,"postInsertionTasks");async function UZs(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(JI(t)?.getTokenValue("sn")==="1")return;await mni(t,e,n,o);return}let c=await t.get($r).getTextDocument({uri:e});if(c){let l=Nhr(c.getText(),n,vni,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=QZs(r.length,n.length,l.start_offset);if(u===void 0){BH.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+qZs(r.length,n.length,l.stop_offset),m=c?.positionAt(h),g=f&&m?c?.getText({start:f,end:m}):"";await t.get(BT).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(UZs,"citationCheck");function QZs(t,e,r){if(!(ee))return r}a(QZs,"computeCitationStart");function qZs(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 Mhr(t,e){let r=t.get(ZA);if(!r.position||!r.uri)return;let n=$Zs(r);n.length>0&&Wdt(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(Mhr,"rejectLastShown");function bni(t,e,r,n){let o=t.get(ZA);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&Mhr(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(bni,"setLastShown");function Sni(t,e){let r=t.get(ZA);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;GZs.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,Wlt(t,"ghostText",e)}}a(Sni,"handleGhostTextShown");function VZs(t,e,r){let n=t.get(ZA);n.linesLeft===void 0&&(n.linesAccepted=OH(e.insertText.substring(0,r)),n.linesLeft=OH(e.displayText));let o=OH(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 vme(t,e,r="ghostText"){let n=t.get(ZA),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:OH(e.displayText)},n.resetState(),RNe(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(vme,"handleGhostTextPostInsert");function zdt(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(ZA),l;return s==="cumulative"?(WZs(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}),RNe(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a(zdt,"handlePartialGhostTextPostInsert");function WZs(t,e,r){let n=t.get(ZA);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=OH(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(WZs,"handleCumulativeAcceptance");p();var l4=new Map;l4.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});l4.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});l4.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});l4.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});l4.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});l4.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var zZs=new pe("sdk");function Ydt(t,e){l4.has(t.get(Ir).getEditorPluginInfo().name)||zZs.warn(t,...e)}a(Ydt,"deprecationWarning");var bzi=de(fk()),_I=de(Bk());p();p();p();p();var Kdt={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function Cme(t,e){let r=Wt.createAndMarkAsIssued({authType:e});Et(t,Kdt.NewGitHubLogin,r),yt(t,Kdt.NewGitHubLogin,{authType:e})}a(Cme,"telemetryNewGitHubLogin");function $2(t,e,r,n,o){Zn(t,Kdt.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a($2,"telemetryGitHubLoginResult");function PNe(t,e,r){Zn(t,Kdt.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(PNe,"telemetryCodeFlowError");var Tni=["repo","workflow"],Ohr=class extends Ai{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function YZs(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...Oy(t)},json:{client_id:e,scope:Tni.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&&zI(c)?new Ai(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new Ai(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(YZs,"requestDeviceFlowStage1");async function KZs(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...Oy(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 Ohr(c):new Ai(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(KZs,"requestDeviceFlowStage2");async function JZs(t,e){let n=await(await qf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new Ai(`Error retrieving user information: ${String(n.errors)}`);return n}a(JZs,"requestUserInfo");var LT=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(Hp).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(Hp).githubAppId=n;let d=await this.save(u);return $2(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{$2(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw $2(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(gC).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;Cme(n,"deviceFlow");let o=await YZs(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 KZs(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await JZs(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):Tni;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new Ai(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var Bhr=de(ri());p();var sR=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var Jdt="github.copilot.finishDeviceFlow",Lhr=class extends sR{constructor(){super(...arguments);this.name=Jdt;this.arguments=S.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get(LT),s=o.pendingSignIn;if(!s)throw new Bhr.ResponseError(Ze.InvalidRequest,"No pending sign in");try{await this.ctx.get(Um).open(s.verificationUri)}catch(c){p_.warn(this.ctx,"Failed to open",s.verificationUri),p_.exception(this.ctx,c,Jdt)}try{return await s.status}catch(c){throw new Bhr.ResponseError(Ze.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},Ini=[Lhr];p();p();var Tu=class extends En{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var kNe="github.copilot.didAcceptCompletionItem",Fhr=class extends sR{constructor(){super(...arguments);this.name=kNe;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(Tu).get(n);return s?(vme(this.ctx,s),!0):!1}},xni=[Fhr];p();p();p();p();p();p();function wni(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` +`],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(` `).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(wni,"normalizeIndentCharacter");jo();function Rni(t,e,r,n,o,s,c){let l=n.lineAt(o),u=e.map(d=>{let f=fu.range(fu.position(o.line,0),fu.position(o.line,o.character+d.suffixCoverage)),h="";if(s&&(d.completion=wni(s,d.completion,l.isEmptyOrWhitespace)),l.isEmptyOrWhitespace&&(d.completion.displayNeedsWsOffset||d.completion.completionText.startsWith(l.text)))h=d.completion.completionText;else{let g=fu.range(f.start,o);h=n.getText(g)+d.completion.displayText}return{uuid:Gt(),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(Rni,"completionsFromGhostTextResults");p();var V2=class{constructor(){this.cache=new En(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 bme=class extends KA{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 bhr(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=bni(s,r.textDocument,r.position,d),h=Rni(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(()=>bhr(s,r,void 0,g),"fn");s.get(V2).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,E=jn.Range.create(A,jn.Position.create(y.line,y.character-c));return{...g,range:E}});return{...l,value:m}}async getPrompt(r,n,o,s={}){let c=await this.getInlineCompletionsResult(iee(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(iee(r,n),o,s);return VXn(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}});Vlt.debug(this.ctx,`Requesting for ${r.uri} at ${n.line}:${n.character}`,`between ${JSON.stringify(o)} and ${JSON.stringify(s)}.`)}triggerSpeculativeRequests(r){return this.ctx.get(V2).request(r.clientCompletionId)}};var b7i=de(D5r()),S7i=de(fgt()),T7i=de(ZX()),ULe=de(bc()),F5r=de(Io());var N5r=class extends F5r.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 ULe.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new ULe.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new ULe.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(Es(r,()=>{this.fireTokenChanged()}))}static{a(this,"AuthServiceAdapter")}fireTokenChanged(){this._tokenChangedEverFired=!0,this._onDidAccessTokenChange.fire(),this._onDidAuthenticationChange.fire()}ensureTokenChangedFired(){this._tokenChangedEverFired||this.fireTokenChanged()}async getAnyGitHubSession(r){let n=await this.ctx.get(Ur).resolveSession();if(n!==void 0)return{id:n.login,accessToken:n.accessToken,account:{id:n.login,label:n.serverUrl},scopes:[]}}async getGitHubSession(r,n){if(r!=="permissive")return this.getAnyGitHubSession(n)}getPermissiveGitHubSession(r){return Promise.resolve(void 0)}get copilotToken(){let r=this.ctx.get(Ut).getLastToken();if(r!==void 0)return this.ensureTokenChangedFired(),Lbt(r,this.ctx)}async getCopilotToken(r){let n=this.ctx.get(Ut);r&&n.resetToken("inline_completion_force_refresh");let o=await n.getToken();this.ensureTokenChangedFired();let s=await this.ctx.get(Ur).resolveSession();return Lbt(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Ut).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function Lbt(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new S7i.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(lf).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(Lbt,"asChatLibCopilotToken");var M5r=class extends F5r.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new ULe.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(Es(r,()=>{this.models=void 0}))}static{a(this,"EndpointProviderAdapter")}async getAllModels(r=!1){if(this.models===void 0||r)try{let n=this.ctx.get(Px),o=await this.ctx.get(Ut).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.")}},O5r=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(tc).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)}},B5r=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}}}},L5r=class extends KA{constructor(r){super();this.ctx=r;this._telemetrySender=new QLe(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(dm).matchFunction,o=new jLe(this.ctx.get(tr)),s=Jce(r),c={fetcher:o,authService:new N5r(r),telemetrySender:this._telemetrySender,logTarget:new qLe(r),isRunningInTest:w1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new B5r(r.get(cs)),documentManager:r.get($r),workspace:r.get(T7i.ObservableWorkspace),urlOpener:r.get(Um),editorInfo:r.get(Ir).getEditorInfo(),editorPluginInfo:r.get(Ir).getEditorPluginInfo(),relatedPluginInfo:r.get(Ir).getRelatedPluginInfo(),editorSession:r.get(La),notificationSender:r.get(_s),ignoreService:new O5r(r),waitForTreatmentVariables:!1,endpointProvider:new M5r(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s},l=(0,b7i.createInlineCompletionsProvider)(c);return this.ctx.get(Mo).onDidChangeCopilotSettings(()=>{let u=Jce(this.ctx);l.setConfigs(u).catch(d=>{Ua(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();return this._telemetrySender.updateExpConfig(c.filtersAndExp.exp),this.completionProvider.updateTreatmentVariables(c.filtersAndExp.exp.variables),this.asLocalResult(await this.completionProvider.getInlineCompletions(r,n,o,s),c)}asLocalResult(r,n){if(r!==void 0)return r.map(o=>({uuid:o.uuid,insertText:o.insertText,range:o.range,uri:o.uri,telemetry:new VI({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new VB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new Jv(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)}},Fbt=class extends KA{constructor(r){super();this.ctx=r}static{a(this,"ConfigurableInlineCompletionManager")}get ghostTextImpl(){return this._ghostTextImpl||(this._ghostTextImpl=new bme(this.ctx)),this._ghostTextImpl}get chatLibImpl(){return this._chatLibImpl||(this._chatLibImpl=new L5r(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();return Ft(this.ctx,Ke.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)}},QLe=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),nse(this.ctx,e,o.properties,o.measurements,0),yt(this.ctx,e,Z9(o.properties,JDe),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),nse(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 I7i=de(g$()),x7i=de(bc()),HLe=de(AIr()),w7i=de(W4());var Nxc=16,t9=class extends I7i.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new En(Nxc);this._onDidChangeDiagnostics=new x7i.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(Mxc);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 Mxc(t){let e=new w7i.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?HLe.DiagnosticSeverity.Error:HLe.DiagnosticSeverity.Warning,n=new HLe.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(Mxc,"toVscodeDiagnostic");p();var Oxc="nes.reportInlineEditArc";function R7i(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};yt(t,Oxc,r,n)}a(R7i,"emitNESArcTelemetry");p();var Zye=de(Pne()),P7i=de(XD()),U5r=de(ldt()),qbt=de(ZX()),k7i=de(Is()),D7i=de(j2()),GLe=de(bE()),Qbt=de(O_()),Q5r=de(dd()),N7i=de(OT()),M7i=de(ri());p();var Ubt=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new Hi;this._onDidChangeTextDocument=new Hi;this._onDidCloseTextDocument=new Hi;this._onDidSelectTextDocument=new Hi;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 Xye=class extends qbt.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,D7i.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new Ubt(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=Zye.DocumentId.create(Os(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=Zye.DocumentId.create(Os(Os(r)));return this.addDocument({id:s,initialValue:o,languageId:U5r.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=Zye.DocumentId.create(Os(Os(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=Zye.DocumentId.create(Os(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=Zye.DocumentId.create(Os(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 q5r(r.id,new N7i.StringText(r.initialValue??""),[],r.languageId??U5r.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()}},q5r=class extends qbt.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 Qbt.Position(e.lineNumber+1,e.column+1));this.updateSelection([new Q5r.OffsetRange(r,r)])}editFromLspContentChanges(e){return new P7i.Edits(GLe.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(M7i.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new Qbt.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new Qbt.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 k7i.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 GLe.StringEdit.single(new GLe.StringReplacement(new Q5r.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var r9=de(D5r()),B7i=de(Pne()),H5r=de(ZX()),L7i=de(fy()),F7i=de(NCt()),U7i=de(bc()),G5r=require("node:stream");jo();var O7i=10,Bxc=[0,30*1e3,120*1e3,300*1e3,600*1e3,900*1e3],j5r=new pe("nextEditSuggestions"),Lxc={[r9.LogLevel.Off]:4,[r9.LogLevel.Trace]:4,[r9.LogLevel.Debug]:4,[r9.LogLevel.Info]:3,[r9.LogLevel.Warning]:2,[r9.LogLevel.Error]:1},qLe=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(Ff).logIt(this.ctx,Lxc[e],r,...n)}},Uv=class{constructor(e){this.lastResultsById=new En(O7i);this.lastResultsByUri=new En(O7i);this.ctx=e,this.telemetrySender=new QLe(this.ctx)}static{a(this,"NextEditSuggestionsManager")}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(H5r.ObservableWorkspace);if(s instanceof Xye&&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=Os(e),l=B7i.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 Uxc({textDocumentManager:this.ctx.get($r)},d.result,{normalizedUri:c,version:r});if(!f)return;f.isCrossFile&&j5r.debug(this.ctx,`Cross-file NES: edit requested for ${l.uri} targets ${f.document.uri}`);let h=Fxc(d)??Gt(),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(KS).initialize(o,e.originalText,n,{timeouts:Bxc}).startReporter(c=>{R7i(this.ctx,{...c,opportunityId:e.resultId,languageId:e.languageId})})}).catch(o=>{j5r.warn(this.ctx,"Failed to start NES ARC telemetry",o)})}catch(r){j5r.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&&Qxc(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(H5r.ObservableWorkspace),r=new jLe(this.ctx.get(tr)),n=new $5r(this.ctx),o=Jce(this.ctx),s=await(0,r9.createNESProvider)({configOverrides:o,workspace:e,fetcher:r,copilotTokenManager:n,terminalService:F7i.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new qLe(this.ctx),languageDiagnosticsService:this.ctx.get(t9)});return this.ctx.get(Mo).onDidChangeCopilotSettings(()=>{let c=Jce(this.ctx);s.setConfigs(c).catch(l=>{Ua(this.ctx,l,"nesProvider.setConfigs")})}),s}shouldUseExplicitRejection(){return Ft(this.ctx,Ke.NESUseExplicitRejection)}};function Fxc(t){let e=t.requestUuid;return typeof e=="string"&&e.length>0?e:void 0}a(Fxc,"readOpportunityId");async function Uxc(t,e,r){let n=r.normalizedUri,o=e.targetDocumentUri,s=o!==void 0&&Os(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(Uxc,"resolveNextEditTarget");function Qxc(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){Ua(t,o,"nesProvider.setDisposalReason")}}a(Qxc,"trySetChatLibDisposalReason");var $5r=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new U7i.Emitter;this.onDidCopilotTokenRefresh=this.didChangeTokenResult.event;this._ctx.get(Ut).onDidChangeTokenResult(()=>{this.didChangeTokenResult.fire()})}static{a(this,"CopilotTokenManagerAdapter")}async getCopilotToken(e){let r=this._ctx.get(Ut);e&&r.resetToken("nes_force_refresh");let n=await r.getToken(),o=await this._ctx.get(Ur).resolveSession();return Lbt(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Ut).resetToken("nes",e)}},jLe=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 G5r.Readable?c=G5r.Readable.toWeb(s):c=s),new L7i.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},Gt(),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 zI(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 qxc="github.copilot.didAcceptNextEditSuggestionItem",V5r=class extends sR{constructor(){super(...arguments);this.name=qxc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(Uv).handleAcceptance(n),!0}},jxc="github.copilot.didRejectNextEditSuggestionItem",W5r=class extends sR{constructor(){super(...arguments);this.name=jxc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(Uv).handleRejection(n),!0}},Hxc="github.copilot.didIgnoreNextEditSuggestionItem",z5r=class extends sR{constructor(){super(...arguments);this.name=Hxc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(Uv).handleIgnored(n),!0}},Q7i=[V5r,W5r,z5r];p();var K5r="github.copilot.didAcceptPanelCompletionItem",Y5r=class extends sR{constructor(){super(...arguments);this.name=K5r;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(Tu).get(o);return c?(RNe(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:OH(c.displayText)},c.copilotAnnotations),!0):!1}},q7i=[Y5r];var Gxc=[...Ini,...xni,...Q7i,...q7i];function j7i(t,e){let r=new Map;for(let n of Gxc){let o=new n(t),s=Fu.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=n9(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Ir).getEditorPluginInfo();await e.get(zn).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(zn).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,$Le.gt)((0,$Le.coerce)(r.version),(0,$Le.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(zn).delete("versions",r.name),(await e.get(zn).listKeys("versions")).length===0&&await e.get(zn).deleteSetting("versions")}};p();var W7i=de(Yc()),z7i=require("crypto"),Vbt=de(require("path")),tEe=de(Kc());var Wxc={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},zxc=new tEe.ProgressType,AN=class t{constructor(e){this.ctx=e;this.#e=new Hi;this._changeHandlerLimiter=new W7i.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new tEe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(ar).connection}init(){this.ctx.get(Pn).getCapabilities().watchedFiles&&this.connection.onNotification(tEe.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(Pn).getCapabilities().watchedFiles)return Wxc;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(Pn).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=Vbt.extname(l).toLowerCase();kQ.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=Vbt.extname(s.uri).toLowerCase();if(!kQ.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(tc).enabled?this.getValidDocument(e):RS.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,z7i.randomUUID)(),n=[],o=this.connection.onProgress(zxc,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=Vbt.extname(l).toLowerCase();if(!kQ.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 Yxc=new pe("mcpGateway.projectCleanup"),Hne=class{constructor(e){this._dispose=e}static{a(this,"McpProjectCleanupSubscription")}dispose(){this._dispose()}};function Y7i(t){let e=t.get($r),r=t.get(WA),n=e.onDidChangeWorkspaceFolders(o=>{if(o.removed.length!==0)for(let s of o.removed)r.removeProject(s.uri).catch(c=>{Yxc.warn(t,"removeProject failed during workspace-folder cleanup",{workspaceFolder:s.uri,error:c instanceof Error?c.message:String(c)})})});return new Hne(()=>n.dispose())}a(Y7i,"installMcpProjectCleanup");p();p();p();p();p();var K7i=require("node:child_process"),J7i=require("node:events"),J5r=de(require("node:readline"));var fV=new pe("CodexProcessManager"),Wbt=class extends J7i.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"]'];fV.debug(this.ctx,`start: cmd=${r} args=${JSON.stringify(n)} cwd=${this.cwd}`);try{this.process=(0,K7i.spawn)(r,n,{env:{...process.env,OPENAI_API_KEY:"copilot-proxy"},stdio:["pipe","pipe","pipe"],cwd:this.cwd||void 0}),fV.debug(this.ctx,`start: spawn succeeded, pid=${this.process.pid}`)}catch(o){let s=o instanceof Error?o.message:String(o);throw fV.error(this.ctx,`start: spawn failed: ${s}`),new Error(`Failed to spawn codex app-server: ${s}`)}this.process.on("error",o=>{fV.error(this.ctx,`process error event: ${o.message}`),this.handleProcessExit(-1)}),this.process.on("exit",o=>{fV.debug(this.ctx,`process exit event: code=${o}`),this.handleProcessExit(o??-1)}),this.process.stdout&&(this.rl=J5r.default.createInterface({input:this.process.stdout}),this.rl.on("line",o=>this.handleLine(o))),this.process.stderr&&J5r.default.createInterface({input:this.process.stderr}).on("line",s=>{fV.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(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+` `),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)fV.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){fV.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 Z7i=de(require("node:http")),X7i=require("node:stream/promises");var o9=new pe("CodexResponsesProxyServer"),Kxc=16*1024*1024,zbt=class{constructor(e){this.ctx=e;this.port=0}static{a(this,"CodexResponsesProxyServer")}async start(){if(this.server)return this.port;let e=Z7i.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,o9.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(o9.info(this.ctx,`handleRequest: ${e.method} ${e.url}`),e.method==="POST"&&e.url?.includes("/responses")){let n=await this.readBody(e);o9.info(this.ctx,`proxyToCapiResponses: forwarding ${n.length} bytes`),await this.proxyToCapiResponses(n,r),o9.info(this.ctx,"proxyToCapiResponses: completed")}else o9.debug(this.ctx,`CodexResponsesProxyServer: unhandled ${e.method} ${e.url}`),r.writeHead(404),r.end("{}")}catch(n){o9.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(Ut),o=this.ctx.get(tr),s;try{s=await n.getToken()}catch(h){o9.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=qce(this.ctx,s,"v1/responses"),l={...Zm(this.ctx),"Content-Type":"application/json"},{headers:u}=await Qce(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});jce(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,X7i.pipeline)(g,r):r.end()}catch(h){if(d.signal.aborted){o9.debug(this.ctx,"upstream fetch aborted by client disconnect"),r.writableEnded||r.end();return}if(o9.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>Kxc){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 Z5r=require("node:fs"),eQi=de(require("node:os")),Ybt=de(require("node:path"));jo();function Jxc(){let t=process.env.CODEX_HOME;return t||Ybt.join(eQi.homedir(),".codex")}a(Jxc,"codexHome");async function tQi(t){let e=Ybt.join(Jxc(),"sessions");try{return await rQi(e,t)}catch{return null}}a(tQi,"findRolloutFile");async function rQi(t,e){let r;try{r=await Z5r.promises.readdir(t,{withFileTypes:!0})}catch{return null}for(let n of r){let o=Ybt.join(t,n.name);if(n.isDirectory()){let s=await rQi(o,e);if(s)return s}else if(n.isFile()&&n.name.endsWith(".jsonl")&&n.name.includes(e))return o}return null}a(rQi,"searchForRollout");async function nQi(t){let e;try{e=await Z5r.promises.readFile(t,"utf8")}catch{return null}let r=e.split(` -`).filter(s=>s.trim().length>0),n=[],o=!1;for(let s of r){let c;try{c=JSON.parse(s)}catch{continue}let l=Zxc(c,o);l&&(Array.isArray(l)?n.push(...l):n.push(l)),c.type==="event_msg"&&c.payload.type==="task_started"&&(o=!0)}return n}a(nQi,"readAndTranslateRollout");function Zxc(t,e){switch(t.type){case"event_msg":return Xxc(t.timestamp,t.payload,e);case"response_item":return null;default:return null}}a(Zxc,"translateRolloutLine");function Xxc(t,e,r){switch(e.type){case"task_started":{if(!r)return{id:Gt(),timestamp:t,type:"session.start",data:{producer:"codex",startTime:t}};let o=e.turn_id||Gt();return{id:Gt(),timestamp:t,type:"assistant.turn_start",data:{turnId:o,interactionId:o}}}case"user_message":{let o=e.message||"";return{id:Gt(),timestamp:t,type:"user.message",data:{content:o}}}case"agent_message":{let o=e.message||"",s=Gt();return{id:s,timestamp:t,type:"assistant.message",data:{content:o,messageId:s}}}case"token_count":return null;case"task_complete":return{id:Gt(),timestamp:t,type:"session.idle"};default:return null}}a(Xxc,"translateEventMsg");p();jo();function pV(t,e){return{id:Gt(),timestamp:new Date().toISOString(),type:t,...e!==void 0?{data:e}:{}}}a(pV,"envelope");function iQi(t,e){switch(t){case"item/agentMessage/delta":return ewc(e);case"item/started":return twc(e);case"item/completed":return rwc(e);case"turn/completed":return nwc(e);case"thread/tokenUsage/updated":return iwc(e);case"turn/started":return owc(e);case"item/reasoning/summaryTextDelta":return swc(e);default:return null}}a(iQi,"translateCodexNotification");function ewc(t){return pV("assistant.message_delta",{deltaContent:t.delta,messageId:t.itemId||t.turnId})}a(ewc,"translateAgentMessageDelta");function twc(t){return pV("assistant.turn_start",{turnId:t.turnId,interactionId:t.turnId})}a(twc,"translateItemStarted");function rwc(t){return pV("assistant.message",{content:"",messageId:t.itemId||t.turnId,turnId:t.turnId})}a(rwc,"translateItemCompleted");function nwc(t){let e=[];return e.push(pV("assistant.usage",{model:"codex",duration:t.turn.durationMs??void 0})),e.push(pV("session.idle")),e}a(nwc,"translateTurnCompleted");function iwc(t){let e=t.tokenUsage.last;return pV("assistant.usage",{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheReadTokens:e.cachedInputTokens})}a(iwc,"translateTokenUsageUpdated");function owc(t){let e=t.turn?.id||"unknown";return pV("assistant.turn_start",{turnId:e,interactionId:e})}a(owc,"translateTurnStarted");function swc(t){return pV("assistant.reasoning_delta",{reasoningId:t.reasoningId||"codex-reasoning",deltaContent:t.delta})}a(swc,"translateReasoningDelta");jo();var GE=new pe("CodexAgentService"),Gne=class{constructor(e){this.ctx=e;this.initialized=!1;this.sessions=new Map;this.proxyServer=new zbt(e),this.notificationSender=e.get(_s),this.codexPath=this.resolveCodexPath()}static{a(this,"CodexAgentService")}resolveCodexPath(){let e=Ft(this.ctx,Ke.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 Wbt(this.ctx,this.codexPath,e,this.workspaceCwd),this.processManager.onNotification((r,n)=>{this.handleNotification(r,n)}),this.processManager.on("error",r=>{GE.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 Sb(this.ctx,"codexAgent.createSession",async r=>{if(GE.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}),r.properties.sessionId=o,r.properties.modelId=e.model??"",{sessionId:o,workspacePath:e.workspaceFolder?.uri}})}async resumeSession(e){return Sb(this.ctx,"codexAgent.resumeSession",async r=>{let n=e.sessionId;GE.info(this.ctx,"resumeSession",{threadId:n}),r.properties.sessionId=n;let o=this.sessions.get(n);if(o)return r.properties.reason="inMemory",{sessionId:n,workspacePath:o.workspacePath};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)"})}catch(c){let l=c instanceof Error?c.message:String(c);GE.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)"}),r.properties.freshThread="true"}let s;try{let c=await tQi(n);c&&(s=await nQi(c)??void 0)}catch(c){let l=c instanceof Error?c.message:String(c);GE.warn(this.ctx,"resumeSession: error reading rollout",{threadId:n,error:l})}return r.measurements.eventCount=s?.length??0,{sessionId:n,workspacePath:e.workspaceFolder?.uri,events:s}})}async sendMessage(e,r){return Sb(this.ctx,"codexAgent.sendMessage",async n=>{GE.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){GE.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},this.sessions.set(e.sessionId,o)}catch(l){GE.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},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)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(", ")}] -`})}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}),GE.info(this.ctx,"CodexAgentService.stopSession",{sessionId:e}))}destroySession(e){return this.sessions.delete(e.sessionId),GE.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)),GE.info(this.ctx,`CodexAgentService.listSessions: ${r.length} sessions`),Promise.resolve({sessions:r})}async listModels(e){try{let o=(await this.ctx.get(Ss).getMetadata(e)).filter(s=>s.supported_endpoints?.includes(u$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 GE.info(this.ctx,`CodexAgentService.listModels: ${s.length} responses-capable models from CAPI`),{models:s}}GE.warn(this.ctx,"CodexAgentService.listModels: no responses-capable models found in CAPI")}catch(r){let n=r instanceof Error?r.message:String(r);GE.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){GE.info(this.ctx,`handleNotification: method=${e}`,{params:JSON.stringify(r).slice(0,500)});let o=r?.threadId;if(!o){GE.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=iQi(e,r);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:Gt(),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:Gt(),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 oQi=new pe("AgentRouter"),sQi="AgentRouter";function fI(t){return t.agentProvider??"BACKGROUND"}a(fI,"resolveProvider");var uc=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(qs);case"CLAUDE":return this.ctx.get(o8);case"CODEX":return this.ctx.get(Gne)}}logDispatch(e,r){oQi.debug(this.ctx,`${sQi}.${e}`,r)}create(e){this.logDispatch("create",e);let r=fI(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=fI(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=fI(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=fI(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=fI(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=fI(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=fI(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=fI(e);return this.serviceFor(r).handleInteraction(e)}async getPlanPath(e){this.logDispatch("getPlanPath",e);let r=fI(e);return{path:await this.serviceFor(r).getPlanPath(e.sessionId)}}enableRemote(e){this.logDispatch("enableRemote",e);let r=fI(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=fI(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=fI(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=fI(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{oQi.info(this.ctx,`${sQi}.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 awc=S.Union([S.String(),S.Number()]),xi=S.String(),rEe=S.Optional(S.String()),cwc=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())}),X5r=S.Array(cwc),VLe=S.Union([S.Literal("default"),S.Literal("long_context")]),nEe=S.Object({model:S.Optional(S.String()),reasoningEffort:rEe,workspaceFolder:S.Object({uri:S.String(),name:S.Optional(S.String())}),globalAgentsMdInstructions:S.Optional(S.String()),globalClaudeMdInstructions:S.Optional(S.String()),externalToolDefinitions:S.Optional(X5r),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 Ei(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof OX?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(Ei,"withServiceErrorHandling");var aQi=new pe("BackgroundAgent.compactHistory"),lwc=S.Object({sessionId:xi});async function e4r(t,e,r){aQi.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(qs),o=e.onCancellationRequested(()=>{aQi.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await Ei(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(e4r,"handleBackgroundAgentCompactHistoryChecked");var eZp=Oe(lwc,e4r);p();var t4r=S.Union(Object.values(sh).map(t=>S.Literal(t))),Dl=S.Optional(t4r),Kbt=S.Intersect([nEe,S.Object({agentProvider:Dl})]);var cQi=new pe("BackgroundAgent.compactHistory"),uwc=S.Object({sessionId:xi,agentProvider:Dl});async function dwc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return e4r(t,e,r);cQi.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(uc),s=r;return Ei(async()=>{let c=await o.compactHistory(s,e);return cQi.info(t,"compactHistory succeeded"),c})}a(dwc,"handleAgentCompactHistoryChecked");var lQi=Oe(uwc,dwc);p();p();var uQi=new pe("BackgroundAgent.create"),fwc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),nEe]);async function r4r(t,e,r){uQi.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(qs),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 Ei(async()=>{let s=await n.createSession(o);return uQi.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(r4r,"handleBackgroundAgentCreateChecked");var wZp=Oe(fwc,r4r);var dQi=new pe("BackgroundAgent.create"),pwc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),Kbt]);async function hwc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return r4r(t,e,r);dQi.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(uc),s=r;return Ei(async()=>{let c=await o.create(s);return dQi.info(t,"create succeeded:",c.sessionId),c})}a(hwc,"handleAgentCreateChecked");var fQi=Oe(pwc,hwc);p();p();var mwc=S.Object({sessionId:xi});async function n4r(t,e,r){let n=t.get(qs);return Ei(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a(n4r,"handleBackgroundAgentDestroyChecked");var zZp=Oe(mwc,n4r);var gwc=new pe("BackgroundAgent.destroy"),Awc=S.Object({sessionId:xi,agentProvider:Dl});async function ywc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return n4r(t,e,r);gwc.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(uc),s=r;return Ei(async()=>o.destroy(s))}a(ywc,"handleAgentDestroyChecked");var pQi=Oe(Awc,ywc);p();p();var Ewc=new pe("BackgroundAgent.disableRemote"),_wc=S.Object({sessionId:xi});async function i4r(t,e,r){Ewc.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(qs);return Ei(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(i4r,"handleBackgroundAgentDisableRemoteChecked");var mXp=Oe(_wc,i4r);var hQi=new pe("BackgroundAgent.disableRemote"),vwc=S.Object({sessionId:xi,agentProvider:Dl});async function Cwc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return i4r(t,e,r);hQi.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(uc),s=r;return Ei(async()=>{let c=await o.disableRemote(s);return hQi.info(t,"disableRemote succeeded"),c})}a(Cwc,"handleAgentDisableRemoteChecked");var mQi=Oe(vwc,Cwc);p();p();var bwc=new pe("BackgroundAgent.enableRemote"),Swc=S.Object({sessionId:xi});async function o4r(t,e,r){bwc.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(qs);return Ei(async()=>n.enableRemote(r.sessionId))}a(o4r,"handleBackgroundAgentEnableRemoteChecked");var BXp=Oe(Swc,o4r);var gQi=new pe("BackgroundAgent.enableRemote"),Twc=S.Object({sessionId:xi,agentProvider:Dl});async function Iwc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return o4r(t,e,r);gQi.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(uc),s=r;return Ei(async()=>{let c=await o.enableRemote(s);return gQi.info(t,"enableRemote succeeded"),c})}a(Iwc,"handleAgentEnableRemoteChecked");var AQi=Oe(Twc,Iwc);p();p();var xwc=S.Object({sessionId:xi});async function s4r(t,e,r){let n=t.get(qs);return Ei(async()=>({path:await n.getPlanPath(r.sessionId)}))}a(s4r,"handleBackgroundAgentGetPlanPathChecked");var reh=Oe(xwc,s4r);var wwc=new pe("BackgroundAgent.getPlanPath"),Rwc=S.Object({sessionId:xi,agentProvider:Dl});async function Pwc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return s4r(t,e,r);wwc.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(uc),s=r;return Ei(async()=>o.getPlanPath(s))}a(Pwc,"handleAgentGetPlanPathChecked");var yQi=Oe(Rwc,Pwc);p();p();var kwc=new pe("BackgroundAgent.getRemoteStatus"),Dwc=S.Object({sessionId:xi});async function a4r(t,e,r){kwc.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(qs);return Ei(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a(a4r,"handleBackgroundAgentGetRemoteStatusChecked");var beh=Oe(Dwc,a4r);var Nwc=new pe("BackgroundAgent.getRemoteStatus"),Mwc=S.Object({sessionId:xi,agentProvider:Dl});async function Owc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return a4r(t,e,r);Nwc.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(uc),s=r;return Ei(async()=>o.getRemoteStatus(s))}a(Owc,"handleAgentGetRemoteStatusChecked");var EQi=Oe(Mwc,Owc);p();p();var Bwc=new pe("BackgroundAgent.interaction"),Lwc=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()})]),Fwc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),Uwc=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())])))}),Qwc=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())}),qwc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),jwc=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())})]),Hwc=S.Union([S.Object({sessionId:xi,requestId:S.String(),type:S.Literal("permission"),result:Lwc}),S.Object({sessionId:xi,requestId:S.String(),type:S.Literal("user_input"),response:Fwc}),S.Object({sessionId:xi,requestId:S.String(),type:S.Literal("elicitation"),response:Uwc}),S.Object({sessionId:xi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:Qwc}),S.Object({sessionId:xi,requestId:S.String(),type:S.Literal("queued_command"),result:qwc}),S.Object({sessionId:xi,requestId:S.String(),type:S.Literal("external_tool"),result:jwc})]);async function c4r(t,e,r){Bwc.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(qs);return Ei(async()=>await n.handleInteraction(r))}a(c4r,"handleBackgroundAgentInteractionChecked");var Geh=Oe(Hwc,c4r);var _Qi=new pe("BackgroundAgent.interaction"),Gwc=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()})]),$wc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),Vwc=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())])))}),Wwc=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())}),zwc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),Ywc=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())})]),Kwc=S.Union([S.Object({sessionId:xi,requestId:S.String(),type:S.Literal("permission"),result:Gwc,agentProvider:Dl}),S.Object({sessionId:xi,requestId:S.String(),type:S.Literal("user_input"),response:$wc,agentProvider:Dl}),S.Object({sessionId:xi,requestId:S.String(),type:S.Literal("elicitation"),response:Vwc,agentProvider:Dl}),S.Object({sessionId:xi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:Wwc,agentProvider:Dl}),S.Object({sessionId:xi,requestId:S.String(),type:S.Literal("queued_command"),result:zwc,agentProvider:Dl}),S.Object({sessionId:xi,requestId:S.String(),type:S.Literal("external_tool"),result:Ywc,agentProvider:Dl})]);async function Jwc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return c4r(t,e,r);_Qi.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(uc),s=r;return Ei(async()=>{let c=await o.interaction(s);return _Qi.info(t,"interaction succeeded"),c})}a(Jwc,"handleAgentInteractionChecked");var vQi=Oe(Kwc,Jwc);p();p();var CQi=new pe("BackgroundAgent.listSessions"),Zwc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String())});async function l4r(t,e,r){CQi.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(qs);return Ei(async()=>{let o=await n.listSessions(r);return CQi.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(l4r,"handleBackgroundAgentSessionsListChecked");var fth=Oe(Zwc,l4r);var bQi=new pe("BackgroundAgent.listSessions"),Xwc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String()),agentProvider:Dl});async function eRc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return l4r(t,e,r);bQi.info(t,"handleAgentSessionsList called",r);let o=t.get(uc),s=r;return Ei(async()=>{let c=await o.listSessions(s);return bQi.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(eRc,"handleAgentSessionsListChecked");var SQi=Oe(Xwc,eRc);p();p();var TQi=new pe("BackgroundAgent.listModels"),tRc=S.Object({forceRefresh:S.Optional(S.Boolean())});async function u4r(t,e,r){TQi.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(qs);return Ei(async()=>{let o=await n.listModels(r.forceRefresh);return TQi.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a(u4r,"handleBackgroundAgentListModelsChecked");var Mth=Oe(tRc,u4r);var IQi=new pe("BackgroundAgent.listModels"),rRc=S.Object({forceRefresh:S.Optional(S.Boolean()),agentProvider:Dl});async function nRc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return u4r(t,e,r);IQi.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(uc),s=r;return Ei(async()=>{let c=await o.listModels(s);return IQi.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(nRc,"handleAgentListModelsChecked");var xQi=Oe(rRc,nRc);p();p();var wQi=new pe("BackgroundAgent.resume"),iRc=S.Intersect([S.Object({sessionId:xi}),nEe]);async function d4r(t,e,r){wQi.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(qs),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 Ei(async()=>{let s=await n.resumeSession(o);return wQi.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a(d4r,"handleBackgroundAgentResumeChecked");var trh=Oe(iRc,d4r);var RQi=new pe("BackgroundAgent.resume"),oRc=S.Intersect([S.Object({sessionId:xi}),Kbt]);async function sRc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return d4r(t,e,r);RQi.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(uc),s=r;return Ei(async()=>{let c=await o.resume(s);return RQi.info(t,"resume succeeded:",c.sessionId),c})}a(sRc,"handleAgentResumeChecked");var PQi=Oe(oRc,sRc);p();p();var aRc=S.String(),Jbt=["interactive","plan","autopilot"],cRc=S.Union(Jbt.map(t=>S.Literal(t))),lRc=S.String({minLength:1}),uRc=S.Object({sessionId:xi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(aRc),reasoningEffort:rEe,references:S.Optional(S.Array(kO)),agentMode:S.Optional(cRc),chatMode:S.Optional(lRc),contextTier:S.Optional(VLe),sendMode:S.Optional(S.Union([S.Literal("enqueue"),S.Literal("immediate")]))});async function f4r(t,e,r){let n=t.get(qs),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 Ei(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(f4r,"handleBackgroundAgentSendChecked");var brh=Oe(uRc,f4r);var kQi=new pe("BackgroundAgent.send"),dRc=S.String(),fRc=S.String(),pRc=S.String({minLength:1}),hRc=S.Object({sessionId:xi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(dRc),reasoningEffort:rEe,references:S.Optional(S.Array(kO)),agentMode:S.Optional(fRc),chatMode:S.Optional(pRc),contextTier:S.Optional(VLe),agentProvider:Dl});async function mRc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return r.agentMode!==void 0&&!Jbt.includes(r.agentMode)?[null,{code:Ze.InvalidParams,message:`Unknown agentMode for Background provider: ${JSON.stringify(r.agentMode)}. Expected one of ${Jbt.join(", ")}.`}]:f4r(t,e,{...r,agentMode:r.agentMode});kQi.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(uc),s=r;return Ei(async()=>{let c=await o.send(s,e);return kQi.info(t,"resume succeeded:",c.messageId),c})}a(mRc,"handleAgentSendChecked");var DQi=Oe(hRc,mRc);p();p();var gRc=new pe("BackgroundAgent.stop"),ARc=S.Object({sessionId:xi});async function p4r(t,e,r){gRc.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(qs);return Ei(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(p4r,"handleBackgroundAgentStopChecked");var Vrh=Oe(ARc,p4r);var yRc=new pe("BackgroundAgent.stop"),ERc=S.Object({sessionId:xi,agentProvider:Dl});async function _Rc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await p4r(t,e,r);return c?[null,c]:[void 0,null]}yRc.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(uc),s=r;return Ei(async()=>o.stop(s))}a(_Rc,"handleAgentStopChecked");var NQi=Oe(ERc,_Rc);p();var vRc=S.Object({sessionId:xi,eventId:S.String(),agentProvider:t4r});async function CRc(t,e,r){let n=t.get(uc),o={sessionId:r.sessionId,eventId:r.eventId,providerName:r.agentProvider};return Ei(async()=>n.truncateHistory(o))}a(CRc,"handleAgentTruncateHistoryChecked");var MQi=Oe(vRc,CRc);p();var bRc=S.Object({});async function SRc(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Ur).listAvailableTokens()},null]}a(SRc,"handleListAvailableTokensChecked");var OQi=Oe(bRc,SRc);p();var TRc=S.Object({tokenId:S.Number()});async function IRc(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Ur).useExistingToken(r.tokenId),null]}a(IRc,"handleUseExistingTokenChecked");var BQi=Oe(TRc,IRc);p();var xRc=S.Object({providerName:S.String()});async function wRc(t,e,r){try{let{providerName:n}=r,o=gO(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 ca(t.get(zn));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(wRc,"handleBYOKDeleteApiKeyChecked");var LQi=Oe(xRc,wRc);p();var RRc=S.Object({providerName:S.String(),modelId:S.String()});async function PRc(t,e,r){try{let n=new ca(t.get(zn)),{providerName:o,modelId:s}=r,c=gO(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(PRc,"handleBYOKDeleteModelChecked");var FQi=Oe(RRc,PRc);p();var kRc=S.Object({providerName:S.Optional(S.String()),modelId:S.Optional(S.String())}),UQi="-api-key";async function DRc(t,e){let r=await e.listKeys("byok"),n=new Set(await t.listCustomProviderNames()),o=new Set(Object.keys(await t.getStoredModelConfigs(oo.Azure))),s=new Set(Object.values(oo).filter(u=>u!==oo.Azure)),c=`${oo.Azure}-`,l=[];for(let u of r){if(!u.endsWith(UQi))continue;let d=await e.read("byok",u);if(!d)continue;let f=u.slice(0,-UQi.length),h=f.startsWith(c)?f.slice(c.length):void 0;if(h!==void 0&&o.has(h)&&!n.has(f)){l.push({providerName:oo.Azure,modelId:h,apiKey:d});continue}(s.has(f)||n.has(f))&&l.push({providerName:f,apiKey:d})}return l}a(DRc,"listAllApiKeys");async function NRc(t,e,r){try{let n=new ca(t.get(zn)),{providerName:o,modelId:s}=r;return o?[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]:[{apiKeys:await DRc(n,t.get(zn))},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(NRc,"handleBYOKListApiKeysChecked");var QQi=Oe(kRc,NRc);p();var MRc=S.Object({providerName:S.Optional(S.String())});async function ORc(t,e,r){try{let n=new ca(t.get(zn)),o=r.providerName?[r.providerName]:await n.listCustomProviderNames(),s=[];for(let c of o){let l=await n.getProviderConfig(c);s.push({providerName:c,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(ORc,"handleBYOKListCustomProviderConfigsChecked");var qQi=Oe(MRc,ORc);p();p();p();nBr();var oSt=class extends Kx{static{a(this,"AnthropicProvider")}constructor(e){super(oo.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new ca(this.ctx.get(zn)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new TB({apiKey:e,fetch:Fkc(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 Cxe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function Fkc(t){return async(e,r)=>{let n=Ukc(e,r),o=qkc(r),s=await t.fetch(n,o);return Hkc(s)}}a(Fkc,"createAnthropicFetchAdapter");function Ukc(t,e){return t instanceof Request?(Qkc(t,e),t.url):t instanceof URL?t.toString():t}a(Ukc,"convertInputToString");function Qkc(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(Qkc,"mergeRequestInit");function qkc(t){let e;return t?.headers&&(e=jkc(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(qkc,"convertToFetchOptions");function jkc(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(jkc,"convertHeaders");async function Hkc(t){let e=t.body(),r=null;if(e)r=Gkc(e);else{let n=await t.text();r=Vkc(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(Hkc,"convertToWebResponse");function Gkc(t){return new ReadableStream({start(e){let r=$kc(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(Gkc,"createReadableStreamFromNodeStream");function $kc(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($kc,"setupStreamHandlers");function Vkc(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(Vkc,"createReadableStreamFromText");p();var sSt=class extends Kx{static{a(this,"GeminiProvider")}constructor(e){super(oo.Gemini,e)}};p();var aSt=class extends Kx{static{a(this,"GroqProvider")}constructor(e){super(oo.Groq,e)}};p();var cSt=class extends Kx{static{a(this,"OpenAIProvider")}constructor(e){super(oo.OpenAI,e)}};p();var lHi=16e3,lSt=class extends Kx{static{a(this,"OpenRouterProvider")}constructor(e){super(oo.OpenRouter,e)}async getAllModels(){try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new ca(this.ctx.get(zn)).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-lHi),maxOutputTokens:lHi,toolCalling:l.supported_parameters?.includes("tools")??!1,vision:l.architecture?.input_modalities?.includes("image")??!1}});return c}catch(e){throw Cxe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getFetchModelUrl(){return`${this.getBaseUrl()}/models?supported_parameters=tools`}};var uie=class{static{a(this,"BYOKProviderFactory")}constructor(e){this.providers=new Map([[oo.OpenAI,new cSt(e)],[oo.Gemini,new sSt(e)],[oo.Groq,new aSt(e)],[oo.OpenRouter,new lSt(e)],[oo.Anthropic,new oSt(e)]])}getBYOKProvider(e){return this.providers.get(e)}};var Wkc=S.Object({providerName:S.Optional(S.String()),enableFetchUrl:S.Optional(S.Boolean())});async function zkc(t,e,r){try{let{providerName:n,enableFetchUrl:o}=r,s=new ca(t.get(zn)),c=[];if(n)if(o){if(!Kle(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(uie).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(zkc,"handleBYOKListModelsChecked");var uHi=Oe(Wkc,zkc);p();var Ykc=S.Object({providerName:S.String(),apiKey:S.String(),modelId:S.Optional(S.String())});async function Kkc(t,e,r){try{let n=new ca(t.get(zn)),{providerName:o,apiKey:s,modelId:c}=r,l=gO(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(Kkc,"handleBYOKSaveApiKeyChecked");var dHi=Oe(Ykc,Kkc);p();var Jkc=S.Object({providerName:S.String(),apiKey:S.String(),apiType:S.Optional(S.Union([S.Literal("chatCompletions"),S.Literal("responses"),S.Literal("messages")]))});async function Zkc(t,e,r){try{let n=r.providerName,{apiKey:o,apiType:s}=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(!RK(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 c=new ca(t.get(zn));return await c.storeAPIKey(n,o,gO(n)),await c.saveProviderConfig(n,{apiType:s}),[{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(Zkc,"handleBYOKSaveCustomProviderConfigChecked");var fHi=Oe(Jkc,Zkc);p();var Xkc=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 e2c(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new ca(t.get(zn)),h=gO(n);if(h===1&&!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];if(RK(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(e2c,"handleBYOKSaveModelChecked");var pHi=Oe(Xkc,e2c);p();var t2c=S.Object({cliPath:S.String()});async function r2c(t,e,r){return[await Hhe.check(r.cliPath),null]}a(r2c,"handleCheckClaudeCliCompatibilityChecked");var hHi=Oe(t2c,r2c);p();p();var gHi=de(fk()),mHi="0.135.0",uSt=new jhe({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(gHi.lt(t,mHi))return{severity:"error",message:`Codex CLI at "${e}" reports version ${t.version}, but version ${mHi} or later is required. Run \`npm install -g @openai/codex\` to upgrade.`}}});var n2c=S.Object({cliPath:S.String()});async function i2c(t,e,r){return[await uSt.check(r.cliPath),null]}a(i2c,"handleCheckCodexCliCompatibilityChecked");var AHi=Oe(n2c,i2c);p();var o2c=S.Object({uri:S.String({minLength:1})});async function s2c(t,e,r){let n=await t.get(ii).getOrReadTextDocument(r);return[{status:ed(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(s2c,"handleCheckFileStatusChecked");var yHi=Oe(o2c,s2c);p();var a2c=S.Object({});function EHi(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(EHi,"calculatePercentRemaining");function sLr(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(sLr,"buildQuotaSnapshot");async function c2c(t,e,r){let n=await t.get(Ur).resolveSession();if(!n)return[null,{code:Ze.InternalError,message:"Not signed in"}];let o=await $Ce(t,n);if(o.ok){let s=await o.json();return t.get(pu).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:sLr(s.quota_snapshots?.chat),completions:sLr(s.quota_snapshots?.completions),premiumInteractions:sLr(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:EHi(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:EHi(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(c2c,"handleCheckQuotaChecked");var _Hi=Oe(a2c,c2c);p();var l2c=S.Object({options:S.Optional(S.Object({localChecksOnly:S.Optional(S.Boolean()),forceRefresh:S.Optional(S.Boolean())}))});async function u2c(t,e,r){return[await t.get(Ur).checkAndUpdateStatus(r.options),null]}a(u2c,"handleCheckStatusChecked");var vHi=Oe(l2c,u2c);p();var d2c=S.Object({pullRequestNumber:S.Integer({minimum:1}),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),body:S.String({minLength:1})});async function f2c(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await new iE(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return yt(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(Zn(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof nE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Od&&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(f2c,"handleCloudAgentAddPullRequestCommentChecked");var CHi=Oe(d2c,f2c);p();var p2c=S.Object({pullRequestId:S.Number(),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1})});async function h2c(t,e,r){try{let o=await new ew(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()),yt(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new iE(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),Et(t,"githubApi.cancelCodingAgent",Wt.createAndMarkAsIssued()),yt(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"),Zn(t,"githubApi.cancelCodingAgent",n),n instanceof Xx)return[null,{code:Ze.NoCopilotToken,message:n.message}];if(n instanceof np)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof i0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof nE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Od&&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(h2c,"handleCancelCodingAgentChecked");var bHi=Oe(p2c,h2c);p();var m2c=S.Object({problemStatement:S.String({minLength:1}),workspaceFolder:S.Optional(S.String({minLength:1})),workspaceFolders:S.Optional(S.Array(Oc))});function g2c(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(g2c,"pickWorkspaceFolder");async function A2c(t,e,r){try{let n=g2c(r);if(!n)return[null,{code:Ze.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a cloud agent job."}];let s=await new r0(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 Iq([new xq,new wq]).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=WJe(r.problemStatement);if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let h=await new ew(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return yt(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(Zn(t,"cloudAgent.createJob",n,{result:"error"}),wqt(n))return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(n instanceof Xx)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof np)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof i0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof nE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Od&&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(A2c,"handleCloudAgentCreateJobChecked");var SHi=Oe(m2c,A2c);p();var y2c=S.Object({sessionId:S.String({minLength:1})});async function E2c(t,e,r){try{let o=await new ew(t).getSessionLogs(r.sessionId,e);return yt(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(Zn(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof Xx)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof np||n instanceof i0)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(E2c,"handleCloudAgentGetSessionLogsChecked");var THi=Oe(y2c,E2c);p();var _2c=S.Object({pullRequestId:S.Integer()});async function v2c(t,e,r){try{let o=await new ew(t).getAllSessions(r.pullRequestId,e);return yt(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(Zn(t,"cloudAgent.listSessions",n),n instanceof Xx)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof np||n instanceof i0)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(v2c,"handleCloudAgentListSessionsChecked");var IHi=Oe(_2c,v2c);p();var C2c=S.Object({});async function b2c(t,e,r){return[(await Zx(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(b2c,"handleConversationAgentsChecked");var xHi=Oe(C2c,b2c);p();p();var D3e=de(Kc());function S2c(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(S2c,"telemetryVersionMismatch");async function g9(t,e,r){let o=t.get($r).getTextDocumentUnsafe(e);if(!o)throw new D3e.ResponseError(Ze.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await $le(t,e,o.getText());if(s.status==="invalid")throw t.get(cs).setClsInactive(s.reason),new D3e.ResponseError(Ze.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(S2c(t,o,e.version),qo.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new D3e.ResponseError(Ze.ContentModified,"Document Version Mismatch");return o}a(g9,"getTextDocument");async function IB(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await g9(t,n,r)}catch(o){if(o instanceof D3e.ResponseError){if(o.code===Ze.CopilotNotAvailable)return;if(o.code===Ze.InvalidParams){qo.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(IB,"getTextDocumentIfAvailable");var T2c=S.Union([S.Literal("keyboard"),S.Literal("toolbar")]),I2c=S.Object({turnId:VK,codeBlockIndex:S.Number(),source:T2c,copiedCharacters:S.Number(),totalCharacters:S.Number(),copiedText:S.String(),doc:S.Optional(hZe),textDocument:S.Optional(qC),position:S.Optional(n0),conversationSource:S.Optional(DO)});async function x2c(t,e,r){let n=await IB(t,r,e),o={totalCharacters:r.totalCharacters,copiedCharacters:r.copiedCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,currentLine:s.line});let c=mq(r.conversationSource),l=t.get(Wo).findByTurnId(r.turnId),u=await Zc(t,l,{languageId:n?.detectedLanguageId??""});return US(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${eE(c)}.acceptedCopy`,u),["OK",null]}a(x2c,"handleConversationCodeCopyChecked");var wHi=Oe(I2c,x2c);p();var w2c=S.Union([S.Literal("keyboard"),S.Literal("toolbar"),S.Literal("diff")]),R2c=S.Object({turnId:VK,source:w2c,codeBlockIndex:S.Number(),acceptedLength:S.Optional(S.Number()),totalCharacters:S.Number(),newFile:S.Optional(S.Boolean()),doc:S.Optional(hZe),textDocument:S.Optional(qC),position:S.Optional(n0),conversationSource:S.Optional(DO)});async function P2c(t,e,r){let n=await IB(t,r,e),o={totalCharacters:r.totalCharacters,acceptedLength:r.acceptedLength??r.totalCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,insertionOffset:n.offsetAt(s),currentLine:s.line});let c=mq(r.conversationSource),l=t.get(Wo).findByTurnId(r.turnId),u=await Zc(t,l,{languageId:n?.detectedLanguageId??""});return US(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=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+=` ## 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 pSt=de(xo());var fSt=class extends lr{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(pSt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(pSt.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});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. You will be provided with a series of user/assistant message pairs from a conversation partition that needs to be compressed. @@ -3939,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(oZe({role:"user",content:QS(o.request.message)})),o.response){let s=vO(o.response.message,!0),c=wO(s,{ctx:r,identifier:"partition summary",enableWarnings:!1});c.length>0&&n.push(vscpp(tw,{assistantRounds:c,ctx:r,isHistorical:!0,identifier:"partition-summary"}))}return n}renderFinalInstructions(){let{partition:e,ctx:r,userLanguage:n}=this.props,o=new s0(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(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}. Please create a comprehensive summary following the exact format specified in the system instructions. @@ -3957,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}};jo();var _N=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 ip.create(fSt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=wA.user(o,Gt()),f=VI.createEmptyConfigForTesting(),h;try{h=this.ctx.get(nc)}catch{h=new nc(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 k2c=S.Object({conversationId:S.String()});async function D2c(t,e,r){let{conversationId:n}=r,o=Date.now();ot.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(yI);N2c(t,n,o);try{if(e.isCancellationRequested)return ot.debug(t,`Manual compression cancelled before start: ${n}`),[N3e(n,"Compression cancelled"),null];let c=t.get(Wo),l;try{l=c.get(n)}catch{return ot.warn(t,`Conversation not found: ${n}`),M3e(t,n,0,"Conversation not found",Date.now()-o),[N3e(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}`),M3e(t,n,0,"No turns to compress",Date.now()-o),[N3e(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}`),M3e(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[N3e(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(Jc).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(_N),y=new tP(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 Lq().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}),M2c(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}`),M3e(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}`),M3e(t,n,0,l,u),[N3e(n,`Compression failed: ${l}`),null]}}a(D2c,"handleConversationCompressChecked");function N3e(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(N3e,"createErrorResult");function N2c(t,e,r,n){let o=Wt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});Et(t,"conversationPartition.manualCompression.started",o,0)}a(N2c,"sendStartedTelemetry");function M2c(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(M2c,"sendCompletedTelemetry");function M3e(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(M3e,"sendFailedTelemetry");var PHi=Oe(k2c,D2c);p();p();var hSt=S.Array(_f);function mSt(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a(mSt,"resolveAsActiveEditor");p();var kHi=de(Kc());var gSt=new kHi.ProgressType,aLr=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new Lq}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(ar).connection.sendProgress(gSt,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(gSt,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(gSt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(ar).connection.sendProgress(gSt,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 ZEe(t){return new aLr(t.workDoneToken)}a(ZEe,"createProgressHandler");p();var DHi=de(Kc());var XEe=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 DHi.ResponseError(Ze.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function ASt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:Ji(t.uri)}]}a(ASt,"resolveAsWorkspaceFolders");p();p();var O2c=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),zE=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?O2c(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 vN=class{constructor(){this.tokens=new En(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new jn.CancellationTokenSource,o=new zE([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 NHi(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a(NHi,"calculateBillingMultiplier");async function ySt(t,e){let r=e,n=e.modelInfo?.id;if(!n&&r.model&&(n=r.modelProviderName?r.model:await Ro.resolveModelIdFromFamily(t,r.model)),!n)throw new Error("A model id is required: provide `modelInfo.id` or the deprecated `model` field.");return{...e.modelInfo,id:n,providerName:e.modelInfo?.providerName??r.modelProviderName}}a(ySt,"resolveTurnModelInfo");function ESt(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:NHi(r)}}a(ESt,"buildTurnSummary");p();function _St(t,e,r,n,o,s){let{properties:c,measurements:l}=L2c(e,r,n,o,s),u=B2c(e,r,n,o,s);Et(t,"conversation.turnCompleted",Wt.createAndMarkAsIssued(u)),yt(t,"conversation.turnCompleted",c,l)}a(_St,"sendTurnTelemetry");function B2c(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};return rP(s,"chatMode",n.chatMode),rP(s,"conversationSource",o?.conversationSource),s}a(B2c,"buildGithubTurnTelemetryProperties");function L2c(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};rP(s,"modelName",n.modelName),rP(s,"modelProviderName",n.modelProviderName),rP(s,"userRequestedModel",n.userRequestedModel),rP(s,"reasoningEffort",n.reasoningEffort),rP(s,"chatMode",n.chatMode),rP(s,"agentSlug",n.agentSlug),rP(s,"conversationSource",o?.conversationSource);let c={};return rP(c,"billingMultiplier",n.billingMultiplier),rP(c,"credits",o?.credits),rP(c,"totalTimeMs",o?.totalTimeMs),{properties:s,measurements:c}}a(L2c,"buildTurnTelemetryData");function vSt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(vSt,"formatCredits");function rP(t,e,r){r!==void 0&&(t[e]=r)}a(rP,"assignDefined");var F2c=S.Object({conversationId:S.Optional(pZe),workDoneToken:S.Union([S.String(),S.Number()]),turns:S.Array(K1n,{minItems:1}),capabilities:S.Optional(S.Object({allSkills:S.Optional(S.Boolean()),skills:S.Optional(S.Array(S.String()))})),doc:S.Optional(qC),textDocument:S.Optional(qC),selection:S.Optional(_f),visibleRanges:S.Optional(hSt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(kO)),source:S.Optional(DO),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Oc)),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(AZe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),todoList:S.Optional(S.Array(yZe)),restoreToTurnId:S.Optional(S.String())});async function U2c(t,e,r){XEe.validate(r.workspaceFolders);let n=await IB(t,r,e),o=await t.get(Wo).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(c0).setTodos(o,r.todoList);let s=await ySt(t,r),c=o.turns.length>0?r.turns.slice(-1):r.turns;await Q2c(t,o,{...r,turns:c},s.id,n);let l=o.turns[o.turns.length-1],u=ZEe(r),d=t.get(vN).add(u.progressToken,e),f=new fw(t,o,l,d),h=await t.get(CN).createProcessor(f,u.progressToken,r.computeSuggestions),m=t.get(pu),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),_=ESt(l,s);return _St(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:vSt(A),preciseCredits:A},null]}a(U2c,"handleConversationCreateChecked");async function Q2c(t,e,r,n,o){for(let s of r.turns){let c=mZe(s.request),l=new Zf({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:ASt(u),f=t.get(B_),h=ZQ(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=s.model??n,l.needToolCallConfirmation=r.needToolCallConfirmation;let m=mSt({textDocument:o,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(Wo).addTurn(e.id,l,r.references,m,u,d,r.ignoredSkills,void 0)}}a(Q2c,"addTurns");var MHi=Oe(F2c,U2c);p();var q2c=S.Object({conversationId:S.String()});function j2c(t,e,r){return t.get(Wo).destroy(r.conversationId),["OK",null]}a(j2c,"handleConversationDestroyChecked");var OHi=Oe(q2c,j2c);p();var H2c=S.Object({workspaceFolders:S.Optional(S.Array(Oc))});async function G2c(t,e,r){return[(await t.get(B_).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(G2c,"handleConversationModesChecked");var BHi=Oe(H2c,G2c);p();var $2c=S.Object({turnId:S.String(),acceptedFileCount:S.Number({minimum:0}),totalFileCount:S.Number({minimum:1})}),V2c=new pe("conversationNotifyCodeAcceptance");async function W2c(t,e,r){let n=t.get(Wo).findByTurnId(r.turnId);if(!n)return V2c.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await Zc(t,n,{languageId:""});return US(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${eE("agentPanel")}.codeAcceptance`,o),["OK",null]}a(W2c,"handleConversationNotifyCodeAcceptanceChecked");var LHi=Oe($2c,W2c);p();var z2c=S.Object({});function Y2c(t,e,r){return[{path:t.get(zn).directory},null]}a(Y2c,"handleConversationPersistenceChecked");var FHi=Oe(z2c,Y2c);p();p();var cLr=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Ur).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},lLr=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Ut).getToken()).envelope.chat_enabled?"ok":"failed"}}},K2c=[new cLr,new lLr],nP=class{constructor(e,r=K2c){this.ctx=e;this.checks=r;this.emitter=new Hi;this.onChange=this.emitter.event;Es(e,async()=>{await this.check()})}static{a(this,"PreconditionsCheck")}check(e){return e&&(this.result=void 0),this.result===void 0&&(this.result=this.requestChecks()),this.result}async requestChecks(){let e=[];this.checks.length>0&&(e=await Promise.all(this.checks.map(o=>o.check(this.ctx))));let r=e.every(o=>o.status==="ok")?"ok":"failed",n={results:e,status:r};return this.emitter.fire(n),n}};var J2c=S.Object({forceCheck:S.Optional(S.Boolean())});async function Z2c(t,e,r){let n=r.forceCheck??!1;return[await t.get(nP).check(n),null]}a(Z2c,"handleConversationPreconditionsChecked");var UHi=Oe(J2c,Z2c);p();var X2c=S.Object({turnId:S.Optional(S.String()),rating:S.Number(),doc:S.Optional(qC),textDocument:S.Optional(qC),source:S.Optional(DO)});async function eDc(t,e,r){let n=await IB(t,r,e),o=mq(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await Zc(t,r.turnId?t.get(Wo).findByTurnId(r.turnId):void 0,{languageId:n?.detectedLanguageId??""}),l=`${eE(o)}.messageRating`,u=US(t,n,{rating:s,uiKind:o},{},l,c);return WI(t,l,u),["OK",null]}a(eDc,"handleConversationRatingChecked");var QHi=Oe(X2c,eDc);p();var tDc=S.Object({tools:S.Array(J1n)});function rDc(t,e,r){let n=t.get(ds);return r.tools.forEach(s=>{n.registerTool(new Yq({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(rDc,"conversationRegisterToolsChecked");var qHi=Oe(tDc,rDc);p();var nDc=S.Object({workspaceFolders:S.Optional(S.Array(Oc))});async function iDc(t,e,r){let n=D$t(t).map(u=>({id:u.id,description:u.description,shortDescription:u.shortDescription,scopes:u.scopes,source:"builtin"})),o=t.get(fg),s=r.workspaceFolders??[],l=(await o.listCustomPrompts(s)).map(u=>({id:u.uri,name:u.name,description:u.description||"",shortDescription:"",scopes:oDc(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(a0).listSkills(r.workspaceFolders)).map(h=>({id:`skill:${Ji(sf(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(iDc,"handleConversationTemplatesChecked");function oDc(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a(oDc,"getCustomPromptScopes");var jHi=Oe(nDc,iDc);p();var sDc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),conversationId:pZe,turnId:S.Optional(VK),message:NHt,followUp:S.Optional(S.Object({id:S.String(),type:S.String()})),doc:S.Optional(qC),textDocument:S.Optional(qC),selection:S.Optional(_f),visibleRanges:S.Optional(hSt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(kO)),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Oc)),ignoredSkills:S.Optional(S.Array(S.String())),confirmationResponse:Zvn,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(AZe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),agentSlug:S.Optional(S.String()),todoList:S.Optional(S.Array(yZe))});async function aDc(t,e,r){XEe.validate(r.workspaceFolders);let n=await IB(t,r,e),o=t.get(Wo),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(c0).setTodos(s,r.todoList);let c=mZe(r.message),l=new Zf({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:ASt(u),f=await ySt(t,r),h=t.get(B_),m=ZQ(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=mSt({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=ZEe(r),y=t.get(vN).add(A.progressToken,e),E=new fw(t,s,l,y),_=await t.get(CN).createProcessor(E,A.progressToken,r.computeSuggestions),v=t.get(pu),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=ESt(l,f);return _St(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:vSt(T),preciseCredits:T},null]}a(aDc,"handleConversationTurnChecked");var HHi=Oe(sDc,aDc);p();var cDc=S.Object({conversationId:S.String(),turnId:S.String(),source:S.Optional(DO)});async function lDc(t,e,r){t.get(Wo).deleteTurn(r.conversationId,r.turnId);let o=mq(r.source),s=await Zc(t,t.get(Wo).findByTurnId(r.turnId),{languageId:""});return US(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${eE(o)}.messageDelete`,s),["OK",null]}a(lDc,"handleConversationTurnDeleteChecked");var GHi=Oe(cDc,lDc);p();var uDc=S.Object({toolIds:S.Array(S.String())});function dDc(t,e,r){let n=t.get(ds);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(dDc,"conversationUnregisterToolsChecked");var $Hi=Oe(uDc,dDc);p();var fDc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Oc)),tools:S.Array(S.Object({name:S.String(),status:S.Enum(M3)}))});async function pDc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(B_).getChatMode(n?ZQ(n):"Agent",o,s),l=t.get(ds),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(pDc,"conversationUpdateToolsStatusChecked");var VHi=Oe(fDc,pDc);p();p();jo();var hDc=5e3,die=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}};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: OUTPUT FORMAT: - MUST be a single sentence @@ -3999,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 jn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),hDc),c=r.onCancellationRequested(()=>o.cancel());try{let l=new nc(e),u=await Ro.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Ut).getToken(),h=await e.get(Zt).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:wA.user("conversation-panel",Gt())},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}`),yt(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var mDc=S.Object({thinkingContent:S.Optional(S.String()),extractedTitles:S.Optional(S.Array(S.String()))});async function gDc(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(die).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(gDc,"handleThinkingTitleGenerateChecked");var WHi=Oe(mDc,gDc);p();p();p();var CSt=/```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(CSt,"")}static extractSuggestionAndText(e){CSt.lastIndex=0;let n=CSt.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(),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(` `),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 bSt=require("path");var t_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(Ut).getToken(),o=KI(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=Zm(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=pl();try{return await DW(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=pl()-l;return this.telemetryTracker.telemetryData.measurements.totalTimeMs=h,this.telemetryTracker.telemetryResponse(),(d.status===401||d.status===403)&&this.ctx.get(Ut).resetToken("code_review_fetch",d.status),d}).catch(d=>{if(Lm(d))throw d;let f=pl()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{wKe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,bSt.basename)(e,(0,bSt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(Ef).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();jo();var r_e=class t{constructor(e,r={}){this.ctx=e;this.id=Gt(),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),yt(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){Et(this.ctx,"request.response",this.telemetryData),yt(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(Vh(e,"name")??""),this.telemetryData.properties.code=String(Vh(e,"code")??""),this.telemetryData.properties.errno=String(Vh(e,"errno")??""),this.telemetryData.properties.type=String(Vh(e,"type")??""),Et(this.ctx,"request.error",this.telemetryData),yt(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var SSt=class t extends t_e{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new r_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(tc),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 ADc=S.Object({uri:S.String(),path:S.String(),baseContent:S.String(),headContent:S.String()}),yDc=S.Object({changes:S.Array(ADc),workspaceFolders:S.Optional(S.Array(Oc))}),O3e;async function EDc(t,e,r){O3e&&(O3e.cancel(),O3e.dispose()),O3e=new jn.CancellationTokenSource;let n=new zE([e,O3e.token]),o=new SSt(t,r.changes,r.workspaceFolders);if(!(await t.get(Ut).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(EDc,"handleCopilotCodeReviewReviewChangesChecked");var zHi=Oe(yDc,EDc);p();p();var TSt=class t extends t_e{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new r_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(tc),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 _Dc=S.Object({uri:S.String(),path:S.String(),content:S.String(),startLine:S.Number(),endLine:S.Number()}),vDc=S.Object({snippets:S.Array(_Dc),workspaceFolders:S.Optional(S.Array(Oc))}),B3e;async function CDc(t,e,r){B3e&&(B3e.cancel(),B3e.dispose()),B3e=new jn.CancellationTokenSource;let n=new zE([e,B3e.token]),o=new TSt(t,r.workspaceFolders);if(!(await t.get(Ut).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(CDc,"handleCopilotCodeReviewReviewSnippetsChecked");var YHi=Oe(vDc,CDc);p();p();var ISt=Symbol("onMCPToolsListChanged"),xSt=Symbol("onMCPResourcesListChanged"),wSt=Symbol("onMCPPromptsListChanged"),KHi=Symbol("onMCPResourceUpdated"),xV=Symbol("onMCPCacheUpdated");function L3e(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(L3e,"normalizeMcpHeaders");var YE=class{static{a(this,"McpManager")}};var bDc=S.Object({}),SDc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Oc)),servers:S.Array(S.Object({name:S.String(),tools:S.Array(S.Object({name:S.String(),status:S.Enum(M3)}))}))}),TDc=S.Object({serverName:S.String(),promptName:S.String(),arguments:S.Optional(S.Record(S.String(),S.String()))}),IDc=S.Object({serverName:S.String(),promptName:S.String(),argumentName:S.String(),prefix:S.String(),alreadyResolved:S.Optional(S.Record(S.String(),S.String()))}),xDc=S.Object({serverName:S.String(),uri:S.String()}),wDc=S.Object({serverName:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});function RDc(t,e,r){return[t.get(YE).getAllContents(),null]}a(RDc,"handleGetMCPContentsChecked");async function PDc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(B_).getChatMode(n?ZQ(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(YE).updateMCPToolsStatus(c,l),[t.get(YE).getAllContents(c),null]}a(PDc,"handleUpdateMCPToolsStatusChecked");async function kDc(t,e,r){return[await t.get(YE).readResource(r.serverName,r.uri),null]}a(kDc,"handleReadResourceChecked");async function DDc(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(YE).getPrompt(n,o,s),null]}a(DDc,"handleGetPromptChecked");async function NDc(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(YE).completePrompt(n,o,s,c,l),null]}a(NDc,"handleCompletePromptChecked");async function MDc(t,e,r){let n=t.get(YE),{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(MDc,"handleMCPServerActionChecked");var JHi=Oe(bDc,RDc),ZHi=Oe(SDc,PDc),XHi=Oe(xDc,kDc),eGi=Oe(TDc,DDc),tGi=Oe(IDc,NDc),rGi=Oe(wDc,MDc);p();var ODc=S.Object({});async function BDc(t,e,r){let n=await t.get(Ut).getToken();return[QDc(t,await t.get(Ss).getMetadata(),n),null]}a(BDc,"handleCopilotModelsChecked");function LDc(t){return(t.capabilities.supports?.reasoning_effort?.length??0)<=1?!1:t.supported_endpoints?.includes(u$e.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!0}a(LDc,"supportReasoningEffortLevel");function FDc(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!Hce.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(FDc,"getModelScopes");function UDc(t){return t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(UDc,"shouldExposeModel");function QDc(t,e,r){let n=[];return e.forEach(o=>{UDc(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:FDc(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:LDc(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:qln(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(Fl).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:Q_,modelName:rJe,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:Q_,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(QDc,"filterModels");var nGi=Oe(ODc,BDc);p();var qDc=S.Object({});async function jDc(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(Ss).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(jDc,"handleCopilotModelsGetModelMetadataListChecked");var iGi=Oe(qDc,jDc);p();var HDc=S.Object({model:S.Optional(S.String()),status:S.Optional(S.String())});async function GDc(t,e,r){return r.model&&r.status==="enabled"?await t.get(Ss).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(GDc,"handleCopilotModelsPolicyChecked");var oGi=Oe(HDc,GDc);p();p();p();p();jo();function $Dc(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a($Dc,"panelPositionForDocument");async function*sGi(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(sGi,"trimChoices");var n_e=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=$Dc(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function uLr(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await uLr(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(uLr,"reportSolutions");async function dLr(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:dLr(t,e)}}a(dLr,"generateSolutionsStream");function RSt(t){return t.replace(/\s+/g,"")}a(RSt,"normalizeCompletionText");async function aGi(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=tQ(t,l.uri),d=Gt(),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 Eme(t,d,iee(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=fu.position(e.startPosition.line,e.startPosition.character-g.length)),e.savedTelemetryData=e.savedTelemetryData.extendedBy({},{...tse(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(aGi,"setupPromptAndTelemetry");function cGi(t,e,r,n,o,s){let c=t.get(vk).forLanguage(t,e.detectedLanguageId,s),l=bS(e.detectedLanguageId),u=iut(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 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=[` `,`\r \r -`]);let h=eQ(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?ZDe(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?ZDe(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a(cGi,"setupCompletionParams");var fLr=new pe("solutions");async function VDc(t,e){let r=e.targetPosition,n=e.textDocument,o=await aGi(t,e,"open copilot",fLr);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}=cGi(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(_O).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;_=sGi(_),_=Sxe(_,T=>bNe(t,n,r,T,!1,fLr));let v=Sxe(_,async T=>{let w=T.completionText;fLr.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await pei(t,n,r,T.completionText)??fu.position(r.line,0),[x]=MH(n.getText(fu.range(R,r)));w=x+w;let P=T.completionText;c.length>0&&P.startsWith(c)&&(P=P.substring(c.length));let D=T.meanLogProb,N=D!==void 0?Math.exp(D):0,B=l.extendedBy({choiceIndex:T.choiceIndex.toString()});return{completionText:P,insertText:w,range:fu.range(R,r),meanProb:N,meanLogProb:D||0,requestId:T.requestId,choiceIndex:T.choiceIndex,telemetryData:B,copilotAnnotations:T.copilotAnnotations}});return dLr(A,v[Symbol.asyncIterator]())}a(VDc,"launchSolutions");async function PSt(t,e,r){return t.get(cs).trackCompletionJob(async()=>{let o=VDc(t,e);return await uLr(o,r)})}a(PSt,"runSolutions");var uGi=de(J9()),U3e=de(Kc());p();jo();p();function kSt(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(kSt,"parseChallengeDoc");var WDc=S.Object({text:S.String(),score:S.Number()}),zDc=S.Object({documents:S.Array(WDc),options:S.Optional(S.Object({}))});async function DSt(t,e,r){let n=Gt();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:VI.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(DSt,"runTestSolutions");var bN=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function YDc(t,e,r){return t.forceSet(bN,new bN(r.documents)),["OK",null]}a(YDc,"handleTestingSetPanelCompletionDocumentsChecked");var lGi=Oe(zDc,YDc);var dGi=CJe.type;function KDc(t,e,r,n,o){let s=RSt(n.completionText),c=(0,uGi.SHA256)(s).toString();return t.get(Tu).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:K5r,title:`Accept completion ${o}`,arguments:[c]}}}a(KDc,"makeCompletion");function hLr(t,e){return`${t}/${e}`}a(hLr,"progressMessage");var pLr=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=KDc(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(U3e.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:hLr(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return JDc(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(U3e.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function JDc(t,e,r=0){t!==void 0&&await e.connection.sendProgress(U3e.WorkDoneProgress.type,t,{kind:"end",message:hLr(r,10)})}a(JDc,"reportDone");var F3e;async function ZDc(t,e,r){let n=await g9(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(ar).connection.sendProgress(U3e.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:hLr(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(CJe.partialResult,l,{items:[f]})},"onCompletion"));let u=new pLr(t,r,c),d=t.get(bN);if(d.documents){let f=d.documents;await DSt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new n_e(n,o,e,10);await PSt(t,f,u)}return u.error!==void 0?[null,{code:Ze.InternalError,message:u.error}]:[{items:s},null]}a(ZDc,"handleChecked");async function XDc(t,e,r){F3e&&(F3e.cancel(),F3e.dispose()),F3e=new jn.CancellationTokenSource;let n=F3e.token,o=new zE([e,n]);try{return await ZDc(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(XDc,"handleCheckedWithAbort");var fGi=Oe(Pbn,XDc);p();var tNc=S.Object({workspaceFolders:S.Optional(S.Array(Oc))});async function rNc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Yp).listCustomAgents(n,{includePlugins:!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,storage:l,providers:fO(c.pluginUri!==void 0,c.providers)}}),null]}a(rNc,"listCustomAgents");var pGi=Oe(tNc,rNc);p();var nNc=new pe("customAgent/registerExtensionAgents"),iNc=S.Object({uri:S.String(),name:S.String(),description:S.String()}),oNc=S.Object({extensionId:S.String(),agents:S.Array(iNc)});function sNc(t,e,r){try{t.get(Yp).registerExtensionAgent(r.extensionId,r.agents)}catch(n){nNc.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(sNc,"registerExtensionAgents");var hGi=Oe(oNc,sNc);p();var aNc=S.Object({extensionId:S.String()});function cNc(t,e,r){return t.get(Yp).unregisterExtensionAgents(r.extensionId),[null,null]}a(cNc,"unregisterExtensionAgents");var mGi=Oe(aNc,cNc);p();var lNc=S.Object({workspaceFolders:S.Optional(S.Array(Oc))});async function uNc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Ef).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:fO(c.pluginUri!==void 0,c.providers)})),null]}a(uNc,"listCustomInstructions");var gGi=Oe(lNc,uNc);p();var dNc=S.Object({workspaceFolders:S.Optional(S.Array(Oc))});async function fNc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(fg).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:fO(c.pluginUri!==void 0,c.providers)}}),null]}a(fNc,"listCustomPrompts");var AGi=Oe(dNc,fNc);p();var pNc=S.Object({workspaceFolders:S.Optional(S.Array(Oc))});async function hNc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(a0).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:fO(c.pluginUri!==void 0,c.providers)})),null]}a(hNc,"listCustomSkills");var yGi=Oe(pNc,hNc);p();p();p();function mNc(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get(Fm).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(mNc,"urlsToCheck");async function EGi(t,e,r=dL(t),n,o){let s=mNc(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await gNc(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(EGi,"checkReachability");async function gNc(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(gNc,"determineReachability");var EI=de(require("os")),i_e=de(require("tls"));async function vGi(t,e){let r=await t.get(tr).getImplementation(),n=await t.get(Ut).getGitHubSession(),o=await t.get(Ut).getToken().catch(()=>{});return{sections:[yNc(t),ANc(t,n),ENc(t,r),await _Nc(t,r,o?.endpoints,n,e)]}}a(vGi,"collectDiagnostics");function CGi(t){return t.sections.map(vNc).join(EI.EOL+EI.EOL)+EI.EOL}a(CGi,"formatDiagnosticsAsMarkdown");function ANc(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:U1(t),"GitHub Account":n,"Session ID":t.get(La).sessionId,"Send Restricted Telemetry":rse(t)?"enabled":"disabled","Content Exclusion":t.get(tc).enabled?"enabled":"unavailable"}}}a(ANc,"collectCopilotSection");function yNc(t){let e={Plugin:bNc(t),Editor:CNc(t),"Operating System":`${EI.type()} ${EI.release()} (${EI.arch()})`};return xB(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(yNc,"collectEnvironmentSection");function ENc(t,e){let r=t.get(Mo).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":i_e.rootCertificates.length,"TLS Default Min Version":i_e.DEFAULT_MIN_VERSION,"TLS Default Max Version":i_e.DEFAULT_MAX_VERSION};return xB(n,"http_proxy"),xB(n,"https_proxy"),xB(n,"no_proxy"),xB(n,"SSL_CERT_FILE"),xB(n,"SSL_CERT_DIR"),xB(n,"OPENSSL_CONF"),xB(n,"NODE_EXTRA_CA_CERTS"),xB(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(ENc,"collectNetworkConfigSection");async function _Nc(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await EGi(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(_Nc,"collectReachabilitySection");function _Gi(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(_Gi,"quoteCode");function xB(t,e){let r=process.env[e];r&&(t[_Gi(e)]=_Gi(r)),r!==process.env[e.toUpperCase()]&&xB(t,e.toUpperCase())}a(xB,"addEnvironmentVariable");function vNc(t){return`## ${t.name}`+EI.EOL+EI.EOL+Object.keys(t.items).filter(e=>e!=="name").map(e=>`- ${e}: ${t.items[e]??"N/A"}`).join(EI.EOL)}a(vNc,"formatSectionAsMarkdown");function CNc(t){let e=t.get(Ir).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(CNc,"getEditorDisplayVersion");function bNc(t){let e=t.get(Ir).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(bNc,"getPluginDisplayVersion");var SNc=S.Object({});async function TNc(t,e){return[{report:CGi(await vGi(t,e))},null]}a(TNc,"handleDiagnosticsChecked");var bGi=Oe(SNc,TNc);p();var INc=S.Object({conversationId:S.String(),sessionTitle:S.Optional(S.String())});async function xNc(t,e,r){let o=await t.get(CT).readSpans(r.conversationId),s=E$n(o,{conversationId:r.conversationId,sessionTitle:r.sessionTitle});return[{content:JSON.stringify(s,null,2)},null]}a(xNc,"handleExportAgentDebugLogChecked");var SGi=Oe(INc,xNc);p();var wNc=S.Object({conversationId:S.String()});async function RNc(t,e,r){return[{spans:await t.get(CT).readSpans(r.conversationId)},null]}a(RNc,"handleGetAgentDebugLogChecked");var TGi=Oe(wNc,RNc);p();jo();var kGi=de(Kc());p();var IGi=require("crypto");var o_e=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new gLr(e,this.id)}},gLr=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,IGi.randomUUID)(),c=o.connection.onProgress(_Je.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(_Je.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 NSt(t,e,r){try{let n=t.get(dm),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 o_e&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof o_e&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Nr.error(t,"Failed to set context items on context providers",n)}}a(NSt,"setContextItems");var mLr={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function xGi(t,e,r){return e.map(o=>{try{if(typeof o=="string")return Af(r.uri,o,mLr);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=Af(r.uri,o.scheme||"",mLr)),"pattern"in o&&(s&&=Af(r.uri,o.pattern||"",mLr)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(xGi,"match");p();var PNc=S.Object({documents:S.Array(S.String()),basename:S.Optional(S.String()),options:S.Optional(S.Object({}))}),RV=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function kNc(t,e,r){return t.forceSet(RV,new RV(r.documents,r.basename||"")),["OK",null]}a(kNc,"handleTestingSetCompletionDocumentsChecked");var wGi=new pe("setCompletionDocuments"),PGi=Oe(PNc,kNc);function MSt(t,e,r,n){let o=t.get(RV);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){wGi.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=DNc(o,r);return c&&c.length>0?RGi(c,s,e):void 0}else return wGi.debug(t,"Returning completions for all pre-set documents"),RGi(o.documents,s,e)}}a(MSt,"getTestCompletions");function RGi(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=kSt(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(RGi,"sliceAndMapCompletions");function DNc(t,e){return t.basename===Ji(e)?t.documents||[]:[]}a(DNc,"getFilteredDocs");var DGi=S.Object({doc:S.Object({position:n0,insertSpaces:S.Optional(S.Boolean()),tabSize:S.Optional(S.Number()),uri:Qxe,version:S.Number()}),contextItems:S.Optional(Gfr)}),Q3e;async function NGi(t,e,r,n){Q3e&&(Q3e.cancel(),Q3e.dispose()),Q3e=new jn.CancellationTokenSource;let o=new zE([e,Q3e.token]);r.contextItems&&NSt(t,r.contextItems);let s=MSt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:Gt(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await g9(t,r.doc,o)}catch(h){if(!(h instanceof kGi.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(KA).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(Tu);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(NGi,"handleGetCompletionsHelper");var MGi=Oe(DGi,(t,e,r)=>NGi(t,e,r,!1)),OGi=Oe(DGi,(t,e,r)=>NGi(t,e,r,!0));p();var NNc=S.Object({});function MNc(t,e,r){return[{defaultRules:t.get(pw).getDefaultRules()},null]}a(MNc,"handleGetDefaultFileSafetyRulesChecked");var BGi=Oe(NNc,MNc);p();var LGi=de(J9()),s_e=de(Kc());var ONc=S.Object({doc:S.Object({position:n0,uri:Qxe,version:S.Number()}),panelId:S.String()});function BNc(t,e,r,n,o){let s=RSt(o.completionText),c=(0,LGi.SHA256)(s).toString();return t.get(Tu).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(BNc,"makeSolution");var ALr=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 s_e.NotificationType("PanelSolution"),BNc(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return FGi(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new s_e.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function FGi(t,e){return e.connection.sendNotification(new s_e.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(FGi,"reportDone");var q3e;async function LNc(t,e,r){q3e&&(q3e.cancel(),q3e.dispose()),q3e=new jn.CancellationTokenSource;let n=new zE([e,q3e.token]),o=r.doc.position,s=fu.range(o,o),c=new ALr(t,r,s),l=t.get(bN);if(l.documents){let u=l.documents;DSt(o,u,c)}else{let u;try{u=await g9(t,r.doc,n)}catch(f){if(!(f instanceof s_e.ResponseError))throw f;switch(f.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return FNc(t,r)}throw f}c.offset=u.offsetAt(o);let d=new n_e(u,o,n,10);PSt(t,d,c)}return[{solutionCountTarget:10},null]}a(LNc,"handleGetPanelCompletionsChecked");async function FNc(t,e){return await FGi(e.panelId,t.get(ar)),[{solutionCountTarget:0},null]}a(FNc,"produceEmptySolutions");var UGi=Oe(ONc,LNc);p();var UNc=S.Object({});async function QNc(t,e,r){let o=(await t.get(Ut).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(QNc,"handleGetUserInfoChecked");var QGi=Oe(UNc,QNc);p();var qNc=S.Object({});function jNc(t,e,r){return[{version:t.get(as).getDisplayVersion(),buildType:_U(t),runtimeVersion:`node/${process.versions.node}`},null]}a(jNc,"handleGetVersionChecked");var qGi=Oe(qNc,jNc);p();jo();var HNc=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 GNc(t,e,r){if(r.changes.length===0)return[null,{code:Ze.InvalidRequest,message:"No changes provided"}];let n=t.get(Wo),o=n.create({capabilities:{skills:[PO]}}),s=new Zf({message:"",type:"user"});await n.addTurn(o.id,s);let c=ZEe({workDoneToken:Gt()});await t.get(Sc).begin(o,s,c);let d=(await new fw(t,o,s,e).skillResolver.resolve(PO))?.head?.name,h=await t.get(NX).generateCommitMessage(t,e,r,d);return h==null?[null,{code:Ze.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(GNc,"handleGitCommitGenerateChecked");var jGi=Oe(HNc,GNc);p();var $Nc=S.Object({repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),pullRequestNumber:S.Number()});async function VNc(t,e,r){try{let o=await new iE(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return Et(t,"githubApi.listPullRequestChangedFiles",Wt.createAndMarkAsIssued()),yt(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(Ua(t,n,"githubApi.listPullRequestChangedFiles"),Zn(t,"githubApi.listPullRequestChangedFiles",n),n instanceof nE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Od&&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(VNc,"handleListPullRequestChangedFilesChecked");var HGi=Oe($Nc,VNc);p();p();var OSt=new pe("GitHubGraphQLClient"),BSt=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=v1n.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){OSt.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++,OSt.debug(this.ctx,`Fetching page ${c} of pull requests search results`);let u=await 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(` query searchPullRequests($searchQuery: String!, $cursor: String) { search(query: $searchQuery, type: ISSUE, first: 100, after: $cursor) { nodes { @@ -4037,7 +4085,7 @@ Content: ${r}`}async generateTitle(e,r,n){let o=new jn.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 OSt.debug(this.ctx,`Found ${n.length} pull requests`),n}catch(n){if(OSt.error(this.ctx,`Failed to search pull requests with query '${e}':`,n),n&&typeof n=="object"&&"status"in n){let o=n;throw new Od(o.status,o.message||"GitHub GraphQL API failed")}throw n}}async getApiSession(){let e=await this.ctx.get(Ur).resolveSession();if(!e)throw new nE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var WNc=S.Object({query:S.String(),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Oc))}),GGi=4,a_e=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function zNc(t,e,r){try{let n=new BSt(t),o=await KNc(t,r),s=await n.searchPullRequests(o);await YNc(t,s);let c=JNc(s);return Et(t,"githubApi.searchPR",Wt.createAndMarkAsIssued()),yt(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof a_e)return[null,{code:n.errorCode,message:n.message}];if(n instanceof nE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(Ua(t,n,"githubApi.searchPR"),Zn(t,"githubApi.searchPR",n),n instanceof Od&&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(zNc,"handleSearchPRChecked");async function YNc(t,e){let r=new iE(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(YNc,"appendCopilotWorkStatus");async function KNc(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Ur).resolveSession();if(!n)throw new a_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 a_e("No workspace folder provided",Ze.InvalidRequest);let s=await t.get(r0).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 a_e(l,Ze.NoGitHubRepository)}}return r}a(KNc,"replaceTemplateVariables");function JNc(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(JNc,"buildCopilotWorkStatusMeasurements");var $Gi=Oe(WNc,zNc);p();var ZNc=new pe("hook.list"),XNc=S.Object({workspaceFolders:S.Optional(S.Array(Oc))});function eMc(t){let e=[];for(let r of t){let n=new Map;for(let o of r.hooks){let s=_fr[o.type];if(s===void 0)continue;let c=o.hooks.map(u=>vfr(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(eMc,"pluginHookRows");async function tMc(t,e,r){let n=r.workspaceFolders??[],o=U5(t)&&nJ(t)?(async()=>{try{let l=(await t.get(cc).listPlugins()).filter(u=>u.enabled);return eMc(l)}catch(l){return l instanceof hu||ZNc.warn(t,"failed to list plugin hooks for hook/list",{err:String(l)}),[]}})():void 0,c=(await t.get(cE).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(tMc,"listHooks");var VGi=Oe(XNc,tMc);p();jo();var zGi=zjt.type,j3e;function WGi(t){return{title:"Completion Accepted",command:kNe,arguments:[t]}}a(WGi,"makeCommand");async function rMc(t,e,r){j3e&&(j3e.cancel(),j3e.dispose());let n=r.context.triggerKind===1;j3e=new jn.CancellationTokenSource;let o=j3e.token,s=new zE([e,o]);r.contextItems&&NSt(t,r.contextItems,r.data);let c=MSt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:WGi(Gt()),...g}))},null];let l=await g9(t,r.textDocument,s),u=r.position,d=await t.get(KA).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(Tu);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:WGi(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(rMc,"handleChecked");var YGi=Oe(nei,(t,e,r)=>rMc(t,e,r));p();p();function yLr(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 c_e(o)}a(yLr,"asReadableCert");function c_e(t){return t.replace(/\s/g,"")}a(c_e,"normalizeNewlines");var iMc=S.Object({});async function oMc(t){return[{certificates:(await t.get(lp).getAllRootCAs()).map(c_e)},null]}a(oMc,"handleListCertificatesChecked");var KGi=Oe(iMc,oMc);p();var ZGi="mcpGateway/serversChanged",XGi="mcpGateway/serverDetailsChanged",e$i=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()})]),sMc=S.Object({source:e$i,name:S.String()}),aMc=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()})]),JGi=S.Record(S.String(),S.Unknown()),cMc=S.Object({workspaceFolder:S.String(),user:JGi,project:JGi});async function lMc(t,e,r){let n=L3e(r.user),o=L3e(r.project);return await t.get(WA).applyConfig({workspaceFolder:r.workspaceFolder,user:n,project:o}),[null,null]}a(lMc,"handleApplyConfigChecked");var t$i=Oe(cMc,lMc),uMc=S.Object({scope:aMc});function dMc(t,e,r){return[{servers:t.get(WA).listServers(r.scope).map(s=>({...s,providers:fO(s.source.kind==="plugin",void 0)}))},null]}a(dMc,"handleListServersChecked");var r$i=Oe(uMc,dMc),fMc=sMc;function pMc(t,e,r){return[{details:t.get(WA).getServerDetails(r)},null]}a(pMc,"handleGetServerDetailsChecked");var n$i=Oe(fMc,pMc),hMc=S.Object({source:e$i,name:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});async function mMc(t,e,r){try{return await t.get(WA).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof EH)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(mMc,"handleServerActionChecked");var i$i=Oe(hMc,mMc);p();p();p();var o$i=de(Kc());var ELr=class extends o$i.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=Ze.InternalError){super(o,e,{errorType:r,...n})}},fie=class extends ELr{static{a(this,"HttpStatusError")}constructor(e,r,n,o=Ze.InternalError){super(e,r,{status:n},o)}},LSt=class extends fie{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,Ze.NoCopilotToken)}},FSt=class extends fie{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var USt=class extends fie{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function s$i(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(s$i,"getRegistryMetadataFromConfig");function a$i(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?gMc(t,r):!1}catch{return!1}}a(a$i,"validateServerConfigurationMatch");function gMc(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(gMc,"validateRemoteURL");var c$i=300*1e3,SN=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 USt(u)]:[null,new fie(`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=s$i(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?a$i(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 AMc=S.Object({url:S.String(),source:S.String(),id:S.String(),subfolder:S.Optional(S.String())}),l$i=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()))}),_Lr=S.Intersect([l$i,S.Object({variables:S.Optional(S.Record(S.String(),l$i))})]),yMc=S.Intersect([_Lr,S.Object({type:S.Literal("positional"),valueHint:S.Optional(S.String()),isRepeated:S.Optional(S.Boolean())})]),EMc=S.Intersect([_Lr,S.Object({type:S.Literal("named"),name:S.String(),isRepeated:S.Optional(S.Boolean())})]),u$i=S.Union([yMc,EMc]),H3e=S.Intersect([_Lr,S.Object({name:S.String()})]),_Mc=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(H3e))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(H3e))})])),runtimeArguments:S.Optional(S.Array(u$i)),packageArguments:S.Optional(S.Array(u$i)),environmentVariables:S.Optional(S.Array(H3e))}),vMc=S.Union([S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(H3e))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(H3e))})]),CMc=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")]))}),bMc=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}),SMc=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}),TMc=S.Object({"io.modelcontextprotocol.registry/official":S.Optional(bMc)},{additionalProperties:!0}),IMc=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),repository:S.Optional(AMc),version:S.String(),websiteUrl:S.Optional(S.String()),icons:S.Optional(S.Array(CMc)),$schema:S.Optional(S.String()),packages:S.Optional(S.Array(_Mc)),remotes:S.Optional(S.Array(vMc)),_meta:S.Optional(SMc)}),xMc=S.Object({server:IMc,_meta:TMc}),akh=S.Object({servers:S.Array(xMc),metadata:S.Optional(S.Object({nextCursor:S.Optional(S.String()),count:S.Optional(S.Number())}))}),d$i=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())}),f$i=S.Object({baseUrl:S.String(),serverName:S.String(),version:S.String()});var G3e="mcp.registry.listServers",l_e="mcp.registry.getServer";async function wMc(t,e,r,n){return await t.get(SN).fetchServer(e,r,n)}a(wMc,"fetchServer");async function RMc(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 $0(t,G3e,Wt.createAndMarkAsIssued({message:d})),[null,{code:Ze.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return Et(t,G3e,Wt.createAndMarkAsIssued()),yt(t,G3e),[u,null]}catch(c){Zn(t,G3e,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return $0(t,G3e,Wt.createAndMarkAsIssued({message:l})),[null,{code:Ze.InternalError,message:l}]}}a(RMc,"handleListServersChecked");async function PMc(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 wMc(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return $0(t,l_e,Wt.createAndMarkAsIssued(s)),yt(t,l_e,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return $0(t,l_e,Wt.createAndMarkAsIssued(c)),yt(t,l_e,c),[null,{code:Ze.InternalError,message:s}]}return Et(t,l_e,Wt.createAndMarkAsIssued()),yt(t,l_e),[n,null]}a(PMc,"handleGetServerChecked");var p$i=Oe(d$i,RMc),h$i=Oe(f$i,PMc);p();p();var m$i=S.Object({}),kMc=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()])}),DMc=S.Object({url:S.String(),registry_access:S.Union([S.Literal("registry_only"),S.Literal("allow_all")]),owner:kMc}),Skh=S.Object({mcp_registries:S.Array(DMc)});async function NMc(t){return await t.get(SN).fetchMcpRegistryAllowlist()}a(NMc,"fetchMcpRegistryAllowlist");async function MMc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await NMc(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(MMc,"handleGetMcpRegistryAllowlistChecked");var g$i=Oe(m$i,MMc);p();var E$i=de(ZX()),_$i=de(Ku()),v$i=de(O_());p();jo();var OMc=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()})}))}),PV=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},vLr=new pe("setNextEditDocument");function BMc(t,e,r){return vLr.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet(PV,new PV(r.edits)),["OK",null]}a(BMc,"handleTestingSetNextEditDocumentChecked");var A$i=Oe(OMc,BMc);function y$i(t,e,r,n){let o=t.get(PV);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?(vLr.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):(vLr.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>LMc(c,r,n)))}}a(y$i,"getTestNextEditSuggestions");function LMc(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:[Gt()]}}}a(LMc,"createNextEditSuggestion");async function FMc(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=Os(r.textDocument.uri);t.get(t9).setForRequest(_$i.URI.parse(n),r.diagnostics??[]);let o=y$i(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(Uv);t.get(E$i.ObservableWorkspace).onUserPositionChange(n,new v$i.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:kNe,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(FMc,"handleChecked");var C$i=Oe(wbn,FMc);p();var QMc=S.Object({uuid:S.String({minLength:1}),acceptedLength:S.Optional(S.Number({minimum:1}))});function qMc(t,e,r){let n=t.get(Tu),o=n.get(r.uuid);return o&&(jMc(r,o)==="full"?(n.delete(r.uuid),vme(t,o,o.triggerCategory)):zdt(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(qMc,"notifyAcceptedChecked");function jMc(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}));Wdt(t,"ghostText",s.offset,s.uri,c),t.get(ZA).resetState()}return["OK",null]}a(VMc,"notifyRejectedChecked");var T$i=Oe($Mc,VMc);p();var WMc=S.Object({uuid:S.String({minLength:1})});function zMc(t,e,r){let o=t.get(Tu).get(r.uuid);return o&&Wlt(t,o.triggerCategory,o),["OK",null]}a(zMc,"notifyShownChecked");var I$i=Oe(WMc,zMc);p();var YMc=S.Object({commandLine:S.String(),shell:S.Optional(S.String())});async function KMc(t,e,r){let n=t.get(zS),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(KMc,"handleParseTerminalCommandChecked");var x$i=Oe(YMc,KMc);p();p();function w$i(t){return S.Union(Object.values(t).map(e=>S.Literal(e)))}a(w$i,"enumSchema");var JMc=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())})]),ZMc=S.Object({rawValue:S.String(),displayLabel:S.String(),cloneUrl:S.String(),canonicalId:S.String(),cacheSegments:S.Array(S.String()),kind:w$i(SX),ref:S.Optional(S.String()),githubRepo:S.Optional(S.String()),localRepositoryUri:S.Optional(S.String())}),R$i=S.Object({name:S.String(),description:S.String(),version:S.String(),sourceDescriptor:JMc,marketplace:S.String(),marketplaceReference:ZMc,marketplaceType:w$i(IDe),readmeUri:S.Optional(S.String())}),kV=S.Object({pluginUri:S.String()}),QSt=S.Object({source:S.String()});p();var XMc="_direct";function P$i(t,e){let r=t.fromMarketplace,n=r?.name??t.label,o=r?.marketplaceReference.canonicalId??XMc;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(P$i,"toPluginListRow");async function xp(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof bH?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(xp,"withPluginErrorHandling");async function eOc(t,e,r){return xp(()=>t.get(cc).disablePlugin(r.pluginUri))}a(eOc,"handlePluginsDisableChecked");var k$i=Oe(kV,eOc);p();async function tOc(t,e,r){return xp(()=>t.get(cc).enablePlugin(r.pluginUri))}a(tOc,"handlePluginsEnableChecked");var D$i=Oe(kV,tOc);p();var rOc=S.Object({plugin:R$i});async function nOc(t,e,r){return xp(async()=>({pluginUri:await t.get(cc).installPlugin(r.plugin)}))}a(nOc,"handlePluginsInstallChecked");var N$i=Oe(rOc,nOc);p();var iOc=S.Object({source:S.String(),pluginName:S.Optional(S.String())});async function oOc(t,e,r){return xp(()=>t.get(cc).installPluginFromSource(r.source,r.pluginName))}a(oOc,"handlePluginsInstallFromSourceChecked");var M$i=Oe(iOc,oOc);p();var sOc=S.Object({});async function aOc(t,e,r){return xp(async()=>{let n=t.get(cc);return(await n.listPlugins()).map(s=>P$i(s,c=>n.isReadOnlyPlugin(c)))})}a(aOc,"handlePluginsListChecked");var O$i=Oe(sOc,aOc);p();async function cOc(t,e,r){return xp(()=>t.get(cc).addMarketplace(r.source))}a(cOc,"handleMarketplaceAddChecked");var B$i=Oe(QSt,cOc);p();var lOc=S.Object({source:S.Optional(S.String())});async function uOc(t,e,r){return xp(()=>t.get(cc).browseMarketplace(r.source))}a(uOc,"handleMarketplaceBrowseChecked");var L$i=Oe(lOc,uOc);p();var dOc=S.Object({});async function fOc(t,e,r){return xp(async()=>[...await t.get(cc).listMarketplaces()])}a(fOc,"handleMarketplaceListChecked");var F$i=Oe(dOc,fOc);p();async function pOc(t,e,r){return xp(()=>t.get(cc).removeMarketplace(r.source))}a(pOc,"handleMarketplaceRemoveChecked");var U$i=Oe(QSt,pOc);p();async function hOc(t,e,r){return xp(()=>t.get(cc).uninstallPlugin(r.pluginUri))}a(hOc,"handlePluginsUninstallChecked");var Q$i=Oe(kV,hOc);p();async function mOc(t,e,r){return xp(async()=>({updated:await t.get(cc).updatePlugin(r.pluginUri)}))}a(mOc,"handlePluginsUpdateChecked");var q$i=Oe(kV,mOc);p();var gOc=tei;function AOc(t,e,r){let n=t.get(dm),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new o_e(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a(AOc,"registerContextProviders");var j$i=Oe(gOc,AOc);p();p();var yOc=S.Object({uri:S.Optional(S.String())}),EOc=S.Object({showEditorCompletions:S.Optional(S.Boolean()),enableAutoCompletions:S.Optional(S.Boolean()),delayCompletions:S.Optional(S.Boolean()),filterCompletions:S.Optional(S.Boolean())}),G$i=S.Object({github:S.Optional(S.Object({copilot:S.Optional(S.Object({}))})),[k7r]:S.Optional(yOc),http:S.Optional(Yun),telemetry:S.Optional(S.Object({telemetryLevel:S.Optional(S.String())}))}),$3e=Object.keys(G$i.properties).filter(t=>t!=="github"),_Oc=S.Intersect([G$i,EOc]),vOc=S.Object({settings:S.Optional(S.Union([S.Object({}),S.Array(S.Unknown(),{maxItems:0})])),authProvider:S.Optional(S.Never())}),H$i=Fu.Compile(vOc),CLr=Fu.Compile(_Oc);function wB(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(wB,"normalizePromptSetting");async function jSt(t,e){if(!H$i.Check(e))throw qSt(t),new NA(H$i.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&COc(t,r),qSt(t,r),Promise.resolve()}a(jSt,"notifyChangeConfiguration");function COc(t,e){for(let n of CLr.Errors(e)){let o=n.path.split("/")?.[1];qo.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!CLr.Check(e))throw new NA(CLr.Errors(e));e.http&&bLr(t,e.http);let r=e["github-enterprise"];r&&VUe(t,r.uri),e.github?.copilot&&bOc(t,e.github.copilot)}a(COc,"applySettingsToConfiguration");function bOc(t,e){let r=t.get(KC),n={};for(let o of Object.values(Ke)){let s=Zun(e,o);n[o]=s}r.setCopilotSettings(n),Hhe.clearCache(),uSt.clearCache(),typeof e.mcp=="string"&&LOc(t,e.mcp),e.agent&&typeof e.agent=="object"&&(FOc(t,e.agent),UOc(t,e.agent),QOc(t,e.agent)),SOc(t,e.globalCopilotInstructions),TOc(t,e.globalGitCommitInstructions),IOc(t,e.globalAgentsMdInstructions),xOc(t,e.globalClaudeMdInstructions),wOc(t,e.globalInstructionFiles),ROc(t,e.globalPromptFiles),NOc(t,e.instructionFileLocations),MOc(t,e.promptFileLocations),OOc(t,e.agentFileLocations),BOc(t,e.skillFileLocations)}a(bOc,"applyCopilotConfiguration");function SOc(t,e){try{let r=t.get(Ef),n=wB(e);r.setGlobalCopilotInstructions(n)}catch(r){qo.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(SOc,"applyGlobalCopilotInstructionsConfiguration");function TOc(t,e){try{let r=t.get(Ef),n=wB(e);r.setGlobalGitCommitInstructions(n)}catch(r){qo.error(t,"Failed to apply global Git commit instructions configuration",r)}}a(TOc,"applyGlobalGitCommitInstructionsConfiguration");function IOc(t,e){try{let r=t.get(Ef),n=wB(e);r.setGlobalAgentsMdInstructions(n)}catch(r){qo.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(IOc,"applyGlobalAgentsMdInstructionsConfiguration");function xOc(t,e){try{let r=t.get(Ef),n=wB(e);r.setGlobalClaudeMdInstructions(n)}catch(r){qo.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(xOc,"applyGlobalClaudeMdInstructionsConfiguration");function wOc(t,e){try{let r=t.get(Ef),n=(e||[]).map(wB);r.setGlobalInstructionFiles(n)}catch(r){qo.error(t,"Failed to apply global instruction files configuration",r)}}a(wOc,"applyGlobalInstructionFilesConfiguration");function ROc(t,e){try{let r=t.get(fg),n=(e||[]).map(wB);r.setGlobalPromptFiles(n)}catch(r){qo.error(t,"Failed to apply global prompt files configuration",r)}}a(ROc,"applyGlobalPromptFilesConfiguration");function POc(t){return t?Array.isArray(t)?t.map(wB):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(POc,"normalizeFileLocations");function kOc(t){let e=wB(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(kOc,"normalizeInstructionPromptSetting");function DOc(t){return t?Array.isArray(t)?t.map(kOc):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(DOc,"normalizeInstructionFileLocations");function NOc(t,e){try{let r=t.get(Ef);if(e===void 0)return;r.setInstructionFileLocations(DOc(e))}catch(r){qo.error(t,"Failed to apply instruction file locations configuration",r)}}a(NOc,"applyInstructionFileLocationsConfiguration");function MOc(t,e){try{let r=t.get(fg);if(e===void 0)return;r.setPromptFileLocations(POc(e))}catch(r){qo.error(t,"Failed to apply prompt file locations configuration",r)}}a(MOc,"applyPromptFileLocationsConfiguration");function OOc(t,e){try{let r=t.get(Yp);if(e===void 0)return;let n=e.map(wB);r.setAgentFileLocations(n)}catch(r){qo.error(t,"Failed to apply agent file locations configuration",r)}}a(OOc,"applyAgentFileLocationsConfiguration");function BOc(t,e){try{let r=t.get(a0);if(e===void 0)return;let n=e.map(wB);r.setSkillFileLocations(n)}catch(r){qo.error(t,"Failed to apply skill file locations configuration",r)}}a(BOc,"applySkillFileLocationsConfiguration");function bLr(t,e){let r=t.get(KC);e.proxy===void 0&&(e=Kun(r.env));try{r.setHttpSettings(qTe(e))}catch(n){if(!(n instanceof TypeError))throw n;qo.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(bLr,"applyHttpConfiguration");async function LOc(t,e){let r;try{r=L3e(JSON.parse(e||"{}"))}catch(n){qo.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(YE).updateMCPServers(r)}catch(n){qo.error(t,"Failed to apply MCP configuration to McpManager",n)}}a(LOc,"applyMCPConfiguration");function FOc(t,e){try{let r=e;t.get(zS).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){qo.error(t,"Failed to apply settings configuration",r)}}a(FOc,"applyTerminalAutoApproveConfiguration");function UOc(t,e){try{let r=e;t.get(pw).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){qo.error(t,"Failed to apply edit auto approve configuration",r)}}a(UOc,"applyEditAutoApproveConfiguration");function QOc(t,e){try{let r=e;t.get(X3).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){qo.error(t,"Failed to apply MCP auto approve configuration",r)}}a(QOc,"applyMCPAutoApproveConfiguration");function qSt(t,e){if(t.get(KC).markReady(),!t.get(Pn).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(lf).initialize(r)}}a(qSt,"initializePostConfigurationDependencies");var $$i=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),qOc=S.Object({editorInfo:$$i,editorPluginInfo:$$i,editorConfiguration:S.Optional(S.Object({}))});async function jOc(t,e,r){t.get(Ir).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),Ydt(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await jSt(t,{settings:r.editorConfiguration}),Et(t,"setEditorInfo");for(let n of["github",...$3e])r.editorConfiguration&&n in r.editorConfiguration&&Et(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(jOc,"handleSetEditorInfoChecked");var V$i=Oe(qOc,jOc);p();var HOc=S.Object({options:S.Optional(S.Object({}))});async function GOc(t,e,r){let n=t.get(LT),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(GOc,"handleSignInConfirmChecked");var W$i=Oe(HOc,GOc);p();var $Oc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function VOc(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(LT).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:Jdt,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof Ai))throw n;return[null,{code:Ze.DeviceFlowFailed,message:n.message}]}}a(VOc,"handleSignInInitiateChecked");var SLr=Oe($Oc,VOc);p();p();p();var z$i=["google","apple"],HSt=S.Optional(S.Union(z$i.map(t=>S.Literal(t))));function Y$i(t){return typeof t=="string"&&z$i.includes(t)}a(Y$i,"isGitHubSocialProvider");function TLr(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(TLr,"isGitHubSocialProviderApplicableHostname");function K$i(t,e){if(!e)return t;try{let r=new URL(t);return TLr(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(K$i,"addGitHubSocialProviderToVerificationUri");p();function J$i(){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(J$i,"isBrowserAvailable");function WOc(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(WOc,"getGitHubOAuthServerMetadata");async function GSt(t,e,r={},n){let o=performance.now();Cme(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!J$i())throw new SU("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=TU(t,r.authAuthority),u=WOc(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=TLr(new URL(c).hostname)?r.socialProvider:void 0,m=await d.createSession(f,{cancellationToken:n,provider:h}),g=m.scopes||f,A=t.get(Hp).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new Ai("Could not resolve GitHub username during sign-in. Please try again.");return s=await t.get(Ur).signInEditor({accessToken:m.accessToken,user:y,githubAppId:A,authAuthority:l,scopes:g?[...g]:void 0}),$2(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw $2(t,"codeFlow",s.status,performance.now()-o,c),c}}a(GSt,"performGitHubOAuthCodeFlow");p();p();p();KGe();var u_e=class extends Um{constructor(r,n=new ILr){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)}},ILr=class extends Um{static{a(this,"SpawnUrlOpener")}async open(e){await pTe(e)}};p();var Z$i=require("crypto"),X$i=de(require("http"));p();var $St=new pe("OAuth Code Flow");function xLr(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 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 @@ -4111,49 +4159,49 @@ Content: ${r}`}async generateTitle(e,r,n){let o=new jn.CancellationTokenSource,s } -`;var RLr=["authorization_code","refresh_token"],d_e=33428,VSt=class{constructor(e,r){this._logger=new pe("LoopbackAuthServer");this.nonce=(0,Z$i.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=X$i.createServer((s,c)=>{let l=new URL(s.url,`http://${s.headers.host}`);switch(l.pathname){case"/signin":{let u=(l.searchParams.get("nonce")??"").replace(/ /g,"+");if(u!==this.nonce){let d=new Ai("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),PNe(this._ctx,d,"/signin"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(d);return}this._startingRedirect.searchParams.set("redirect_uri",`http://127.0.0.1:${this.port}/callback`),this._logger.info(this._ctx,"Redirecting to auth server"),c.writeHead(302,{location:this._startingRedirect.toString()}),c.end();break}case"/callback":{let u=l.search||"",d=/[?&]code=([^&]+)/.exec(u),f=/[?&]state=([^&]+)/.exec(u),h=d&&d.length>1?decodeURIComponent(d[1]):void 0,m=f&&f.length>1?decodeURIComponent(f[1]):void 0,g=new URL(m||"").searchParams.get("nonce")??void 0;if(!h||!m||!g){let A="Missing required parameters, at least one from code, state, nonce is needed.",y=new Ai(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),PNe(this._ctx,y,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent(A)}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(y);return}if(this.state!==m){let A=new Ai("State does not match.");this._logger.warn(this._ctx,"OAuth callback state mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedState:m,expectedState:this.state}),PNe(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("State does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}if(this.nonce!==g){let A=new Ai("Nonce does not match.");this._logger.warn(this._ctx,"OAuth callback nonce mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedNonce:g,expectedNonce:this.nonce}),PNe(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(wLr,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(wLr)}})}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 ${d_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(d_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 WSt=require("crypto");var V3e=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,WSt.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,WSt.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 zOc="Timed out",eVi="Sign-in request was cancelled",PLr=class{static{a(this,"CodeFlow")}},f_e=class extends PLr{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=V3e.isServerSupported(n.code_challenge_methods_supported),h=f?V3e.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 VSt(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 u_e(this.ctx).open(_);let v,b=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,P)=>{let D=setTimeout(()=>P(new Error(zOc)),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(eVi));return}let N=x.onCancellationRequested(()=>{Nr.info(this.ctx,"OAuth flow cancelled"),D(new Error(eVi))});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 vX(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 TN=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=>xLr([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(zn).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(Hp),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=Y$i(r.provider)?r.provider:void 0,d=await new f_e(this.ctx).auth({clientId:c,clientSecret:l},n,this.serverMetadata,this.resourceMetadata,{prompt:"select_account",provider:u},r.cancellationToken),f=await this.tokenToSession(d.access_token,e);this.afterSessionLoad(f);let h=o.findIndex(g=>g.account.id===f.account.id&&xLr([...g.scopes].sort(),n)),m=new Array;return h>-1?m.push(...o.splice(h,1,f)):o.push(f),await this.storeSessions(o),f}async storeSessions(e){this._sessionsPromise=Promise.resolve(e),await this.ctx.get(zn).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 $St.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 $St.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 $St.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 YOc=S.Object({scopes:S.Optional(S.Array(S.String({minLength:1}),{minItems:1})),authServer:S.Optional(S.String({minLength:1})),socialProvider:HSt});async function KOc(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:zUe(c)}];let l=await GSt(t,(u,d)=>new TN(u,TN.providerId,d,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider},e);if(!["OK","MaybeOK"].includes(l.status))throw new Ai("OAuth authentication failed for unknown reasons. Please try again later.");return[l,null]}catch(n){if(n instanceof SU)return[null,{code:Ze.NoBrowserAvailable,message:n.message}];if(!(n instanceof Ai))throw n;return[null,{code:Ze.CodeFlowFailed,message:n.message}]}}a(KOc,"handleSignInWithCodeFlowChecked");var tVi=Oe(YOc,KOc);p();p();p();var A9=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},W3e=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function rVi(t,e,r){return e.isCancellationRequested?Promise.reject(new A9):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new A9))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new W3e))},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(rVi,"raceWithCancellationAndTimeout");var JOc=["repo","workflow"];async function ZOc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...Oy(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&&zI(l)?new Ai(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new Ai(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(ZOc,"requestDeviceCode");async function XOc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...Oy(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&&zI(l)?new Ai(`Device flow token request failed on ${n}: ${l.message}`):l}let c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new Ai(c.error_description):new Ai(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(XOc,"requestAccessToken");async function e5c(t,e){let n=await(await qf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new Ai(`Error retrieving user information: ${String(n.errors)}`);return n}a(e5c,"requestUserInfo");async function t5c(t,e,r){let n=r?.githubAppId??t.get(Hp).findAppIdToAuthenticate(),o=r?.scopes??JOc,{serverUrl:s,apiUrl:c,authAuthority:l}=TU(t,r?.authAuthority),u=await ZOc(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 A9("Sign-in request was cancelled");m=await XOc(t,u.device_code,n,s);let g=m.access_token;if(g){let A=await e5c(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new A9("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:zUe(u)}];Cme(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(i5c,{userCode:f.userCode,verificationUri:f.verificationUri,expiresIn:f.expiresIn});let h=await rVi(f.waitForAuth,e,o5c),m=await d.save(h);return $2(t,"deviceFlow",m.status,o()),[m,null]}catch(s){if(s instanceof A9)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof W3e)return $2(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:Ze.DeviceFlowFailed,message:"Sign-in request timed out"}];if($2(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof Ai))throw s;return[null,{code:Ze.DeviceFlowFailed,message:s.message}]}}a(s5c,"handleSignInWithDeviceFlowChecked");var iVi=Oe(n5c,s5c);p();var a5c=S.Object({githubToken:S.String({minLength:1}),user:S.String({minLength:1}),githubAppId:S.Optional(S.String({minLength:1}))});async function c5c(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Ur);return[await t.get(LT).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a(c5c,"handleSignInWithGithubTokenChecked");var oVi=Oe(a5c,c5c);p();var l5c=S.Object({options:S.Optional(S.Object({}))});async function u5c(t,e,r){return[await t.get(Ur).signOutEditor(),null]}a(u5c,"handleSignOutChecked");var sVi=Oe(l5c,u5c);p();var d5c=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())})))})))}),kLr=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function f5c(t,e,r){let n=t.get(as),o=t.get(Ir).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&l4.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:wPt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},l4.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new kLr(r.stacktrace??"N/A",o.name);return l.stack=void 0,Ua(t,l,r.transaction??"",s,c),["OK",null]}a(f5c,"handleTelemetryExceptionChecked");var aVi=Oe(d5c,f5c);p();p();p();jo();function DLr(t,e){let r=Date.now()+((t?.refresh_in??0)+sDt)*1e3;return new BW({token:`test token ${Gt()}`,refresh_in:0,expires_at:r,...t},e,r)}a(DLr,"createTestCopilotToken");var p_e=class extends Sh{constructor(){super(...arguments);this.defaultToken=DLr({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:DLr({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 zSt=class extends Sh{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:DLr(await this.envelopeFn())}}};var p5c=S.Object({options:S.Optional(S.Object({}))});async function h5c(t,e,r){let n=new p_e;return t.get(Ur).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet(Sh,n),t.get(cs).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(h5c,"handleTestingAlwaysAuthChecked");var NLr=Oe(p5c,h5c);p();jo();var m5c=S.Object({messages:S.Array(S.Object({role:S.Enum(rc),content:S.String(),name:S.Optional(S.String())})),modelFamily:S.Optional(S.Enum(In)),stop:S.Optional(S.Array(S.String())),conversationOptions:S.Optional(S.Object({maxResponseTokens:S.Optional(S.Number()),temperature:S.Optional(S.Number())}))});async function g5c(t,e,r){let n=new nc(t),s=await Eq(t)?In.Gpt35turbo:In.CopilotBase,c=await t.get(Jc).getBestChatModelConfig([r.modelFamily??s]),l=await xxe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:wA.user("test",Gt())},e,l),null]}a(g5c,"handleChatMLChecked");var cVi=Oe(m5c,g5c);p();p();p();var y_e=de(fWi(),1),tLh={ALPN_HTTP2:y_e.default.ALPN_HTTP2,ALPN_HTTP2C:y_e.default.ALPN_HTTP2C,ALPN_HTTP1_1:y_e.default.ALPN_HTTP1_1,ALPN_HTTP1_0:y_e.default.ALPN_HTTP1_0},{fetch:rLh,context:pWi,reset:nLh,noCache:iLh,h1:oLh,keepAlive:sLh,h1NoCache:aLh,keepAliveNoCache:cLh,cacheStats:lLh,clearCache:uLh,offPush:dLh,onPush:fLh,createUrl:pLh,timeoutSignal:hLh,Body:mLh,Headers:hWi,Request:gLh,Response:ALh,AbortController:yLh,AbortError:dTt,AbortSignal:ELh,FetchBaseError:_Lh,FetchError:vLh,ALPN_HTTP2:CLh,ALPN_HTTP2C:bLh,ALPN_HTTP1_1:SLh,ALPN_HTTP1_0:TLh}=y_e.default;var gWi=require("crypto"),AWi=require("http"),yWi=require("stream"),EWi=require("util"),__e=de(Bk());var FBc=6e5,UBc=new __e.ProtocolRequestType("copilot/fetch"),QBc=new __e.ProtocolRequestType("copilot/fetchCancel"),qBc=new __e.ProgressType,jBc=new __e.ProtocolRequestType("copilot/fetchDisconnectAll"),RB=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},E_e=class extends tr{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(as).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(ar).connection.sendRequest(jBc,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(ar).connection,c=(0,gWi.randomUUID)(),l=new jn.CancellationTokenSource,u=new yWi.PassThrough,d=a(()=>{s.sendRequest(QBc,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new dTt("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new RB("EditorFetcher received unexpected abort signal");if(o.aborted)throw new dTt("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(qBc,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new RB(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??FBc,y=setTimeout(()=>{yt(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new RB("Request timed out from lsp server"))},A),E=a(()=>{g(new dTt("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",E),s.sendRequest(UBc,GBc(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,EWi.inspect)(_.data)}`),g(new RB(v))}).finally(()=>{o?.removeEventListener("abort",E),clearTimeout(y)})});if(!h.status)throw new RB("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new YI(h.status,AWi.STATUS_CODES[h.status]??"",new hWi(h.headers),()=>HBc(u),()=>u)}};function HBc(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(HBc,"consumeStream");function GBc(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(GBc,"convertOptionsToParams");var $Bc=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 VBc(t,e,r){let n=new E_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 RB?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 RB?y.message:String(y)}`},null]}}a(VBc,"handleTestingFetchChecked");var _Wi=Oe($Bc,VBc);p();var WBc=S.Object({});async function zBc(t,e,r){return await t.get(Td).flush(),["OK",null]}a(zBc,"handleTestingFlushPromiseQueueChecked");var vWi=Oe(WBc,zBc);p();p();p();var MV=class{static{a(this,"FileSearch")}};p();p();p();var fTt=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 CWi=de(ri());var pTt="main.js",hTt=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=vgn(pTt,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new fTt(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new mze(this.id++),CWi.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new fze(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new pze(this.id++,e),r)}getContext(e,r,n,o,s,c){return this.postMessageInQueue(new hze(this.id++,e,r,n,o,s),c,!0)}tryCreateIndex(e,r,n){return this.postMessageInQueue(new uze(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 dze(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 lze(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(pTt+"'")&&(r=new Error(`Failed to load ${pTt}`),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(`${pTt} 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 tFe=de(ri());var C9=new pe(qfr),mTt=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){C9.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,tFe.CancellationToken.None);return}C9.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new hTt(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{C9.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 YBc(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,tFe.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{C9.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){C9.debug(this.ctx,`indexing workspace ${e}`);let r=HUt.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${HUt.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get(MV),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,tFe.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));C9.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)})),C9.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{C9.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,tFe.CancellationToken.None)}catch(n){C9.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return bmn(e)}};async function YBc(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(YBc,"createIndexableWorkspaceFolder");var KBc=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 JBc(t,e,r){try{await t.get(OS).start();let n=t.get(mTt),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,jfr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(tLc,"handleTestingNeverAuthChecked");var c3r=Oe(eLc,tLc);p();p();p();var l3r=class extends lp{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},TWi=a(t=>new l3r(t),"createTestCertificateReader");function d3r(t,e,r){let n=new u3r;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new YI(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(d3r,"createFakeResponse");function IWi(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),d3r(t,n,Object.assign({"content-type":"application/json"},r))}a(IWi,"createFakeJsonResponse");var rFe=class extends tr{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var gTt=class extends rFe{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var u3r=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 f3r=class extends rFe{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(IWi(200,this.fullConfig)):Promise.resolve(d3r(404,""))}},ATt=class extends f3r{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 rLc=S.Object({expFlags:S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean()]))});function nLc(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(tr,new ATt(n,t.get(tr)))}return["OK",null]}a(nLc,"handleTestingOverrideExpFlagsChecked");var xWi=Oe(rLc,nLc);p();var iLc=S.Object({rules:XQt});function oLc(t,e,r){return t.get(tc).setTestingRules(r.rules),["OK",null]}a(oLc,"handleTestingSetContentExclusionRulesChecked");var wWi=Oe(iLc,oLc);p();var sLc=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(kO)),options:S.Optional(S.Object({}))});function aLc(t,e,r){return t.get(b9).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(aLc,"handleTestingSetSyntheticTurnsChecked");var RWi=Oe(sLc,aLc);p();var cLc=S.Object({});async function lLc(t,e,r){let n=t.get(_s),o=t.get(Ff);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(lLc,"handleTriggerShowMessageChecked");var PWi=Oe(cLc,lLc);p();p();p();p();var kWi=de(require("tls"));var v_e=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(lp)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=kWi.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 HWi=de(require("http"));var MLc=407,_y=new pe("proxySocketFactory"),oP=class{static{a(this,"ProxySocketFactory")}},yie=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 yTt(t){return new m3r(t,new g3r(t))}a(yTt,"getProxySocketFactory");var m3r=class extends oP{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 En(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(_y.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 yie&&o.code===`ProxyStatusCode${MLc}`){_y.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return _y.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&&(_y.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(_y.debug(this.ctx,"Proxy authorization successful, received token"),o)return _y.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){_y.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);_y.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);_y.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return _y.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return _y.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return _y.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},g3r=class extends oP{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(as).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{_y.debug(this.ctx,"Attempting to establish connection to proxy");let l=HWi.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{_y.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new yie(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new yie(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(_y.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{_y.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new yie(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{_y.debug(this.ctx,"Proxy socket connection timeout"),c(new yie(`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(jWi()))}};var Eie=class extends tr{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new v_e(r),this.proxySocketFactory=r.get(oP),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(Mo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(Mo).getHttpSettings()),this.updateNoProxy(r.get(Mo).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(as),s=this.proxySocketTimeoutForTesting;return pWi({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 kW(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new YI(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var S_e=class extends Fm{constructor(r,n={}){super();this.env=n;this.recalculateUrlDefaults(r,this.getDefaultUrls())}static{a(this,"DefaultNetworkConfiguration")}getAuthAuthority(){return this.baseUrlObject.hostname}getConfiguredUrls(){return{serverUrl:this.baseUrlObject.href,apiUrl:this.apiUrl}}setConfiguredUrls(r,n){let o=this.getConfiguredUrls();this.recalculateUrlDefaults(r,n);let s=this.getConfiguredUrls();(o.apiUrl!==s.apiUrl||o.serverUrl!==s.serverUrl)&&r.get(Ut).resetToken("config_urls_changed"),r.get(lf).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=By({serverUrl:$Ue(r,n.serverUrl),apiUrl:$Ue(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 T_e=class extends QB{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){Ua(e,r,n)}};p();var I_e=class extends a4{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var ETt=class extends zk{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var _Tt=class extends Wh{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 vTt=class extends MV{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 GWi(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(GWi,"fakeChatModelConfiguration");function OLc(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a(OLc,"fakeEmbeddingModelConfiguration");var CTt=class extends Jc{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(GWi(r))}getModelConfigurationById(e){return Promise.resolve({...GWi(e),modelId:e})}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve(OLc(e))}};p();var bTt=class extends Um{constructor(){super(...arguments);this.openedUrls=[];this.opened=new dA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},STt=class extends _s{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 $Wi(t,e,r,n){return RS.create(GUe(t),e,r,n,e)}a($Wi,"createTextDocument");var A3r=class extends $r{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new Hi;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new Hi;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new Hi;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new Hi;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new Hi;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=$Wi(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]=$Wi(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}},TTt=class extends A3r{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 y3r=class extends Ff{static{a(this,"NullLog")}logIt(...e){}},E3r=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 BLc(t){let e=new uue;e.set(Mo,t),e.set(SY,t);let r=new E3r(e,{accessToken:"",login:"user"});e.set(Ur,r),e.set(as,new as),e.set(OI,new OI({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(lp,TWi([])),e.set(oP,yTt(e)),e.set(Ax,new Ax),e.set(sk,new Xqe);let n=new p_e;e.set(Sh,n);let o=new Ut(e,!0);e.set(Ut,o);let s=new Pp(e);return s.updateFromToken(n.defaultToken),e.set(Pp,s),e.set(G0,new G0),e.set(VN,new VN),e.set(_s,new STt),e.set(Um,new bTt),e.set(QB,new T_e),e.set(Ff,new y3r),e.set(gC,new gC),e.set(La,new La("test-session","test-machine","test-device")),e.set(MI,new MI(()=>Promise.resolve("test-device"))),e.set(Fm,new S_e(e)),e.set(TP,new ooe),e.set(lf,new lf(e,"copilot-test")),e.set(Zt,new Zt(e)),e.set(YM,new YM(e,o)),e.set(B2,new B2),e.set(vk,new Yce),e.set(cs,new Kqe),e.set(Td,new Td),e.set(W5,new W5(e)),e.set(MV,new vTt),e.set(H2,new H2(e)),e.set(f8,Fdt(e)),e.set(ZA,new ZA),e.set(Ib,new Ib),e.set(p8,p8.default),e.set(Px,new Px(e,!1)),e.set(Hp,new Hp),e.set(ii,new ii(e)),e.set(BT,new qdt),e.set(um,new um),e.set(dm,Jlt(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(xb,new xb(e)),LLc(e),e.set(Tb,new Tb(e)),e.set(Pn,new Pn),e.set(a4,new I_e),e.set(V2,new V2),e.set(mw,new mw),e.set(KS,new KS(e)),e}a(BLc,"_createBaselineContext");function LLc(t){t.set(Wo,new Wo(t)),t.set(Sc,new Sc(t)),t.set(SA,new SA(t)),t.set(zh,new zh),t.set(lg,new lg),t.set(Wh,new _Tt),t.set(nP,new nP(t,[])),t.set(Jc,new CTt),t.set(zk,new ETt),t.set(RO,new RO(t));let e=new _N(t);t.set(_N,e),t.set(tP,new tP(e,t)),t.set(OO,new OO(t)),t.set(yI,new dSt),t.set(VC,new VC(t.get(tP),t.get(yI),t)),t.set(c0,new c0)}a(LLc,"registerConversation");function VWi(){let t=BLc(new SY(new Kce,new Map));return t.set(tr,new gTt),t.set(Ir,new _3r),t.set($r,new TTt(t)),t.set($o,new OQ),t.set(tc,new tc(t)),t.set(pu,new pu(t)),t.set(LS,new MKe),t.set(EO,new EO(t)),t.set(z5,new Whe),t.set(N2,new $ct),t.set(Fl,new AKe),t.set(bA,new bA(t)),t.set(CA,new rKe),t.set(lm,new lm),tKe(t),t.set(KA,new bme(t)),t}a(VWi,"createLibTestingContext");var _3r=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 zWi=de(require("fs"));var WWi=`${process.env.HOME}/.copilot-testing-gh-token`,ITt,xTt;function YWi(t){let e=KWi(),r=new zSt(FLc);return t.forceSet(Sh,r),t.get(Ur).setTransientSession(e),r}a(YWi,"setIntegrationTokenManager");var FLc=a(async()=>{if(xTt)return xTt;let t=await KWi(),e=VWi(),r=new Eie(e);return e.forceSet(tr,r),xTt=aDt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new Ai('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),xTt},"getEnvelope");async function KWi(){let{session:t}=YOt(process.env);if(t)return t;try{ITt??=(await zWi.promises.readFile(WWi)).toString().trim()}catch{ITt??=process.env.GITHUB_TOKEN??""}if(!ITt)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 ${WWi}. Run "npm run get_token" to get one.`);return{...By({}),accessToken:ITt,login:"copilot-client tests"}}a(KWi,"getTestingGitHubSession");var ULc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function QLc(t,e,r){return YWi(t),await t.get(Ut).primeToken(),["OK",null]}a(QLc,"handleTestingUseTestingTokenChecked");var JWi=Oe(ULc,QLc);p();var qLc=S.Object({});async function jLc(t,e,r){return await new eEe().uninstall(t),["OK",null]}a(jLc,"handleUninstallChecked");var ZWi=Oe(qLc,jLc);p();var HLc=rei;function GLc(t,e,r){let n=t.get(dm),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(GLc,"unregisterContextProviders");var XWi=Oe(HLc,GLc);p();var v3r=de(require("os"));var $Lc=S.Object({expectedCertificate:S.String()});async function VLc(t,e,r){let o=(await Eot(t).getAllRootCAs()).map(c_e),s=c_e(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${yLr(s)}. Only found those installed on the system:${v3r.EOL}${o.map(c=>"- "+yLr(c)).join(v3r.EOL)}`},null]}a(VLc,"handleVerifyCertificateChecked");var ezi=Oe($Lc,VLc);p();var WLc=S.Object({});async function zLc(){return[{status:!!await new iFe().load()},null]}a(zLc,"handleVerifyKerberosChecked");var tzi=Oe(WLc,zLc);p();var YLc=S.Object({source:S.String(),version:S.Number(),uri:S.String()});async function KLc(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(KLc,"handleVerifyStateChecked");var rzi=Oe(YLc,KLc);p();var JLc=S.Object({});function ZLc(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(ZLc,"handleVerifyWorkspaceStateChecked");var nzi=Oe(JLc,ZLc);p();p();var w_e=de(require("fs/promises")),izi=de(require("os")),Yd=de(require("path"));var wp=new pe("GitWorktreeService"),XLc=20,x_e=class{constructor(e){this.ctx=e;this.gitInstances=new En(XLc)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=Yd.resolve(e),n=this.gitInstances.get(r);return n||(n=Bue(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=Yd.resolve(e);wp.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return wp.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw wp.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?(wp.info(this.ctx,`Skipping checkpoint commit for ${Yd.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)),wp.info(this.ctx,`Created ${n} commit for ${Yd.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){wp.info(this.ctx,`Snapshotting copied changes in ${Yd.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 wp.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await w_e.mkdtemp(Yd.join(izi.tmpdir(),"copilot-worktree-")),o=Yd.join(n,"changes.patch");try{wp.info(this.ctx,`Writing temporary patch for ${Yd.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}),wp.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=Yd.basename(r),h=Yd.join(Yd.dirname(r),`${f}.worktrees`),m=Yd.join(h,d);return wp.info(this.ctx,`Preparing worktree creation for ${Yd.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])),wp.info(this.ctx,`Created worktree ${m} from ${Yd.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){wp.info(this.ctx,`Preparing to remove worktree ${e} from ${Yd.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),wp.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return wp.info(this.ctx,`Skipping status lookup for ${Yd.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){wp.info(this.ctx,`Applying worktree changes from ${Yd.resolve(e)} to ${Yd.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");wp.info(this.ctx,o?`Committed pending worktree changes in ${Yd.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${Yd.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return wp.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 wp.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 wp.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"])),wp.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),wp.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),wp.info(this.ctx,`Popped stash in ${e}`)}};p();var ozi=de(ri());var _1=new pe("WorktreeService");var e3c=new ozi.ProtocolRequestType("worktree/requestUserDecision"),oFe=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 _1.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";_1.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(ar).connection.sendRequest(e3c,{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?(_1.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(_1.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){_1.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(_1.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&&(_1.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(_1.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},_1.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);_1.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw _1.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return _1.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){_1.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return _1.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var t3c="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",r3c=["already exists in working directory","patch does not apply","patch failed"];function n3c(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&r3c.some(n=>e.includes(n))?t3c:`Failed to apply worktree changes: ${e}`}a(n3c,"getWorktreeCompleteErrorMessage");var i3c=S.Object({repositoryPath:S.String()});async function o3c(t,e,r){try{let n=new x_e(t),o=new oFe(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(o3c,"handleWorktreeCreateChecked");var szi=Oe(i3c,o3c),s3c=S.Object({repositoryPath:S.String(),worktreePath:S.String(),baseCommit:S.String()});async function a3c(t,e,r){try{let n=new x_e(t);return[{success:!0,baseCommit:(await new oFe(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:Ze.InternalError,message:n3c(n)}]}}a(a3c,"handleWorktreeCompleteChecked");var azi=Oe(s3c,a3c),c3c=S.Object({worktreePath:S.String(),repositoryPath:S.String()});async function l3c(t,e,r){try{return await new x_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(l3c,"handleWorktreeDeleteChecked");var czi=Oe(c3c,l3c);var _ie=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function lzi(){let t=new Map;return t.set(zGi.method,YGi),t.set("getCompletions",MGi),t.set("getCompletionsCycling",OGi),t.set("getDefaultFileSafetyRules",BGi),t.set("copilot/parseTerminalCommand",x$i),t.set("getPanelCompletions",UGi),t.set(dGi.method,fGi),t.set("getVersion",qGi),t.set("getUserInfo",QGi),t.set("setEditorInfo",V$i),t.set("checkStatus",vHi),t.set("checkQuota",_Hi),t.set("checkFileStatus",yHi),t.set("claude/checkCliCompatibility",hHi),t.set("codex/checkCliCompatibility",AHi),t.set("signInInitiate",SLr),t.set("signIn",SLr),t.set("signInWithCodeFlow",tVi),t.set("signInWithDeviceFlow",iVi),t.set("signInConfirm",W$i),t.set("signInWithGithubToken",oVi),t.set("signOut",sVi),t.set("auth/listAvailableTokens",OQi),t.set("auth/useExistingToken",BQi),t.set("notifyShown",I$i),t.set("notifyAccepted",b$i),t.set("notifyRejected",T$i),t.set("notifyNextEditRejected",S$i),t.set("telemetry/exception",aVi),t.set("textDocument/copilotInlineEdit",C$i),t.set("testing/overrideExpFlags",xWi),t.set("testing/alwaysAuth",NLr),t.set("testing/setAlwaysAuthed",NLr),t.set("testing/neverAuth",c3r),t.set("testing/setNeverAuthed",c3r),t.set("testing/useTestingToken",JWi),t.set("testing/setCompletionDocuments",PGi),t.set("testing/setPanelCompletionDocuments",lGi),t.set("testing/setNextEditDocument",A$i),t.set("testing/triggerShowMessageRequest",PWi),t.set("testing/flushPromiseQueue",vWi),t.set("testing/getDocument",SWi),t.set("testing/chatml",cVi),t.set("testing/setSyntheticTurns",RWi),t.set("testing/fetch",_Wi),t.set("testing/setContentExclusionRules",wWi),t.set("testing/getContext",bWi),t.set("uninstall",ZWi),t.set("debug/diagnostics",bGi),t.set("debug/listCertificates",KGi),t.set("debug/verifyState",rzi),t.set("debug/verifyCertificate",ezi),t.set("debug/verifyKerberos",tzi),t.set("debug/verifyWorkspaceState",nzi),t.set("debug/getAgentDebugLog",TGi),t.set("debug/exportAgentDebugLog",SGi),t.set("context/registerProviders",j$i),t.set("context/unregisterProviders",XWi),t.set("conversation/preconditions",UHi),t.set("conversation/persistence",FHi),t.set("conversation/create",MHi),t.set("conversation/turn",HHi),t.set("conversation/turnDelete",GHi),t.set("conversation/destroy",OHi),t.set("conversation/compress",PHi),t.set("conversation/rating",QHi),t.set("conversation/copyCode",wHi),t.set("conversation/insertCode",RHi),t.set("conversation/templates",jHi),t.set("conversation/modes",BHi),t.set("conversation/agents",xHi),t.set("conversation/registerTools",qHi),t.set("conversation/unregisterTools",$Hi),t.set("conversation/updateToolsStatus",VHi),t.set("conversation/notifyCodeAcceptance",LHi),t.set("customAgent/registerExtensionAgents",hGi),t.set("customAgent/unregisterExtensionAgents",mGi),t.set("copilot/customAgent/list",pGi),t.set("copilot/customSkill/list",yGi),t.set("copilot/customPrompt/list",AGi),t.set("copilot/customInstruction/list",gGi),t.set("copilot/hook/list",VGi),t.set("copilot/models",nGi),t.set("copilot/models/getModelMetadataList",iGi),t.set("copilot/byok/saveModel",pHi),t.set("copilot/byok/deleteModel",FQi),t.set("copilot/byok/listModels",uHi),t.set("copilot/byok/saveApiKey",dHi),t.set("copilot/byok/deleteApiKey",LQi),t.set("copilot/byok/listApiKeys",QQi),t.set("copilot/byok/saveCustomProviderConfig",fHi),t.set("copilot/byok/listCustomProviderConfigs",qQi),t.set("copilot/setModelPolicy",oGi),t.set("copilot/codeReview/reviewChanges",zHi),t.set("copilot/codeReview/reviewSnippets",YHi),t.set("git/commitGenerate",jGi),t.set("thinking/generateTitle",WHi),t.set("mcp/getTools",JHi),t.set("mcp/updateToolsStatus",ZHi),t.set("mcp/readResource",XHi),t.set("mcp/registry/listServers",p$i),t.set("mcp/registry/getServer",h$i),t.set("mcp/registry/getAllowlist",g$i),t.set("mcp/getPrompt",eGi),t.set("mcp/completePrompt",tGi),t.set("mcp/serverAction",rGi),t.set("mcpGateway/listServers",r$i),t.set("mcpGateway/getServerDetails",n$i),t.set("mcpGateway/serverAction",i$i),t.set("mcpGateway/applyConfig",t$i),t.set("plugins/list",O$i),t.set("plugins/install",N$i),t.set("plugins/installFromSource",M$i),t.set("plugins/uninstall",Q$i),t.set("plugins/enable",D$i),t.set("plugins/disable",k$i),t.set("plugins/update",q$i),t.set("plugins/marketplace/add",B$i),t.set("plugins/marketplace/remove",U$i),t.set("plugins/marketplace/list",F$i),t.set("plugins/marketplace/browse",L$i),t.set("githubApi/searchPR",$Gi),t.set("githubApi/cancelCodingAgent",bHi),t.set("cloudAgent/listSessions",IHi),t.set("cloudAgent/getSessionLogs",THi),t.set("cloudAgent/createJob",SHi),t.set("cloudAgent/addPullRequestComment",CHi),t.set("githubApi/listPullRequestChangedFiles",HGi),t.set("worktree/create",szi),t.set("worktree/complete",azi),t.set("worktree/delete",czi),t.set("backgroundAgent/create",fQi),t.set("backgroundAgent/send",DQi),t.set("backgroundAgent/truncateHistory",MQi),t.set("backgroundAgent/destroy",pQi),t.set("backgroundAgent/listModels",xQi),t.set("backgroundAgent/listSessions",SQi),t.set("backgroundAgent/resume",PQi),t.set("backgroundAgent/stop",NQi),t.set("backgroundAgent/interaction",vQi),t.set("backgroundAgent/enableRemote",AQi),t.set("backgroundAgent/disableRemote",mQi),t.set("backgroundAgent/getRemoteStatus",EQi),t.set("backgroundAgent/getPlanPath",yQi),t.set("backgroundAgent/compactHistory",lQi),new _ie(t)}a(lzi,"getAllMethods");p();p();p();var uzi=de(Bk());var qv=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new uzi.NotificationType(this.name)}};var u3c=new pe("BackgroundAgent.notifications"),C3r=class extends qv{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=S.Object({sessionId:S.String(),event:S.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},b3r=class extends qv{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=S.Object({sessionId:S.String(),externalToolDefinitions:X5r})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){u3c.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(qs).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},dzi=[C3r,b3r];p();var S3r=class extends qv{constructor(){super(...arguments);this.name="copilot/didChangeToken";this.params=S.Unknown()}static{a(this,"DidChangeTokenNotificationHandler")}handle(){this.ctx.get(Ut).resetToken("did_change_token_notification")}},fzi=[S3r];p();var d3c=new pe("agentCopilotTokenManager");function I3r(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(I3r,"tokenEndpointToApiUrl");function f3c(t,e){if(!e.tokenEndpoint)return By(e);let r=I3r(e.tokenEndpoint);return r||d3c.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),By({apiUrl:r})}a(f3c,"getUrlsFromParams");var T3r=class extends qv{constructor(){super(...arguments);this.name=Hjt.method;this.params=gbn}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Ur),o=f3c(this.ctx,r);this.ctx.get(Fm).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})}},pzi=[T3r];p();var x3r=class extends qv{constructor(){super(...arguments);this.name=Yjt.method;this.params=Sbn}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(Tu).get(n);s&&Sni(this.ctx,s)}},w3r=class extends qv{constructor(){super(...arguments);this.name=Jjt.method;this.params=Rbn}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(Uv).handleShown(n)}},R3r=class extends qv{constructor(){super(...arguments);this.name=Kjt.method;this.params=Tbn}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(Tu),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),vme(this.ctx,c)):zdt(this.ctx,c,o,void 0,void 0,"cumulative"))}},hzi=[x3r,w3r,R3r];p();var wTt=class extends qv{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(vN).cancel(r.token)}};var p3c=[...dzi,...fzi,...pzi,...hzi,wTt];function mzi(t,e){for(let r of p3c){let n=new r(t),o=Fu.Compile(n.params);e.onNotification(n.type,U0(t,async s=>{n9(s),o.Check(s)?await n.handle(s):qo.error(t,`Notification ${n.name}:`,new NA(o.Errors(s)))},`Notification ${n.name}`))}}a(mzi,"registerNotifications");p();var gzi=de(Kc());p();var R_e=de(Kc());var h3c=new R_e.ProtocolNotificationType("copilot/customAgent/didChange"),m3c=new R_e.ProtocolNotificationType("copilot/customSkill/didChange"),g3c=new R_e.ProtocolNotificationType("copilot/customPrompt/didChange"),A3c=new R_e.ProtocolNotificationType("copilot/customInstruction/didChange"),P3r=new R_e.ProtocolNotificationType("copilot/hook/didChange");function y3c(t){switch(t){case"agent":return h3c;case"skill":return m3c;case"prompt":return g3c;case"instructions":return A3c;case"hook":return P3r;default:return}}a(y3c,"notificationTypeFor");var RTt=class extends CA{constructor(r){super();this.ctx=r;this.logger=new pe("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=y3c(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 E3c=new gzi.ProtocolNotificationType("copilot/plugins/didChange"),vie=class{constructor(e,r){this.ctx=e;this.logger=new pe("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(E3c,{}),e.sendNotification(P3r,{})]);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 Azi=de(require("crypto")),yzi=require("os");jo();var _3c=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function v3c(t){let e=t.replace(/-/g,":").toLowerCase();return!_3c.has(e)}a(v3c,"validateMacAddress");function C3c(){let t=(0,yzi.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(v3c(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a(C3c,"getMac");var k3r;function b3c(){try{let t=C3c();return Azi.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(b3c,"getMacMachineId");function D3r(){return k3r||(k3r=b3c()||Gt()),k3r}a(D3r,"getMachineId");jo();function N3r(t){let e=t??Gt()+Date.now();return new La(e,D3r(),D3r())}a(N3r,"createEditorSession");var Ezi=N3r();p();p();var _zi=require("os");var S3c=(0,_zi.platform)()==="win32",S9=class{constructor(){this.trustByUri=new Map;this.emitter=new Hi;this.onDidChangeTrust=this.emitter.event}static{a(this,"WorkspaceTrustService")}setTrust(e,r){let n=this.normalizeKey(e),o=this.trustByUri.get(n);this.trustByUri.set(n,r),o!==r&&this.emitter.fire({folderUri:n,trusted:r})}forget(e){let r=this.normalizeKey(e);this.trustByUri.delete(r)&&this.emitter.fire({folderUri:r,trusted:this.isTrustedInternal(r)})}isTrusted(e){return this.isTrustedInternal(this.normalizeKey(e))}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(c{let s=o.textDocument,c=this._textDocumentConfiguration.create(s.uri,s.languageId,s.version,s.text);this._documents.set(Os(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=Os(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=Os(o.textDocument.uri);this._documents.delete(s),this.#t.fire({document:{uri:s}})}),this.connection.onNotification(Vjt.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(S9);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(S9).forget(r.uri)}registerWorkspaceFolder(r){let n=r.trusted;typeof n=="boolean"&&this.ctx.get(S9).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(Os(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 vzi=Fu.Compile(vbn);function n9(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(Czi.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of $3e)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(bO).handleConfigurationChange(e.settings)}catch(n){qo.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return jSt(this.ctx,n9(e))}catch(r){qo.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(Ff)}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)),mzi(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(as).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(BV).didChangeWorkspaceFolders(c)}catch(l){qo.exception(e,l,"didChangeWorkspaceFolders")}}a(o,"didChangeWorkspaceFolders"),this.connection.onNotification("vs/didAddWorkspaceFolder",({name:c,uri:l})=>o({added:[{uri:l,name:c??l}],removed:[]})),this.connection.onNotification("vs/didRemoveWorkspaceFolder",({name:c,uri:l})=>o({added:[],removed:[{uri:l,name:c??l}]})),r.onInitialize(c=>{if(this.initialized)throw new Error("initialize request sent after initialized notification");this.#r=c.capabilities;let l=c.capabilities.copilot,u=n9(c.initializationOptions);if(u){if(!vzi.Check(u))throw new NA(vzi.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??[]):qo.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(Hp).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(La,N3r(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(BV).init(c.workspaceFolders??[]),LXn(this.ctx),l&&(e.get(Pn).setCapabilities(l),l.contentProvider&&sa.registerSchemes(l.contentProvider),"openURL"in l&&Ydt(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,qo.info(e,`${n.name} ${n.version} initialized`),e.get(Ut).primeToken().catch(m=>{e.get(cs).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(_I.DidChangeConfigurationNotification.type,{section:Czi}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(KC).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||qSt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(cs).sendInitNonAuthStatus(),new eEe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(U0(e,h,"onInitialized")),e.get(AN).init(),l?.token&&e.get(Ur).setTransientSession({}),l?.redirectedTelemetry&&V7i(e),bzi.lt(process.versions.node,"22.0.0")&&qo.warn(e,`Node.js ${process.versions.node} support is deprecated. Please upgrade to Node.js 22 or newer.`),{capabilities:{textDocumentSync:{openClose:!0,change:_I.TextDocumentSyncKind.Incremental},notebookDocumentSync:{notebookSelector:[{notebook:"*"}]},workspace:{workspaceFolders:{supported:d,changeNotifications:d}},executeCommandProvider:{commands:j7i(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 Hbt;this.ctx.forceSet(Ff,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");Zn(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(_ie).handlers.get(e);if(!o)return new _I.ResponseError(Ze.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new _I.ResponseError(Ze.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new _I.ResponseError(Ze.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!this.ctx.get(Ir).isEditorPluginInfoKnown())throw new _I.ResponseError(Ze.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),n9(r);try{let[s,c]=await o(this.ctx,n,r);return c?new _I.ResponseError(c.code,c.message,c.data):s}catch(s){if(n.isCancellationRequested)return new _I.ResponseError(Ze.RequestCancelled,"Request was canceled");if(s instanceof Ai)return this.telemetryMethodFailure(e,s),new _I.ResponseError(Ze.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof _I.ResponseError||qo.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get(XY).stop()}catch(e){qo.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(sF).dispose()}catch(e){qo.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(i8).dispose()}catch(e){qo.exception(this.ctx,e,"failed to dispose plugin contribution injector")}try{this.ctx.get(vie).dispose()}catch(e){qo.exception(this.ctx,e,"failed to dispose plugin change notifier")}try{this.ctx.get(Hne).dispose()}catch(e){qo.exception(this.ctx,e,"failed to dispose MCP project cleanup subscription")}try{this.ctx.get(WA).dispose().catch(e=>{qo.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){qo.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(vH).dispose()}catch(e){qo.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(Jk).dispose()}catch(e){qo.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(o8).dispose()}catch(e){qo.exception(this.ctx,e,"failed to dispose Claude Code agent service")}try{this.ctx.get(cc).dispose()}catch(e){qo.exception(this.ctx,e,"failed to dispose agent plugin service")}this.ctx.get(qs).shutdown().catch(e=>{qo.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(ig).dispose()}catch(e){qo.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(Ff,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(KC).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),Mhr(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(Td).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(G0).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},qo=new pe("lsp");var jv=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new Szi.ProtocolRequestType("conversation/context");this.typeCheck=Fu.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 Tzi.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 NA(this.typeCheck.Errors(o));return o}}};var B3r=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")}},b9=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new B3r(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},kTt=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(Sc)}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(Wo).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new jv(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 AC(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:Gt()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var CN=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(b9).get(r);if(o)return new kTt(e,o);let c=(await Zx(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 uZe(e.ctx):l=new vue(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new BRe(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new BRe(e,l):new Urt(e,l)}};p();var LV=class extends k_{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 Pr(r)],"success")}errorResult(r){return new Br([new Pr(r)],"error")}};p();function T3c(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(T3c,"mapToolNameToKind");function I3c(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(I3c,"extractLocationsFromInput");function x3c(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(x3c,"mapToolCallStatus");var DTt=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=x3c(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=I3c(c.name,c.input);await this.reportToolCallStart(c.id,c.name,T3c(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 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(` 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 NTt(t){try{if((await t.get(Ur).checkAndUpdateStatus()).status==="OK")return;let n=await GSt(t,(o,s)=>new TN(o,TN.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new po(Ze.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof SU?new po(Ze.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof Ai?new po(Ze.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(NTt,"performACPGitHubOAuth");function MTt(t){if(t!=="github_oauth")throw new po(Ze.InvalidParams,`Unknown authentication method: ${t}`)}a(MTt,"validateAuthMethodId");async function OTt(t){let r=await t.get(Ur).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw po.authRequired()}a(OTt,"requireACPAuthenticated");var Izi=[{id:El.Ask.id,name:El.Ask.name,description:El.Ask.description},{id:El.Agent.id,name:El.Agent.name,description:El.Agent.description}],BTt=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 ej&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}yt(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:Prt,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:U1(this.ctx)},authMethods:n})}async newSession(e){yt(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=Gt(),n=Gt(),s=this.ctx.get(Wo).create({source:"panel",conversationId:n}),c=e.cwd?{uri:Ta(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 yt(this.ctx,"acp.authenticate"),MTt(e.methodId),await NTt(this.ctx),{}}async requireAuthenticated(){await OTt(this.ctx)}async prompt(e){yt(this.ctx,"acp.prompt"),await this.requireAuthenticated();let r=this.sessions.get(e.sessionId);if(!r)throw new Error(`Session ${e.sessionId} not found`);let n=process.env.GITHUB_COPILOT_ACP_MODEL_ID??r.currentModelId;r.pendingPrompt?.abort(),r.cancellationTokenSource?.cancel(),r.pendingPrompt=new AbortController,r.cancellationTokenSource=new jn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=Gt(),l=new Zf(s,c),u=r.currentModeId===El.Ask.id?El.Ask:El.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(Wo),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 DTt(this.connection,e.sessionId),g=new fw(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(k_);A instanceof LV&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let E=await this.ctx.get(CN).createProcessor(g,e.sessionId);try{await E.process(m,r.cancellationTokenSource.token,void 0,void 0,{id:n})}finally{A instanceof LV&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(k_);if(s instanceof LV&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){yt(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){yt(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new po(Ze.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new po(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){yt(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new po(Ze.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new po(Ze.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return JI(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?Izi:Izi.filter(e=>e.id===El.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?El.Agent.id:El.Ask.id}async getAvailableModels(){let e=await this.ctx.get(Ss).getMetadata(),r=[],n=Q_;r.push({modelId:Q_,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!(Hce.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 xzi=require("node:child_process"),FTt=require("node:stream");var LTt=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,xzi.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:LQt}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{Zn(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||yt(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=FTt.Writable.toWeb(this.cliProcess.stdin),c=FTt.Readable.toWeb(this.cliProcess.stdout),l=NRe(s,c);return this._cliConnection=new Brt(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 UTt=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 ej&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return yt(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:Prt,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:U1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return yt(this.ctx,"acp.cli.authenticate"),MTt(e.methodId),await NTt(this.ctx),{}}async newSession(e){return yt(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return yt(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return yt(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return yt(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return yt(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return yt(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return yt(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return yt(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 po(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(Ut).getGitHubSession())?.accessToken;this.cliConnection=this.cliProcessManager.start(u=>this.createCLIClientHandler(),r);let n=this.initParams.clientInfo,o={name:"GitHub Copilot Language Server",version:U1(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]),yt(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw Zn(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 po(Ze.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await OTt(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 Ewt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(gio(),mio)),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 Aio(t){let e=new uue;e.set(Mo,t),e.set(Ax,new Ax),e.set(as,new as),e.set(B2,new B2);let r=new Ut(e);return e.set(Ut,r),e.set(Zt,new Zt(e)),e.set(YM,new YM(e,r)),e.set(VN,new VN),e.set(Pp,new Pp(e)),e.set(G0,new G0),e.set(gC,new gC),e.set(_O,new Txe),e.set(vk,new Yce),e.set(sk,new H1e),e.set(Td,new Td),e.set(W5,new W5(e)),e.set(ii,new ii(e)),e.set(H2,new H2(e)),e.set(f8,Fdt(e)),e.set(ZA,new ZA),e.set(Ib,new Ib),e.set(p8,p8.default),e.set(r0,new r0(e)),e.set(Px,new Px(e)),e.set(Hp,new Hp),e.set(Tb,new Tb(e)),e.set(Pn,new Pn),e.set(pu,new pu(e)),e.set(EO,new EO(e)),e.set(V2,new V2),e.set(OK,new OK(e)),e}a(Aio,"createCommonContext");p();var _wt=class extends Ff{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||jbt(r))&&this.console.warn(`[${o}]`,...s)}};p();var vio=require("node:os");var ael=new pe("repository"),Vie="\\\\",Cio="(?:[#;].*)",kve=`(?:[^"${Vie}]|${Vie}.)`,cel="[0-9A-Za-z-]",yio=`[A-Za-z]${cel}*`,bio=`\\s*${Cio}?$`,Sio=`(?:[^"${Vie};#]|${Vie}.)`,lel=`(?:"${kve}*"|"${kve}*(?${Vie})$)`,uel=`(?:${Sio}|${lel})+`,del=`(?:(?${Vie})$)`,Tio=`(?${uel})${del}?${bio}`,Eio=new RegExp(`^${Tio}`),fel=new RegExp(`^(?${kve}*(?:(?${Vie})$|(?")))`),pel=new RegExp(`^\\s*(?:(?${yio})\\s*=\\s*${Tio}|(?${yio})${bio})`),hel=new RegExp(`(?${Sio}+)|"(?${kve}*)"`,"g"),_io="[-.0-9A-Za-z]+",mel=`\\s+"(?${kve}*)"`,gel=`\\s+"(?${kve}*)"`,Ael=new RegExp(`^\\s*\\[(?:(?${_io})${mel}|${gel}|(?${_io}))\\]`),yel=new RegExp(`^\\s*${Cio}$`),SUr=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(Ael);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(pel);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(fel),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(Eio),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(Eio),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(hel)].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(){yel.test(this.line)&&(this.line="")}},vwt=class extends Fk{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await r0.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 CK)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new SUr(o),c=new CK;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get($o).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&ael.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=Ia(this.xdgConfigUri(),"git","config"),s=Ia(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=sf(r),o=Ia(n,"commondir");try{let s=(await e.get($o).readFileString(o)).trimEnd();return Ia(MW(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?Ta(process.env.XDG_CONFIG_HOME):Ia(this.homeUri(),".config")}homeUri(){return Ta((0,vio.homedir)())}};p();var Iio=require("child_process");var Cwt=class extends Fk{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,Iio.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){HQt.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=Zo(r);if(n===void 0)return;let o;try{o=(await pO()).path}catch(c){HQt.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 CK;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 xio(t){let e=Aio(t);return Eel(e),e.set(lp,Eot(e)),e.set(oP,yTt(e)),e.set(Fk,new VYe([new Cwt,new vwt])),e}a(xio,"createProductionContext");function Eel(t){t.set(OI,OI.fromEnvironment(!1)),t.set(QB,new T_e),t.set(Ff,new _wt(console))}a(Eel,"setupRudimentaryLogging");var DYh=new pe("context");p();var roo=require("fs");p();p();var Jio=require("node:url");p();p();var Dve=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Rio=new Set,TUr=typeof process=="object"&&process?process:{},Pio=a((t,e,r,n)=>{typeof TUr.emitWarning=="function"?TUr.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),bwt=globalThis.AbortController,wio=globalThis.AbortSignal;if(typeof bwt>"u"){wio=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},bwt=class{static{a(this,"AbortController")}constructor(){e()}signal=new wio;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=TUr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,Pio("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 _el=a(t=>!Rio.has(t),"shouldWarn");var oW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),kio=a(t=>oW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Nve:null:null,"getUintArray"),Nve=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},IUr=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=kio(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]}},M8e=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&&!oW(r))throw new TypeError("max option must be a nonnegative integer");let x=r?kio(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=IUr.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&&!oW(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!oW(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=oW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!oW(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let P="LRU_CACHE_UNBOUNDED";_el(P)&&(Rio.add(P),Pio("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,t))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#P(){let e=new Nve(this.#e),r=new Nve(this.#e);this.#E=e,this.#T=r,this.#B=(s,c,l=Dve.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?Dve.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=Dve.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"getNow");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#updateItemAge");#d=a(()=>{},"#statusTTL");#B=a(()=>{},"#setItemTTL");#_=a(()=>!1,"#isStale");#D(){let e=new Nve(this.#e);this.#a=0,this.#b=e,this.#k=r=>{this.#a-=e[r],e[r]=0},this.#L=(r,n,o,s)=>{if(this.#f(n))return 0;if(!oW(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!oW(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#k=a(e=>{},"#removeItemSize");#N=a((e,r,n)=>{},"#addItemSize");#L=a((e,r,n,o)=>{if(n||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#_(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(Dve.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=Dve.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=Dve.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#L(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#v.length!==0?this.#v.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#C&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#C&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#k(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#E&&this.#P(),this.#E&&(d||this.#B(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(new Error("evicted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#k(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#v.push(r)),this.#s===1?(this.#A=this.#h=0,this.#v.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#_(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#_(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new bwt,{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 bwt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let N=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",N&&(_.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),D=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",D&&R&&(_.returnedStale=!0)),D?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#_(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#k(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(new Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#v.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(new Error("deleted"));else{let o=this.#u[r];this.#C&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#E&&this.#T&&(this.#E.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#v.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};var Bve=require("node:path"),qio=require("node:url"),FB=require("fs"),Pel=de(require("node:fs"),1),cW=require("node:fs/promises");p();var Pwt=require("node:events"),NUr=de(require("node:stream"),1),Bio=require("node:string_decoder");var Dio=typeof process=="object"&&process?process:{stdout:null,stderr:null},vel=a(t=>!!t&&typeof t=="object"&&(t instanceof aW||t instanceof NUr.default||Cel(t)||bel(t)),"isStream"),Cel=a(t=>!!t&&typeof t=="object"&&t instanceof Pwt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==NUr.default.Writable.prototype.pipe,"isReadable"),bel=a(t=>!!t&&typeof t=="object"&&t instanceof Pwt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),L9=Symbol("EOF"),F9=Symbol("maybeEmitEnd"),sW=Symbol("emittedEnd"),Swt=Symbol("emittingEnd"),O8e=Symbol("emittedError"),Twt=Symbol("closed"),Nio=Symbol("read"),Iwt=Symbol("flush"),Mio=Symbol("flushChunk"),UN=Symbol("encoding"),Mve=Symbol("decoder"),Jg=Symbol("flowing"),B8e=Symbol("paused"),Ove=Symbol("resume"),Zg=Symbol("buffer"),zv=Symbol("pipes"),Xg=Symbol("bufferLength"),xUr=Symbol("bufferPush"),xwt=Symbol("bufferShift"),e_=Symbol("objectMode"),_h=Symbol("destroyed"),wUr=Symbol("error"),RUr=Symbol("emitData"),Oio=Symbol("emitEnd"),PUr=Symbol("emitEnd2"),BB=Symbol("async"),kUr=Symbol("abort"),wwt=Symbol("aborted"),L8e=Symbol("signal"),Wie=Symbol("dataListeners"),PI=Symbol("discarded"),F8e=a(t=>Promise.resolve().then(t),"defer"),Sel=a(t=>t(),"nodefer"),Tel=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),Iel=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),xel=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),Rwt=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[Ove](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},DUr=class extends Rwt{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)}},wel=a(t=>!!t.objectMode,"isObjectModeOptions"),Rel=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),aW=class extends Pwt.EventEmitter{static{a(this,"Minipass")}[Jg]=!1;[B8e]=!1;[zv]=[];[Zg]=[];[e_];[UN];[BB];[Mve];[L9]=!1;[sW]=!1;[Swt]=!1;[Twt]=!1;[O8e]=null;[Xg]=0;[_h]=!1;[L8e];[wwt]=!1;[Wie]=0;[PI]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");wel(r)?(this[e_]=!0,this[UN]=null):Rel(r)?(this[UN]=r.encoding,this[e_]=!1):(this[e_]=!1,this[UN]=null),this[BB]=!!r.async,this[Mve]=this[UN]?new Bio.StringDecoder(this[UN]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[Zg],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[zv],"get")});let{signal:n}=r;n&&(this[L8e]=n,n.aborted?this[kUr]():n.addEventListener("abort",()=>this[kUr]()))}get bufferLength(){return this[Xg]}get encoding(){return this[UN]}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[e_]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[BB]}set async(e){this[BB]=this[BB]||!!e}[kUr](){this[wwt]=!0,this.emit("abort",this[L8e]?.reason),this.destroy(this[L8e]?.reason)}get aborted(){return this[wwt]}set aborted(e){}write(e,r,n){if(this[wwt])return!1;if(this[L9])throw new Error("write after end");if(this[_h])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[BB]?F8e:Sel;if(!this[e_]&&!Buffer.isBuffer(e)){if(xel(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Iel(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[e_]?(this[Jg]&&this[Xg]!==0&&this[Iwt](!0),this[Jg]?this.emit("data",e):this[xUr](e),this[Xg]!==0&&this.emit("readable"),n&&o(n),this[Jg]):e.length?(typeof e=="string"&&!(r===this[UN]&&!this[Mve]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[UN]&&(e=this[Mve].write(e)),this[Jg]&&this[Xg]!==0&&this[Iwt](!0),this[Jg]?this.emit("data",e):this[xUr](e),this[Xg]!==0&&this.emit("readable"),n&&o(n),this[Jg]):(this[Xg]!==0&&this.emit("readable"),n&&o(n),this[Jg])}read(e){if(this[_h])return null;if(this[PI]=!1,this[Xg]===0||e===0||e&&e>this[Xg])return this[F9](),null;this[e_]&&(e=null),this[Zg].length>1&&!this[e_]&&(this[Zg]=[this[UN]?this[Zg].join(""):Buffer.concat(this[Zg],this[Xg])]);let r=this[Nio](e||null,this[Zg][0]);return this[F9](),r}[Nio](e,r){if(this[e_])this[xwt]();else{let n=r;e===n.length||e===null?this[xwt]():typeof n=="string"?(this[Zg][0]=n.slice(e),r=n.slice(0,e),this[Xg]-=e):(this[Zg][0]=n.subarray(e),r=n.subarray(0,e),this[Xg]-=e)}return this.emit("data",r),!this[Zg].length&&!this[L9]&&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[L9]=!0,this.writable=!1,(this[Jg]||!this[B8e])&&this[F9](),this}[Ove](){this[_h]||(!this[Wie]&&!this[zv].length&&(this[PI]=!0),this[B8e]=!1,this[Jg]=!0,this.emit("resume"),this[Zg].length?this[Iwt]():this[L9]?this[F9]():this.emit("drain"))}resume(){return this[Ove]()}pause(){this[Jg]=!1,this[B8e]=!0,this[PI]=!1}get destroyed(){return this[_h]}get flowing(){return this[Jg]}get paused(){return this[B8e]}[xUr](e){this[e_]?this[Xg]+=1:this[Xg]+=e.length,this[Zg].push(e)}[xwt](){return this[e_]?this[Xg]-=1:this[Xg]-=this[Zg][0].length,this[Zg].shift()}[Iwt](e=!1){do;while(this[Mio](this[xwt]())&&this[Zg].length);!e&&!this[Zg].length&&!this[L9]&&this.emit("drain")}[Mio](e){return this.emit("data",e),this[Jg]}pipe(e,r){if(this[_h])return e;this[PI]=!1;let n=this[sW];return r=r||{},e===Dio.stdout||e===Dio.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[zv].push(r.proxyErrors?new DUr(this,e,r):new Rwt(this,e,r)),this[BB]?F8e(()=>this[Ove]()):this[Ove]()),e}unpipe(e){let r=this[zv].find(n=>n.dest===e);r&&(this[zv].length===1?(this[Jg]&&this[Wie]===0&&(this[Jg]=!1),this[zv]=[]):this[zv].splice(this[zv].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[PI]=!1,this[Wie]++,!this[zv].length&&!this[Jg]&&this[Ove]();else if(e==="readable"&&this[Xg]!==0)super.emit("readable");else if(Tel(e)&&this[sW])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[O8e]){let o=r;this[BB]?F8e(()=>o.call(this,this[O8e])):o.call(this,this[O8e])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[Wie]=this.listeners("data").length,this[Wie]===0&&!this[PI]&&!this[zv].length&&(this[Jg]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Wie]=0,!this[PI]&&!this[zv].length&&(this[Jg]=!1)),r}get emittedEnd(){return this[sW]}[F9](){!this[Swt]&&!this[sW]&&!this[_h]&&this[Zg].length===0&&this[L9]&&(this[Swt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Twt]&&this.emit("close"),this[Swt]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==_h&&this[_h])return!1;if(e==="data")return!this[e_]&&!n?!1:this[BB]?(F8e(()=>this[RUr](n)),!0):this[RUr](n);if(e==="end")return this[Oio]();if(e==="close"){if(this[Twt]=!0,!this[sW]&&!this[_h])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[O8e]=n,super.emit(wUr,n);let s=!this[L8e]||this.listeners("error").length?super.emit("error",n):!1;return this[F9](),s}else if(e==="resume"){let s=super.emit("resume");return this[F9](),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[F9](),o}[RUr](e){for(let n of this[zv])n.dest.write(e)===!1&&this.pause();let r=this[PI]?!1:super.emit("data",e);return this[F9](),r}[Oio](){return this[sW]?!1:(this[sW]=!0,this.readable=!1,this[BB]?(F8e(()=>this[PUr]()),!0):this[PUr]())}[PUr](){if(this[Mve]){let r=this[Mve].end();if(r){for(let n of this[zv])n.dest.write(r);this[PI]||super.emit("data",r)}}for(let r of this[zv])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[e_]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[e_]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[e_])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[UN]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(_h,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[PI]=!1;let e=!1,r=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return r();let o=this.read();if(o!==null)return Promise.resolve({done:!1,value:o});if(this[L9])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(_h,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(_h,f),this.pause(),s({value:h,done:!!this[L9]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(_h,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(_h,f),this.once("error",l),this.once("end",d),this.once("data",u)})},"next"),throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[PI]=!1;let e=!1,r=a(()=>(this.pause(),this.off(wUr,r),this.off(_h,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(wUr,r),this.once(_h,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[_h])return e?this.emit("error",e):this.emit(_h),this;this[_h]=!0,this[PI]=!0,this[Zg].length=0,this[Xg]=0;let r=this;return typeof r.close=="function"&&!this[Twt]&&r.close(),e?this.emit("error",e):this.emit(_h),this}static get isStream(){return vel}};var kel=FB.realpathSync.native,Q8e={lstatSync:FB.lstatSync,readdir:FB.readdir,readdirSync:FB.readdirSync,readlinkSync:FB.readlinkSync,realpathSync:kel,promises:{lstat:cW.lstat,readdir:cW.readdir,readlink:cW.readlink,realpath:cW.realpath}},jio=a(t=>!t||t===Q8e||t===Pel?Q8e:{...Q8e,...t,promises:{...Q8e.promises,...t.promises||{}}},"fsFromOption"),Hio=/^\\\\\?\\([a-z]:)\\?$/i,Del=a(t=>t.replace(/\//g,"\\").replace(Hio,"$1\\"),"uncToDrive"),Nel=/[\\\/]/,_P=0,Gio=1,$io=2,LB=4,Vio=6,Wio=8,zie=10,zio=12,EP=15,U8e=~EP,MUr=16,Lio=32,q8e=64,QN=128,kwt=256,Nwt=512,Fio=q8e|QN|Nwt,Mel=1023,OUr=a(t=>t.isFile()?Wio:t.isDirectory()?LB:t.isSymbolicLink()?zie:t.isCharacterDevice()?$io:t.isBlockDevice()?Vio:t.isSocket()?zio:t.isFIFO()?Gio:_P,"entToType"),Uio=new Map,j8e=a(t=>{let e=Uio.get(t);if(e)return e;let r=t.normalize("NFKD");return Uio.set(t,r),r},"normalize"),Qio=new Map,Dwt=a(t=>{let e=Qio.get(t);if(e)return e;let r=j8e(t.toLowerCase());return Qio.set(t,r),r},"normalizeNocase"),Mwt=class extends M8e{static{a(this,"ResolveCache")}constructor(){super({max:256})}},BUr=class extends M8e{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},Yio=Symbol("PathScurry setAsCwd"),t_=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#n;get nlink(){return this.#n}#i;get uid(){return this.#i}#o;get gid(){return this.#o}#s;get rdev(){return this.#s}#a;get blksize(){return this.#a}#c;get ino(){return this.#c}#u;get size(){return this.#u}#l;get blocks(){return this.#l}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#A;get ctimeMs(){return this.#A}#h;get birthtimeMs(){return this.#h}#v;get atime(){return this.#v}#m;get mtime(){return this.#m}#b;get ctime(){return this.#b}#T;get birthtime(){return this.#T}#E;#C;#S;#y;#P;#R;#d;#B;#_;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=_P,n,o,s,c,l){this.name=e,this.#E=s?Dwt(e):j8e(e),this.#d=r&Mel,this.nocase=s,this.roots=o,this.root=n||this,this.#B=c,this.#S=l.fullpath,this.#P=l.relative,this.#R=l.relativePosix,this.parent=l.parent,this.parent?this.#e=this.parent.#e:this.#e=jio(l.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#B}resolve(e){if(!e)return this;let r=this.getRootString(e),o=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#k(o):this.#k(o)}#k(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#B.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#B.set(this,r),this.#d&=~MUr,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?Dwt(e):j8e(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,_P,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=QN),n.push(l),l}relative(){if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let e=this.name,r=this.parent;if(!r)return this.#P=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,r=this.parent;if(!r)return this.#R=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let o=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=o}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let o=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(o)?this.#y=`//?/${o}`:this.#y=o}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#y=n}isUnknown(){return(this.#d&EP)===_P}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&EP)===Wio}isDirectory(){return(this.#d&EP)===LB}isCharacterDevice(){return(this.#d&EP)===$io}isBlockDevice(){return(this.#d&EP)===Vio}isFIFO(){return(this.#d&EP)===Gio}isSocket(){return(this.#d&EP)===zio}isSymbolicLink(){return(this.#d&zie)===zie}lstatCached(){return this.#d&Lio?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&EP;return!(e!==_P&&e!==zie||this.#d&kwt||this.#d&QN)}calledReaddir(){return!!(this.#d&MUr)}isENOENT(){return!!(this.#d&QN)}isNamed(e){return this.nocase?this.#E===Dwt(e):this.#E===j8e(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|=MUr;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&Fio)return!1;let e=EP&this.#d;return e===_P||e===LB||e===zie}shouldWalk(e,r){return(this.#d&LB)===LB&&!(this.#d&Fio)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((Nwt|kwt|QN)&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(!((Nwt|kwt|QN)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[Yio](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],o=this;for(;o&&o.parent;)r.add(o),o.#P=n.join(this.sep),o.#R=n.join("/"),o=o.parent,n.push("..");for(o=e;o&&o.parent&&!r.has(o);)o.#P=void 0,o.#R=void 0,o=o.parent}},Owt=class t extends t_{static{a(this,"PathWin32")}sep="\\";splitSep=Nel;constructor(e,r=_P,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=_P,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Bve.win32.parse(e).root}getRoot(e){if(e=Del(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 Lve(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Hio,"$1\\"),e===r}},Bwt=class t extends t_{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=_P,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=_P,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Lwt=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=Q8e}={}){this.#n=jio(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,qio.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new Mwt,this.#t=new Mwt,this.#r=new BUr(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 t_||(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 t_||(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 t_||(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 t_||(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 t_||(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 t_||(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 t_||(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 t_||(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 t_||(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 t_||(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 t_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new aW({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 t_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new aW({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[Yio](r)}},Lve=class extends Lwt{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,Bve.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return Bve.win32.parse(e).root.toUpperCase()}newRoot(e){return new Owt(this.rootPath,LB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Fve=class extends Lwt{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,Bve.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Bwt(this.rootPath,LB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},H8e=class extends Fve{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},VYh=process.platform==="win32"?Owt:Bwt,Kio=process.platform==="win32"?Lve:process.platform==="darwin"?H8e:Fve;p();var Oel=a(t=>t.length>=1,"isPatternList"),Bel=a(t=>t.length>=1,"isGlobList"),Uve=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!Oel(e))throw new TypeError("empty pattern list");if(!Bel(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]===Vp}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 Lel=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Qve=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=Lel}){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 N_(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},UUr=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())}},G8e=class t{static{a(this,"Processor")}hasWalkedCache;matches=new FUr;subwalks=new UUr;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new LUr}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===Vp){(!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===Vp?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 Fel=a((t,e)=>typeof t=="string"?new Qve([t],e):Array.isArray(t)?new Qve(t,e):t,"makeIgnore"),Fwt=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=Fel(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 G8e(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 G8e(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()}},$8e=class extends Fwt{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}},V8e=class extends Fwt{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new aW({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 Uel=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",qN=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,Jio.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||Uel,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"?Lve:r.platform==="darwin"?H8e:r.platform?Fve:Kio;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 N_(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 Uve(u,f,0,this.platform)})}async walk(){return[...await new $8e(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 $8e(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 V8e(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 V8e(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 QUr=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new N_(r,e).hasMagic())return!0;return!1},"hasMagic");function Qwt(t,e={}){return new qN(t,e).streamSync()}a(Qwt,"globStreamSync");function Xio(t,e={}){return new qN(t,e).stream()}a(Xio,"globStream");function eoo(t,e={}){return new qN(t,e).walkSync()}a(eoo,"globSync");async function Zio(t,e={}){return new qN(t,e).walk()}a(Zio,"glob_");function qwt(t,e={}){return new qN(t,e).iterateSync()}a(qwt,"globIterateSync");function too(t,e={}){return new qN(t,e).iterate()}a(too,"globIterate");var Qel=Qwt,qel=Object.assign(Xio,{sync:Qwt}),jel=qwt,Hel=Object.assign(too,{sync:qwt}),Gel=Object.assign(eoo,{stream:Qwt,iterate:qwt}),Uwt=Object.assign(Zio,{glob:Zio,globSync:eoo,sync:Gel,globStream:Xio,stream:qel,globStreamSync:Qwt,streamSync:Qel,globIterate:too,iterate:Hel,globIterateSync:qwt,iterateSync:jel,Glob:qN,hasMagic:QUr,escape:Gle,unescape:Uk});Uwt.glob=Uwt;var W8e=class t{constructor(){this.logger=new pe("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(bA),s=r.map(d=>gn(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(Ta(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 Uwt(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 roo.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=Ta(r);try{let o=await e.get($o).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 eJh=new pe("exp");function ioo(t){let e=t.get(Zt);e.registerStaticFilters(Wel(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>Ft(t,Ke.DebugOverrideEngine)||Ft(t,Ke.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>jUe()?"copilot-web":t.get(Ir).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>noo(t)),e.registerDynamicFilter(soe.CopilotRelatedPluginVersionGithubCopilot,()=>noo(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>$el(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Ir).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>jwt(t.get(Ir).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>Vel(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get(MI).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getRelatedPluginInfo()){let o=l_+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(soe).includes(o)){N6e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=jwt(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getEditorPluginSpecificFilters()){let o=n.isVersion?jwt(n.value):n.value;r[n.filter]=o}return r})}a(ioo,"setupExperimentationService");function noo(t){return jwt(!t.get(as).isProduction()&&t.get(Ir).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Ir).getEditorPluginInfo().version)}a(noo,"getEditorPluginVersion");function $el(t){let e=t.get(Ir).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a($el,"getPluginRelease");function Vel(t){let e=t.get(Ir).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(Vel,"getTargetPopulation");function Wel(t){return zel(t)}a(Wel,"createAllFilters");function zel(t){let e=t.get(La);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(as).isProduction()?U1(t):"1.999.0"}}a(zel,"createDefaultFilters");function jwt(t){return t.split("-")[0]}a(jwt,"trimVersionSuffix");p();var lW=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var qve=class{static{a(this,"AbstractCopilotMessageSender")}};p();var ooo=100,soo=1e3*60*5;function aoo(t){let e=new qUr(t);t.get(dm).registerContextProvider(e),t.get(z5).add(e.id)}a(aoo,"registerRelatedFilesShim");var qUr=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new IP(ooo,soo);this.relatedFilesCache=new IP(ooo,soo);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 Adt(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){TY(this.ctx,s,"relatedFilesShim")}}};var eso=de(ZX()),tso=de(require("path"));p();var z8e=de(ri());var Yel=new z8e.ProtocolRequestType("workspace/readFile"),Kel=new z8e.ProtocolRequestType("workspace/readDirectory"),Jel=new z8e.ProtocolRequestType("workspace/findFiles"),Zel=new z8e.ProtocolRequestType("workspace/findTextInFiles"),Hwt=class extends sa{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(Yel,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(Kel,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(Jel,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(Zel,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 yt(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw Zn(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var Gwt=class extends xO{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 Zn(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var $wt=class t extends ree{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),h0.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){h0.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(Pn).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return h0.debug(this.context,"`copilot/related` not supported"),Cri;try{let c=await this.service.connection.sendRequest(Zjt.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){h0.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){h0.exception(r,s,"copilotRelated")}}};p();p();var hoo=de(ri());p();p();function coo(t,e){return(e<<5)-e+t|0}a(coo,"numberHash");function loo(t,e){e=coo(149417,e);for(let r=0,n=t.length;rnew 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;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=Zwn(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(Pn).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,jve.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){jve.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,poo.setTimeout)(ttl).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 doo.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` - ${rtl}; - ${ntl}; - ${itl}; - ${otl}; - ${stl}; - `);let n=this.all(r,ctl,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):jve.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){jve.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(zn).directory;await uoo.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return foo.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Ir).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||etl}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=Xel;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=>{jve.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){jve.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,atl,[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 Yv=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},Vwt=class extends Yv{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"&&Wct(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(eA).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get(eA).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get(eA).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get(eA).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get(eA).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get(eA).delete(n)}};var r_=new pe("DynamicAuthenticationProvider"),Wwt=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 jUr(e,l,{set:a(u=>{this.ctx.get(Yv).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(r_.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=>Twe([...c.scopes].sort(),n));if(r_.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(r_.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){r_.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&&(r_.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),r_.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){r_.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=>Twe([...d.scopes].sort(),n))),r_.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new f_e(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(r_.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 r_.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){r_.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return r_.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]}),r_.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(r_.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(Wct(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},jUr=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}){r_.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)),r_.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=Cdr(e.id_token)}catch{}if(!r)try{r=Cdr(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:loo(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 kI=new pe("DynamicAuthProviderService"),jN=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new hoo.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 Wwt(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){kI.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:${d_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)? +`,Anl="SELECT key, value FROM state",oCe=new fe("state-database"),uA=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=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)? 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){kI.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,kI.info(this.ctx,`User provided client registration for ${e.toString()}`),s?kI.info(this.ctx,`User provided client secret for ${e.toString()}`):kI.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=>RLr.includes(s)):RLr,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${d_e}/callback`,`http://127.0.0.1:${d_e}/callback`],scope:r?.join(fKn),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(yKn(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(cm).registerAuthenticationProvider(e.id,e),this.ctx.get(Yv).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(cm);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);kI.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);kI.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw kI.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(cm);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});kI.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);kI.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw kI.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(cm),n=this.ctx.get(Yv);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),kI.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw kI.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var zwt=class extends cm{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===TN.providerId){let s=new TN(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(Yv).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(Yv).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(jN).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 goo=de(Kc());var moo=new pe("agentCopilotTokenManager"),ltl={type:new goo.ProtocolRequestType("copilot/token")},Ywt=class extends Sh{constructor(){super(...arguments);this.networkFetcher=new WUe}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(Pn).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(ar).connection;try{let c=await s.sendRequest(ltl.type,{force:!1,session:n});if(!c?.envelope)throw new Ai("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(moo.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(Pn),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(Pn),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 utl=new pe("Public Code References"),Kwt=class extends BT{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," ");utl.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(Pn).getCapabilities().ipCodeCitation===!0&&await e.get(ar).connection.sendNotification(Gjt.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var HUr=de(Kc());var dtl=new HUr.ProtocolNotificationType("$/copilot/compressionStarted"),ftl=new HUr.ProtocolNotificationType("$/copilot/compressionCompleted"),Jwt=class extends yI{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(ar).connection.sendNotification(dtl,r)}async notifyCompressionCompleted(r){await this.ctx.get(ar).connection.sendNotification(ftl,r)}};p();p();function Aoo(t){ptl(t)}a(Aoo,"activateExtensibilityPlatformFeature");function ptl(t){t.set(zk,new vZe(t)),t.set(RO,new RO(t))}a(ptl,"registerContextDependencies");p();var yoo=S.String(),GUr=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(Xwt,"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){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: \`\`\` ${e} -\`\`\``}},Xwt="build-logs",Zwt=class extends cg{static{a(this,"BuildLogsSkill")}constructor(e){super(Xwt,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new GUr(r))}};p();var $Ur=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 GXe(this.turnContext.ctx,this.turnContext.cancelationToken,r);if(n.length>0){let o=[[new yr(["The user wants you to consider the following directory structures when computing your answer."]),1]];for(let s of n)o.push([new yr([s]),1]);return new yr(o)}}filterDirectoryReferences(e){return e.filter(r=>r.type==="directory")}},VUr=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},htl="directory-references",eRt=class{constructor(){this.id=htl;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new VUr}processor(e){return new $Ur(e)}};p();var mtl=S.Object({uri:S.String(),visibleRange:S.Optional(_f),openedAt:S.Optional(S.String()),activeAt:S.Optional(S.String())}),Eoo=S.Object({files:S.Array(mtl)}),gtl=3,WUr=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=bq(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=ed(c);if(await this.turnContext.collectFile(rRt,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===gtl))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 TO(n,void 0,o.visibleRange);return new yr([[`Code excerpt from file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),.9]])})}async preElideDocuments(e){let r=(await Ro.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new yr([n])}},rRt="recent-files",tRt=class extends cg{static{a(this,"RecentFilesSkill")}constructor(e){super(rRt,"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 WUr(r))}};p();var _oo=S.String(),zUr=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(iRt,"runtime logs"),`The contents of the application runtime logs: +\`\`\``}},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: \`\`\` ${e} -\`\`\``}},iRt="runtime-logs",nRt=class extends cg{static{a(this,"RuntimeLogsSkill")}constructor(e){super(iRt,"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 zUr(r))}};p();var oRt=de(Bk());var sRt=class extends Wh{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return b9e(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(ar).connection}async inspectPrompt(r){return this.connection?.sendNotification(new oRt.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new oRt.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new oRt.NotificationType("conversation/documentDiff"),r)}};p();var voo=de(Kc());var K8e=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(nP).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(ar).connection.sendNotification(new voo.NotificationType(this.notificationEndpoint),e)}};function Coo(t){Atl(t),ytl(t),Aoo(t)}a(Coo,"activateConversationFeature");function Atl(t){t.set(Wo,new Wo(t)),t.set(lg,new lg),t.set(SA,new SA(t)),t.set(Jc,new PKe(t)),t.set(b9,new b9),t.set(Sc,new Sc(t)),t.set(nP,new nP(t)),t.set(K8e,new K8e(t)),t.set(Ss,new l$e(t,new c$e(t))),t.set(CN,new CN),t.set(Wh,new sRt(t)),t.set(Jk,new Jk(t))}a(Atl,"registerContextDependencies");function ytl(t){let e=new zh;e.registerSkill(new EXe(new yXe)),e.registerSkill(new BJe(new jv(t,IO,Ubn))),e.registerSkill(new SJe(new jv(t,$k,Mbn))),e.registerSkill(new bJe(new jv(t,rE,Nbn))),e.registerSkill(new LJe),e.registerSkill(new eRt),e.registerSkill(new tRt(new jv(t,rRt,Eoo))),e.registerSkill(new fZe(new jv(t,PO,W1n))),e.registerSkill(new bXe(new jv(t,Bq,Zxn))),e.registerSkill(new nRt(new jv(t,iRt,_oo))),e.registerSkill(new Zwt(new jv(t,Xwt,yoo))),e.registerSkill(new TXe(new jv(t,Zk,Xxn))),e.registerSkill(new IXe(new jv(t,XK,ewn))),t.set(zh,e)}a(ytl,"registerSkills");p();var boo=de(Kc()),Soo=de(Bk());var aRt=class extends Ld{constructor(){super(...arguments);this.requestType=new boo.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=Fu.Compile(ovn)}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 Soo.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 NA(this.typeCheck.Errors(s));return s}};p();var Too=de(Kc()),Ioo=de(Bk());var cRt=class extends k_{constructor(){super(...arguments);this.requestType=new Too.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=Fu.Compile(ivn)}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 Ioo.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 NA(this.typeCheck.Errors(s));return this.transformToToolResult(s)}transformToToolResult(r){let n=r.content.map(o=>typeof o.value=="string"?new Pr(o.value):new wK(o.value));return new Br(n,r.status??"success")}};p();p();function xoo(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(xoo,"fillInJavaActiveExperiments");var YUr=de(Bk());var Etl={type:new YUr.NotificationType("featureFlagsNotification")},_tl={type:new YUr.NotificationType("copilot/didChangeFeatureFlags")},J8e=class{constructor(e){this.ctx=e;Es(e,r=>this.sendNotification(r))}static{a(this,"FeatureFlagsNotifier")}async sendNotification(e){let r=this.ctx,n=!1,o=!1,s=!1,c=!1,l=!1,u=r.get(Zt),d=await u.updateExPValuesAndAssignments(e);n=u.ideDataMigrationCompleted(d),o=u.appmodContextMenuEnabled(d),s=u.cliAsDefaultAgentProviderEnabled(d),c=$un(r,d),l=u.inlineChatUseCliEnabled(d);let f={};r.get(Zt).excludeRelatedFiles(d)&&(f.ExcludeRelatedFiles=!0);let h=zfr(r,d);h.length>0&&(f.ExpContextProviders=h);let m=new Map;WXn(r,h,m,d),zlt(r,m,d),xoo(r,m,d);for(let[y,E]of m.entries())f[y]=E;let g=r.get(Pn),A=r.get(ar).connection;if(g.getCapabilities().didChangeFeatureFlags)await A.sendNotification(_tl.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:f,byok:dq(e),data_migration_completed:n,appmod_context_menu_enabled:o,cli_as_default_agent_provider_enabled:s,ide_enable_copilot_nes_nonfree_enabled:c,inline_chat_use_cli_enabled:l,user_info__cli_enabled:e.userInfo.cliEnabled,copilot_plan:e.userInfo.copilotPlan});else{let y={rt:e.getTokenValue("rt")==="1",sn:e.getTokenValue("sn")==="1",chat:e.envelope.chat_enabled??!1,ic:e.envelope.chat_enabled??!1,pc:!0,ae:f,byok:dq(e),data_migration_completed:n,appmod_context_menu_enabled:o,cli_as_default_agent_provider_enabled:s,ide_enable_copilot_nes_nonfree_enabled:c,inline_chat_use_cli_enabled:l};e.getTokenValue("agent_mode")==="0"&&(y.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(y.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(y.mcp=!1),e.envelope.chat_enabled&&(y.xc=!0),e.userInfo.cliEnabled!==void 0&&(y.user_info__cli_enabled=e.userInfo.cliEnabled),await A.sendNotification(Etl.type,y)}}};p();var lRt=class extends cs{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(eHt.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(tHt.type,r)}};p();var woo=new pe("AgentEncodingConfigurationService"),uRt=class extends bO{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(ar)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){woo.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){woo.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var Roo=new OQ;p();var Doo=de(ri());var Noo={"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"}},vtl=new Doo.NotificationType("policy/didChange"),Ctl=Object.fromEntries(Object.entries(Noo).map(([t,e])=>[t,{type:e.type}])),Z8e=class extends Fl{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries(Noo).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(koo()));this.policyWatcher=r("IDEGitHubCopilot",Ctl,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(Pn).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(Pn).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(vtl,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 dRt=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(e){this.ctx.get(ar).connection.sendNotification(ZGi,{scope:e}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(ar).connection.sendNotification(XGi,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(jN).unregisterProvider(e)}};p();var fRt=class extends Cb{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get(eA).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get(eA).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get(eA).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var Moo=de(ri());var pRt="mcp.elicitation",hRt=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new Moo.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Fn(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 Fn(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 ac(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(xO).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,pRt,Wt.createAndMarkAsIssued()),yt(e.ctx,pRt),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 p0(e.ctx,{message:l,server:r}),Ua(e.ctx,c,pRt),Zn(e.ctx,pRt,c),new Fn(ei.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var vP=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var X8e=class extends vP{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),ac(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":sr.warn(this.ctx,`MCP server ${this.serverName} log:`,r),_X(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),p0(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),ac(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var e6e=class extends vP{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..."),ac(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(wSt)}};p();var t6e=class extends vP{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..."),ac(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(xSt)}};p();var r6e=class extends vP{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}`),ac(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(KHi)}};p();var mRt=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},n6e=class extends mRt{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)}),ac(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),p0(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 vP{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..."),ac(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(ISt)}};p();var Ooo="mcp.sampling",gRt=class{constructor(){this.defaultTemperature=.7;this.ongoingMcpSamplingCalls=!1}static{a(this,"McpSamplingService")}async handleSamplingRequest(e,r,n,o,s,c){try{if(this.ongoingMcpSamplingCalls)throw new Fn(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 ac(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(lW).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(Ld).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 Nc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await xxe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new jn.CancellationTokenSource().token,g=await r.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:e.toLlmInteraction(),temperature:n.params.temperature??this.defaultTemperature,stop:n.params.stopSequences,turnId:String(e.turn.id)},m,f),A=this.processFetchResult(g,u.uiName);return yt(e.ctx,Ooo,{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 p0(e.ctx,{message:u,server:o}),yt(e.ctx,Ooo,{success:"false",errorMessage:u}),new Fn(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?AO(e,u.provider,l):await e.get(Jc).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(Ss).getMetadata()).filter(n=>n.capabilities.type&&!Hce.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 ca(e.get(zn)).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 Hve=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function Boo(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=Vct(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(Boo,"parseScopeChallenge");p();var JUr=/[^a-z0-9_-]/gi;var btl=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function Loo(){let t={};for(let e of btl){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(Loo,"getDefaultEnvironment");async function Foo(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 _X(t,{message:n,server:r,tool:e.name}),e.description=""}if(JUr.lastIndex=0,JUr.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;sr.warn(t,n),await _X(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(JUr,"_")}else e._nameForModel=e.name;return e}a(Foo,"normalizeTool");var ARt=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*ZUr(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(ZUr,"paginateRequest");async function XUr(t){let e=[];for await(let r of t)e.push(...r);return e}a(XUr,"flattenAsyncIterable");var Uoo=de(require("events"));var e7r=6e4,uW=class{constructor(e,r,n){this.transport=null;this.emitter=new Uoo.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(Pn);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new gRt),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new hRt);let s=this.ctx.get(Ir).getEditorInfo(),c=this.ctx.get(Ir).getEditorPluginInfo();this.mcp=new gH({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 p0(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(xV)}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 Foo(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof Hve){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 p0(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 p0(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=ZUr(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 XUr(this.getResourcesIterable(e));return ac(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=ZUr(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 XUr(this.getResourceTemplatesIterable(e));return ac(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=_J();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 Pr(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}},sH,{onprogress:a(m=>{sr.info(this.ctx,`${e} calling progress`,m),ac(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 p0(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 p0(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.`),ac(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{sr.error(this.ctx,`MCP server ${this.name} error:`,e),p0(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(rX,e=>new X8e(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(YF,e=>new i6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(zF,e=>new e6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(WF,e=>new t6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(Ycr,e=>new r6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(alr,e=>(this.initRootsTracker(),new n6e(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(S2e,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw sr.error(this.ctx,o),new Fn(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 Fn(ei.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new nc(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler(T2e,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 Fn(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(ISt,()=>{this.refreshToolsCache()}),this.emitter.on(xSt,()=>{this.refreshResourcesCache()}),this.emitter.on(wSt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(e7r),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(xV)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout(e7r),[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(xV)}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(e7r),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(xV)},"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 Pr(n.text));else if(n.type==="image"||n.type==="audio")r.content.push(new cq({mimeType:n.mimeType,data:n.data}));else if(n.type==="resource"){let o=n.resource;if("text"in o)r.content.push(new Pr(o.text));else if("blob"in o){let s=o.mimeType||"application/octet-stream";r.content.push(new cq({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new Pr(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 Stl(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=Boo(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new Hve(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(Stl,"createFetchAdapter");function yRt(t,e){let r=t.get(tr),n=Stl(r);return{...e,fetch:n}}a(yRt,"createConfigWithFetch");var ERt=class extends uW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=yRt(this.ctx,r),{url:o,...s}=n;return new phe(new URL(o),s)}};p();var Qoo=require("child_process"),qoo=require("util");var _Rt=class extends uW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...Loo(),...r.env||{}},r.stderr="pipe",new Ehe(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{_X(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,qoo.promisify)(Qoo.exec);sr.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),ac(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),p0(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var o6e=class extends uW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=yRt(this.ctx,r),{url:o,...s}=n;return new hhe(new URL(o),s)}};p();var vRt=class extends aq{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 Nc;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(Ld).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var $oo=de(Kc());p();var joo="mcp-servers-cache",Hoo="mcp-first-boot-completed",CRt=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get(eA),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get(Hoo)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set(Hoo,"true")}parseCache(){let e=this.stateDb.get(joo);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(joo,e)}};p();function Goo(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(Goo,"isNightlyOrDevBuild");var bRt=class t extends YE{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new Gx;this.prefixGenerator=new ARt;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new CRt(r),this.registryService=r.get(SN),Es(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(Pn).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 $oo.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(Pn).getCapabilities().mcpAllowlist)return sr.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=Goo(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(Pn).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}Exe(r)&&(d._status=c),this.ctx.get(ds).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(ds).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()),yt(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 ac(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 ac(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners(xV),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await ac(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await ac(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 ac(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 ac(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(jN).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(Cb).removeAccountPreference(r,c);try{let u=this.ctx.get(cm).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(xV,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await ac(this.ctx,{message:"Connection state: Running",server:r})}catch(c){sr.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof Yw||c instanceof yDe,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof o6e&&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),ac(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 p0(this.ctx,{message:d,server:r}),this.ctx.get(_s).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 ERt(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new o6e(this.ctx,r.name,r.version||"1.0.0"):new _Rt(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(ds).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 vRt({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(ds).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(Cb).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new ghe(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(cm).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(cm).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(cm).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(cm).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(Cb).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(cm).getProvider(l),g=!!this.ctx.get(Yv).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(_s).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(Cb).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(_s).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(_s).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(Cb).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(_s).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 Voo=de(Kc());var SRt=class t extends N2{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new Voo.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 Woo=de(Kc());var Ttl=new Woo.ProtocolRequestType("copilot/readMcpSamplingConfig"),TRt=class extends lW{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(Ttl,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 xRt=de(Kc());var Itl=new xRt.ProtocolRequestType("copilot/showPanelMessageRequest"),xtl=new xRt.ProtocolNotificationType("copilot/showPanelMessage"),IRt=class extends qve{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(ar).connection.sendNotification(xtl,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(ar).connection,o;try{o=await n.sendRequest(Itl,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 Yoo=require("node:stream"),Yie=de(rcr());var U9=new pe("UndiciFetcher"),RRt=class extends tr{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(as).getVersion()}`,this.certificateConfigurator=new v_e(r),this.proxySocketFactory=r.get(oP),this.settings=r.get(Mo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),U9.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(Mo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),U9.info(this.ctx,"HTTP settings changed; resetting Undici dispatchers.",this.getSettingsLogProperties()),this.resetDispatchers()})}static{a(this,"UndiciFetcher")}async fetch(r,n){let o={...n.headers??{}};o["User-Agent"]=this.userAgent;let s=n.body;if(n.json!==void 0){if(n.body!==void 0)throw new Error("Illegal arguments! Cannot pass in both 'body' and 'json'!");o["Content-Type"]="application/json",s=JSON.stringify(n.json)}let c=n.method??"GET";if(c!=="GET"&&c!=="POST"&&c!=="DELETE")throw new Error("Illegal arguments! 'method' must be 'GET', 'POST', or 'DELETE'!");let l=!1,u,d=Ptl(n.signal),f=d.signal;if(n.timeout){let h=new AbortController;u=setTimeout(()=>{l=!0,h.abort()},n.timeout),f=f?AbortSignal.any([f,h.signal]):h.signal}try{let h={method:c,headers:o,body:s,signal:f};U9.debug(this.ctx,"Starting Undici fetch.",{target:wRt(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,Yie.fetch)(r,{...h,dispatcher:m});return U9.debug(this.ctx,"Undici fetch completed.",{target:wRt(r),status:A.status,isProxy:g}),new YI(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?Yoo.Readable.fromWeb(A.body):null)}catch(h){throw l?(U9.warn(this.ctx,"Undici fetch timed out.",{target:wRt(r),timeout:n.timeout}),new kW(`Request to <${r}> timed out after ${n.timeout}ms`,h)):ktl(h)}finally{u&&clearTimeout(u),d.cleanup()}}async disconnectAll(){await this.resetDispatchers()}async getDispatcher(r){let n=await this.certificateConfigurator.getCertificates(),o=n?n.join("\0"):"";this.dispatcherCertsKey!==o&&(U9.info(this.ctx,"Root certificate set changed; resetting Undici dispatchers.",{certificateCount:n?.length??0}),await this.resetDispatchers()),this.dispatcherCertsKey=o;let s={allowH2:!0,ca:n,rejectUnauthorized:this.settings.proxyStrictSSL??!0};return!this.settings.proxy||this.shouldBypassProxy(r)?(this.noProxyAgent||(U9.debug(this.ctx,"Creating direct Undici agent.",{target:wRt(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new Yie.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,Yie.buildConnector)(r);return U9.debug(this.ctx,"Creating proxied Undici agent.",{proxy:zoo(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new Yie.Agent({allowH2:!0,connect:a((c,l)=>{let u=c.port!==void 0&&c.port!==""?Number(c.port):c.protocol==="https:"?443:80,d={hostname:c.hostname,port:u,headers:{}};this.proxySocketFactory.createSocket(d,{hostname:o.hostname,port:o.port,authorization:this.settings.proxyAuthorization,kerberosServicePrincipal:this.settings.proxyKerberosServicePrincipal}).then(f=>{if(c.protocol!=="https:"){l(null,f);return}s({...c,httpSocket:f},l)}).catch(f=>{l(f instanceof Error?f:new Error(String(f)),null)})},"connect")})}async resetDispatchers(){let r=this.noProxyAgent,n=this.proxyAgent;this.noProxyAgent=void 0,this.proxyAgent=void 0,this.dispatcherCertsKey=void 0,(r||n)&&U9.debug(this.ctx,"Closing Undici dispatchers.",{hasDirectAgent:!!r,hasProxyAgent:!!n}),await Promise.all([r?.close().catch(()=>{}),n?.close().catch(()=>{})])}updateNoProxyFilters(r){let n=(r??[]).map(s=>s.trim()).filter(s=>s.length>0);if(this.noProxyFilters=void 0,n.length===0)return;if(n.includes("*")){this.noProxyFilters=[{regex:/.*/i}];return}let o=[];for(let s of n){let{host:c,port:l}=wtl(s),u=Rtl(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:zoo(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 wtl(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(wtl,"splitHostPort");function Rtl(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a(Rtl,"compileHostPattern");function wRt(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(wRt,"describeUrl");function zoo(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(zoo,"describeProxy");function Ptl(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(Ptl,"toNativeAbortSignal");function ktl(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(ktl,"withCauseNetworkProperties");p();var s6e=new pe("fetcher"),Dtl="https://default.exp-tas.com/",a6e=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(Lm(o)||`${r}/`.startsWith(Dtl))throw o;s6e.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),s6e.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()}},PRt=class extends tr{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new a6e(r,n,o,(s,c)=>{this.current!==o&&(s6e.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,Zn(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:Mtl(c),...Otl(s),...Btl(r)}),n.disconnectAll().catch(l=>{s6e.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(s6e.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()])}},Ntl=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function Mtl(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return Ntl.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(Mtl,"describeHost");function Otl(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(Otl,"buildErrorCauseProperties");function Btl(t){try{let e=t.get(Mo).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(Btl,"describeHttpContext");var Koo=new pe("fetcher");function Ltl(t){return Ft(t,Ke.UseHelixFetcher)==="true"}a(Ltl,"isHelixFetcherForced");function Ftl(t){if(Ltl(t))return new Eie(t);let e=new PRt(t,new RRt(t),new Eie(t));return t.get(Mo).onDidChangeHttpSettings(()=>e.reset()),e}a(Ftl,"createDefaultFetcher");var kRt=class extends tr{constructor(r,n=Ftl(r),o=new E_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,Ke.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&&(Koo.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new a6e(r,n,o,()=>{Koo.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(Pn).onDidSetCapabilities(this.updateFetcher),r.get(Mo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return Ft(this.ctx,Ke.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(Pn).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 NRt=de(ri());var DRt=class extends _s{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(NRt.ShowMessageRequest.type,{type:NRt.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 Joo=de(Kc());var MRt=class t extends kK{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new Joo.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(ar).connection.sendNotification(t.notificationType,r)}};p();var Zoo=de(Kc());var ORt=class t extends pq{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new Zoo.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(ar).connection.sendNotification(t.notificationType,r)}};p();var Xoo=de(Kc());var Utl=new Xoo.ProtocolNotificationType("$/copilot/rateLimitWarning"),BRt=class extends LS{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(ar).connection.sendNotification(Utl,r)}};p();p();var LRt=class extends eKe{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get(AN).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get(AN).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get(AN);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 FRt=class extends Vx{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new LRt(this.ctx,e)}shouldStartWatching(e){return Ck(this.ctx)?!1:!!this.ctx.get(Pn).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped")}};function URt(t){let e=new KC(process.env),r=xio(e);r.set(KC,e),r.set(tr,new kRt(r)),r.set(nc,new nc(r)),bLr(r,{});let n=Pen();r.set(zn,n),r.set(eA,new eA(r));let o=new Ywt;r.set(Sh,o);let s=tso.join(n.directory,P7r),c=l3.plaintextOnly();r.set(l3,c);let{repo:l,diagnostics:u}=hdn(r,s,c);r.set(ZI,l),r.set(Ur,new Zqe(r,process.env)),r.set(LT,new LT(r)),r.set(pie,new pie(r));let d=new lf(r,"agent");d.onInitialized(()=>gdn(r,u)),r.set(lf,d),r.set(La,Ezi),r.set(MI,new MI),r.set(Ir,new ej),r.set(_ie,lzi()),r.set(Tu,new Tu),r.set($o,Roo),r.set(sa,new Hwt(r)),r.set(ree,new $wt(r)),r.set(Vx,new FRt(r)),r.set(AN,new AN(r)),r.set(um,new um),r.set(dm,Jlt(r,xGi)),r.set(xb,new xb(r)),r.set(z5,new Whe),aoo(r),tKe(r),Adn(r),r.set(ar,new ar(r,t)),r.set(xO,new Gwt(r)),r.set(_s,new DRt(r)),mdn(r,u),r.set(qve,new IRt(r)),r.set(lW,new TRt(r)),r.set(Um,new u_e(r)),r.set(cs,new lRt(r));let f=new Z8e(r,t);r.set(Z8e,f),r.set(Fl,f),r.set(J8e,new J8e(r)),r.set(Y8e,new Y8e(r)),r.set(S9,new S9);let h=new BV(r);r.set($r,h),r.set(BV,h),r.set(Fm,new S_e(r,process.env)),r.set(TP,new ooe),r.set(tc,new tc(r)),Coo(r),ioo(r),r.set(vN,new vN),r.set(RV,new RV),r.set(bN,new bN),r.set(PV,new PV([])),r.set(BT,new Kwt),r.set(eso.ObservableWorkspace,new Xye(r,!0,!0)),r.set(a4,new I_e),r.set(t9,new t9),r.set(Uv,new Uv(r)),r.set(KA,new Fbt(r)),r.set(k_,new cRt(r)),r.set(Ld,new aRt(r)),r.set(pw,new pw(r)),r.set(ds,new ds(r)),r.set(iF,new iF(r)),r.set(sF,new sF(r)),r.set(zS,new zS(r)),r.set(lJ,new lJ(r)),r.set($O,new $O),r.set(c0,new c0),r.set(SN,new SN(r)),r.set(YE,new bRt(r)),r.set(N2,new SRt(r)),r.set(X3,new X3(r)),r.set(Cb,new fRt(r));let m=new vH(r);r.set(vH,m);let g=new WA(r,m,new dRt(r));r.set(WA,g),r.set(TT,new TT(r,m,g)),r.set(Hne,Y7i(r)),r.set(LS,new BRt(r)),r.set(NX,new NX),r.set(die,new die),r.set(cm,new zwt(r)),r.set(Yv,new Vwt(r)),r.set(jN,new jN(r));let A=new bA(r);r.set(bA,A),r.set(Ef,new Ef(r,A)),r.set(fg,new fg(r,A)),r.set(Yp,new Yp(r,A)),r.set(a0,new a0(r,e,A));let y=new D3(r,A,n);r.set(D3,y),r.get(OS).addListener(y.lifecycleListener);let E=new W8e;r.set(W8e,E),r.set(CA,new RTt(r)),r.set(ig,new ig(r,E)),r.set(mw,new mw),r.set(KS,new KS(r)),r.set(zq,new zq(r)),r.set(rw,new Iq([new xq,new wq])),r.set(uie,new uie(r)),r.set(B_,new B_(r)),r.set(pq,new ORt(r)),r.set(kK,new MRt(r)),r.set(CT,new CT(r)),r.set(qs,new qs(r)),r.set(lm,new lm),r.set(FX,new FX(r)),r.set(o8,new o8(r,new Ewt)),r.set(Gne,new Gne(r)),r.set(uc,new uc(r)),r.set(bO,new uRt(r)),r.set(_N,new _N(r)),r.set(tP,new tP(r.get(_N),r)),r.set(OO,new OO(r)),r.set(yI,new Jwt(r)),r.set(VC,new VC(r.get(tP),r.get(yI),r)),r.set(cE,new cE(r));let _=new cc(r);r.set(cc,_);let v=new i8(r,_);return r.set(i8,v),r.set(vie,new vie(r,_)),r.get(ar).onActivation(()=>{v.ensureInitialSync()}),r}a(URt,"createLanguageServerContext");var HN=new pe("ACP");async function rso(t){let e=t.get(as);HN.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(KC).markReady(),t.get(Hp).githubAppId=Nae,jtl(t),qtl(t),t.get(Pn).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Ut).primeToken()?HN.info(t,"Token primed successfully"):HN.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(lf).initialize(!0),Qyn()?await Qtl(t):(yt(t,"acp.server.start",{acpPipeline:"internal"}),await nso(t))}a(rso,"startACPServer");async function nso(t){HN.info(t,"Starting ACP server with internal pipeline");let e=Gve.Writable.toWeb(process.stdout),r=Gve.Readable.toWeb(process.stdin),n=NRe(e,r),o=new MRe(s=>new BTt(s,t),n);o.signal.addEventListener("abort",()=>{HN.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(nso,"startACPServerInternal");async function Qtl(t){HN.info(t,"Starting ACP server with CLI proxy"),yt(t,"acp.cli.discover");let e;try{e=await qyn()}catch(u){let d=u instanceof Error?u.message:String(u);HN.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),Zn(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await nso(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;HN.info(t,`Found Copilot CLI: ${r} v${e.version}`),yt(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new LTt(e,t),o=Gve.Writable.toWeb(process.stdout),s=Gve.Readable.toWeb(process.stdin),c=NRe(o,s),l=new MRe(u=>new UTt(u,t,n),c);l.signal.addEventListener("abort",()=>{HN.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a(Qtl,"startACPServerWithCLI");function qtl(t){let e=t.get(ds);e.registerTool(new Yq({name:"create_file",description:"Create a new file in the workspace with the specified content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.String({description:"The content to write to the new file."})})})),e.registerTool(new Yq({name:"insert_edit_into_file",description:"Edit an existing file by inserting, replacing, or deleting content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),content:S.Optional(S.String({description:"The new content for the file."})),edits:S.Optional(S.Array(S.Object({startLine:S.Number({description:"The starting line number (1-based)."}),endLine:S.Number({description:"The ending line number (1-based)."}),newContent:S.String({description:"The new content to replace the range with."})})))})})),e.registerTool(new Yq({name:"replace_string_in_file",description:"Replace a specific string in a file with a new string.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.String({description:"The string to find and replace."}),newString:S.String({description:"The string to replace it with."})})})),HN.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(qtl,"registerACPClientTools");function iso(){let e=URt({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 LV(e);return e.forceSet(k_,r),{ctx:e,acpToolInvoker:r}}a(iso,"createACPContext");function jtl(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(HN.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),VUe(t,r))}a(jtl,"configureGitHubEnterpriseUrl");p();var t7r=require("events"),c6e=de(require("fs"));KGe();var qRt=de(Kc());p();var sso=de(require("fs")),aso=de(require("http")),$ve=de(require("path"));var QRt=class{constructor(e,r){this.port=e;let n;this.server=aso.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=>{oso(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{oso(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;$ve.basename(__dirname)!=="debug"&&(c=$ve.dirname(__dirname)),n??=sso.readFileSync($ve.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 oso(t,e){t.write("data: "+e.toString().replace(/\n/g,` +\`\`\``}},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,` data: `)+` -`)}a(oso,"writeData");var r7r=class extends qRt.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()}},n7r=class extends qRt.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 cso(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new t7r.EventEmitter;let l=new QRt(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=c6e.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=c6e.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&c6e.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new t7r.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} +`)}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)} `)),n.on("write",u=>l(`--> ${JSON.stringify(u)} -`))}return n&&(e=new n7r(e,n),r=new r7r(r,n)),[e,r]}a(cso,"wrapTransports");p();var jRt=de(require("fs/promises")),lso=de(require("os")),uso=de(require("path"));var Htl={tmpdir:a(()=>lso.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function dso(t=Htl){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await jRt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await jRt.mkdtemp(uso.join(e,"github-copilot-"))}}a(dso,"mitigateTempFolder");function wrl(){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(wrl,"shouldEnableSourceMapSupport");wrl()&&Vso();async function zso(){let t=Oyn(process.argv.slice(2)).version(new as().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(Amn(),e.acp){let{ctx:u}=iso();await c8t(u),await rso(u);return}let r,n;e["node-ipc"]?(r=new bP.IPCMessageReader(process),n=new bP.IPCMessageWriter(process)):e.stdio?(r=new bP.StreamMessageReader(process.stdin),n=new bP.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await dso();let o=(0,bP.createConnection)(bP.ProposedFeatures.all,...await cso(process.env,r,n)),s=URt(o);console=Egn(s),await c8t(s);let c=s.get(ar),l=new XY(s);s.set(XY,l),c.onActivation(()=>{l.start(),ymn()}),Rrl(c,r),c.listen()}a(zso,"main");function Rrl(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(Rrl,"setupExitHandlers");Wso.isMainThread?require.main===module&&zso():(Qmn()&&qmn(),k7t()&&ygn());0&&(module.exports={getTokenizer,getTokenizerAsync,main}); +`))}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}); //!!! DO NOT modify, this file was COPIED from 'microsoft/vscode' /*! Bundled license information: @@ -4190,25 +4238,39 @@ git-url-parse/lib/index.js: * @return {String} token prefix *) -@vscode/chat-lib/dist/src/_internal/util/vs/base/common/lazy.js: -@vscode/chat-lib/dist/src/_internal/util/vs/base/common/errors.js: +is-extglob/index.js: + (*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + *) + +is-glob/index.js: + (*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + *) + +@vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/position.js: +@vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/range.js: +@vscode/prompt-tsx/dist/base/util/vs/nls.js: +@vscode/prompt-tsx/dist/base/util/vs/common/platform.js: +@vscode/prompt-tsx/dist/base/util/vs/common/process.js: +@vscode/prompt-tsx/dist/base/util/vs/common/path.js: +@vscode/prompt-tsx/dist/base/util/vs/common/uri.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/arraysFind.js: +@vscode/chat-lib/dist/src/_internal/util/vs/base/common/errors.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/arrays.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/collections.js: -@vscode/chat-lib/dist/src/_internal/util/vs/base/common/map.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/functional.js: +@vscode/chat-lib/dist/src/_internal/util/vs/base/common/map.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/assert.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/types.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/iterator.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/lifecycle.js: -@vscode/chat-lib/dist/src/_internal/util/vs/base/common/stream.js: -@vscode/chat-lib/dist/src/_internal/util/vs/base/common/buffer.js: -@vscode/prompt-tsx/dist/base/util/vs/nls.js: -@vscode/prompt-tsx/dist/base/util/vs/common/platform.js: -@vscode/prompt-tsx/dist/base/util/vs/common/process.js: -@vscode/prompt-tsx/dist/base/util/vs/common/path.js: -@vscode/prompt-tsx/dist/base/util/vs/common/uri.js: -@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/instantiation.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/linkedList.js: @vscode/chat-lib/dist/src/_internal/util/vs/nls.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/platform.js: @@ -4218,6 +4280,7 @@ git-url-parse/lib/index.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/cancellation.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/path.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/cache.js: +@vscode/chat-lib/dist/src/_internal/util/vs/base/common/lazy.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/strings.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/extpath.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/uri.js: @@ -4225,13 +4288,6 @@ git-url-parse/lib/index.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/resources.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/symbols.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/async.js: -@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/descriptors.js: -@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/graph.js: -@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/serviceCollection.js: -@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/instantiationService.js: -@vscode/chat-lib/dist/src/_internal/util/vs/base/common/numbers.js: -@vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/position.js: -@vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/range.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/objects.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/observableInternal/debugName.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/equals.js: @@ -4277,6 +4333,11 @@ git-url-parse/lib/index.js: @vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/edits/edit.js: @vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/edits/stringEdit.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/observable.js: +@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/instantiation.js: +@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/descriptors.js: +@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/graph.js: +@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/serviceCollection.js: +@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/instantiationService.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/codiconsUtil.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/codiconsLibrary.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/codicons.js: @@ -4284,6 +4345,8 @@ git-url-parse/lib/index.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/uuid.js: @vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/edits/textEdit.js: @vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/edits/lineEdit.js: +@vscode/chat-lib/dist/src/_internal/util/vs/base/common/stream.js: +@vscode/chat-lib/dist/src/_internal/util/vs/base/common/buffer.js: @vscode/chat-lib/dist/src/_internal/util/vs/workbench/api/common/extHostTypes/es5ClassCompat.js: @vscode/chat-lib/dist/src/_internal/util/vs/workbench/api/common/extHostTypes/position.js: @vscode/chat-lib/dist/src/_internal/util/vs/workbench/api/common/extHostTypes/range.js: @@ -4317,31 +4380,12 @@ git-url-parse/lib/index.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/glob.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/sseParser.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/hash.js: +@vscode/chat-lib/dist/src/_internal/util/vs/base/common/numbers.js: @vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/wordHelper.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/uint.js: @vscode/chat-lib/dist/src/_internal/util/vs/editor/common/model/prefixSumComputer.js: (*!!! DO NOT modify, this file was COPIED from 'microsoft/vscode' *) -@vscode/chat-lib/dist/src/_internal/extension/completions-core/vscode-node/prompt/src/tokenization/tokenizer.js: - (*! CLS-HOST-INJECTION-VENDORED-v2 delegate (script/chatLibPatch/patchChatLib.ts) *) - (*! CLS-HOST-INJECTION-VENDORED-v2 lazy-init (script/chatLibPatch/patchChatLib.ts) *) - -is-extglob/index.js: - (*! - * is-extglob - * - * Copyright (c) 2014-2016, Jon Schlinkert. - * Licensed under the MIT License. - *) - -is-glob/index.js: - (*! - * is-glob - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - *) - undici/lib/web/fetch/body.js: undici/lib/web/fetch/body.js: (*! formdata-polyfill. MIT License. Jimmy Wärting *) diff --git a/copilot/js/tfidfWorker.js b/copilot/js/tfidfWorker.js index e814e0bd..fb2e1443 100644 --- a/copilot/js/tfidfWorker.js +++ b/copilot/js/tfidfWorker.js @@ -3,13 +3,13 @@ `+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(n=>{n(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};P.ErrorHandler=Pt;P.errorHandler=new Pt;function uo(t){P.errorHandler.setUnexpectedErrorHandler(t)}s(uo,"setUnexpectedErrorHandler");function ao(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}s(ao,"isSigPipeError");function lo(t){P.errorHandler.onUnexpectedError(t)}s(lo,"onBugIndicatingError");function co(t){Hn(t)||P.errorHandler.onUnexpectedError(t)}s(co,"onUnexpectedError");function fo(t){Hn(t)||P.errorHandler.onUnexpectedExternalError(t)}s(fo,"onUnexpectedExternalError");function ji(t){if(t instanceof Error){let{name:e,message:n,cause:r}=t,i=t.stacktrace||t.stack;return{$isError:!0,name:e,message:n,stack:i,noTelemetry:Fe.isErrorNoTelemetry(t),cause:r?ji(r):void 0,code:t.code}}return t}s(ji,"transformErrorForSerialization");function zi(t){let e;return t.noTelemetry?e=new Fe:(e=new Error,e.name=t.name),e.message=t.message,e.stack=t.stack,t.code&&(e.code=t.code),t.cause&&(e.cause=zi(t.cause)),e}s(zi,"transformErrorFromSerialization");P.canceledName="Canceled";function Hn(t){return t instanceof It?!0:t instanceof Error&&t.name===P.canceledName&&t.message===P.canceledName}s(Hn,"isCancellationError");var It=class extends Error{static{s(this,"CancellationError")}constructor(){super(P.canceledName),this.name=this.message}};P.CancellationError=It;var qn=class t extends Error{static{s(this,"PendingMigrationError")}static{this._name="PendingMigrationError"}static is(e){return e instanceof t||e instanceof Error&&e.name===t._name}constructor(e){super(e),this.name=t._name}};P.PendingMigrationError=qn;function ho(){let t=new Error(P.canceledName);return t.name=t.message,t}s(ho,"canceled");function mo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}s(mo,"illegalArgument");function po(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}s(po,"illegalState");var Wn=class extends TypeError{static{s(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};P.ReadonlyError=Wn;function go(t){return t?t.message?t.message:t.stack?t.stack.split(` -`)[0]:String(t):"Error"}s(go,"getErrorMessage");var jn=class extends Error{static{s(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};P.NotImplementedError=jn;var zn=class extends Error{static{s(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};P.NotSupportedError=zn;var Bn=class extends Error{static{s(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};P.ExpectedError=Bn;var Fe=class t extends Error{static{s(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let n=new t;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};P.ErrorNoTelemetry=Fe;var $n=class t extends Error{static{s(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};P.BugIndicatingError=$n});var Kn=U(Gn=>{"use strict";g();Object.defineProperty(Gn,"__esModule",{value:!0});Gn.createSingleCallFunction=_o;function _o(t,e){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,e)try{i=t.apply(n,arguments)}finally{e()}else i=t.apply(n,arguments);return i}}s(_o,"createSingleCallFunction")});var Gi=U(Q=>{"use strict";g();Object.defineProperty(Q,"__esModule",{value:!0});Q.MonotonousArray=void 0;Q.findLast=bo;Q.findLastIdx=Bi;Q.findFirst=Co;Q.findFirstIdx=$i;Q.findLastMonotonous=yo;Q.findLastIdxMonotonous=Qn;Q.findFirstMonotonous=vo;Q.findFirstIdxMonotonousOrArrLen=Yn;Q.findFirstIdxMonotonous=wo;Q.findFirstMax=Hi;Q.findLastMax=Eo;Q.findFirstMin=Lo;Q.findMaxIdx=No;Q.mapFindFirst=Ao;function bo(t,e,n=t.length-1){let r=Bi(t,e,n);if(r!==-1)return t[r]}s(bo,"findLast");function Bi(t,e,n=t.length-1){for(let r=n;r>=0;r--){let i=t[r];if(e(i,r))return r}return-1}s(Bi,"findLastIdx");function Co(t,e,n=0){let r=$i(t,e,n);if(r!==-1)return t[r]}s(Co,"findFirst");function $i(t,e,n=0){for(let r=n;r0&&(n=i)}return n}s(Hi,"findFirstMax");function Eo(t,e){if(t.length===0)return;let n=t[0];for(let r=1;r=0&&(n=i)}return n}s(Eo,"findLastMax");function Lo(t,e){return Hi(t,(n,r)=>-e(n,r))}s(Lo,"findFirstMin");function No(t,e){if(t.length===0)return-1;let n=0;for(let r=1;r0&&(n=r)}return n}s(No,"findMaxIdx");function Ao(t,e){for(let n of t){let r=e(n);if(r!==void 0)return r}}s(Ao,"mapFindFirst")});var Ji=U(N=>{"use strict";g();Object.defineProperty(N,"__esModule",{value:!0});N.Permutation=N.CallbackIterable=N.ArrayQueue=N.booleanComparator=N.numberComparator=N.CompareResult=void 0;N.tail=xo;N.equals=Po;N.removeFastWithoutKeepingOrder=Io;N.binarySearch=So;N.binarySearch2=Ki;N.quickSelect=Zn;N.groupBy=Ro;N.groupAdjacentBy=Oo;N.forEachAdjacent=Do;N.forEachWithNeighbors=Mo;N.concatArrays=Fo;N.sortedDiff=Vi;N.delta=Uo;N.top=qo;N.topAsync=Wo;N.coalesce=jo;N.coalesceInPlace=zo;N.move=Bo;N.isFalsyOrEmpty=$o;N.isNonEmptyArray=Ho;N.distinct=Go;N.uniqueFilter=Ko;N.commonPrefixLength=Vo;N.range=Qo;N.index=Yo;N.insert=Zo;N.remove=Yi;N.arrayInsert=Xo;N.shuffle=Jo;N.pushToStart=eu;N.pushToEnd=tu;N.pushMany=nu;N.mapArrayOrNot=ru;N.mapFilter=iu;N.withoutDuplicates=su;N.asArray=ou;N.getRandomElement=uu;N.insertInto=Zi;N.splice=au;N.compareBy=lu;N.tieBreakComparators=cu;N.reverseOrder=du;N.compareUndefinedSmallest=mu;N.findAsync=pu;N.sum=gu;N.sumBy=_u;var To=Gi(),ko=Ue();function xo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}s(xo,"tail");function Po(t,e,n=(r,i)=>r===i){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let r=0,i=t.length;rn(t[r],e))}s(So,"binarySearch");function Ki(t,e){let n=0,r=t-1;for(;n<=r;){let i=(n+r)/2|0,o=e(i);if(o<0)n=i+1;else if(o>0)r=i-1;else return i}return-(n+1)}s(Ki,"binarySearch2");function Zn(t,e,n){if(t=t|0,t>=e.length)throw new TypeError("invalid index");let r=e[Math.floor(e.length*Math.random())],i=[],o=[],u=[];for(let a of e){let l=n(a,r);l<0?i.push(a):l>0?o.push(a):u.push(a)}return t0&&(i(o,0,[l]),u+=1)}return r}s(Vi,"sortedDiff");function Uo(t,e,n){let r=Vi(t,e,n),i=[],o=[];for(let u of r)i.push(...t.slice(u.start,u.start+u.deleteCount)),o.push(...u.toInsert);return{removed:i,added:o}}s(Uo,"delta");function qo(t,e,n){if(n===0)return[];let r=t.slice(0,n).sort(e);return Qi(t,e,r,n,t.length),r}s(qo,"top");function Wo(t,e,n,r,i){return n===0?Promise.resolve([]):new Promise((o,u)=>{(async()=>{let a=t.length,l=t.slice(0,n).sort(e);for(let c=n,d=Math.min(n+r,a);cn&&await new Promise(f=>setTimeout(f)),i&&i.isCancellationRequested)throw new ko.CancellationError;Qi(t,e,l,c,d)}return l})().then(o,u)})}s(Wo,"topAsync");function Qi(t,e,n,r,i){for(let o=n.length;re(u,l)<0);n.splice(a,0,u)}}}s(Qi,"topStep");function jo(t){return t.filter(e=>!!e)}s(jo,"coalesce");function zo(t){let e=0;for(let n=0;n0}s(Ho,"isNonEmptyArray");function Go(t,e=n=>n){let n=new Set;return t.filter(r=>{let i=e(r);return n.has(i)?!1:(n.add(i),!0)})}s(Go,"distinct");function Ko(t){let e=new Set;return n=>{let r=t(n);return e.has(r)?!1:(e.add(r),!0)}}s(Ko,"uniqueFilter");function Vo(t,e,n=(r,i)=>r===i){let r=0;for(let i=0,o=Math.min(t.length,e.length);ie;i--)r.push(i);return r}s(Qo,"range");function Yo(t,e,n){return t.reduce((r,i)=>(r[e(i)]=n?n(i):i,r),Object.create(null))}s(Yo,"index");function Zo(t,e){return t.push(e),()=>Yi(t,e)}s(Zo,"insert");function Yi(t,e){let n=t.indexOf(e);if(n>-1)return t.splice(n,1),e}s(Yi,"remove");function Xo(t,e,n){let r=t.slice(0,e),i=t.slice(e);return r.concat(n,i)}s(Xo,"arrayInsert");function Jo(t,e){let n;if(typeof e=="number"){let r=e;n=s(()=>{let i=Math.sin(r++)*179426549;return i-Math.floor(i)},"rand")}else n=Math.random;for(let r=t.length-1;r>0;r-=1){let i=Math.floor(n()*(r+1)),o=t[r];t[r]=t[i],t[i]=o}}s(Jo,"shuffle");function eu(t,e){let n=t.indexOf(e);n>-1&&(t.splice(n,1),t.unshift(e))}s(eu,"pushToStart");function tu(t,e){let n=t.indexOf(e);n>-1&&(t.splice(n,1),t.push(e))}s(tu,"pushToEnd");function nu(t,e){for(let n of e)t.push(n)}s(nu,"pushMany");function ru(t,e){return Array.isArray(t)?t.map(e):e(t)}s(ru,"mapArrayOrNot");function iu(t,e){let n=[];for(let r of t){let i=e(r);i!==void 0&&n.push(i)}return n}s(iu,"mapFilter");function su(t){let e=new Set(t);return Array.from(e)}s(su,"withoutDuplicates");function ou(t){return Array.isArray(t)?t:[t]}s(ou,"asArray");function uu(t){return t[Math.floor(Math.random()*t.length)]}s(uu,"getRandomElement");function Zi(t,e,n){let r=Xi(t,e),i=t.length,o=n.length;t.length=i+o;for(let u=i-1;u>=r;u--)t[u+o]=t[u];for(let u=0;u0}s(r,"isGreaterThan"),t.isGreaterThan=r;function i(o){return o===0}s(i,"isNeitherLessOrGreaterThan"),t.isNeitherLessOrGreaterThan=i,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(Ie||(N.CompareResult=Ie={}));function lu(t,e){return(n,r)=>e(t(n),t(r))}s(lu,"compareBy");function cu(...t){return(e,n)=>{for(let r of t){let i=r(e,n);if(!Ie.isNeitherLessOrGreaterThan(i))return i}return Ie.neitherLessOrGreaterThan}}s(cu,"tieBreakComparators");var fu=s((t,e)=>t-e,"numberComparator");N.numberComparator=fu;var hu=s((t,e)=>(0,N.numberComparator)(t?1:0,e?1:0),"booleanComparator");N.booleanComparator=hu;function du(t){return(e,n)=>-t(e,n)}s(du,"reverseOrder");function mu(t){return(e,n)=>e===void 0?n===void 0?Ie.neitherLessOrGreaterThan:Ie.lessThan:n===void 0?Ie.greaterThan:t(e,n)}s(mu,"compareUndefinedSmallest");var Xn=class{static{s(this,"ArrayQueue")}constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let n=this.firstIdx;for(;n=0&&e(this.items[n]);)n--;let r=n===this.lastIdx?null:this.items.slice(n+1,this.lastIdx+1);return this.lastIdx=n,r}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}removeLast(){let e=this.items[this.lastIdx];return this.lastIdx--,e}takeCount(e){let n=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,n}};N.ArrayQueue=Xn;var Jn=class t{static{s(this,"CallbackIterable")}static{this.empty=new t(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(n=>(e(n),!0))}toArray(){let e=[];return this.iterate(n=>(e.push(n),!0)),e}filter(e){return new t(n=>this.iterate(r=>e(r)?n(r):!0))}map(e){return new t(n=>this.iterate(r=>n(e(r))))}some(e){let n=!1;return this.iterate(r=>(n=e(r),!n)),n}findFirst(e){let n;return this.iterate(r=>e(r)?(n=r,!1):!0),n}findLast(e){let n;return this.iterate(r=>(e(r)&&(n=r),!0)),n}findLastMaxBy(e){let n,r=!0;return this.iterate(i=>((r||Ie.isGreaterThan(e(i,n)))&&(r=!1,n=i),!0)),n}};N.CallbackIterable=Jn;var er=class t{static{s(this,"Permutation")}constructor(e){this._indexMap=e}static createSortPermutation(e,n){let r=Array.from(e.keys()).sort((i,o)=>n(e[i],e[o]));return new t(r)}apply(e){return e.map((n,r)=>e[this._indexMap[r]])}inverse(){let e=this._indexMap.slice();for(let n=0;n({element:r,ok:await e(r,i)})))).find(r=>r.ok)?.element}s(pu,"findAsync");function gu(t){return t.reduce((e,n)=>e+n,0)}s(gu,"sum");function _u(t,e){return t.reduce((n,r)=>n+e(r),0)}s(_u,"sumBy")});var rs=U(B=>{"use strict";g();var es,ts,ns;Object.defineProperty(B,"__esModule",{value:!0});B.NKeyMap=B.SetMap=B.BidirectionalMap=B.CounterSet=B.MRUCache=B.LRUCache=B.LinkedMap=B.ResourceSet=B.ResourceMap=void 0;B.getOrSet=bu;B.mapToString=Cu;B.setToString=yu;B.mapsStrictEqualIgnoreOrder=wu;function bu(t,e,n){let r=t.get(e);return r===void 0&&(r=n,t.set(e,r)),r}s(bu,"getOrSet");function Cu(t){let e=[];return t.forEach((n,r)=>{e.push(`${r} => ${n}`)}),`Map(${t.size}) {${e.join(", ")}}`}s(Cu,"mapToString");function yu(t){let e=[];return t.forEach(n=>{e.push(n)}),`Set(${t.size}) {${e.join(", ")}}`}s(yu,"setToString");var tr=class{static{s(this,"ResourceMapEntry")}constructor(e,n){this.uri=e,this.value=n}};function vu(t){return Array.isArray(t)}s(vu,"isEntries");var ot=class t{static{s(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,n){if(this[es]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=n??t.defaultToKey;else if(vu(e)){this.map=new Map,this.toKey=n??t.defaultToKey;for(let[r,i]of e)this.set(r,i)}else this.map=new Map,this.toKey=e??t.defaultToKey}set(e,n){return this.map.set(this.toKey(e),new tr(e,n)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,n){typeof n<"u"&&(e=e.bind(n));for(let[r,i]of this.map)e(i.value,i.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(es=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};B.ResourceMap=ot;var nr=class{static{s(this,"ResourceSet")}constructor(e,n){this[ts]="ResourceSet",!e||typeof e=="function"?this._map=new ot(e):(this._map=new ot(n),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,n){this._map.forEach((r,i)=>e.call(n,i,i,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(ts=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};B.ResourceSet=nr;var St=class{static{s(this,"LinkedMap")}constructor(){this[ns]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=0){let r=this._map.get(e);if(r)return n!==0&&this.touch(r,n),r.value}set(e,n,r=0){let i=this._map.get(e);if(i)i.value=n,r!==0&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case 0:this.addItemLast(i);break;case 1:this.addItemFirst(i);break;case 2:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return i}values(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return i}entries(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return i}[(ns=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._tail,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.previous,r--;this._tail=n,this._size=r,n&&(n.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==1&&n!==2)){if(n===1){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===2){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};B.LinkedMap=St;var Rt=class extends St{static{s(this,"Cache")}constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=2){return super.get(e,n)}peek(e){return super.get(e,0)}set(e,n){return super.set(e,n,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},rr=class extends Rt{static{s(this,"LRUCache")}constructor(e,n=1){super(e,n)}trim(e){this.trimOld(e)}set(e,n){return super.set(e,n),this.checkTrim(),this}};B.LRUCache=rr;var ir=class extends Rt{static{s(this,"MRUCache")}constructor(e,n=1){super(e,n)}trim(e){this.trimNew(e)}set(e,n){return this._limit<=this.size&&!this.has(e)&&this.trim(Math.round(this._limit*this._ratio)-1),super.set(e,n),this}};B.MRUCache=ir;var sr=class{static{s(this,"CounterSet")}constructor(){this.map=new Map}add(e){return this.map.set(e,(this.map.get(e)||0)+1),this}delete(e){let n=this.map.get(e)||0;return n===0?!1:(n--,n===0?this.map.delete(e):this.map.set(e,n),!0)}has(e){return this.map.has(e)}};B.CounterSet=sr;var or=class{static{s(this,"BidirectionalMap")}constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[n,r]of e)this.set(n,r)}clear(){this._m1.clear(),this._m2.clear()}set(e,n){this._m1.set(e,n),this._m2.set(n,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let n=this._m1.get(e);return n===void 0?!1:(this._m1.delete(e),this._m2.delete(n),!0)}forEach(e,n){this._m1.forEach((r,i)=>{e.call(n,r,i,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}};B.BidirectionalMap=or;var ur=class{static{s(this,"SetMap")}constructor(){this.map=new Map}add(e,n){let r=this.map.get(e);r||(r=new Set,this.map.set(e,r)),r.add(n)}delete(e,n){let r=this.map.get(e);r&&(r.delete(n),r.size===0&&this.map.delete(e))}forEach(e,n){let r=this.map.get(e);r&&r.forEach(n)}get(e){let n=this.map.get(e);return n||new Set}};B.SetMap=ur;function wu(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(let[n,r]of t)if(!e.has(n)||e.get(n)!==r)return!1;for(let[n]of e)if(!t.has(n))return!1;return!0}s(wu,"mapsStrictEqualIgnoreOrder");var ar=class{static{s(this,"NKeyMap")}constructor(){this._data=new Map}set(e,...n){let r=this._data;for(let i=0;i{let i="";for(let[o,u]of n)i+=`${" ".repeat(r)}${o}: `,u instanceof Map?i+=` +`)[0]:String(t):"Error"}s(go,"getErrorMessage");var jn=class extends Error{static{s(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};P.NotImplementedError=jn;var zn=class extends Error{static{s(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};P.NotSupportedError=zn;var Bn=class extends Error{static{s(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};P.ExpectedError=Bn;var Fe=class t extends Error{static{s(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let n=new t;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};P.ErrorNoTelemetry=Fe;var $n=class t extends Error{static{s(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};P.BugIndicatingError=$n});var Kn=U(Gn=>{"use strict";g();Object.defineProperty(Gn,"__esModule",{value:!0});Gn.createSingleCallFunction=_o;function _o(t,e){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,e)try{i=t.apply(n,arguments)}finally{e()}else i=t.apply(n,arguments);return i}}s(_o,"createSingleCallFunction")});var Gi=U(Y=>{"use strict";g();Object.defineProperty(Y,"__esModule",{value:!0});Y.MonotonousArray=void 0;Y.findLast=bo;Y.findLastIdx=Bi;Y.findFirst=Co;Y.findFirstIdx=$i;Y.findLastMonotonous=yo;Y.findLastIdxMonotonous=Qn;Y.findFirstMonotonous=vo;Y.findFirstIdxMonotonousOrArrLen=Yn;Y.findFirstIdxMonotonous=wo;Y.findFirstMax=Hi;Y.findLastMax=Eo;Y.findFirstMin=Lo;Y.findMaxIdx=No;Y.mapFindFirst=Ao;function bo(t,e,n=t.length-1){let r=Bi(t,e,n);if(r!==-1)return t[r]}s(bo,"findLast");function Bi(t,e,n=t.length-1){for(let r=n;r>=0;r--){let i=t[r];if(e(i,r))return r}return-1}s(Bi,"findLastIdx");function Co(t,e,n=0){let r=$i(t,e,n);if(r!==-1)return t[r]}s(Co,"findFirst");function $i(t,e,n=0){for(let r=n;r0&&(n=i)}return n}s(Hi,"findFirstMax");function Eo(t,e){if(t.length===0)return;let n=t[0];for(let r=1;r=0&&(n=i)}return n}s(Eo,"findLastMax");function Lo(t,e){return Hi(t,(n,r)=>-e(n,r))}s(Lo,"findFirstMin");function No(t,e){if(t.length===0)return-1;let n=0;for(let r=1;r0&&(n=r)}return n}s(No,"findMaxIdx");function Ao(t,e){for(let n of t){let r=e(n);if(r!==void 0)return r}}s(Ao,"mapFindFirst")});var Ji=U(N=>{"use strict";g();Object.defineProperty(N,"__esModule",{value:!0});N.Permutation=N.CallbackIterable=N.ArrayQueue=N.booleanComparator=N.numberComparator=N.CompareResult=void 0;N.tail=xo;N.equals=Po;N.removeFastWithoutKeepingOrder=Io;N.binarySearch=So;N.binarySearch2=Ki;N.quickSelect=Zn;N.groupBy=Ro;N.groupAdjacentBy=Oo;N.forEachAdjacent=Do;N.forEachWithNeighbors=Mo;N.concatArrays=Fo;N.sortedDiff=Vi;N.delta=Uo;N.top=qo;N.topAsync=Wo;N.coalesce=jo;N.coalesceInPlace=zo;N.move=Bo;N.isFalsyOrEmpty=$o;N.isNonEmptyArray=Ho;N.distinct=Go;N.uniqueFilter=Ko;N.commonPrefixLength=Vo;N.range=Qo;N.index=Yo;N.insert=Zo;N.remove=Yi;N.arrayInsert=Xo;N.shuffle=Jo;N.pushToStart=eu;N.pushToEnd=tu;N.pushMany=nu;N.mapArrayOrNot=ru;N.mapFilter=iu;N.withoutDuplicates=su;N.asArray=ou;N.getRandomElement=uu;N.insertInto=Zi;N.splice=au;N.compareBy=lu;N.tieBreakComparators=cu;N.reverseOrder=du;N.compareUndefinedSmallest=mu;N.findAsync=pu;N.sum=gu;N.sumBy=_u;var To=Gi(),ko=Ue();function xo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}s(xo,"tail");function Po(t,e,n=(r,i)=>r===i){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let r=0,i=t.length;rn(t[r],e))}s(So,"binarySearch");function Ki(t,e){let n=0,r=t-1;for(;n<=r;){let i=(n+r)/2|0,o=e(i);if(o<0)n=i+1;else if(o>0)r=i-1;else return i}return-(n+1)}s(Ki,"binarySearch2");function Zn(t,e,n){if(t=t|0,t>=e.length)throw new TypeError("invalid index");let r=e[Math.floor(e.length*Math.random())],i=[],o=[],u=[];for(let a of e){let l=n(a,r);l<0?i.push(a):l>0?o.push(a):u.push(a)}return t0&&(i(o,0,[l]),u+=1)}return r}s(Vi,"sortedDiff");function Uo(t,e,n){let r=Vi(t,e,n),i=[],o=[];for(let u of r)i.push(...t.slice(u.start,u.start+u.deleteCount)),o.push(...u.toInsert);return{removed:i,added:o}}s(Uo,"delta");function qo(t,e,n){if(n===0)return[];let r=t.slice(0,n).sort(e);return Qi(t,e,r,n,t.length),r}s(qo,"top");function Wo(t,e,n,r,i){return n===0?Promise.resolve([]):new Promise((o,u)=>{(async()=>{let a=t.length,l=t.slice(0,n).sort(e);for(let c=n,d=Math.min(n+r,a);cn&&await new Promise(f=>setTimeout(f)),i&&i.isCancellationRequested)throw new ko.CancellationError;Qi(t,e,l,c,d)}return l})().then(o,u)})}s(Wo,"topAsync");function Qi(t,e,n,r,i){for(let o=n.length;re(u,l)<0);n.splice(a,0,u)}}}s(Qi,"topStep");function jo(t){return t.filter(e=>!!e)}s(jo,"coalesce");function zo(t){let e=0;for(let n=0;n0}s(Ho,"isNonEmptyArray");function Go(t,e=n=>n){let n=new Set;return t.filter(r=>{let i=e(r);return n.has(i)?!1:(n.add(i),!0)})}s(Go,"distinct");function Ko(t){let e=new Set;return n=>{let r=t(n);return e.has(r)?!1:(e.add(r),!0)}}s(Ko,"uniqueFilter");function Vo(t,e,n=(r,i)=>r===i){let r=0;for(let i=0,o=Math.min(t.length,e.length);ie;i--)r.push(i);return r}s(Qo,"range");function Yo(t,e,n){return t.reduce((r,i)=>(r[e(i)]=n?n(i):i,r),Object.create(null))}s(Yo,"index");function Zo(t,e){return t.push(e),()=>Yi(t,e)}s(Zo,"insert");function Yi(t,e){let n=t.indexOf(e);if(n>-1)return t.splice(n,1),e}s(Yi,"remove");function Xo(t,e,n){let r=t.slice(0,e),i=t.slice(e);return r.concat(n,i)}s(Xo,"arrayInsert");function Jo(t,e){let n;if(typeof e=="number"){let r=e;n=s(()=>{let i=Math.sin(r++)*179426549;return i-Math.floor(i)},"rand")}else n=Math.random;for(let r=t.length-1;r>0;r-=1){let i=Math.floor(n()*(r+1)),o=t[r];t[r]=t[i],t[i]=o}}s(Jo,"shuffle");function eu(t,e){let n=t.indexOf(e);n>-1&&(t.splice(n,1),t.unshift(e))}s(eu,"pushToStart");function tu(t,e){let n=t.indexOf(e);n>-1&&(t.splice(n,1),t.push(e))}s(tu,"pushToEnd");function nu(t,e){for(let n of e)t.push(n)}s(nu,"pushMany");function ru(t,e){return Array.isArray(t)?t.map(e):e(t)}s(ru,"mapArrayOrNot");function iu(t,e){let n=[];for(let r of t){let i=e(r);i!==void 0&&n.push(i)}return n}s(iu,"mapFilter");function su(t){let e=new Set(t);return Array.from(e)}s(su,"withoutDuplicates");function ou(t){return Array.isArray(t)?t:[t]}s(ou,"asArray");function uu(t){return t[Math.floor(Math.random()*t.length)]}s(uu,"getRandomElement");function Zi(t,e,n){let r=Xi(t,e),i=t.length,o=n.length;t.length=i+o;for(let u=i-1;u>=r;u--)t[u+o]=t[u];for(let u=0;u0}s(r,"isGreaterThan"),t.isGreaterThan=r;function i(o){return o===0}s(i,"isNeitherLessOrGreaterThan"),t.isNeitherLessOrGreaterThan=i,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(Ie||(N.CompareResult=Ie={}));function lu(t,e){return(n,r)=>e(t(n),t(r))}s(lu,"compareBy");function cu(...t){return(e,n)=>{for(let r of t){let i=r(e,n);if(!Ie.isNeitherLessOrGreaterThan(i))return i}return Ie.neitherLessOrGreaterThan}}s(cu,"tieBreakComparators");var fu=s((t,e)=>t-e,"numberComparator");N.numberComparator=fu;var hu=s((t,e)=>(0,N.numberComparator)(t?1:0,e?1:0),"booleanComparator");N.booleanComparator=hu;function du(t){return(e,n)=>-t(e,n)}s(du,"reverseOrder");function mu(t){return(e,n)=>e===void 0?n===void 0?Ie.neitherLessOrGreaterThan:Ie.lessThan:n===void 0?Ie.greaterThan:t(e,n)}s(mu,"compareUndefinedSmallest");var Xn=class{static{s(this,"ArrayQueue")}constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let n=this.firstIdx;for(;n=0&&e(this.items[n]);)n--;let r=n===this.lastIdx?null:this.items.slice(n+1,this.lastIdx+1);return this.lastIdx=n,r}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}removeLast(){let e=this.items[this.lastIdx];return this.lastIdx--,e}takeCount(e){let n=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,n}};N.ArrayQueue=Xn;var Jn=class t{static{s(this,"CallbackIterable")}static{this.empty=new t(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(n=>(e(n),!0))}toArray(){let e=[];return this.iterate(n=>(e.push(n),!0)),e}filter(e){return new t(n=>this.iterate(r=>e(r)?n(r):!0))}map(e){return new t(n=>this.iterate(r=>n(e(r))))}some(e){let n=!1;return this.iterate(r=>(n=e(r),!n)),n}findFirst(e){let n;return this.iterate(r=>e(r)?(n=r,!1):!0),n}findLast(e){let n;return this.iterate(r=>(e(r)&&(n=r),!0)),n}findLastMaxBy(e){let n,r=!0;return this.iterate(i=>((r||Ie.isGreaterThan(e(i,n)))&&(r=!1,n=i),!0)),n}};N.CallbackIterable=Jn;var er=class t{static{s(this,"Permutation")}constructor(e){this._indexMap=e}static createSortPermutation(e,n){let r=Array.from(e.keys()).sort((i,o)=>n(e[i],e[o]));return new t(r)}apply(e){return e.map((n,r)=>e[this._indexMap[r]])}inverse(){let e=this._indexMap.slice();for(let n=0;n({element:r,ok:await e(r,i)})))).find(r=>r.ok)?.element}s(pu,"findAsync");function gu(t){return t.reduce((e,n)=>e+n,0)}s(gu,"sum");function _u(t,e){return t.reduce((n,r)=>n+e(r),0)}s(_u,"sumBy")});var rs=U(B=>{"use strict";g();var es,ts,ns;Object.defineProperty(B,"__esModule",{value:!0});B.NKeyMap=B.SetMap=B.BidirectionalMap=B.CounterSet=B.MRUCache=B.LRUCache=B.LinkedMap=B.ResourceSet=B.ResourceMap=void 0;B.getOrSet=bu;B.mapToString=Cu;B.setToString=yu;B.mapsStrictEqualIgnoreOrder=wu;function bu(t,e,n){let r=t.get(e);return r===void 0&&(r=n,t.set(e,r)),r}s(bu,"getOrSet");function Cu(t){let e=[];return t.forEach((n,r)=>{e.push(`${r} => ${n}`)}),`Map(${t.size}) {${e.join(", ")}}`}s(Cu,"mapToString");function yu(t){let e=[];return t.forEach(n=>{e.push(n)}),`Set(${t.size}) {${e.join(", ")}}`}s(yu,"setToString");var tr=class{static{s(this,"ResourceMapEntry")}constructor(e,n){this.uri=e,this.value=n}};function vu(t){return Array.isArray(t)}s(vu,"isEntries");var ot=class t{static{s(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,n){if(this[es]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=n??t.defaultToKey;else if(vu(e)){this.map=new Map,this.toKey=n??t.defaultToKey;for(let[r,i]of e)this.set(r,i)}else this.map=new Map,this.toKey=e??t.defaultToKey}set(e,n){return this.map.set(this.toKey(e),new tr(e,n)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,n){typeof n<"u"&&(e=e.bind(n));for(let[r,i]of this.map)e(i.value,i.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(es=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};B.ResourceMap=ot;var nr=class{static{s(this,"ResourceSet")}constructor(e,n){this[ts]="ResourceSet",!e||typeof e=="function"?this._map=new ot(e):(this._map=new ot(n),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,n){this._map.forEach((r,i)=>e.call(n,i,i,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(ts=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};B.ResourceSet=nr;var St=class{static{s(this,"LinkedMap")}constructor(){this[ns]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=0){let r=this._map.get(e);if(r)return n!==0&&this.touch(r,n),r.value}set(e,n,r=0){let i=this._map.get(e);if(i)i.value=n,r!==0&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case 0:this.addItemLast(i);break;case 1:this.addItemFirst(i);break;case 2:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return i}values(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return i}entries(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return i}[(ns=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._tail,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.previous,r--;this._tail=n,this._size=r,n&&(n.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==1&&n!==2)){if(n===1){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===2){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};B.LinkedMap=St;var Rt=class extends St{static{s(this,"Cache")}constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=2){return super.get(e,n)}peek(e){return super.get(e,0)}set(e,n){return super.set(e,n,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},rr=class extends Rt{static{s(this,"LRUCache")}constructor(e,n=1){super(e,n)}trim(e){this.trimOld(e)}set(e,n){return super.set(e,n),this.checkTrim(),this}};B.LRUCache=rr;var ir=class extends Rt{static{s(this,"MRUCache")}constructor(e,n=1){super(e,n)}trim(e){this.trimNew(e)}set(e,n){return this._limit<=this.size&&!this.has(e)&&this.trim(Math.round(this._limit*this._ratio)-1),super.set(e,n),this}};B.MRUCache=ir;var sr=class{static{s(this,"CounterSet")}constructor(){this.map=new Map}add(e){return this.map.set(e,(this.map.get(e)||0)+1),this}delete(e){let n=this.map.get(e)||0;return n===0?!1:(n--,n===0?this.map.delete(e):this.map.set(e,n),!0)}has(e){return this.map.has(e)}};B.CounterSet=sr;var or=class{static{s(this,"BidirectionalMap")}constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[n,r]of e)this.set(n,r)}clear(){this._m1.clear(),this._m2.clear()}set(e,n){this._m1.set(e,n),this._m2.set(n,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let n=this._m1.get(e);return n===void 0?!1:(this._m1.delete(e),this._m2.delete(n),!0)}forEach(e,n){this._m1.forEach((r,i)=>{e.call(n,r,i,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}};B.BidirectionalMap=or;var ur=class{static{s(this,"SetMap")}constructor(){this.map=new Map}add(e,n){let r=this.map.get(e);r||(r=new Set,this.map.set(e,r)),r.add(n)}delete(e,n){let r=this.map.get(e);r&&(r.delete(n),r.size===0&&this.map.delete(e))}forEach(e,n){let r=this.map.get(e);r&&r.forEach(n)}get(e){let n=this.map.get(e);return n||new Set}};B.SetMap=ur;function wu(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(let[n,r]of t)if(!e.has(n)||e.get(n)!==r)return!1;for(let[n]of e)if(!t.has(n))return!1;return!0}s(wu,"mapsStrictEqualIgnoreOrder");var ar=class{static{s(this,"NKeyMap")}constructor(){this._data=new Map}set(e,...n){let r=this._data;for(let i=0;i{let i="";for(let[o,u]of n)i+=`${" ".repeat(r)}${o}: `,u instanceof Map?i+=` `+e(u,r+1):i+=`${u} -`;return i},"printMap");return e(this._data,0)}};B.NKeyMap=ar});var is=U(ye=>{"use strict";g();Object.defineProperty(ye,"__esModule",{value:!0});ye.ok=Eu;ye.assertNever=Lu;ye.softAssertNever=Nu;ye.assert=Au;ye.softAssert=Tu;ye.assertFn=ku;ye.checkAdjacentItems=xu;var ut=Ue();function Eu(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}s(Eu,"ok");function Lu(t,e="Unreachable"){throw new Error(e)}s(Lu,"assertNever");function Nu(t){}s(Nu,"softAssertNever");function Au(t,e="unexpected state"){if(!t)throw typeof e=="string"?new ut.BugIndicatingError(`Assertion Failed: ${e}`):e}s(Au,"assert");function Tu(t,e="Soft Assertion Failed"){t||(0,ut.onUnexpectedError)(new ut.BugIndicatingError(e))}s(Tu,"softAssert");function ku(t){if(!t()){debugger;t(),(0,ut.onUnexpectedError)(new ut.BugIndicatingError("Assertion Failed"))}}s(ku,"assertFn");function xu(t,e){let n=0;for(;n{"use strict";g();Object.defineProperty(q,"__esModule",{value:!0});q.isOneOf=void 0;q.isString=lr;q.isStringArray=Iu;q.isArrayOf=ss;q.isObject=os;q.isTypedArray=Su;q.isNumber=Ru;q.isIterable=Ou;q.isAsyncIterable=Du;q.isBoolean=Mu;q.isUndefined=us;q.isDefined=Fu;q.isUndefinedOrNull=Ot;q.assertType=Uu;q.assertReturnsDefined=qu;q.assertDefined=Wu;q.assertReturnsAllDefined=ju;q.typeCheck=Bu;q.isEmptyObject=Hu;q.isFunction=cr;q.areFunctions=Gu;q.validateConstraints=Ku;q.validateConstraint=as;q.upcast=Vu;q.hasKey=Qu;var Pu=is();function lr(t){return typeof t=="string"}s(lr,"isString");function Iu(t){return ss(t,lr)}s(Iu,"isStringArray");function ss(t,e){return Array.isArray(t)&&t.every(e)}s(ss,"isArrayOf");function os(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}s(os,"isObject");function Su(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}s(Su,"isTypedArray");function Ru(t){return typeof t=="number"&&!isNaN(t)}s(Ru,"isNumber");function Ou(t){return!!t&&typeof t[Symbol.iterator]=="function"}s(Ou,"isIterable");function Du(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}s(Du,"isAsyncIterable");function Mu(t){return t===!0||t===!1}s(Mu,"isBoolean");function us(t){return typeof t>"u"}s(us,"isUndefined");function Fu(t){return!Ot(t)}s(Fu,"isDefined");function Ot(t){return us(t)||t===null}s(Ot,"isUndefinedOrNull");function Uu(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}s(Uu,"assertType");function qu(t){return(0,Pu.assert)(t!=null,"Argument is `undefined` or `null`."),t}s(qu,"assertReturnsDefined");function Wu(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}s(Wu,"assertDefined");function ju(...t){let e=[];for(let n=0;ne.includes(t),"isOneOf");q.isOneOf=zu;function Bu(t){}s(Bu,"typeCheck");var $u=Object.prototype.hasOwnProperty;function Hu(t){if(!os(t))return!1;for(let e in t)if($u.call(t,e))return!1;return!0}s(Hu,"isEmptyObject");function cr(t){return typeof t=="function"}s(cr,"isFunction");function Gu(...t){return t.length>0&&t.every(cr)}s(Gu,"areFunctions");function Ku(t,e){let n=Math.min(t.length,e.length);for(let r=0;r{"use strict";g();Object.defineProperty(Dt,"__esModule",{value:!0});Dt.Iterable=void 0;var Yu=fr(),ls;(function(t){function e(A){return!!A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}s(e,"is"),t.is=e;let n=Object.freeze([]);function r(){return n}s(r,"empty"),t.empty=r;function*i(A){yield A}s(i,"single"),t.single=i;function o(A){return e(A)?A:i(A)}s(o,"wrap"),t.wrap=o;function u(A){return A??n}s(u,"from"),t.from=u;function*a(A){for(let k=A.length-1;k>=0;k--)yield A[k]}s(a,"reverse"),t.reverse=a;function l(A){return!A||A[Symbol.iterator]().next().done===!0}s(l,"isEmpty"),t.isEmpty=l;function c(A){return A[Symbol.iterator]().next().value}s(c,"first"),t.first=c;function d(A,k){let F=0;for(let ee of A)if(k(ee,F++))return!0;return!1}s(d,"some"),t.some=d;function f(A,k){let F=0;for(let ee of A)if(!k(ee,F++))return!1;return!0}s(f,"every"),t.every=f;function y(A,k){for(let F of A)if(k(F))return F}s(y,"find"),t.find=y;function*D(A,k){for(let F of A)k(F)&&(yield F)}s(D,"filter"),t.filter=D;function*$(A,k){let F=0;for(let ee of A)yield k(ee,F++)}s($,"map"),t.map=$;function*H(A,k){let F=0;for(let ee of A)yield*k(ee,F++)}s(H,"flatMap"),t.flatMap=H;function*Z(...A){for(let k of A)(0,Yu.isIterable)(k)?yield*k:yield k}s(Z,"concat"),t.concat=Z;function de(A,k,F){let ee=F;for(let Ke of A)ee=k(ee,Ke);return ee}s(de,"reduce"),t.reduce=de;function oe(A){let k=0;for(let F of A)k++;return k}s(oe,"length"),t.length=oe;function*V(A,k,F=A.length){for(k<-A.length&&(k=0),k<0&&(k+=A.length),F<0?F+=A.length:F>A.length&&(F=A.length);k{"use strict";g();Object.defineProperty(R,"__esModule",{value:!0});R.DisposableResourceMap=R.DisposableSet=R.DisposableMap=R.ImmortalReference=R.AsyncReferenceCollection=R.ReferenceCollection=R.RefCountedDisposable=R.MandatoryMutableDisposable=R.MutableDisposable=R.Disposable=R.DisposableStore=R.DisposableTracker=R.GCBasedDisposableTracker=void 0;R.setDisposableTracker=ms;R.trackDisposable=We;R.markAsDisposed=je;R.markAsSingleton=na;R.isDisposable=ps;R.dispose=lt;R.disposeIfDisposable=ra;R.combinedDisposable=ia;R.toDisposable=wr;R.disposeOnReturn=sa;R.thenIfNotDisposed=oa;R.thenRegisterOrDispose=ua;var fs=Ji(),Zu=Un(),ds=rs(),Xu=Kn(),Ju=cs(),hs=Ue(),ea=!1,qe=null,hr=class{static{s(this,"GCBasedDisposableTracker")}constructor(){this._registry=new FinalizationRegistry(e=>{console.warn(`[LEAKED DISPOSABLE] ${e}`)})}trackDisposable(e){let n=new Error("CREATED via:").stack;this._registry.register(e,n,e)}setParent(e,n){n?this._registry.unregister(e):this.trackDisposable(e)}markAsDisposed(e){this._registry.unregister(e)}markAsSingleton(e){this._registry.unregister(e)}};R.GCBasedDisposableTracker=hr;var dr=class t{static{s(this,"DisposableTracker")}constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let n=this.livingDisposables.get(e);return n||(n={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,n)),n}trackDisposable(e){let n=this.getDisposableData(e);n.source||(n.source=new Error().stack)}setParent(e,n){let r=this.getDisposableData(e);r.parent=n}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,n){let r=n.get(e);if(r)return r;let i=e.parent?this.getRootParent(this.getDisposableData(e.parent),n):e;return n.set(e,i),i}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,r])=>r.source!==null&&!this.getRootParent(r,e).isSingleton).flatMap(([r])=>r)}computeLeakingDisposables(e=10,n){let r;if(n)r=n;else{let l=new Map,c=[...this.livingDisposables.values()].filter(f=>f.source!==null&&!this.getRootParent(f,l).isSingleton);if(c.length===0)return;let d=new Set(c.map(f=>f.value));if(r=c.filter(f=>!(f.parent&&d.has(f.parent))),r.length===0)throw new Error("There are cyclic diposable chains!")}if(!r)return;function i(l){function c(f,y){for(;f.length>0&&y.some(D=>typeof D=="string"?D===f[0]:f[0].match(D));)f.shift()}s(c,"removePrefix");let d=l.source.split(` +`;return i},"printMap");return e(this._data,0)}};B.NKeyMap=ar});var is=U(ye=>{"use strict";g();Object.defineProperty(ye,"__esModule",{value:!0});ye.ok=Eu;ye.assertNever=Lu;ye.softAssertNever=Nu;ye.assert=Au;ye.softAssert=Tu;ye.assertFn=ku;ye.checkAdjacentItems=xu;var ut=Ue();function Eu(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}s(Eu,"ok");function Lu(t,e="Unreachable"){throw new Error(e)}s(Lu,"assertNever");function Nu(t){}s(Nu,"softAssertNever");function Au(t,e="unexpected state"){if(!t)throw typeof e=="string"?new ut.BugIndicatingError(`Assertion Failed: ${e}`):e}s(Au,"assert");function Tu(t,e="Soft Assertion Failed"){t||(0,ut.onUnexpectedError)(new ut.BugIndicatingError(e))}s(Tu,"softAssert");function ku(t){if(!t()){debugger;t(),(0,ut.onUnexpectedError)(new ut.BugIndicatingError("Assertion Failed"))}}s(ku,"assertFn");function xu(t,e){let n=0;for(;n{"use strict";g();Object.defineProperty(q,"__esModule",{value:!0});q.isOneOf=void 0;q.isString=lr;q.isStringArray=Iu;q.isArrayOf=ss;q.isObject=os;q.isTypedArray=Su;q.isNumber=Ru;q.isIterable=Ou;q.isAsyncIterable=Du;q.isBoolean=Mu;q.isUndefined=us;q.isDefined=Fu;q.isUndefinedOrNull=Ot;q.assertType=Uu;q.assertReturnsDefined=qu;q.assertDefined=Wu;q.assertReturnsAllDefined=ju;q.typeCheck=Bu;q.isEmptyObject=Hu;q.isFunction=cr;q.areFunctions=Gu;q.validateConstraints=Ku;q.validateConstraint=as;q.upcast=Vu;q.hasKey=Qu;var Pu=is();function lr(t){return typeof t=="string"}s(lr,"isString");function Iu(t){return ss(t,lr)}s(Iu,"isStringArray");function ss(t,e){return Array.isArray(t)&&t.every(e)}s(ss,"isArrayOf");function os(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}s(os,"isObject");function Su(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}s(Su,"isTypedArray");function Ru(t){return typeof t=="number"&&!isNaN(t)}s(Ru,"isNumber");function Ou(t){return!!t&&typeof t[Symbol.iterator]=="function"}s(Ou,"isIterable");function Du(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}s(Du,"isAsyncIterable");function Mu(t){return t===!0||t===!1}s(Mu,"isBoolean");function us(t){return typeof t>"u"}s(us,"isUndefined");function Fu(t){return!Ot(t)}s(Fu,"isDefined");function Ot(t){return us(t)||t===null}s(Ot,"isUndefinedOrNull");function Uu(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}s(Uu,"assertType");function qu(t){return(0,Pu.assert)(t!=null,"Argument is `undefined` or `null`."),t}s(qu,"assertReturnsDefined");function Wu(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}s(Wu,"assertDefined");function ju(...t){let e=[];for(let n=0;ne.includes(t),"isOneOf");q.isOneOf=zu;function Bu(t){}s(Bu,"typeCheck");var $u=Object.prototype.hasOwnProperty;function Hu(t){if(!os(t))return!1;for(let e in t)if($u.call(t,e))return!1;return!0}s(Hu,"isEmptyObject");function cr(t){return typeof t=="function"}s(cr,"isFunction");function Gu(...t){return t.length>0&&t.every(cr)}s(Gu,"areFunctions");function Ku(t,e){let n=Math.min(t.length,e.length);for(let r=0;r{"use strict";g();Object.defineProperty(Dt,"__esModule",{value:!0});Dt.Iterable=void 0;var Yu=fr(),ls;(function(t){function e(A){return!!A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}s(e,"is"),t.is=e;let n=Object.freeze([]);function r(){return n}s(r,"empty"),t.empty=r;function*i(A){yield A}s(i,"single"),t.single=i;function o(A){return e(A)?A:i(A)}s(o,"wrap"),t.wrap=o;function u(A){return A??n}s(u,"from"),t.from=u;function*a(A){for(let k=A.length-1;k>=0;k--)yield A[k]}s(a,"reverse"),t.reverse=a;function l(A){return!A||A[Symbol.iterator]().next().done===!0}s(l,"isEmpty"),t.isEmpty=l;function c(A){return A[Symbol.iterator]().next().value}s(c,"first"),t.first=c;function d(A,k){let F=0;for(let te of A)if(k(te,F++))return!0;return!1}s(d,"some"),t.some=d;function f(A,k){let F=0;for(let te of A)if(!k(te,F++))return!1;return!0}s(f,"every"),t.every=f;function y(A,k){for(let F of A)if(k(F))return F}s(y,"find"),t.find=y;function*D(A,k){for(let F of A)k(F)&&(yield F)}s(D,"filter"),t.filter=D;function*$(A,k){let F=0;for(let te of A)yield k(te,F++)}s($,"map"),t.map=$;function*H(A,k){let F=0;for(let te of A)yield*k(te,F++)}s(H,"flatMap"),t.flatMap=H;function*X(...A){for(let k of A)(0,Yu.isIterable)(k)?yield*k:yield k}s(X,"concat"),t.concat=X;function de(A,k,F){let te=F;for(let Ke of A)te=k(te,Ke);return te}s(de,"reduce"),t.reduce=de;function ue(A){let k=0;for(let F of A)k++;return k}s(ue,"length"),t.length=ue;function*Q(A,k,F=A.length){for(k<-A.length&&(k=0),k<0&&(k+=A.length),F<0?F+=A.length:F>A.length&&(F=A.length);k{"use strict";g();Object.defineProperty(R,"__esModule",{value:!0});R.DisposableResourceMap=R.DisposableSet=R.DisposableMap=R.ImmortalReference=R.AsyncReferenceCollection=R.ReferenceCollection=R.RefCountedDisposable=R.MandatoryMutableDisposable=R.MutableDisposable=R.Disposable=R.DisposableStore=R.DisposableTracker=R.GCBasedDisposableTracker=void 0;R.setDisposableTracker=ms;R.trackDisposable=We;R.markAsDisposed=je;R.markAsSingleton=na;R.isDisposable=ps;R.dispose=lt;R.disposeIfDisposable=ra;R.combinedDisposable=ia;R.toDisposable=wr;R.disposeOnReturn=sa;R.thenIfNotDisposed=oa;R.thenRegisterOrDispose=ua;var fs=Ji(),Zu=Un(),ds=rs(),Xu=Kn(),Ju=cs(),hs=Ue(),ea=!1,qe=null,hr=class{static{s(this,"GCBasedDisposableTracker")}constructor(){this._registry=new FinalizationRegistry(e=>{console.warn(`[LEAKED DISPOSABLE] ${e}`)})}trackDisposable(e){let n=new Error("CREATED via:").stack;this._registry.register(e,n,e)}setParent(e,n){n?this._registry.unregister(e):this.trackDisposable(e)}markAsDisposed(e){this._registry.unregister(e)}markAsSingleton(e){this._registry.unregister(e)}};R.GCBasedDisposableTracker=hr;var dr=class t{static{s(this,"DisposableTracker")}constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let n=this.livingDisposables.get(e);return n||(n={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,n)),n}trackDisposable(e){let n=this.getDisposableData(e);n.source||(n.source=new Error().stack)}setParent(e,n){let r=this.getDisposableData(e);r.parent=n}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,n){let r=n.get(e);if(r)return r;let i=e.parent?this.getRootParent(this.getDisposableData(e.parent),n):e;return n.set(e,i),i}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,r])=>r.source!==null&&!this.getRootParent(r,e).isSingleton).flatMap(([r])=>r)}computeLeakingDisposables(e=10,n){let r;if(n)r=n;else{let l=new Map,c=[...this.livingDisposables.values()].filter(f=>f.source!==null&&!this.getRootParent(f,l).isSingleton);if(c.length===0)return;let d=new Set(c.map(f=>f.value));if(r=c.filter(f=>!(f.parent&&d.has(f.parent))),r.length===0)throw new Error("There are cyclic diposable chains!")}if(!r)return;function i(l){function c(f,y){for(;f.length>0&&y.some(D=>typeof D=="string"?D===f[0]:f[0].match(D));)f.shift()}s(c,"removePrefix");let d=l.source.split(` `).map(f=>f.trim().replace("at ","")).filter(f=>f!=="");return c(d,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),d.reverse()}s(i,"getStackTracePath");let o=new ds.SetMap;for(let l of r){let c=i(l);for(let d=0;d<=c.length;d++)o.add(c.slice(0,d).join(` `),l)}r.sort((0,fs.compareBy)(l=>l.idx,fs.numberComparator));let u="",a=0;for(let l of r.slice(0,e)){a++;let c=i(l),d=[];for(let f=0;fi(Z)[f]),Z=>Z);delete H[c[f]];for(let[Z,de]of Object.entries(H))de&&d.unshift(` - stacktraces of ${de.length} other leaks continue with ${Z}`);d.unshift(y)}u+=` +`)),H=(0,Zu.groupBy)([...$].map(X=>i(X)[f]),X=>X);delete H[c[f]];for(let[X,de]of Object.entries(H))de&&d.unshift(` - stacktraces of ${de.length} other leaks continue with ${X}`);d.unshift(y)}u+=` ==================== Leaking disposable ${a}/${r.length}: ${l.value.constructor.name} ==================== @@ -22,10 +22,10 @@ ${d.join(` ... and ${r.length-e} more leaking disposables -`),{leaks:r,details:u}}};R.DisposableTracker=dr;function ms(t){qe=t}s(ms,"setDisposableTracker");if(ea){let t="__is_disposable_tracked__";ms(new class{trackDisposable(e){let n=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(n)},3e3)}setParent(e,n){if(e&&e!==Qe.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==Qe.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function We(t){return qe?.trackDisposable(t),t}s(We,"trackDisposable");function je(t){qe?.markAsDisposed(t)}s(je,"markAsDisposed");function ve(t,e){qe?.setParent(t,e)}s(ve,"setParentOfDisposable");function ta(t,e){if(qe)for(let n of t)qe.setParent(n,e)}s(ta,"setParentOfDisposables");function na(t){return qe?.markAsSingleton(t),t}s(na,"markAsSingleton");function ps(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}s(ps,"isDisposable");function lt(t){if(Ju.Iterable.is(t)){let e=[];for(let n of t)if(n)try{n.dispose()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}s(lt,"dispose");function ra(t){for(let e of t)ps(e)&&e.dispose();return[]}s(ra,"disposeIfDisposable");function ia(...t){let e=wr(()=>lt(t));return ta(t,e),e}s(ia,"combinedDisposable");var mr=class{static{s(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,We(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,je(this),this._fn()}}};function wr(t){return new mr(t)}s(wr,"toDisposable");var at=class t{static{s(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,We(this)}dispose(){this._isDisposed||(je(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{lt(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===Qe.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return ve(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&ve(e,null)}assertNotDisposed(){this._isDisposed&&(0,hs.onUnexpectedError)(new hs.BugIndicatingError("Object disposed"))}};R.DisposableStore=at;var Qe=class{static{s(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new at,We(this),ve(this._store,this)}dispose(){je(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};R.Disposable=Qe;var Mt=class{static{s(this,"MutableDisposable")}constructor(){this._isDisposed=!1,We(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&ve(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,je(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&ve(e,null),e}};R.MutableDisposable=Mt;var pr=class{static{s(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new Mt,this._isDisposed=!1,this._disposable.value=e}get value(){return this._disposable.value}set value(e){this._isDisposed||e===this._disposable.value||(this._disposable.value=e)}dispose(){this._isDisposed=!0,this._disposable.dispose()}};R.MandatoryMutableDisposable=pr;var gr=class{static{s(this,"RefCountedDisposable")}constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}};R.RefCountedDisposable=gr;var _r=class{static{s(this,"ReferenceCollection")}constructor(){this.references=new Map}acquire(e,...n){let r=this.references.get(e);r||(r={counter:0,object:this.createReferencedObject(e,...n)},this.references.set(e,r));let{object:i}=r,o=(0,Xu.createSingleCallFunction)(()=>{--r.counter===0&&(this.destroyReferencedObject(e,r.object),this.references.delete(e))});return r.counter++,{object:i,dispose:o}}};R.ReferenceCollection=_r;var br=class{static{s(this,"AsyncReferenceCollection")}constructor(e){this.referenceCollection=e}async acquire(e,...n){let r=this.referenceCollection.acquire(e,...n);try{return{object:await r.object,dispose:s(()=>r.dispose(),"dispose")}}catch(i){throw r.dispose(),i}}};R.AsyncReferenceCollection=br;var Cr=class{static{s(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};R.ImmortalReference=Cr;function sa(t){let e=new at;try{t(e)}finally{e.dispose()}}s(sa,"disposeOnReturn");var Ft=class{static{s(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,We(this)}dispose(){je(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{lt(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,n,r=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),r||this._store.get(e)?.dispose(),this._store.set(e,n),ve(n,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let n=this._store.get(e);return n&&ve(n,null),this._store.delete(e),n}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};R.DisposableMap=Ft;var yr=class{static{s(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,We(this)}dispose(){je(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{lt(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}add(e){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableSet that has already been disposed of. The added object will be leaked!").stack),this._store.add(e),ve(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return ve(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};R.DisposableSet=yr;function oa(t,e){let n=!1;return t.then(r=>{n||e(r)}),wr(()=>{n=!0})}s(oa,"thenIfNotDisposed");function ua(t,e){return t.then(n=>(e.isDisposed?n.dispose():e.add(n),n))}s(ua,"thenRegisterOrDispose");var vr=class extends Ft{static{s(this,"DisposableResourceMap")}constructor(){super(new ds.ResourceMap)}};R.DisposableResourceMap=vr});var gs=U(qt=>{"use strict";g();Object.defineProperty(qt,"__esModule",{value:!0});qt.LinkedList=void 0;var z=class t{static{s(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}},Er=class{static{s(this,"LinkedList")}constructor(){this._first=z.Undefined,this._last=z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===z.Undefined}clear(){let e=this._first;for(;e!==z.Undefined;){let n=e.next;e.prev=z.Undefined,e.next=z.Undefined,e=n}this._first=z.Undefined,this._last=z.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,n){let r=new z(e);if(this._first===z.Undefined)this._first=r,this._last=r;else if(n){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(r))}}shift(){if(this._first!==z.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==z.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==z.Undefined)return this._last.element}_remove(e){if(e.prev!==z.Undefined&&e.next!==z.Undefined){let n=e.prev;n.next=e.next,e.next.prev=n}else e.prev===z.Undefined&&e.next===z.Undefined?(this._first=z.Undefined,this._last=z.Undefined):e.next===z.Undefined?(this._last=this._last.prev,this._last.next=z.Undefined):e.prev===z.Undefined&&(this._first=this._first.next,this._first.prev=z.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==z.Undefined;)yield e.element,e=e.next}};qt.LinkedList=Er});var ys=U(Ye=>{"use strict";g();Object.defineProperty(Ye,"__esModule",{value:!0});Ye.getNLSMessages=_s;Ye.getNLSLanguage=bs;Ye.localize=la;Ye.localize2=ca;function _s(){return globalThis._VSCODE_NLS_MESSAGES}s(_s,"getNLSMessages");function bs(){return globalThis._VSCODE_NLS_LANGUAGE}s(bs,"getNLSLanguage");var aa=bs()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function Wt(t,e){let n;return e.length===0?n=t:n=t.replace(/\{(\d+)\}/g,(r,i)=>{let o=i[0],u=e[o],a=r;return typeof u=="string"?a=u:(typeof u=="number"||typeof u=="boolean"||u===void 0||u===null)&&(a=String(u)),a}),aa&&(n="\uFF3B"+n.replace(/[aouei]/g,"$&$&")+"\uFF3D"),n}s(Wt,"_format");function la(t,e,...n){return Wt(typeof t=="number"?Cs(t,e):e,n)}s(la,"localize");function Cs(t,e){let n=_s()?.[t];if(typeof n!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return n}s(Cs,"lookupMessage");function ca(t,e,...n){let r;typeof t=="number"?r=Cs(t,e):r=e;let i=Wt(r,n);return{value:i,original:e===r?i:Wt(e,n)}}s(ca,"localize2")});var ze=U(m=>{"use strict";g();var fa=m&&m.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),ha=m&&m.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),da=m&&m.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i=0,dt=we.indexOf("Macintosh")>=0,Ar=(we.indexOf("Macintosh")>=0||we.indexOf("iPad")>=0||we.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ft=we.indexOf("Linux")>=0,ks=we?.indexOf("Mobi")>=0,Nr=!0,jt=ma.getNLSLanguage()||m.LANGUAGE_DEFAULT,ct=navigator.language.toLowerCase(),Lr=ct):console.error("Unable to resolve platform.");function ga(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}s(ga,"PlatformToString");var zt=0;dt?zt=1:ht?zt=3:ft&&(zt=2);m.isWindows=ht;m.isMacintosh=dt;m.isLinux=ft;m.isLinuxSnap=Ls;m.isNative=Ns;m.isElectron=As;m.isWeb=Nr;m.isWebWorker=Nr&&typeof Ee.importScripts=="function";m.webWorkerOrigin=m.isWebWorker?Ee.origin:void 0;m.isIOS=Ar;m.isMobile=ks;m.isCI=Ts;m.platform=zt;m.userAgent=we;m.language=jt;var vs;(function(t){function e(){return m.language}s(e,"value"),t.value=e;function n(){return m.language.length===2?m.language==="en":m.language.length>=3?m.language[0]==="e"&&m.language[1]==="n"&&m.language[2]==="-":!1}s(n,"isDefaultVariant"),t.isDefaultVariant=n;function r(){return m.language==="en"}s(r,"isDefault"),t.isDefault=r})(vs||(m.Language=vs={}));m.locale=ct;m.platformLocale=Lr;m.translationsConfigFile=xs;m.setTimeout0IsFaster=typeof Ee.postMessage=="function"&&!Ee.importScripts;m.setTimeout0=(()=>{if(m.setTimeout0IsFaster){let t=[];Ee.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,i=t.length;r{let r=++e;t.push({id:r,callback:n}),Ee.postMessage({vscodeScheduleAsyncWork:r},"*")}}return t=>setTimeout(t)})();m.OS=dt||Ar?2:ht?1:3;var ws=!0,Es=!1;function _a(){if(!Es){Es=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,ws=new Uint16Array(t.buffer)[0]===513}return ws}s(_a,"isLittleEndian");m.isChrome=!!(m.userAgent&&m.userAgent.indexOf("Chrome")>=0);m.isFirefox=!!(m.userAgent&&m.userAgent.indexOf("Firefox")>=0);m.isSafari=!!(!m.isChrome&&m.userAgent&&m.userAgent.indexOf("Safari")>=0);m.isEdge=!!(m.userAgent&&m.userAgent.indexOf("Edg/")>=0);m.isAndroid=!!(m.userAgent&&m.userAgent.indexOf("Android")>=0);function ba(t){return parseFloat(t)>=25}s(ba,"isTahoeOrNewer")});var kr=U(ge=>{"use strict";g();Object.defineProperty(ge,"__esModule",{value:!0});ge.arch=ge.platform=ge.env=ge.cwd=void 0;var Is=ze(),Be,Tr=globalThis.vscode;if(typeof Tr<"u"&&typeof Tr.process<"u"){let t=Tr.process;Be={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"?Be={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Be={get platform(){return Is.isWindows?"win32":Is.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};ge.cwd=Be.cwd;ge.env=Be.env;ge.platform=Be.platform;ge.arch=Be.arch});var Pr=U(Bt=>{"use strict";g();Object.defineProperty(Bt,"__esModule",{value:!0});Bt.StopWatch=void 0;var Ca=globalThis.performance.now.bind(globalThis.performance),xr=class t{static{s(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:Ca,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};Bt.StopWatch=xr});var jr=U(M=>{"use strict";g();Object.defineProperty(M,"__esModule",{value:!0});M.ValueWithChangeEvent=M.Relay=M.EventBufferer=M.DynamicListEventMultiplexer=M.EventMultiplexer=M.MicrotaskEmitter=M.DebounceEmitter=M.PauseableEmitter=M.AsyncEmitter=M.createEventDeliveryQueue=M.Emitter=M.ListenerRefusalError=M.ListenerLeakError=M.EventProfiling=M.Event=void 0;M.setGlobalLeakWarningThreshold=Aa;M.trackSetChanges=Pa;var ya=Un(),mt=Ue(),va=Kn(),ae=Ut(),Ms=gs(),wa=kr(),Ea=Pr(),Ss=!1,La=!1,Na=100,Rs=6e4;function Os(){return!!wa.env.VSCODE_DEV}s(Os,"_isBufferLeakWarningEnabled");var $t;(function(t){t.None=()=>ae.Disposable.None;function e(E){if(La){let{onDidAddListener:b}=E,v=Xe.create(),w=0;E.onDidAddListener=()=>{++w===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),v.print()),b?.()}}}s(e,"_addLeakageTraceLogic");function n(E,b,v){return D(E,()=>{},0,void 0,b??!0,void 0,v)}s(n,"defer"),t.defer=n;function r(E){return(b,v=null,w)=>{let L=!1,T;return T=E(I=>{if(!L)return T?T.dispose():L=!0,b.call(v,I)},null,w),L&&T.dispose(),T}}s(r,"once"),t.once=r;function i(E,b){return t.once(t.filter(E,b))}s(i,"onceIf"),t.onceIf=i;function o(E,b,v){return f((w,L=null,T)=>E(I=>w.call(L,b(I)),null,T),v)}s(o,"map"),t.map=o;function u(E,b,v){return f((w,L=null,T)=>E(I=>{b(I),w.call(L,I)},null,T),v)}s(u,"forEach"),t.forEach=u;function a(E,b,v){return f((w,L=null,T)=>E(I=>b(I)&&w.call(L,I),null,T),v)}s(a,"filter"),t.filter=a;function l(E){return E}s(l,"signal"),t.signal=l;function c(...E){return(b,v=null,w)=>{let L=(0,ae.combinedDisposable)(...E.map(T=>T(I=>b.call(v,I))));return y(L,w)}}s(c,"any"),t.any=c;function d(E,b,v,w){let L=v;return o(E,T=>(L=b(L,T),L),w)}s(d,"reduce"),t.reduce=d;function f(E,b){let v,w={onWillAddFirstListener(){v=E(L.fire,L)},onDidRemoveLastListener(){v?.dispose()}};b||e(w);let L=new ne(w);return b?.add(L),L.event}s(f,"snapshot");function y(E,b){return b instanceof Array?b.push(E):b&&b.add(E),E}s(y,"addAndReturnDisposable");function D(E,b,v=100,w=!1,L=!1,T,I){let X,j,te,J=0,re,xe={leakWarningThreshold:T,onWillAddFirstListener(){X=E(W1=>{J++,j=b(j,W1),w&&!te&&(Ve.fire(j),j=void 0),re=s(()=>{let j1=j;j=void 0,te=void 0,(!w||J>1)&&Ve.fire(j1),J=0},"doFire"),typeof v=="number"?(te&&clearTimeout(te),te=setTimeout(re,v)):te===void 0&&(te=null,queueMicrotask(re))})},onWillRemoveListener(){L&&J>0&&re?.()},onDidRemoveLastListener(){re=void 0,X.dispose()}};I||e(xe);let Ve=new ne(xe);return I?.add(Ve),Ve.event}s(D,"debounce"),t.debounce=D;function $(E,b=0,v,w){return t.debounce(E,(L,T)=>L?(L.push(T),L):[T],b,void 0,v??!0,void 0,w)}s($,"accumulate"),t.accumulate=$;function H(E,b,v=100,w=!0,L=!0,T,I){let X,j,te,J=0,re={leakWarningThreshold:T,onWillAddFirstListener(){X=E(Ve=>{J++,j=b(j,Ve),te===void 0&&(w&&(xe.fire(j),j=void 0,J=0),typeof v=="number"?te=setTimeout(()=>{L&&J>0&&xe.fire(j),j=void 0,te=void 0,J=0},v):(te=0,queueMicrotask(()=>{L&&J>0&&xe.fire(j),j=void 0,te=void 0,J=0})))})},onDidRemoveLastListener(){X.dispose()}};I||e(re);let xe=new ne(re);return I?.add(xe),xe.event}s(H,"throttle"),t.throttle=H;function Z(E,b=(w,L)=>w===L,v){let w=!0,L;return a(E,T=>{let I=w||!b(T,L);return w=!1,L=T,I},v)}s(Z,"latch"),t.latch=Z;function de(E,b,v){return[t.filter(E,b,v),t.filter(E,w=>!b(w),v)]}s(de,"split"),t.split=de;function oe(E,b,v=!1,w=[],L){let T=w.slice(),I;Os()&&(I={stack:Xe.create(),timerId:setTimeout(()=>{T&&T.length>0&&I&&!I.warned&&(I.warned=!0,console.warn(`[Event.buffer][${b}] potential LEAK detected: ${T.length} events buffered for ${Rs/1e3}s without being consumed. Buffered here:`),I.stack.print())},Rs),warned:!1},L&&L.add((0,ae.toDisposable)(()=>clearTimeout(I.timerId))));let X=s(()=>{I&&clearTimeout(I.timerId)},"clearLeakWarningTimer"),j=E(re=>{T?(T.push(re),Os()&&I&&!I.warned&&T.length>=Na&&(I.warned=!0,console.warn(`[Event.buffer][${b}] potential LEAK detected: ${T.length} events buffered without being consumed. Buffered here:`),I.stack.print())):J.fire(re)});L&&L.add(j);let te=s(()=>{T?.forEach(re=>J.fire(re)),T=null,X()},"flush"),J=new ne({onWillAddFirstListener(){j||(j=E(re=>J.fire(re)),L&&L.add(j))},onDidAddFirstListener(){T&&(v?setTimeout(te):te())},onDidRemoveLastListener(){j&&j.dispose(),j=null,X()}});return L&&L.add(J),J.event}s(oe,"buffer"),t.buffer=oe;function V(E,b){return s((w,L,T)=>{let I=b(new kn);return E(function(X){let j=I.evaluate(X);j!==Ge&&w.call(L,j)},void 0,T)},"fn")}s(V,"chain"),t.chain=V;let Ge=Symbol("HaltChainable");class kn{static{s(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(b){return this.steps.push(b),this}forEach(b){return this.steps.push(v=>(b(v),v)),this}filter(b){return this.steps.push(v=>b(v)?v:Ge),this}reduce(b,v){let w=v;return this.steps.push(L=>(w=b(w,L),w)),this}latch(b=(v,w)=>v===w){let v=!0,w;return this.steps.push(L=>{let T=v||!b(L,w);return v=!1,w=L,T?L:Ge}),this}evaluate(b){for(let v of this.steps)if(b=v(b),b===Ge)break;return b}}function xn(E,b,v=w=>w){let w=s((...X)=>I.fire(v(...X)),"fn"),L=s(()=>E.on(b,w),"onFirstListenerAdd"),T=s(()=>E.removeListener(b,w),"onLastListenerRemove"),I=new ne({onWillAddFirstListener:L,onDidRemoveLastListener:T});return I.event}s(xn,"fromNodeEventEmitter"),t.fromNodeEventEmitter=xn;function A(E,b,v=w=>w){let w=s((...X)=>I.fire(v(...X)),"fn"),L=s(()=>E.addEventListener(b,w),"onFirstListenerAdd"),T=s(()=>E.removeEventListener(b,w),"onLastListenerRemove"),I=new ne({onWillAddFirstListener:L,onDidRemoveLastListener:T});return I.event}s(A,"fromDOMEventEmitter"),t.fromDOMEventEmitter=A;function k(E,b){let v,w,L=new Promise(T=>{w=r(E)(T),Wr(w,b),v=s(()=>{Ds(w,b)},"cancelRef")});return L.cancel=v,b&&L.finally(()=>Ds(w,b)),L}s(k,"toPromise"),t.toPromise=k;function F(E,b){return E(v=>b.fire(v))}s(F,"forward"),t.forward=F;function ee(E,b,v){return b(v),E(w=>b(w))}s(ee,"runAndSubscribe"),t.runAndSubscribe=ee;class Ke{static{s(this,"EmitterObserver")}constructor(b,v){this._observable=b,this._counter=0,this._hasChanged=!1;let w={onWillAddFirstListener:s(()=>{b.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:s(()=>{b.removeObserver(this)},"onDidRemoveLastListener")};v||e(w),this.emitter=new ne(w),v&&v.add(this.emitter)}beginUpdate(b){this._counter++}handlePossibleChange(b){}handleChange(b,v){this._hasChanged=!0}endUpdate(b){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Nt(E,b){return new Ke(E,b).emitter.event}s(Nt,"fromObservable"),t.fromObservable=Nt;function q1(E){return(b,v,w)=>{let L=0,T=!1,I={beginUpdate(){L++},endUpdate(){L--,L===0&&(E.reportChanges(),T&&(T=!1,b.call(v)))},handlePossibleChange(){},handleChange(){T=!0}};E.addObserver(I),E.reportChanges();let X={dispose(){E.removeObserver(I)}};return Wr(X,w),X}}s(q1,"fromObservableLight"),t.fromObservableLight=q1})($t||(M.Event=$t={}));var Ht=class t{static{s(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${t._idPool++}`,t.all.add(this)}start(e){this._stopWatch=new Ea.StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};M.EventProfiling=Ht;var pt=-1;function Aa(t){let e=pt;return pt=t,{dispose(){pt=e}}}s(Aa,"setGlobalLeakWarningThreshold");var Ir=class t{static{s(this,"LeakageMonitor")}static{this._idPool=1}constructor(e,n,r=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,n){let r=this.threshold;if(r<=0||n.3?"dominated":"popular",d=new gt(c,l,o,n,a);this._errorHandler(d)}return()=>{let o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,n=0;for(let[r,i]of this._stacks)(!e||n{e[t]||console.log(n)},3e3)}setParent(e,n){if(e&&e!==Qe.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==Qe.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function We(t){return qe?.trackDisposable(t),t}s(We,"trackDisposable");function je(t){qe?.markAsDisposed(t)}s(je,"markAsDisposed");function ve(t,e){qe?.setParent(t,e)}s(ve,"setParentOfDisposable");function ta(t,e){if(qe)for(let n of t)qe.setParent(n,e)}s(ta,"setParentOfDisposables");function na(t){return qe?.markAsSingleton(t),t}s(na,"markAsSingleton");function ps(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}s(ps,"isDisposable");function lt(t){if(Ju.Iterable.is(t)){let e=[];for(let n of t)if(n)try{n.dispose()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}s(lt,"dispose");function ra(t){for(let e of t)ps(e)&&e.dispose();return[]}s(ra,"disposeIfDisposable");function ia(...t){let e=wr(()=>lt(t));return ta(t,e),e}s(ia,"combinedDisposable");var mr=class{static{s(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,We(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,je(this),this._fn()}}};function wr(t){return new mr(t)}s(wr,"toDisposable");var at=class t{static{s(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,We(this)}dispose(){this._isDisposed||(je(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{lt(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===Qe.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return ve(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&ve(e,null)}assertNotDisposed(){this._isDisposed&&(0,hs.onUnexpectedError)(new hs.BugIndicatingError("Object disposed"))}};R.DisposableStore=at;var Qe=class{static{s(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new at,We(this),ve(this._store,this)}dispose(){je(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};R.Disposable=Qe;var Mt=class{static{s(this,"MutableDisposable")}constructor(){this._isDisposed=!1,We(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&ve(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,je(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&ve(e,null),e}};R.MutableDisposable=Mt;var pr=class{static{s(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new Mt,this._isDisposed=!1,this._disposable.value=e}get value(){return this._disposable.value}set value(e){this._isDisposed||e===this._disposable.value||(this._disposable.value=e)}dispose(){this._isDisposed=!0,this._disposable.dispose()}};R.MandatoryMutableDisposable=pr;var gr=class{static{s(this,"RefCountedDisposable")}constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}};R.RefCountedDisposable=gr;var _r=class{static{s(this,"ReferenceCollection")}constructor(){this.references=new Map}acquire(e,...n){let r=this.references.get(e);r||(r={counter:0,object:this.createReferencedObject(e,...n)},this.references.set(e,r));let{object:i}=r,o=(0,Xu.createSingleCallFunction)(()=>{--r.counter===0&&(this.destroyReferencedObject(e,r.object),this.references.delete(e))});return r.counter++,{object:i,dispose:o}}};R.ReferenceCollection=_r;var br=class{static{s(this,"AsyncReferenceCollection")}constructor(e){this.referenceCollection=e}async acquire(e,...n){let r=this.referenceCollection.acquire(e,...n);try{return{object:await r.object,dispose:s(()=>r.dispose(),"dispose")}}catch(i){throw r.dispose(),i}}};R.AsyncReferenceCollection=br;var Cr=class{static{s(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};R.ImmortalReference=Cr;function sa(t){let e=new at;try{t(e)}finally{e.dispose()}}s(sa,"disposeOnReturn");var Ft=class{static{s(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,We(this)}dispose(){je(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{lt(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,n,r=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),r||this._store.get(e)?.dispose(),this._store.set(e,n),ve(n,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let n=this._store.get(e);return n&&ve(n,null),this._store.delete(e),n}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};R.DisposableMap=Ft;var yr=class{static{s(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,We(this)}dispose(){je(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{lt(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}add(e){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableSet that has already been disposed of. The added object will be leaked!").stack),this._store.add(e),ve(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return ve(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};R.DisposableSet=yr;function oa(t,e){let n=!1;return t.then(r=>{n||e(r)}),wr(()=>{n=!0})}s(oa,"thenIfNotDisposed");function ua(t,e){return t.then(n=>(e.isDisposed?n.dispose():e.add(n),n))}s(ua,"thenRegisterOrDispose");var vr=class extends Ft{static{s(this,"DisposableResourceMap")}constructor(){super(new ds.ResourceMap)}};R.DisposableResourceMap=vr});var gs=U(qt=>{"use strict";g();Object.defineProperty(qt,"__esModule",{value:!0});qt.LinkedList=void 0;var z=class t{static{s(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}},Er=class{static{s(this,"LinkedList")}constructor(){this._first=z.Undefined,this._last=z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===z.Undefined}clear(){let e=this._first;for(;e!==z.Undefined;){let n=e.next;e.prev=z.Undefined,e.next=z.Undefined,e=n}this._first=z.Undefined,this._last=z.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,n){let r=new z(e);if(this._first===z.Undefined)this._first=r,this._last=r;else if(n){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(r))}}shift(){if(this._first!==z.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==z.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==z.Undefined)return this._last.element}_remove(e){if(e.prev!==z.Undefined&&e.next!==z.Undefined){let n=e.prev;n.next=e.next,e.next.prev=n}else e.prev===z.Undefined&&e.next===z.Undefined?(this._first=z.Undefined,this._last=z.Undefined):e.next===z.Undefined?(this._last=this._last.prev,this._last.next=z.Undefined):e.prev===z.Undefined&&(this._first=this._first.next,this._first.prev=z.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==z.Undefined;)yield e.element,e=e.next}};qt.LinkedList=Er});var ys=U(Ye=>{"use strict";g();Object.defineProperty(Ye,"__esModule",{value:!0});Ye.getNLSMessages=_s;Ye.getNLSLanguage=bs;Ye.localize=la;Ye.localize2=ca;function _s(){return globalThis._VSCODE_NLS_MESSAGES}s(_s,"getNLSMessages");function bs(){return globalThis._VSCODE_NLS_LANGUAGE}s(bs,"getNLSLanguage");var aa=bs()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function Wt(t,e){let n;return e.length===0?n=t:n=t.replace(/\{(\d+)\}/g,(r,i)=>{let o=i[0],u=e[o],a=r;return typeof u=="string"?a=u:(typeof u=="number"||typeof u=="boolean"||u===void 0||u===null)&&(a=String(u)),a}),aa&&(n="\uFF3B"+n.replace(/[aouei]/g,"$&$&")+"\uFF3D"),n}s(Wt,"_format");function la(t,e,...n){return Wt(typeof t=="number"?Cs(t,e):e,n)}s(la,"localize");function Cs(t,e){let n=_s()?.[t];if(typeof n!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return n}s(Cs,"lookupMessage");function ca(t,e,...n){let r;typeof t=="number"?r=Cs(t,e):r=e;let i=Wt(r,n);return{value:i,original:e===r?i:Wt(e,n)}}s(ca,"localize2")});var ze=U(m=>{"use strict";g();var fa=m&&m.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),ha=m&&m.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),da=m&&m.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i=0,dt=we.indexOf("Macintosh")>=0,Ar=(we.indexOf("Macintosh")>=0||we.indexOf("iPad")>=0||we.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ft=we.indexOf("Linux")>=0,ks=we?.indexOf("Mobi")>=0,Nr=!0,jt=ma.getNLSLanguage()||m.LANGUAGE_DEFAULT,ct=navigator.language.toLowerCase(),Lr=ct):console.error("Unable to resolve platform.");function ga(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}s(ga,"PlatformToString");var zt=0;dt?zt=1:ht?zt=3:ft&&(zt=2);m.isWindows=ht;m.isMacintosh=dt;m.isLinux=ft;m.isLinuxSnap=Ls;m.isNative=Ns;m.isElectron=As;m.isWeb=Nr;m.isWebWorker=Nr&&typeof Ee.importScripts=="function";m.webWorkerOrigin=m.isWebWorker?Ee.origin:void 0;m.isIOS=Ar;m.isMobile=ks;m.isCI=Ts;m.platform=zt;m.userAgent=we;m.language=jt;var vs;(function(t){function e(){return m.language}s(e,"value"),t.value=e;function n(){return m.language.length===2?m.language==="en":m.language.length>=3?m.language[0]==="e"&&m.language[1]==="n"&&m.language[2]==="-":!1}s(n,"isDefaultVariant"),t.isDefaultVariant=n;function r(){return m.language==="en"}s(r,"isDefault"),t.isDefault=r})(vs||(m.Language=vs={}));m.locale=ct;m.platformLocale=Lr;m.translationsConfigFile=xs;m.setTimeout0IsFaster=typeof Ee.postMessage=="function"&&!Ee.importScripts;m.setTimeout0=(()=>{if(m.setTimeout0IsFaster){let t=[];Ee.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,i=t.length;r{let r=++e;t.push({id:r,callback:n}),Ee.postMessage({vscodeScheduleAsyncWork:r},"*")}}return t=>setTimeout(t)})();m.OS=dt||Ar?2:ht?1:3;var ws=!0,Es=!1;function _a(){if(!Es){Es=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,ws=new Uint16Array(t.buffer)[0]===513}return ws}s(_a,"isLittleEndian");m.isChrome=!!(m.userAgent&&m.userAgent.indexOf("Chrome")>=0);m.isFirefox=!!(m.userAgent&&m.userAgent.indexOf("Firefox")>=0);m.isSafari=!!(!m.isChrome&&m.userAgent&&m.userAgent.indexOf("Safari")>=0);m.isEdge=!!(m.userAgent&&m.userAgent.indexOf("Edg/")>=0);m.isAndroid=!!(m.userAgent&&m.userAgent.indexOf("Android")>=0);function ba(t){return parseFloat(t)>=25}s(ba,"isTahoeOrNewer")});var kr=U(ge=>{"use strict";g();Object.defineProperty(ge,"__esModule",{value:!0});ge.arch=ge.platform=ge.env=ge.cwd=void 0;var Is=ze(),Be,Tr=globalThis.vscode;if(typeof Tr<"u"&&typeof Tr.process<"u"){let t=Tr.process;Be={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"?Be={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Be={get platform(){return Is.isWindows?"win32":Is.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};ge.cwd=Be.cwd;ge.env=Be.env;ge.platform=Be.platform;ge.arch=Be.arch});var Pr=U(Bt=>{"use strict";g();Object.defineProperty(Bt,"__esModule",{value:!0});Bt.StopWatch=void 0;var Ca=globalThis.performance.now.bind(globalThis.performance),xr=class t{static{s(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:Ca,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};Bt.StopWatch=xr});var jr=U(M=>{"use strict";g();Object.defineProperty(M,"__esModule",{value:!0});M.ValueWithChangeEvent=M.Relay=M.EventBufferer=M.DynamicListEventMultiplexer=M.EventMultiplexer=M.MicrotaskEmitter=M.DebounceEmitter=M.PauseableEmitter=M.AsyncEmitter=M.createEventDeliveryQueue=M.Emitter=M.ListenerRefusalError=M.ListenerLeakError=M.EventProfiling=M.Event=void 0;M.setGlobalLeakWarningThreshold=Aa;M.trackSetChanges=Pa;var ya=Un(),mt=Ue(),va=Kn(),le=Ut(),Ms=gs(),wa=kr(),Ea=Pr(),Ss=!1,La=!1,Na=100,Rs=6e4;function Os(){return!!wa.env.VSCODE_DEV}s(Os,"_isBufferLeakWarningEnabled");var $t;(function(t){t.None=()=>le.Disposable.None;function e(E){if(La){let{onDidAddListener:b}=E,v=Xe.create(),w=0;E.onDidAddListener=()=>{++w===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),v.print()),b?.()}}}s(e,"_addLeakageTraceLogic");function n(E,b,v){return D(E,()=>{},0,void 0,b??!0,void 0,v)}s(n,"defer"),t.defer=n;function r(E){return(b,v=null,w)=>{let L=!1,T;return T=E(I=>{if(!L)return T?T.dispose():L=!0,b.call(v,I)},null,w),L&&T.dispose(),T}}s(r,"once"),t.once=r;function i(E,b){return t.once(t.filter(E,b))}s(i,"onceIf"),t.onceIf=i;function o(E,b,v){return f((w,L=null,T)=>E(I=>w.call(L,b(I)),null,T),v)}s(o,"map"),t.map=o;function u(E,b,v){return f((w,L=null,T)=>E(I=>{b(I),w.call(L,I)},null,T),v)}s(u,"forEach"),t.forEach=u;function a(E,b,v){return f((w,L=null,T)=>E(I=>b(I)&&w.call(L,I),null,T),v)}s(a,"filter"),t.filter=a;function l(E){return E}s(l,"signal"),t.signal=l;function c(...E){return(b,v=null,w)=>{let L=(0,le.combinedDisposable)(...E.map(T=>T(I=>b.call(v,I))));return y(L,w)}}s(c,"any"),t.any=c;function d(E,b,v,w){let L=v;return o(E,T=>(L=b(L,T),L),w)}s(d,"reduce"),t.reduce=d;function f(E,b){let v,w={onWillAddFirstListener(){v=E(L.fire,L)},onDidRemoveLastListener(){v?.dispose()}};b||e(w);let L=new re(w);return b?.add(L),L.event}s(f,"snapshot");function y(E,b){return b instanceof Array?b.push(E):b&&b.add(E),E}s(y,"addAndReturnDisposable");function D(E,b,v=100,w=!1,L=!1,T,I){let J,j,ne,ee=0,ie,xe={leakWarningThreshold:T,onWillAddFirstListener(){J=E(W1=>{ee++,j=b(j,W1),w&&!ne&&(Ve.fire(j),j=void 0),ie=s(()=>{let j1=j;j=void 0,ne=void 0,(!w||ee>1)&&Ve.fire(j1),ee=0},"doFire"),typeof v=="number"?(ne&&clearTimeout(ne),ne=setTimeout(ie,v)):ne===void 0&&(ne=null,queueMicrotask(ie))})},onWillRemoveListener(){L&&ee>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,J.dispose()}};I||e(xe);let Ve=new re(xe);return I?.add(Ve),Ve.event}s(D,"debounce"),t.debounce=D;function $(E,b=0,v,w){return t.debounce(E,(L,T)=>L?(L.push(T),L):[T],b,void 0,v??!0,void 0,w)}s($,"accumulate"),t.accumulate=$;function H(E,b,v=100,w=!0,L=!0,T,I){let J,j,ne,ee=0,ie={leakWarningThreshold:T,onWillAddFirstListener(){J=E(Ve=>{ee++,j=b(j,Ve),ne===void 0&&(w&&(xe.fire(j),j=void 0,ee=0),typeof v=="number"?ne=setTimeout(()=>{L&&ee>0&&xe.fire(j),j=void 0,ne=void 0,ee=0},v):(ne=0,queueMicrotask(()=>{L&&ee>0&&xe.fire(j),j=void 0,ne=void 0,ee=0})))})},onDidRemoveLastListener(){J.dispose()}};I||e(ie);let xe=new re(ie);return I?.add(xe),xe.event}s(H,"throttle"),t.throttle=H;function X(E,b=(w,L)=>w===L,v){let w=!0,L;return a(E,T=>{let I=w||!b(T,L);return w=!1,L=T,I},v)}s(X,"latch"),t.latch=X;function de(E,b,v){return[t.filter(E,b,v),t.filter(E,w=>!b(w),v)]}s(de,"split"),t.split=de;function ue(E,b,v=!1,w=[],L){let T=w.slice(),I;Os()&&(I={stack:Xe.create(),timerId:setTimeout(()=>{T&&T.length>0&&I&&!I.warned&&(I.warned=!0,console.warn(`[Event.buffer][${b}] potential LEAK detected: ${T.length} events buffered for ${Rs/1e3}s without being consumed. Buffered here:`),I.stack.print())},Rs),warned:!1},L&&L.add((0,le.toDisposable)(()=>clearTimeout(I.timerId))));let J=s(()=>{I&&clearTimeout(I.timerId)},"clearLeakWarningTimer"),j=E(ie=>{T?(T.push(ie),Os()&&I&&!I.warned&&T.length>=Na&&(I.warned=!0,console.warn(`[Event.buffer][${b}] potential LEAK detected: ${T.length} events buffered without being consumed. Buffered here:`),I.stack.print())):ee.fire(ie)});L&&L.add(j);let ne=s(()=>{T?.forEach(ie=>ee.fire(ie)),T=null,J()},"flush"),ee=new re({onWillAddFirstListener(){j||(j=E(ie=>ee.fire(ie)),L&&L.add(j))},onDidAddFirstListener(){T&&(v?setTimeout(ne):ne())},onDidRemoveLastListener(){j&&j.dispose(),j=null,J()}});return L&&L.add(ee),ee.event}s(ue,"buffer"),t.buffer=ue;function Q(E,b){return s((w,L,T)=>{let I=b(new kn);return E(function(J){let j=I.evaluate(J);j!==Ge&&w.call(L,j)},void 0,T)},"fn")}s(Q,"chain"),t.chain=Q;let Ge=Symbol("HaltChainable");class kn{static{s(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(b){return this.steps.push(b),this}forEach(b){return this.steps.push(v=>(b(v),v)),this}filter(b){return this.steps.push(v=>b(v)?v:Ge),this}reduce(b,v){let w=v;return this.steps.push(L=>(w=b(w,L),w)),this}latch(b=(v,w)=>v===w){let v=!0,w;return this.steps.push(L=>{let T=v||!b(L,w);return v=!1,w=L,T?L:Ge}),this}evaluate(b){for(let v of this.steps)if(b=v(b),b===Ge)break;return b}}function xn(E,b,v=w=>w){let w=s((...J)=>I.fire(v(...J)),"fn"),L=s(()=>E.on(b,w),"onFirstListenerAdd"),T=s(()=>E.removeListener(b,w),"onLastListenerRemove"),I=new re({onWillAddFirstListener:L,onDidRemoveLastListener:T});return I.event}s(xn,"fromNodeEventEmitter"),t.fromNodeEventEmitter=xn;function A(E,b,v=w=>w){let w=s((...J)=>I.fire(v(...J)),"fn"),L=s(()=>E.addEventListener(b,w),"onFirstListenerAdd"),T=s(()=>E.removeEventListener(b,w),"onLastListenerRemove"),I=new re({onWillAddFirstListener:L,onDidRemoveLastListener:T});return I.event}s(A,"fromDOMEventEmitter"),t.fromDOMEventEmitter=A;function k(E,b){let v,w,L=new Promise(T=>{w=r(E)(T),Wr(w,b),v=s(()=>{Ds(w,b)},"cancelRef")});return L.cancel=v,b&&L.finally(()=>Ds(w,b)),L}s(k,"toPromise"),t.toPromise=k;function F(E,b){return E(v=>b.fire(v))}s(F,"forward"),t.forward=F;function te(E,b,v){return b(v),E(w=>b(w))}s(te,"runAndSubscribe"),t.runAndSubscribe=te;class Ke{static{s(this,"EmitterObserver")}constructor(b,v){this._observable=b,this._counter=0,this._hasChanged=!1;let w={onWillAddFirstListener:s(()=>{b.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:s(()=>{b.removeObserver(this)},"onDidRemoveLastListener")};v||e(w),this.emitter=new re(w),v&&v.add(this.emitter)}beginUpdate(b){this._counter++}handlePossibleChange(b){}handleChange(b,v){this._hasChanged=!0}endUpdate(b){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Nt(E,b){return new Ke(E,b).emitter.event}s(Nt,"fromObservable"),t.fromObservable=Nt;function q1(E){return(b,v,w)=>{let L=0,T=!1,I={beginUpdate(){L++},endUpdate(){L--,L===0&&(E.reportChanges(),T&&(T=!1,b.call(v)))},handlePossibleChange(){},handleChange(){T=!0}};E.addObserver(I),E.reportChanges();let J={dispose(){E.removeObserver(I)}};return Wr(J,w),J}}s(q1,"fromObservableLight"),t.fromObservableLight=q1})($t||(M.Event=$t={}));var Ht=class t{static{s(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${t._idPool++}`,t.all.add(this)}start(e){this._stopWatch=new Ea.StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};M.EventProfiling=Ht;var pt=-1;function Aa(t){let e=pt;return pt=t,{dispose(){pt=e}}}s(Aa,"setGlobalLeakWarningThreshold");var Ir=class t{static{s(this,"LeakageMonitor")}static{this._idPool=1}constructor(e,n,r=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,n){let r=this.threshold;if(r<=0||n.3?"dominated":"popular",d=new gt(c,l,o,n,a);this._errorHandler(d)}return()=>{let o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,n=0;for(let[r,i]of this._stacks)(!e||n{if(t instanceof Ze)e(t);else for(let n=0;n0||this._options?.leakWarningThreshold?new Ir(e?.onListenerError??mt.onUnexpectedError,this._options?.leakWarningThreshold??pt,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new Ht(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Ss){let e=this._listeners;queueMicrotask(()=>{Fs(e,n=>n.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,n,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let c=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=c[1]/this._size>.3?"dominated":"popular",f=new Gt(d,`${l}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||mt.onUnexpectedError)(f),ae.Disposable.None}if(this._disposed)return ae.Disposable.None;n&&(e=e.bind(n));let i=new Ze(e),o,u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=Xe.create(),o=this._leakageMon.check(i.stack,this._size+1)),Ss&&(i.stack=u??Xe.create()),this._listeners?this._listeners instanceof Ze?(this._deliveryQueue??=new Kt,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let a=(0,ae.toDisposable)(()=>{o?.(),this._removeListener(i)});return Wr(a,r),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let n=this._listeners,r=n.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;let i=this._deliveryQueue.current===this;if(this._size*ka<=n.length){let o=0;for(let u=0;u0}};M.Emitter=ne;var xa=s(()=>new Kt,"createEventDeliveryQueue");M.createEventDeliveryQueue=xa;var Kt=class{static{s(this,"EventDeliveryQueuePrivate")}constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Sr=class extends ne{static{s(this,"AsyncEmitter")}async fireAsync(e,n,r){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new Ms.LinkedList),Fs(this._listeners,i=>this._asyncDeliveryQueue.push([i.value,e]));this._asyncDeliveryQueue.size>0&&!n.isCancellationRequested;){let[i,o]=this._asyncDeliveryQueue.shift(),u=[],a={...o,token:n,waitUntil:s(l=>{if(Object.isFrozen(u))throw new Error("waitUntil can NOT be called asynchronous");r&&(l=r(l,i)),u.push(l)},"waitUntil")};try{i(a)}catch(l){(0,mt.onUnexpectedError)(l);continue}Object.freeze(u),await Promise.allSettled(u).then(l=>{for(let c of l)c.status==="rejected"&&(0,mt.onUnexpectedError)(c.reason)})}}};M.AsyncEmitter=Sr;var Vt=class extends ne{static{s(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new Ms.LinkedList,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}};M.PauseableEmitter=Vt;var Rr=class extends Vt{static{s(this,"DebounceEmitter")}constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}};M.DebounceEmitter=Rr;var Or=class extends ne{static{s(this,"MicrotaskEmitter")}constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(n=>super.fire(n)),this._queuedEvents=[]}))}};M.MicrotaskEmitter=Or;var Qt=class{static{s(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new ne({onWillAddFirstListener:s(()=>this.onFirstListenerAdd(),"onWillAddFirstListener"),onDidRemoveLastListener:s(()=>this.onLastListenerRemove(),"onDidRemoveLastListener")})}get event(){return this.emitter.event}add(e){let n={event:e,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);let r=s(()=>{this.hasListeners&&this.unhook(n);let i=this.events.indexOf(n);this.events.splice(i,1)},"dispose");return(0,ae.toDisposable)((0,va.createSingleCallFunction)(r))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(n=>this.emitter.fire(n))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(let e of this.events)e.listener?.dispose();this.events=[]}};M.EventMultiplexer=Qt;var Dr=class{static{s(this,"DynamicListEventMultiplexer")}constructor(e,n,r,i){this._store=new ae.DisposableStore;let o=this._store.add(new Qt),u=this._store.add(new ae.DisposableMap);function a(l){u.set(l,o.add(i(l)))}s(a,"addItem");for(let l of e)a(l);this._store.add(n(l=>{a(l)})),this._store.add(r(l=>{u.deleteAndDispose(l)})),this.event=o.event}dispose(){this._store.dispose()}};M.DynamicListEventMultiplexer=Dr;var Mr=class{static{s(this,"EventBufferer")}constructor(){this.data=[]}wrapEvent(e,n,r){return(i,o,u)=>e(a=>{let l=this.data[this.data.length-1];if(!n){l?l.buffers.push(()=>i.call(o,a)):i.call(o,a);return}let c=l;if(!c){i.call(o,n(r,a));return}c.items??=[],c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??=r?c.items.reduce(n,r):c.items.reduce(n),i.call(o,c.reducedResult)})},void 0,u)}bufferEvents(e){let n={buffers:new Array};this.data.push(n);let r=e();return this.data.pop(),n.buffers.forEach(i=>i()),r}};M.EventBufferer=Mr;var Fr=class{static{s(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=$t.None,this.inputEventListener=ae.Disposable.None,this.emitter=new ne({onDidAddFirstListener:s(()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},"onDidAddFirstListener"),onDidRemoveLastListener:s(()=>{this.listening=!1,this.inputEventListener.dispose()},"onDidRemoveLastListener")}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}};M.Relay=Fr;var Ur=class{static{s(this,"ValueWithChangeEvent")}static const(e){return new qr(e)}constructor(e){this._value=e,this._onDidChange=new ne,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};M.ValueWithChangeEvent=Ur;var qr=class{static{s(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=$t.None}};function Pa(t,e,n){let r=new ae.DisposableMap,i=new Set(t());for(let u of i)r.set(u,n(u));let o=new ae.DisposableStore;return o.add(e(()=>{let u=t(),a=(0,ya.diffSets)(i,u);for(let l of a.removed)r.deleteAndDispose(l);for(let l of a.added)r.set(l,n(l));i=new Set(u)})),o.add(r),o}s(Pa,"trackSetChanges");function Wr(t,e){e instanceof ae.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}s(Wr,"addToDisposables");function Ds(t,e){if(e instanceof ae.DisposableStore)e.delete(t);else if(Array.isArray(e)){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}t.dispose()}s(Ds,"disposeAndRemove")});var Br=U(Le=>{"use strict";g();Object.defineProperty(Le,"__esModule",{value:!0});Le.CancellationTokenPool=Le.CancellationTokenSource=Le.CancellationToken=void 0;Le.cancelOnDispose=Sa;var Us=jr(),Ia=Ut(),qs=Object.freeze(function(t,e){let n=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(n)}}}),Yt;(function(t){function e(n){return n===t.None||n===t.Cancelled||n instanceof Je?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}s(e,"isCancellationToken"),t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Us.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:qs})})(Yt||(Le.CancellationToken=Yt={}));var Je=class{static{s(this,"MutableToken")}constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?qs:(this._emitter||(this._emitter=new Us.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},_t=class{static{s(this,"CancellationTokenSource")}constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Je),this._token}cancel(){this._token?this._token instanceof Je&&this._token.cancel():this._token=Yt.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Je&&this._token.dispose():this._token=Yt.None}};Le.CancellationTokenSource=_t;function Sa(t){let e=new _t;return t.add({dispose(){e.cancel()}}),e.token}s(Sa,"cancelOnDispose");var zr=class{static{s(this,"CancellationTokenPool")}constructor(){this._source=new _t,this._listeners=new Ia.DisposableStore,this._total=0,this._cancelled=0,this._isDone=!1}get token(){return this._source.token}add(e){if(this._isDone)return;if(this._total++,e.isCancellationRequested){this._cancelled++,this._check();return}let n=e.onCancellationRequested(()=>{n.dispose(),this._cancelled++,this._check()});this._listeners.add(n)}_check(){!this._isDone&&this._total>0&&this._total===this._cancelled&&(this._isDone=!0,this._listeners.dispose(),this._source.cancel())}dispose(){this._listeners.dispose(),this._source.dispose()}};Le.CancellationTokenPool=zr});var bt=U(C=>{"use strict";g();var Ra=C&&C.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Oa=C&&C.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Da=C&&C.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i=Ma&&t<=Ua||t>=Fa&&t<=qa}s(Ae,"isWindowsDeviceRoot");function Xt(t,e,n,r){let i="",o=0,u=-1,a=0,l=0;for(let c=0;c<=t.length;++c){if(c2){let d=i.lastIndexOf(n);d===-1?(i="",o=0):(i=i.slice(0,d),o=i.length-1-i.lastIndexOf(n)),u=c,a=0;continue}else if(i.length!==0){i="",o=0,u=c,a=0;continue}}e&&(i+=i.length>0?`${n}..`:"..",o=2)}else i.length>0?i+=`${n}${t.slice(u+1,c)}`:i=t.slice(u+1,c),o=c-u-1;u=c,a=0}else l===$e&&a!==-1?++a:a=-1}return i}s(Xt,"normalizeString");function za(t){return t?`${t[0]==="."?"":"."}${t}`:""}s(za,"formatExt");function Ws(t,e){ja(e,"pathObject");let n=e.dir||e.root,r=e.base||`${e.name||""}${za(e.ext)}`;return n?n===e.root?`${n}${r}`:`${n}${t}${r}`:r}s(Ws,"_format");C.win32={resolve(...t){let e="",n="",r=!1;for(let i=t.length-1;i>=-1;i--){let o;if(i>=0){if(o=t[i],G(o,`paths[${i}]`),o.length===0)continue}else e.length===0?o=et.cwd():(o=et.env[`=${e}`]||et.cwd(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===le)&&(o=`${e}\\`));let u=o.length,a=0,l="",c=!1,d=o.charCodeAt(0);if(u===1)S(d)&&(a=1,c=!0);else if(S(d))if(c=!0,S(o.charCodeAt(1))){let f=2,y=f;for(;f2&&S(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(r){if(e.length>0)break}else if(n=`${o.slice(a)}\\${n}`,r=c,c&&e.length>0)break}return n=Xt(n,!r,"\\",S),r?`${e}\\${n}`:`${e}${n}`||"."},normalize(t){G(t,"path");let e=t.length;if(e===0)return".";let n=0,r,i=!1,o=t.charCodeAt(0);if(e===1)return $r(o)?"\\":t;if(S(o))if(i=!0,S(t.charCodeAt(1))){let a=2,l=a;for(;a2&&S(t.charCodeAt(2))&&(i=!0,n=3));let u=n0&&S(t.charCodeAt(e-1))&&(u+="\\"),!i&&r===void 0&&t.includes(":")){if(u.length>=2&&Ae(u.charCodeAt(0))&&u.charCodeAt(1)===Ne)return`.\\${u}`;let a=t.indexOf(":");do if(a===e-1||S(t.charCodeAt(a+1)))return`.\\${u}`;while((a=t.indexOf(":",a+1))!==-1)}return r===void 0?i?`\\${u}`:u:i?`${r}\\${u}`:`${r}${u}`},isAbsolute(t){G(t,"path");let e=t.length;if(e===0)return!1;let n=t.charCodeAt(0);return S(n)||e>2&&Ae(n)&&t.charCodeAt(1)===Ne&&S(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,n;for(let o=0;o0&&(e===void 0?e=n=u:e+=`\\${u}`)}if(e===void 0)return".";let r=!0,i=0;if(typeof n=="string"&&S(n.charCodeAt(0))){++i;let o=n.length;o>1&&S(n.charCodeAt(1))&&(++i,o>2&&(S(n.charCodeAt(2))?++i:r=!1))}if(r){for(;i=2&&(e=`\\${e.slice(i)}`)}return C.win32.normalize(e)},relative(t,e){if(G(t,"from"),G(e,"to"),t===e)return"";let n=C.win32.resolve(t),r=C.win32.resolve(e);if(n===r||(t=n.toLowerCase(),e=r.toLowerCase(),t===e))return"";if(n.length!==t.length||r.length!==e.length){let $=n.split("\\"),H=r.split("\\");$[$.length-1]===""&&$.pop(),H[H.length-1]===""&&H.pop();let Z=$.length,de=H.length,oe=Zoe?H.slice(V).join("\\"):Z>oe?"..\\".repeat(Z-1-V)+"..":"":"..\\".repeat(Z-V)+H.slice(V).join("\\")}let i=0;for(;ii&&t.charCodeAt(o-1)===le;)o--;let u=o-i,a=0;for(;aa&&e.charCodeAt(l-1)===le;)l--;let c=l-a,d=ud){if(e.charCodeAt(a+y)===le)return r.slice(a+y+1);if(y===2)return r.slice(a+y)}u>d&&(t.charCodeAt(i+y)===le?f=y:y===2&&(f=3)),f===-1&&(f=0)}let D="";for(y=i+f+1;y<=o;++y)(y===o||t.charCodeAt(y)===le)&&(D+=D.length===0?"..":"\\..");return a+=f,D.length>0?`${D}${r.slice(a,l)}`:(r.charCodeAt(a)===le&&++a,r.slice(a,l))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=C.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===le){if(e.charCodeAt(1)===le){let n=e.charCodeAt(2);if(n!==Wa&&n!==$e)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Ae(e.charCodeAt(0))&&e.charCodeAt(1)===Ne&&e.charCodeAt(2)===le)return`\\\\?\\${e}`;return e},dirname(t){G(t,"path");let e=t.length;if(e===0)return".";let n=-1,r=0,i=t.charCodeAt(0);if(e===1)return S(i)?t:".";if(S(i)){if(n=r=1,S(t.charCodeAt(1))){let a=2,l=a;for(;a2&&S(t.charCodeAt(2))?3:2,r=n);let o=-1,u=!0;for(let a=e-1;a>=r;--a)if(S(t.charCodeAt(a))){if(!u){o=a;break}}else u=!1;if(o===-1){if(n===-1)return".";o=n}return t.slice(0,o)},basename(t,e){e!==void 0&&G(e,"suffix"),G(t,"path");let n=0,r=-1,i=!0,o;if(t.length>=2&&Ae(t.charCodeAt(0))&&t.charCodeAt(1)===Ne&&(n=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let u=e.length-1,a=-1;for(o=t.length-1;o>=n;--o){let l=t.charCodeAt(o);if(S(l)){if(!i){n=o+1;break}}else a===-1&&(i=!1,a=o+1),u>=0&&(l===e.charCodeAt(u)?--u===-1&&(r=o):(u=-1,r=a))}return n===r?r=a:r===-1&&(r=t.length),t.slice(n,r)}for(o=t.length-1;o>=n;--o)if(S(t.charCodeAt(o))){if(!i){n=o+1;break}}else r===-1&&(i=!1,r=o+1);return r===-1?"":t.slice(n,r)},extname(t){G(t,"path");let e=0,n=-1,r=0,i=-1,o=!0,u=0;t.length>=2&&t.charCodeAt(1)===Ne&&Ae(t.charCodeAt(0))&&(e=r=2);for(let a=t.length-1;a>=e;--a){let l=t.charCodeAt(a);if(S(l)){if(!o){r=a+1;break}continue}i===-1&&(o=!1,i=a+1),l===$e?n===-1?n=a:u!==1&&(u=1):n!==-1&&(u=-1)}return n===-1||i===-1||u===0||u===1&&n===i-1&&n===r+1?"":t.slice(n,i)},format:Ws.bind(null,"\\"),parse(t){G(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let n=t.length,r=0,i=t.charCodeAt(0);if(n===1)return S(i)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(S(i)){if(r=1,S(t.charCodeAt(1))){let f=2,y=f;for(;f0&&(e.root=t.slice(0,r));let o=-1,u=r,a=-1,l=!0,c=t.length-1,d=0;for(;c>=r;--c){if(i=t.charCodeAt(c),S(i)){if(!l){u=c+1;break}continue}a===-1&&(l=!1,a=c+1),i===$e?o===-1?o=c:d!==1&&(d=1):o!==-1&&(d=-1)}return a!==-1&&(o===-1||d===0||d===1&&o===a-1&&o===u+1?e.base=e.name=t.slice(u,a):(e.name=t.slice(u,o),e.base=t.slice(u,a),e.ext=t.slice(o,a))),u>0&&u!==r?e.dir=t.slice(0,u-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var Ba=(()=>{if(ce){let t=/\\/g;return()=>{let e=et.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>et.cwd()})();C.posix={resolve(...t){let e="",n=!1;for(let r=t.length-1;r>=0&&!n;r--){let i=t[r];G(i,`paths[${r}]`),i.length!==0&&(e=`${i}/${e}`,n=i.charCodeAt(0)===Y)}if(!n){let r=Ba();e=`${r}/${e}`,n=r.charCodeAt(0)===Y}return e=Xt(e,!n,"/",$r),n?`/${e}`:e.length>0?e:"."},normalize(t){if(G(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Y,n=t.charCodeAt(t.length-1)===Y;return t=Xt(t,!e,"/",$r),t.length===0?e?"/":n?"./":".":(n&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return G(t,"path"),t.length>0&&t.charCodeAt(0)===Y},join(...t){if(t.length===0)return".";let e=[];for(let n=0;n0&&e.push(r)}return e.length===0?".":C.posix.normalize(e.join("/"))},relative(t,e){if(G(t,"from"),G(e,"to"),t===e||(t=C.posix.resolve(t),e=C.posix.resolve(e),t===e))return"";let n=1,r=t.length,i=r-n,o=1,u=e.length-o,a=ia){if(e.charCodeAt(o+c)===Y)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else i>a&&(t.charCodeAt(n+c)===Y?l=c:c===0&&(l=0));let d="";for(c=n+l+1;c<=r;++c)(c===r||t.charCodeAt(c)===Y)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+l)}`},toNamespacedPath(t){return t},dirname(t){if(G(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Y,n=-1,r=!0;for(let i=t.length-1;i>=1;--i)if(t.charCodeAt(i)===Y){if(!r){n=i;break}}else r=!1;return n===-1?e?"/":".":e&&n===1?"//":t.slice(0,n)},basename(t,e){e!==void 0&&G(e,"suffix"),G(t,"path");let n=0,r=-1,i=!0,o;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let u=e.length-1,a=-1;for(o=t.length-1;o>=0;--o){let l=t.charCodeAt(o);if(l===Y){if(!i){n=o+1;break}}else a===-1&&(i=!1,a=o+1),u>=0&&(l===e.charCodeAt(u)?--u===-1&&(r=o):(u=-1,r=a))}return n===r?r=a:r===-1&&(r=t.length),t.slice(n,r)}for(o=t.length-1;o>=0;--o)if(t.charCodeAt(o)===Y){if(!i){n=o+1;break}}else r===-1&&(i=!1,r=o+1);return r===-1?"":t.slice(n,r)},extname(t){G(t,"path");let e=-1,n=0,r=-1,i=!0,o=0;for(let u=t.length-1;u>=0;--u){let a=t[u];if(a==="/"){if(!i){n=u+1;break}continue}r===-1&&(i=!1,r=u+1),a==="."?e===-1?e=u:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||r===-1||o===0||o===1&&e===r-1&&e===n+1?"":t.slice(e,r)},format:Ws.bind(null,"/"),parse(t){G(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let n=t.charCodeAt(0)===Y,r;n?(e.root="/",r=1):r=0;let i=-1,o=0,u=-1,a=!0,l=t.length-1,c=0;for(;l>=r;--l){let d=t.charCodeAt(l);if(d===Y){if(!a){o=l+1;break}continue}u===-1&&(a=!1,u=l+1),d===$e?i===-1?i=l:c!==1&&(c=1):i!==-1&&(c=-1)}if(u!==-1){let d=o===0&&n?1:o;i===-1||c===0||c===1&&i===u-1&&i===o+1?e.base=e.name=t.slice(d,u):(e.name=t.slice(d,i),e.base=t.slice(d,u),e.ext=t.slice(i,u))}return o>0?e.dir=t.slice(0,o-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};C.posix.win32=C.win32.win32=C.win32;C.posix.posix=C.win32.posix=C.posix;C.normalize=ce?C.win32.normalize:C.posix.normalize;C.isAbsolute=ce?C.win32.isAbsolute:C.posix.isAbsolute;C.join=ce?C.win32.join:C.posix.join;C.resolve=ce?C.win32.resolve:C.posix.resolve;C.relative=ce?C.win32.relative:C.posix.relative;C.dirname=ce?C.win32.dirname:C.posix.dirname;C.basename=ce?C.win32.basename:C.posix.basename;C.extname=ce?C.win32.extname:C.posix.extname;C.format=ce?C.win32.format:C.posix.format;C.parse=ce?C.win32.parse:C.posix.parse;C.toNamespacedPath=ce?C.win32.toNamespacedPath:C.posix.toNamespacedPath;C.sep=ce?C.win32.sep:C.posix.sep;C.delimiter=ce?C.win32.delimiter:C.posix.delimiter});var js=U(me=>{"use strict";g();Object.defineProperty(me,"__esModule",{value:!0});me.WeakCachedFunction=me.CachedFunction=me.LRUCachedFunction=me.Cache=void 0;me.identity=Jt;var $a=Br(),Hr=class{static{s(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new $a.CancellationTokenSource,n=this.task(e.token);return this.result={promise:n,dispose:s(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};me.Cache=Hr;function Jt(t){return t}s(Jt,"identity");var Gr=class{static{s(this,"LRUCachedFunction")}constructor(e,n){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=Jt):(this._fn=n,this._computeKey=e.getCacheKey)}get(e){let n=this._computeKey(e);return this.lastArgKey!==n&&(this.lastArgKey=n,this.lastCache=this._fn(e)),this.lastCache}};me.LRUCachedFunction=Gr;var Kr=class{static{s(this,"CachedFunction")}get cachedValues(){return this._map}constructor(e,n){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=Jt):(this._fn=n,this._computeKey=e.getCacheKey)}get(e){let n=this._computeKey(e);if(this._map2.has(n))return this._map2.get(n);let r=this._fn(e);return this._map.set(e,r),this._map2.set(n,r),r}};me.CachedFunction=Kr;var Vr=class{static{s(this,"WeakCachedFunction")}constructor(e,n){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=Jt):(this._fn=n,this._computeKey=e.getCacheKey)}get(e){let n=this._computeKey(e);if(this._map.has(n))return this._map.get(n);let r=this._fn(e);return this._map.set(n,r),r}};me.WeakCachedFunction=Vr});var tn=U(en=>{"use strict";g();Object.defineProperty(en,"__esModule",{value:!0});en.Lazy=void 0;var Se;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(Se||(Se={}));var Qr=class{static{s(this,"Lazy")}constructor(e){this.executor=e,this._state=Se.Uninitialized}get hasValue(){return this._state===Se.Completed}get value(){if(this._state===Se.Uninitialized){this._state=Se.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=Se.Completed}}else if(this._state===Se.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};en.Lazy=Qr});var rn=U(_=>{"use strict";g();Object.defineProperty(_,"__esModule",{value:!0});_.Ellipsis=_.InvisibleCharacters=_.AmbiguousCharacters=_.noBreakWhitespace=_.UTF8_BOM_CHARACTER=_.UNUSUAL_LINE_TERMINATORS=_.GraphemeIterator=_.CodePointIterator=void 0;_.isFalsyOrWhitespace=Ga;_.format=Va;_.format2=Ya;_.htmlAttributeEncodeValue=Za;_.escape=Xa;_.escapeRegExpCharacters=$s;_.count=Ja;_.truncate=el;_.truncateMiddle=tl;_.trim=nl;_.ltrim=Hs;_.rtrim=Gs;_.convertSimple2RegExpPattern=rl;_.createRegExp=il;_.regExpLeadsToEndlessLoop=sl;_.joinStrings=ol;_.splitLines=ul;_.splitLinesIncludeSeparators=al;_.indexOfPattern=ll;_.firstNonWhitespaceIndex=Ks;_.getLeadingWhitespace=cl;_.lastNonWhitespaceIndex=fl;_.getIndentationLength=hl;_.replaceAsync=dl;_.compare=ml;_.compareSubstring=Vs;_.compareIgnoreCase=pl;_.compareSubstringIgnoreCase=yt;_.isAsciiDigit=gl;_.isLowerAsciiLetter=Zr;_.isUpperAsciiLetter=_l;_.equalsIgnoreCase=Qs;_.equals=bl;_.startsWithIgnoreCase=Cl;_.endsWithIgnoreCase=yl;_.commonPrefixLength=vl;_.commonSuffixLength=wl;_.isHighSurrogate=ei;_.isLowSurrogate=nn;_.computeCodePoint=ti;_.getNextCodePoint=Ys;_.nextCharLength=Zs;_.prevCharLength=Xs;_.getCharContainingOffset=Ll;_.charCount=Nl;_.containsRTL=Tl;_.isBasicASCII=xl;_.containsUnusualLineTerminators=Pl;_.isFullWidthCharacter=Il;_.isEmojiImprecise=Js;_.lcut=Sl;_.rcut=Rl;_.forAnsiStringParts=Fl;_.removeAnsiEscapeCodes=t1;_.removeAnsiEscapeCodesFromPrompt=ql;_.startsWithUTF8BOM=n1;_.stripUTF8BOM=Wl;_.fuzzyContains=jl;_.containsUppercaseCharacter=zl;_.uppercaseFirstLetter=Bl;_.getNLines=$l;_.singleLetterHash=Hl;_.getGraphemeBreakType=Gl;_.getLeftDeleteOffset=Vl;_.multibyteAwareBtoa=Xl;var Ha=js(),zs=tn();function Ga(t){return!t||typeof t!="string"?!0:t.trim().length===0}s(Ga,"isFalsyOrWhitespace");var Ka=/{(\d+)}/g;function Va(t,...e){return e.length===0?t:t.replace(Ka,function(n,r){let i=parseInt(r,10);return isNaN(i)||i<0||i>=e.length?n:e[i]})}s(Va,"format");var Qa=/{([^}]+)}/g;function Ya(t,e){return Object.keys(e).length===0?t:t.replace(Qa,(n,r)=>e[r]??n)}s(Ya,"format2");function Za(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}s(Za,"htmlAttributeEncodeValue");function Xa(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}s(Xa,"escape");function $s(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}s($s,"escapeRegExpCharacters");function Ja(t,e){let n=0,r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length);return n}s(Ja,"count");function el(t,e,n=_.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${n}`}s(el,"truncate");function tl(t,e,n=_.Ellipsis){if(t.length<=e)return t;let r=Math.ceil(e/2)-n.length/2,i=Math.floor(e/2)-n.length/2;return`${t.substr(0,r)}${n}${t.substr(t.length-i)}`}s(tl,"truncateMiddle");function nl(t,e=" "){let n=Hs(t,e);return Gs(n,e)}s(nl,"trim");function Hs(t,e){if(!t||!e)return t;let n=e.length,r=0;if(n===1){let i=e.charCodeAt(0);for(;r0&&t.charCodeAt(o-1)===u;)o--;return t.substring(0,o)}let i=r;for(;i>0&&t.endsWith(e,i);)i-=n;return t.substring(0,i)}s(Gs,"rtrim");function rl(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}s(rl,"convertSimple2RegExpPattern");function il(t,e,n={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=$s(t)),n.wholeWord&&(/\B/.test(t.charAt(0))||(t="\\b"+t),/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"));let r="";return n.global&&(r+="g"),n.matchCase||(r+="i"),n.multiline&&(r+="m"),n.unicode&&(r+="u"),new RegExp(t,r)}s(il,"createRegExp");function sl(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}s(sl,"regExpLeadsToEndlessLoop");function ol(t,e){return t.filter(n=>n!=null&&n!==!1).join(e)}s(ol,"joinStrings");function ul(t){return t.split(/\r\n|\r|\n/)}s(ul,"splitLines");function al(t){let e=[],n=t.split(/(\r\n|\r|\n)/);for(let r=0;r=0;n--){let r=t.charCodeAt(n);if(r!==32&&r!==9)return n}return-1}s(fl,"lastNonWhitespaceIndex");function hl(t){let e=Ks(t);return e===-1?t.length:e}s(hl,"getIndentationLength");function dl(t,e,n){let r=[],i=0;for(let o of t.matchAll(e)){if(r.push(t.slice(i,o.index)),o.index===void 0)throw new Error("match.index should be defined");i=o.index+o[0].length,r.push(n(o[0],...o.slice(1),o.index,t,o.groups))}return r.push(t.slice(i)),Promise.all(r).then(o=>o.join(""))}s(dl,"replaceAsync");function ml(t,e){return te?1:0}s(ml,"compare");function Vs(t,e,n=0,r=t.length,i=0,o=e.length){for(;nc)return 1}let u=r-n,a=o-i;return ua?1:0}s(Vs,"compareSubstring");function pl(t,e){return yt(t,e,0,t.length,0,e.length)}s(pl,"compareIgnoreCase");function yt(t,e,n=0,r=t.length,i=0,o=e.length){for(;n=128||c>=128)return Vs(t.toLowerCase(),e.toLowerCase(),n,r,i,o);Zr(l)&&(l-=32),Zr(c)&&(c-=32);let d=l-c;if(d!==0)return d}let u=r-n,a=o-i;return ua?1:0}s(yt,"compareSubstringIgnoreCase");function gl(t){return t>=48&&t<=57}s(gl,"isAsciiDigit");function Zr(t){return t>=97&&t<=122}s(Zr,"isLowerAsciiLetter");function _l(t){return t>=65&&t<=90}s(_l,"isUpperAsciiLetter");function Qs(t,e){return t.length===e.length&&yt(t,e)===0}s(Qs,"equalsIgnoreCase");function bl(t,e,n){return t===e||!!n&&t!==void 0&&e!==void 0&&Qs(t,e)}s(bl,"equals");function Cl(t,e){let n=e.length;return n<=t.length&&yt(t,e,0,n)===0}s(Cl,"startsWithIgnoreCase");function yl(t,e){let n=t.length,r=n-e.length;return r>=0&&yt(t,e,r,n)===0}s(yl,"endsWithIgnoreCase");function vl(t,e){let n=Math.min(t.length,e.length),r;for(r=0;r1){let r=t.charCodeAt(e-2);if(ei(r))return ti(r,n)}return n}s(El,"getPrevCodePoint");var tt=class{static{s(this,"CodePointIterator")}get offset(){return this._offset}constructor(e,n=0){this._str=e,this._len=e.length,this._offset=n}setOffset(e){this._offset=e}prevCodePoint(){let e=El(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=Ys(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};_.CodePointIterator=tt;var nt=class{static{s(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,n=0){this._iterator=new tt(e,n)}nextGraphemeLength(){let e=Ct.getInstance(),n=this._iterator,r=n.offset,i=e.getGraphemeBreakType(n.nextCodePoint());for(;!n.eol();){let o=n.offset,u=e.getGraphemeBreakType(n.nextCodePoint());if(Bs(i,u)){n.setOffset(o);break}i=u}return n.offset-r}prevGraphemeLength(){let e=Ct.getInstance(),n=this._iterator,r=n.offset,i=e.getGraphemeBreakType(n.prevCodePoint());for(;n.offset>0;){let o=n.offset,u=e.getGraphemeBreakType(n.prevCodePoint());if(Bs(u,i)){n.setOffset(o);break}i=u}return r-n.offset}eol(){return this._iterator.eol()}};_.GraphemeIterator=nt;function Zs(t,e){return new nt(t,e).nextGraphemeLength()}s(Zs,"nextCharLength");function Xs(t,e){return new nt(t,e).prevGraphemeLength()}s(Xs,"prevCharLength");function Ll(t,e){e>0&&nn(t.charCodeAt(e))&&e--;let n=e+Zs(t,e);return[n-Xs(t,n),n]}s(Ll,"getCharContainingOffset");function Nl(t){let e=new nt(t),n=0;for(;!e.eol();)n++,e.nextGraphemeLength();return n}s(Nl,"charCount");var Yr;function Al(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}s(Al,"makeContainsRtl");function Tl(t){return Yr||(Yr=Al()),Yr.test(t)}s(Tl,"containsRTL");var kl=/^[\t\n\r\x20-\x7E]*$/;function xl(t){return kl.test(t)}s(xl,"isBasicASCII");_.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function Pl(t){return _.UNUSUAL_LINE_TERMINATORS.test(t)}s(Pl,"containsUnusualLineTerminators");function Il(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}s(Il,"isFullWidthCharacter");function Js(t){return t>=127462&&t<=127487||t===8986||t===8987||t===9200||t===9203||t>=9728&&t<=10175||t===11088||t===11093||t>=127744&&t<=128591||t>=128640&&t<=128764||t>=128992&&t<=129008||t>=129280&&t<=129535||t>=129648&&t<=129782}s(Js,"isEmojiImprecise");function Sl(t,e,n=""){let r=t.trimStart();if(r.lengthe){u=!0;break}o=i.lastIndex,i.lastIndex+=1}if(!u)return r;if(o===0)return n;let a=r.substring(0,o).trimEnd();return a.length!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,Dl=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,Ml=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,e1=new RegExp("(?:"+[Ol.source,Dl.source,Ml.source].join("|")+")","g");function*Fl(t){let e=0;for(let n of t.matchAll(e1))e!==n.index&&(yield{isCode:!1,str:t.substring(e,n.index)}),yield{isCode:!0,str:n[0]},e=n.index+n[0].length;e!==t.length&&(yield{isCode:!1,str:t.substring(e)})}s(Fl,"forAnsiStringParts");function t1(t){return t&&(t=t.replace(e1,"")),t}s(t1,"removeAnsiEscapeCodes");var Ul=/\\\[.*?\\\]/g;function ql(t){return t1(t).replace(Ul,"")}s(ql,"removeAnsiEscapeCodesFromPrompt");_.UTF8_BOM_CHARACTER="\uFEFF";function n1(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}s(n1,"startsWithUTF8BOM");function Wl(t){return n1(t)?t.substr(1):t}s(Wl,"stripUTF8BOM");function jl(t,e){if(!t||!e||t.length0&&n>=0);return n===-1?t:(t[n-1]==="\r"&&n--,t.substr(0,n))}s($l,"getNLines");function Hl(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}s(Hl,"singleLetterHash");function Gl(t){return Ct.getInstance().getGraphemeBreakType(t)}s(Gl,"getGraphemeBreakType");function Bs(t,e){return t===0?e!==5&&e!==7:t===2&&e===3?!1:t===4||t===2||t===3||e===4||e===2||e===3?!0:!(t===8&&(e===8||e===9||e===11||e===12)||(t===11||t===9)&&(e===9||e===10)||(t===12||t===10)&&e===10||e===5||e===13||e===7||t===1||t===13&&e===14||t===6&&e===6)}s(Bs,"breakBetweenGraphemeBreakType");var Ct=class t{static{s(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=Kl()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let n=this._data,r=n.length/3,i=1;for(;i<=r;)if(en[3*i+1])i=2*i+1;else return n[3*i+2];return 0}};function Kl(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}s(Kl,"getGraphemeBreakRawData");function Vl(t,e){if(t===0)return 0;let n=Ql(t,e);if(n!==void 0)return n;let r=new tt(e,t);return r.prevCodePoint(),r.offset}s(Vl,"getLeftDeleteOffset");function Ql(t,e){let n=new tt(e,t),r=n.prevCodePoint();for(;Yl(r)||r===65039||r===8419;){if(n.offset===0)return;r=n.prevCodePoint()}if(!Js(r))return;let i=n.offset;return i>0&&n.prevCodePoint()===8205&&(i=n.offset),i}s(Ql,"getOffsetBeforeLastEmojiComponent");function Yl(t){return 127995<=t&&t<=127999}s(Yl,"isEmojiModifier");_.noBreakWhitespace="\xA0";var Xr=class t{static{s(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new zs.Lazy(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new Ha.LRUCachedFunction(e=>{let n=e.split(",");function r(f){let y=new Map;for(let D=0;D!f.startsWith("_")&&Object.hasOwn(u,f));a.length===0&&(a=["_default"]);let l;for(let f of a){let y=r(u[f]);l=o(l,y)}let c=r(u._common),d=i(c,l);return new t(d)})}static getInstance(e){return t.cache.get(Array.from(e).join(","))}static{this._locales=new zs.Lazy(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let n=0;n{"use strict";g();Object.defineProperty(K,"__esModule",{value:!0});K.isPathSeparator=Te;K.toSlashes=r1;K.toPosixPath=e2;K.getRoot=t2;K.isUNC=n2;K.isValidBasename=o2;K.isEqual=u2;K.isEqualOrParent=a2;K.isWindowsDriveLetter=ni;K.sanitizeFilePath=l2;K.removeTrailingPathSeparator=i1;K.isRootOrDriveLetter=c2;K.hasDriveLetter=ri;K.getDriveLetter=f2;K.indexOfPath=h2;K.parseLineAndColumnAware=d2;K.randomPath=g2;var fe=bt(),Re=ze(),sn=rn(),Jl=fr();function Te(t){return t===47||t===92}s(Te,"isPathSeparator");function r1(t){return t.replace(/[\\/]/g,fe.posix.sep)}s(r1,"toSlashes");function e2(t){return t.indexOf("/")===-1&&(t=r1(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}s(e2,"toPosixPath");function t2(t,e=fe.posix.sep){if(!t)return"";let n=t.length,r=t.charCodeAt(0);if(Te(r)){if(Te(t.charCodeAt(1))&&!Te(t.charCodeAt(2))){let o=3,u=o;for(;o\|]/g,i2=/[/]/g,s2=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function o2(t,e=Re.isWindows){let n=e?r2:i2;return!(!t||t.length===0||/^\s+$/.test(t)||(n.lastIndex=0,n.test(t))||e&&s2.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}s(o2,"isValidBasename");function u2(t,e,n){let r=t===e;return!n||r?r:!t||!e?!1:(0,sn.equalsIgnoreCase)(t,e)}s(u2,"isEqual");function a2(t,e,n,r=fe.sep){if(t===e)return!0;if(!t||!e||e.length>t.length)return!1;if(n){if(!(0,sn.startsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;let o=e.length;return e.charAt(e.length-1)===r&&o--,t.charAt(o)===r}return e.charAt(e.length-1)!==r&&(e+=r),t.indexOf(e)===0}s(a2,"isEqualOrParent");function ni(t){return t>=65&&t<=90||t>=97&&t<=122}s(ni,"isWindowsDriveLetter");function l2(t,e){return Re.isWindows&&t.endsWith(":")&&(t+=fe.sep),(0,fe.isAbsolute)(t)||(t=(0,fe.join)(e,t)),t=(0,fe.normalize)(t),i1(t)}s(l2,"sanitizeFilePath");function i1(t){return Re.isWindows?(t=(0,sn.rtrim)(t,fe.sep),t.endsWith(":")&&(t+=fe.sep)):(t=(0,sn.rtrim)(t,fe.sep),t||(t=fe.sep)),t}s(i1,"removeTrailingPathSeparator");function c2(t){let e=(0,fe.normalize)(t);return Re.isWindows?t.length>3?!1:ri(e)&&(t.length===2||e.charCodeAt(2)===92):e===fe.posix.sep}s(c2,"isRootOrDriveLetter");function ri(t,e=Re.isWindows){return e?ni(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}s(ri,"hasDriveLetter");function f2(t,e=Re.isWindows){return ri(t,e)?t[0]:void 0}s(f2,"getDriveLetter");function h2(t,e,n){return e.length>t.length?-1:t===e?0:(n&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}s(h2,"indexOfPath");function d2(t){let e=t.split(":"),n,r,i;for(let o of e){let u=Number(o);(0,Jl.isNumber)(u)?r===void 0?r=u:i===void 0&&(i=u):n=n?[n,o].join(":"):o}if(!n)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:n,line:r!==void 0?r:void 0,column:i!==void 0?i:r!==void 0?1:void 0}}s(d2,"parseLineAndColumnAware");var m2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",p2="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function g2(t,e,n=8){let r="";for(let o=0;o{"use strict";g();var _2=he&&he.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),b2=he&&he.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C2=he&&he.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i0?` Found '${n[0][0]}' at index ${n[0].index} (${n.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${r} (len:${t.scheme.length})`)}if(t.path){if(t.authority){if(!v2.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(w2.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}s(E2,"_validateUri");function L2(t,e){return!t&&!e?"file":t}s(L2,"_schemeFix");function N2(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==pe&&(e=pe+e):e=pe;break}return e}s(N2,"_referenceResolution");var W="",pe="/",A2=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,an=class t{static{s(this,"URI")}static isUri(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,n,r,i,o,u=!1){typeof e=="object"?(this.scheme=e.scheme||W,this.authority=e.authority||W,this.path=e.path||W,this.query=e.query||W,this.fragment=e.fragment||W):(this.scheme=L2(e,u),this.authority=n||W,this.path=N2(this.scheme,r||W),this.query=i||W,this.fragment=o||W,E2(this,u))}get fsPath(){return ln(this,!1)}with(e){if(!e)return this;let{scheme:n,authority:r,path:i,query:o,fragment:u}=e;return n===void 0?n=this.scheme:n===null&&(n=W),r===void 0?r=this.authority:r===null&&(r=W),i===void 0?i=this.path:i===null&&(i=W),o===void 0?o=this.query:o===null&&(o=W),u===void 0?u=this.fragment:u===null&&(u=W),n===this.scheme&&r===this.authority&&i===this.path&&o===this.query&&u===this.fragment?this:new Oe(n,r,i,o,u)}static parse(e,n=!1){let r=A2.exec(e);return r?new Oe(r[2]||W,on(r[4]||W),on(r[5]||W),on(r[7]||W),on(r[9]||W),n):new Oe(W,W,W,W,W)}static file(e){let n=W;if(un.isWindows&&(e=e.replace(/\\/g,pe)),e[0]===pe&&e[1]===pe){let r=e.indexOf(pe,2);r===-1?(n=e.substring(2),e=pe):(n=e.substring(2,r),e=e.substring(r)||pe)}return new Oe("file",n,e,W,W)}static from(e,n){return new Oe(e.scheme,e.authority,e.path,e.query,e.fragment,n)}static joinPath(e,...n){if(!e.path)throw new Error(`[UriError]: cannot call joinPath on URI without path: ${e.toString()}`);let r;return un.isWindows&&e.scheme==="file"?r=t.file(o1.win32.join(ln(e,!0),...n)).path:r=o1.posix.join(e.path,...n),e.with({path:r})}toString(e=!1){return ii(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let n=new Oe(e);return n._formatted=e.external??null,n._fsPath=e._sep===l1?e.fsPath??null:null,n}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};he.URI=an;function T2(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}s(T2,"isUriComponents");var l1=un.isWindows?1:void 0,Oe=class extends an{static{s(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=ln(this,!1)),this._fsPath}toString(e=!1){return e?ii(this,!0):(this._formatted||(this._formatted=ii(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=l1),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},c1={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function u1(t,e,n){let r,i=-1;for(let o=0;o=97&&u<=122||u>=65&&u<=90||u>=48&&u<=57||u===45||u===46||u===95||u===126||e&&u===47||n&&u===91||n&&u===93||n&&u===58)i!==-1&&(r+=encodeURIComponent(t.substring(i,o)),i=-1),r!==void 0&&(r+=t.charAt(o));else{r===void 0&&(r=t.substr(0,o));let a=c1[u];a!==void 0?(i!==-1&&(r+=encodeURIComponent(t.substring(i,o)),i=-1),r+=a):i===-1&&(i=o)}}return i!==-1&&(r+=encodeURIComponent(t.substring(i))),r!==void 0?r:t}s(u1,"encodeURIComponentFast");function k2(t){let e;for(let n=0;n1&&t.scheme==="file"?n=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?n=t.path.substr(1):n=t.path[1].toLowerCase()+t.path.substr(2):n=t.path,un.isWindows&&(n=n.replace(/\//g,"\\")),n}s(ln,"uriToFsPath");function ii(t,e){let n=e?k2:u1,r="",{scheme:i,authority:o,path:u,query:a,fragment:l}=t;if(i&&(r+=i,r+=":"),(o||i==="file")&&(r+=pe,r+=pe),o){let c=o.indexOf("@");if(c!==-1){let d=o.substr(0,c);o=o.substr(c+1),c=d.lastIndexOf(":"),c===-1?r+=n(d,!1,!1):(r+=n(d.substr(0,c),!1,!1),r+=":",r+=n(d.substr(c+1),!1,!0)),r+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?r+=n(o,!1,!0):(r+=n(o.substr(0,c),!1,!0),r+=o.substr(c))}if(u){if(u.length>=3&&u.charCodeAt(0)===47&&u.charCodeAt(2)===58){let c=u.charCodeAt(1);c>=65&&c<=90&&(u=`/${String.fromCharCode(c+32)}:${u.substr(3)}`)}else if(u.length>=2&&u.charCodeAt(1)===58){let c=u.charCodeAt(0);c>=65&&c<=90&&(u=`${String.fromCharCode(c+32)}:${u.substr(2)}`)}r+=n(u,!0,!1)}return a&&(r+="?",r+=n(a,!1,!1)),l&&(r+="#",r+=e?l:u1(l,!1,!1)),r}s(ii,"_asFormatted");function f1(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+f1(t.substr(3)):t}}s(f1,"decodeURIComponentGraceful");var a1=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function on(t){return t.match(a1)?t.replace(a1,e=>f1(e)):t}s(on,"percentDecode")});var g1=U(O=>{"use strict";g();var x2=O&&O.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),P2=O&&O.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ci=O&&O.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;im1(t,n))}s(S2,"matchesSomeScheme");O.connectionTokenCookieName="vscode-tkn";O.connectionTokenQueryName="tkn";var ai=class{static{s(this,"RemoteAuthoritiesImpl")}constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,n){this._serverRootPath=ui.posix.join(n??"/",p1(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return ui.posix.join(this._serverRootPath,_e.vscodeRemoteResource)}set(e,n,r){this._hosts[e]=n,this._ports[e]=r}setConnectionToken(e,n){this._connectionTokens[e]=n}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return I2.onUnexpectedExternalError(a),e}let n=e.authority,r=this._hosts[n];r&&r.indexOf(":")!==-1&&r.indexOf("[")===-1&&(r=`[${r}]`);let i=this._ports[n],o=this._connectionTokens[n],u=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(u+=`&${O.connectionTokenQueryName}=${encodeURIComponent(o)}`),He.URI.from({scheme:oi.isWeb?this._preferredWebSchema:_e.vscodeRemoteResource,authority:`${r}:${i}`,path:this._remoteResourcesPath,query:u})}};O.RemoteAuthorities=new ai;function p1(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}s(p1,"getServerProductSegment");O.builtinExtensionsPath="vs/../../extensions";O.nodeModulesPath="vs/../../node_modules";O.nodeModulesAsarPath="vs/../../node_modules.asar";O.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";O.VSCODE_AUTHORITY="vscode-app";var li=class t{static{s(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=O.VSCODE_AUTHORITY}asBrowserUri(e){let n=this.toUri(e);return this.uriToBrowserUri(n)}uriToBrowserUri(e){return e.scheme===_e.vscodeRemote?O.RemoteAuthorities.rewrite(e):e.scheme===_e.file&&(oi.isNative||oi.webWorkerOrigin===`${_e.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:_e.vscodeFileResource,authority:e.authority||t.FALLBACK_AUTHORITY,query:null,fragment:null}):e}asFileUri(e){let n=this.toUri(e);return this.uriToFileUri(n)}uriToFileUri(e){return e.scheme===_e.vscodeFileResource?e.with({scheme:_e.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(He.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let n=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(n))return He.URI.joinPath(He.URI.parse(n,!0),e);let r=ui.join(n,e);return He.URI.file(r)}throw new Error("Cannot determine URI for module id!")}};O.FileAccess=new li;O.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});O.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var d1;(function(t){let e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);t.CoopAndCoep=Object.freeze(e.get("3"));let n="vscode-coi";function r(o){let u;typeof o=="string"?u=new URL(o).searchParams:o instanceof URL?u=o.searchParams:He.URI.isUri(o)&&(u=new URL(o.toString(!0)).searchParams);let a=u?.get(n);if(a)return e.get(a)}s(r,"getHeadersFromQuery"),t.getHeadersFromQuery=r;function i(o,u,a){if(!globalThis.crossOriginIsolated)return;let l=u&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(n,l):o[n]=l}s(i,"addSearchParam"),t.addSearchParam=i})(d1||(O.COI=d1={}))});var v1=U(p=>{"use strict";g();var R2=p&&p.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),O2=p&&p.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C1=p&&p.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;irt.getRoot(r).length&&r[r.length-1]===n}else{let r=e.path;return r.length>1&&r.charCodeAt(r.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,n=ie.sep){return(0,p.hasTrailingPathSeparator)(e,n)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,n=ie.sep){let r=!1;if(e.scheme===De.Schemas.file){let i=be(e);r=i!==void 0&&i.length===rt.getRoot(i).length&&i[i.length-1]===n}else{n="/";let i=e.path;r=i.length===1&&i.charCodeAt(i.length-1)===47}return!r&&!(0,p.hasTrailingPathSeparator)(e,n)?e.with({path:e.path+"/"}):e}};p.ExtUri=it;p.extUri=new it(()=>!1);p.extUriBiasedIgnorePathCase=new it(t=>t.scheme===De.Schemas.file?!y1.isLinux:!0);p.extUriIgnorePathCase=new it(t=>!0);p.isEqual=p.extUri.isEqual.bind(p.extUri);p.isEqualOrParent=p.extUri.isEqualOrParent.bind(p.extUri);p.getComparisonKey=p.extUri.getComparisonKey.bind(p.extUri);p.basenameOrAuthority=p.extUri.basenameOrAuthority.bind(p.extUri);p.basename=p.extUri.basename.bind(p.extUri);p.extname=p.extUri.extname.bind(p.extUri);p.dirname=p.extUri.dirname.bind(p.extUri);p.joinPath=p.extUri.joinPath.bind(p.extUri);p.normalizePath=p.extUri.normalizePath.bind(p.extUri);p.relativePath=p.extUri.relativePath.bind(p.extUri);p.resolvePath=p.extUri.resolvePath.bind(p.extUri);p.isAbsolutePath=p.extUri.isAbsolutePath.bind(p.extUri);p.isEqualAuthority=p.extUri.isEqualAuthority.bind(p.extUri);p.hasTrailingPathSeparator=p.extUri.hasTrailingPathSeparator.bind(p.extUri);p.removeTrailingPathSeparator=p.extUri.removeTrailingPathSeparator.bind(p.extUri);p.addTrailingPathSeparator=p.extUri.addTrailingPathSeparator.bind(p.extUri);function D2(t,e){let n=[];for(let r=0;ru===r?!1:(0,p.isEqualOrParent)(i,e(o)))||n.push(t[r])}return n}s(D2,"distinctParents");var b1;(function(t){t.META_DATA_LABEL="label",t.META_DATA_DESCRIPTION="description",t.META_DATA_SIZE="size",t.META_DATA_MIME="mime";function e(n){let r=new Map;n.path.substring(n.path.indexOf(";")+1,n.path.lastIndexOf(";")).split(";").forEach(u=>{let[a,l]=u.split(":");a&&l&&r.set(a,l)});let o=n.path.substring(0,n.path.indexOf(";"));return o&&r.set(t.META_DATA_MIME,o),r}s(e,"parseMetaData"),t.parseMetaData=e})(b1||(p.DataUri=b1={}));function M2(t,e,n){if(e){let r=t.path;return r&&r[0]!==ie.posix.sep&&(r=ie.posix.sep+r),t.with({scheme:n,authority:e,path:r})}return t.with({scheme:n})}s(M2,"toLocalResource")});var w1=U(cn=>{"use strict";g();Object.defineProperty(cn,"__esModule",{value:!0});cn.MicrotaskDelay=void 0;cn.MicrotaskDelay=Symbol("MicrotaskDelay")});var P1=U(h=>{"use strict";g();Object.defineProperty(h,"__esModule",{value:!0});h.AsyncReader=h.AsyncReaderEndOfStream=h.CancelableAsyncIterableProducer=h.AsyncIterableProducer=h.AsyncIterableSource=h.AsyncIterableObject=h.LazyStatefulPromise=h.StatefulPromise=h.Promises=h.DeferredPromise=h.IntervalCounter=h.TaskSequentializer=h.GlobalIdleValue=h.AbstractIdleValue=h._runWhenIdle=h.runWhenGlobalIdle=h.ThrottledWorker=h.RunOnceWorker=h.ProcessTimeRunOnceScheduler=h.RunOnceScheduler=h.IntervalTimer=h.TimeoutTimer=h.TaskQueue=h.ResourceQueue=h.LimitedQueue=h.Queue=h.Limiter=h.AutoOpenBarrier=h.Barrier=h.ThrottledDelayer=h.Delayer=h.SequencerByKey=h.Sequencer=h.Throttler=void 0;h.isThenable=N1;h.createCancelablePromise=A1;h.raceCancellation=T1;h.raceCancellationError=W2;h.rejectIfNotCanceled=j2;h.notCancellablePromise=z2;h.raceCancellablePromises=B2;h.raceTimeout=k1;h.asPromise=$2;h.promiseWithResolvers=x1;h.timeout=Pi;h.disposableTimeout=K2;h.sequence=V2;h.first=Q2;h.firstParallel=Y2;h.installFakeRunWhenIdle=Z2;h.retry=X2;h.createCancelableAsyncIterableProducer=J2;h.cancellableIterable=ec;h.createTimeout=tc;var xi=Br(),se=Ue(),wt=jr(),Me=Ut(),E1=v1(),F2=ze(),U2=w1(),q2=tn();function N1(t){return!!t&&typeof t.then=="function"}s(N1,"isThenable");function A1(t){let e=new xi.CancellationTokenSource,n=t(e.token),r=!1,i=new Promise((o,u)=>{let a=e.token.onCancellationRequested(()=>{r=!0,a.dispose(),u(new se.CancellationError)});Promise.resolve(n).then(l=>{a.dispose(),e.dispose(),r?(0,Me.isDisposable)(l)&&l.dispose():o(l)},l=>{a.dispose(),e.dispose(),u(l)})});return new class{cancel(){e.cancel(),e.dispose()}then(o,u){return i.then(o,u)}catch(o){return this.then(void 0,o)}finally(o){return i.finally(o)}}}s(A1,"createCancelablePromise");function T1(t,e,n){return new Promise((r,i)=>{let o=e.onCancellationRequested(()=>{o.dispose(),r(n)});t.then(r,i).finally(()=>o.dispose())})}s(T1,"raceCancellation");function W2(t,e){return new Promise((n,r)=>{let i=e.onCancellationRequested(()=>{i.dispose(),r(new se.CancellationError)});t.then(n,r).finally(()=>i.dispose())})}s(W2,"raceCancellationError");function j2(t){if(!(0,se.isCancellationError)(t))return Promise.reject(t)}s(j2,"rejectIfNotCanceled");function z2(t){return new Promise((e,n)=>{t.then(e,n)})}s(z2,"notCancellablePromise");function B2(t){let e=-1,n=t.map((i,o)=>i.then(u=>(e=o,u))),r=Promise.race(n);return r.cancel=()=>{t.forEach((i,o)=>{o!==e&&i.cancel&&i.cancel()})},r.finally(()=>{r.cancel()}),r}s(B2,"raceCancellablePromises");function k1(t,e,n){let r,i=setTimeout(()=>{r?.(void 0),n?.()},e);return Promise.race([t.finally(()=>clearTimeout(i)),new Promise(o=>r=o)])}s(k1,"raceTimeout");function $2(t){return new Promise((e,n)=>{let r=t();N1(r)?r.then(e,n):e(r)})}s($2,"asPromise");function x1(){let t,e;return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}s(x1,"promiseWithResolvers");var fn=class{static{s(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new xi.CancellationTokenSource}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let n=s(()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let r=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,r},"onComplete");this.queuedPromise=new Promise(r=>{this.activePromise.then(n,n).then(r)})}return new Promise((n,r)=>{this.queuedPromise.then(n,r)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((n,r)=>{this.activePromise.then(i=>{this.activePromise=null,n(i)},i=>{this.activePromise=null,r(i)})})}dispose(){this.cancellationTokenSource.cancel()}};h.Throttler=fn;var fi=class{static{s(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};h.Sequencer=fi;var hi=class{static{s(this,"SequencerByKey")}constructor(){this.promiseMap=new Map}queue(e,n){let i=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(n).finally(()=>{this.promiseMap.get(e)===i&&this.promiseMap.delete(e)});return this.promiseMap.set(e,i),i}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}};h.SequencerByKey=hi;var H2=s((t,e)=>{let n=!0,r=setTimeout(()=>{n=!1,e()},t);return{isTriggered:s(()=>n,"isTriggered"),dispose:s(()=>{clearTimeout(r),n=!1},"dispose")}},"timeoutDeferred"),G2=s(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:s(()=>e,"isTriggered"),dispose:s(()=>{e=!1},"dispose")}},"microtaskDeferred"),hn=class{static{s(this,"Delayer")}constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,n=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((i,o)=>{this.doResolve=i,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let i=this.task;return this.task=null,i()}}));let r=s(()=>{this.deferred=null,this.doResolve?.(null)},"fn");return this.deferred=n===U2.MicrotaskDelay?G2(r):H2(n,r),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new se.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};h.Delayer=hn;var di=class{static{s(this,"ThrottledDelayer")}constructor(e){this.delayer=new hn(e),this.throttler=new fn}trigger(e,n){return this.delayer.trigger(()=>this.throttler.queue(e),n)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};h.ThrottledDelayer=di;var dn=class{static{s(this,"Barrier")}constructor(){this._isOpen=!1,this._promise=new Promise((e,n)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};h.Barrier=dn;var mi=class extends dn{static{s(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};h.AutoOpenBarrier=mi;function Pi(t,e){return e?new Promise((n,r)=>{let i=setTimeout(()=>{o.dispose(),n()},t),o=e.onCancellationRequested(()=>{clearTimeout(i),o.dispose(),r(new se.CancellationError)})}):A1(n=>Pi(t,n))}s(Pi,"timeout");function K2(t,e=0,n){let r=setTimeout(()=>{t(),n&&i.dispose()},e),i=(0,Me.toDisposable)(()=>{clearTimeout(r),n?.delete(i)});return n?.add(i),i}s(K2,"disposableTimeout");function V2(t){let e=[],n=0,r=t.length;function i(){return n!!r,n=null){let r=0,i=t.length,o=s(()=>{if(r>=i)return Promise.resolve(n);let u=t[r++];return Promise.resolve(u()).then(l=>e(l)?Promise.resolve(l):o())},"loop");return o()}s(Q2,"first");function Y2(t,e=r=>!!r,n=null){if(t.length===0)return Promise.resolve(n);let r=t.length,i=s(()=>{r=-1;for(let o of t)o.cancel?.()},"finish");return new Promise((o,u)=>{for(let a of t)a.then(l=>{--r>=0&&e(l)?(i(),o(l)):r===0&&o(n)}).catch(l=>{--r>=0&&(i(),u(l))})})}s(Y2,"firstParallel");var mn=class{static{s(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new wt.Emitter}whenIdle(){return this.size>0?wt.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((n,r)=>{this.outstandingPromises.push({factory:e,c:n,e:r}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}};h.Limiter=mn;var pn=class extends mn{static{s(this,"Queue")}constructor(){super(1)}};h.Queue=pn;var pi=class{static{s(this,"LimitedQueue")}constructor(){this.sequentializer=new _n,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};h.LimitedQueue=pi;var gi=class{static{s(this,"ResourceQueue")}constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new ke;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,n=E1.extUri){let r=n.getComparisonKey(e);return this.queues.get(r)?.size??0}queueFor(e,n,r=E1.extUri){let i=r.getComparisonKey(e),o=this.queues.get(i);if(!o){o=new pn;let u=this.drainListenerCount++,a=wt.Event.once(o.onDrained)(()=>{o?.dispose(),this.queues.delete(i),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(u),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new Me.DisposableMap),this.drainListeners.set(u,a),this.queues.set(i,o)}return o.queue(n)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}};h.ResourceQueue=gi;var _i=class{static{s(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let n=new ke;return this._pendingTasks.push({task:e,deferred:n,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),n.p}scheduleSkipIfCleared(e){let n=new ke;return this._pendingTasks.push({task:e,deferred:n,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),n.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new se.BugIndicatingError;this._runningTask=e.task;try{let n=await e.task();e.deferred.complete(n)}catch(n){e.deferred.error(n)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let n of e)n.setUndefinedWhenCleared?n.deferred.complete(void 0):n.deferred.error(new se.CancellationError)}};h.TaskQueue=_i;var bi=class{static{s(this,"TimeoutTimer")}constructor(e,n){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof n=="number"&&this.setIfNotSet(e,n)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,n){if(this._isDisposed)throw new se.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},n)}setIfNotSet(e,n){if(this._isDisposed)throw new se.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},n))}};h.TimeoutTimer=bi;var Ci=class{static{s(this,"IntervalTimer")}constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,n,r=globalThis){if(this.isDisposed)throw new se.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let i=r.setInterval(()=>{e()},n);this.disposable=(0,Me.toDisposable)(()=>{r.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};h.IntervalTimer=Ci;var Et=class{static{s(this,"RunOnceScheduler")}constructor(e,n){this.timeoutToken=void 0,this.runner=e,this.timeout=n,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};h.RunOnceScheduler=Et;var yi=class{static{s(this,"ProcessTimeRunOnceScheduler")}constructor(e,n){n%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${n}ms is not a multiple of 1000ms.`),this.runner=e,this.timeout=n,this.counter=0,this.intervalToken=void 0,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=void 0)}schedule(e=this.timeout){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(e/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==void 0}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=void 0,this.runner?.())}};h.ProcessTimeRunOnceScheduler=yi;var vi=class extends Et{static{s(this,"RunOnceWorker")}constructor(e,n){super(e,n),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){let e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}};h.RunOnceWorker=vi;var wi=class extends Me.Disposable{static{s(this,"ThrottledWorker")}constructor(e,n){super(),this.options=e,this.handler=n,this.pendingWork=[],this.throttler=this._register(new Me.MutableDisposable),this.disposed=!1,this.lastExecutionTime=0}get pending(){return this.pendingWork.length}work(e){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+e.length>this.options.maxBufferedWork)return!1}else if(this.pending+e.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(let r of e)this.pendingWork.push(r);let n=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||n>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-n,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(e=this.options.throttleDelay){this.throttler.value=new Et(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};h.ThrottledWorker=wi;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?h._runWhenIdle=(e,n,r)=>{(0,F2.setTimeout0)(()=>{if(i)return;let o=Date.now()+15;n(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,o-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:h._runWhenIdle=(e,n,r)=>{let i=e.requestIdleCallback(n,typeof r=="number"?{timeout:r}:void 0),o=!1;return{dispose(){o||(o=!0,e.cancelIdleCallback(i))}}},h.runWhenGlobalIdle=(e,n)=>(0,h._runWhenIdle)(globalThis,e,n)})();function Z2(t){let e=h._runWhenIdle,n=h.runWhenGlobalIdle;return h._runWhenIdle=t,h.runWhenGlobalIdle=(r,i)=>t(globalThis,r,i),(0,Me.toDisposable)(()=>{h._runWhenIdle=e,h.runWhenGlobalIdle=n})}s(Z2,"installFakeRunWhenIdle");var gn=class{static{s(this,"AbstractIdleValue")}constructor(e,n){this._didRun=!1,this._executor=()=>{try{this._value=n()}catch(r){this._error=r}finally{this._didRun=!0}},this._handle=(0,h._runWhenIdle)(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}};h.AbstractIdleValue=gn;var Ei=class extends gn{static{s(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};h.GlobalIdleValue=Ei;async function X2(t,e,n){let r;for(let i=0;ir?.(),"cancel"),promise:n},n.then(()=>this.doneRunning(e),()=>this.doneRunning(e)),n}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){let e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{let{promise:n,resolve:r,reject:i}=x1();this._queued={run:e,promise:n,promiseResolve:r,promiseReject:i}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}};h.TaskSequentializer=_n;var Li=class{static{s(this,"IntervalCounter")}constructor(e,n=()=>Date.now()){this.interval=e,this.nowFn=n,this.lastIncrementTime=0,this.value=0}increment(){let e=this.nowFn();return e-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=e,this.value=0),this.value++,this.value}};h.IntervalCounter=Li;var ke=class t{static{s(this,"DeferredPromise")}static fromPromise(e){let n=new t;return n.settleWith(e),n}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,n)=>{this.completeCallback=e,this.errorCallback=n})}complete(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.completeCallback(e),this.outcome={outcome:0,value:e},n()})}error(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.errorCallback(e),this.outcome={outcome:1,value:e},n()})}settleWith(e){return e.then(n=>this.complete(n),n=>this.error(n))}cancel(){return this.error(new se.CancellationError)}};h.DeferredPromise=ke;var L1;(function(t){async function e(r){let i,o=await Promise.all(r.map(u=>u.then(a=>a,a=>{i||(i=a)})));if(typeof i<"u")throw i;return o}s(e,"settled"),t.settled=e;function n(r){return new Promise(async(i,o)=>{try{await r(i,o)}catch(u){o(u)}})}s(n,"withAsyncBody"),t.withAsyncBody=n})(L1||(h.Promises=L1={}));var bn=class{static{s(this,"StatefulPromise")}get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then(n=>(this._value=n,this._isResolved=!0,n),n=>{throw this._error=n,this._isResolved=!0,n})}requireValue(){if(!this._isResolved)throw new se.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};h.StatefulPromise=bn;var Ni=class{static{s(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new q2.Lazy(()=>new bn(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};h.LazyStatefulPromise=Ni;var Cn=class t{static{s(this,"AsyncIterableObject")}static fromArray(e){return new t(n=>{n.emitMany(e)})}static fromPromise(e){return new t(async n=>{n.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async n=>{await Promise.all(e.map(async r=>n.emitOne(await r)))})}static merge(e){return new t(async n=>{await Promise.all(e.map(async r=>{for await(let i of r)n.emitOne(i)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new wt.Emitter,queueMicrotask(async()=>{let r={emitOne:s(i=>this.emitOne(i),"emitOne"),emitMany:s(i=>this.emitMany(i),"emitMany"),reject:s(i=>this.reject(i),"reject")};try{await Promise.resolve(e(r)),this.resolve()}catch(i){this.reject(i)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:s(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,n){return new t(async r=>{for await(let i of e)r.emitOne(n(i))})}map(e){return t.map(this,e)}static filter(e,n){return new t(async r=>{for await(let i of e)n(i)&&r.emitOne(i)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,n=>!!n)}coalesce(){return t.coalesce(this)}static async toPromise(e){let n=[];for await(let r of e)n.push(r);return n}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};h.AsyncIterableObject=Cn;function J2(t){let e=new xi.CancellationTokenSource,n=t(e.token);return new vn(e,async r=>{let i=e.token.onCancellationRequested(()=>{i.dispose(),e.dispose(),r.reject(new se.CancellationError)});try{for await(let o of n){if(e.token.isCancellationRequested)return;r.emitOne(o)}i.dispose(),e.dispose()}catch(o){i.dispose(),e.dispose(),r.reject(o)}})}s(J2,"createCancelableAsyncIterableProducer");var Ai=class{static{s(this,"AsyncIterableSource")}constructor(e){this._deferred=new ke,this._asyncIterable=new Cn(i=>{if(n){i.reject(n);return}return r&&i.emitMany(r),this._errorFn=o=>i.reject(o),this._emitOneFn=o=>i.emitOne(o),this._emitManyFn=o=>i.emitMany(o),this._deferred.p},e);let n,r;this._errorFn=i=>{n||(n=i)},this._emitOneFn=i=>{r||(r=[]),r.push(i)},this._emitManyFn=i=>{r?i.forEach(o=>r.push(o)):r=i.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}};h.AsyncIterableSource=Ai;function ec(t,e){let n=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await T1(n.next(),e)||{done:!0,value:void 0}},throw:n.throw?.bind(n),return:n.return?.bind(n),[Symbol.asyncIterator](){return this}}}s(ec,"cancellableIterable");var Ti=class{static{s(this,"ProducerConsumer")}constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let n=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(n,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let n of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(n,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new se.BugIndicatingError("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,n){n.ok?e.complete(n.value):e.error(n.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new ke;return this._unsatisfiedConsumers.push(e),e.p}}},yn=class t{static{s(this,"AsyncIterableProducer")}constructor(e,n){this._onReturn=n,this._producerConsumer=new Ti,this._iterator={next:s(()=>this._producerConsumer.consume(),"next"),return:s(()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),"return"),throw:s(async r=>(this._finishError(r),{done:!0,value:void 0}),"throw")},queueMicrotask(async()=>{let r=e({emitOne:s(i=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}}),"emitOne"),emitMany:s(i=>{for(let o of i)this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}})},"emitMany"),reject:s(i=>this._finishError(i),"reject")});if(!this._producerConsumer.hasFinalValue)try{await r,this._finishOk()}catch(i){this._finishError(i)}})}static fromArray(e){return new t(n=>{n.emitMany(e)})}static fromPromise(e){return new t(async n=>{n.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async n=>{await Promise.all(e.map(async r=>n.emitOne(await r)))})}static merge(e){return new t(async n=>{await Promise.all(e.map(async r=>{for await(let i of r)n.emitOne(i)}))})}static{this.EMPTY=t.fromArray([])}static map(e,n){return new t(async r=>{for await(let i of e)r.emitOne(n(i))})}static tee(e){let n,r,i=new ke,o=s(async()=>{if(!(!n||!r))try{for await(let l of e)n.emitOne(l),r.emitOne(l)}catch(l){n.reject(l),r.reject(l)}finally{i.complete()}},"start"),u=new t(async l=>(n=l,o(),i.p)),a=new t(async l=>(r=l,o(),i.p));return[u,a]}map(e){return t.map(this,e)}static coalesce(e){return t.filter(e,n=>!!n)}coalesce(){return t.coalesce(this)}static filter(e,n){return new t(async r=>{for await(let i of e)n(i)&&r.emitOne(i)})}filter(e){return t.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};h.AsyncIterableProducer=yn;var vn=class extends yn{static{s(this,"CancelableAsyncIterableProducer")}constructor(e,n){super(n),this._source=e}cancel(){this._source.cancel()}};h.CancelableAsyncIterableProducer=vn;h.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var ki=class{static{s(this,"AsyncReader")}get endOfStream(){return this._buffer.length===0&&this._atEnd}constructor(e){this._source=e,this._buffer=[],this._atEnd=!1}async read(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?h.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,n){do{let r=await this.peek();if(r===h.AsyncReaderEndOfStream||!e(r))break;await this.read(),await n(r)}while(!0)}readBufferedOrThrow(){let e=this.peekBufferedOrThrow();return this._buffer.shift(),e}async consumeToEnd(){for(;!this.endOfStream;)await this.read()}async peek(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?h.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return h.AsyncReaderEndOfStream;throw new se.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await k1(this._extendBuffer(),e),this._atEnd)return h.AsyncReaderEndOfStream;if(this._buffer.length!==0)return this._buffer[0]}_extendBuffer(){return this._atEnd?Promise.resolve():(this._extendBufferPromise||(this._extendBufferPromise=(async()=>{let{value:e,done:n}=await this._source.next();this._extendBufferPromise=void 0,n?this._atEnd=!0:this._buffer.push(e)})()),this._extendBufferPromise)}};h.AsyncReader=ki;function tc(t,e){let n=setTimeout(e,t);return(0,Me.toDisposable)(()=>clearTimeout(n))}s(tc,"createTimeout")});var I1=U(wn=>{"use strict";g();Object.defineProperty(wn,"__esModule",{value:!0});wn.Position=void 0;var Ii=class t{static{s(this,"Position")}constructor(e,n){this.lineNumber=e,this.column=n}with(e=this.lineNumber,n=this.column){return e===this.lineNumber&&n===this.column?this:new t(e,n)}delta(e=0,n=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+n))}equals(e){return t.equals(this,e)}static equals(e,n){return!e&&!n?!0:!!e&&!!n&&e.lineNumber===n.lineNumber&&e.column===n.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,n){return e.lineNumber{"use strict";g();Object.defineProperty(En,"__esModule",{value:!0});En.Range=void 0;var S1=I1(),Si=class t{static{s(this,"Range")}constructor(e,n,r,i){e>r||e===r&&n>i?(this.startLineNumber=r,this.startColumn=i,this.endLineNumber=e,this.endColumn=n):(this.startLineNumber=e,this.startColumn=n,this.endLineNumber=r,this.endColumn=i)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.columne.endColumn)}static strictContainsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.column<=e.startColumn||n.lineNumber===e.endLineNumber&&n.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumn<=e.startColumn||n.endLineNumber===e.endLineNumber&&n.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,n){let r,i,o,u;return n.startLineNumbere.endLineNumber?(o=n.endLineNumber,u=n.endColumn):n.endLineNumber===e.endLineNumber?(o=n.endLineNumber,u=Math.max(n.endColumn,e.endColumn)):(o=e.endLineNumber,u=e.endColumn),new t(r,i,o,u)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,n){let r=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,u=e.endColumn,a=n.startLineNumber,l=n.startColumn,c=n.endLineNumber,d=n.endColumn;return rc?(o=c,u=d):o===c&&(u=Math.min(u,d)),r>o||r===o&&i>u?null:new t(r,i,o,u)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,n){return!e&&!n?!0:!!e&&!!n&&e.startLineNumber===n.startLineNumber&&e.startColumn===n.startColumn&&e.endLineNumber===n.endLineNumber&&e.endColumn===n.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new S1.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new S1.Position(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,n){return new t(this.startLineNumber,this.startColumn,e,n)}setStartPosition(e,n){return new t(e,n,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,n=e){return new t(e.lineNumber,e.column,n.lineNumber,n.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,n){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};En.Range=Si});g();g();g();g();g();g();var st=class t{static{s(this,"Position")}constructor(e,n){this.lineNumber=e,this.column=n}with(e=this.lineNumber,n=this.column){return e===this.lineNumber&&n===this.column?this:new t(e,n)}delta(e=0,n=0){return this.with(this.lineNumber+e,this.column+n)}equals(e){return t.equals(this,e)}static equals(e,n){return!e&&!n?!0:!!e&&!!n&&e.lineNumber===n.lineNumber&&e.column===n.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,n){return e.lineNumberr||e===r&&n>i?(this.startLineNumber=r,this.startColumn=i,this.endLineNumber=e,this.endColumn=n):(this.startLineNumber=e,this.startColumn=n,this.endLineNumber=r,this.endColumn=i)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.columne.endColumn)}static strictContainsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.column<=e.startColumn||n.lineNumber===e.endLineNumber&&n.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumn<=e.startColumn||n.endLineNumber===e.endLineNumber&&n.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,n){let r,i,o,u;return n.startLineNumbere.endLineNumber?(o=n.endLineNumber,u=n.endColumn):n.endLineNumber===e.endLineNumber?(o=n.endLineNumber,u=Math.max(n.endColumn,e.endColumn)):(o=e.endLineNumber,u=e.endColumn),new t(r,i,o,u)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,n){let r=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,u=e.endColumn,a=n.startLineNumber,l=n.startColumn,c=n.endLineNumber,d=n.endColumn;return rc?(o=c,u=d):o===c&&(u=Math.min(u,d)),r>o||r===o&&i>u?null:new t(r,i,o,u)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,n){return!e&&!n?!0:!!e&&!!n&&e.startLineNumber===n.startLineNumber&&e.startColumn===n.startColumn&&e.endLineNumber===n.endLineNumber&&e.endColumn===n.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new st(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new st(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,n){return new t(this.startLineNumber,this.startColumn,e,n)}setStartPosition(e,n){return new t(e,n,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,n=e){return new t(e.lineNumber,e.column,n.lineNumber,n.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,n){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};var Rn=250,In=4,Q1=/\w{2}/,Sn=class{static{s(this,"InlineApproximateTokenizer")}tokenLength(e){return Math.ceil(e.length/In)}},Y1="o200k_base",Tt=class{static{s(this,"NaiveChunker")}constructor(e=Y1){this.tokenizer=new Sn}getTokenCount(e){return this.tokenizer.tokenLength(e)}chunkFile(e,n,r={},i){let{maxTokenLength:o=Rn,removeEmptyLines:u=!0}=r,a=[];for(let l of this._processLinesIntoChunks(e,n,o,!0,u,i)){if(i?.isCancellationRequested)return[];(!u||l.text.length>0&&Q1.test(l.text))&&a.push(l)}return a}*_processLinesIntoChunks(e,n,r,i,o,u){let a=Z1(n),l=[],c=0,d,f=!0;for(let D=0;D0?1:0;if(Math.ceil((c+Z+H.length)/In)>r&&l.length>0){let oe=this.finalizeChunk(e,l,i,d??"",!1,f);oe&&(yield oe),l.length=0,c=0,d=void 0,f=!1}if(d===void 0||d.length>0){let oe=$.match(/^\s+/),V=oe?oe[0]:"";d=d?J1(d,V):V}l.push({text:H,lineNumber:D}),c+=(l.length>1?1:0)+H.length}let y=this.finalizeChunk(e,l,i,d??"",!0,f);y&&(yield y)}finalizeChunk(e,n,r,i,o,u){if(!n.length)return;let a=r?n.map(c=>c.text.substring(i.length)).join(` +`))}},gt=class t extends Error{static{s(this,"ListenerLeakError")}constructor(e,n,r,i,o){super(o?`[${o}] potential listener LEAK detected, ${e}`:`potential listener LEAK detected, ${e}`),this.name="ListenerLeakError",this.kind=e,this.listenerCount=i,this.details=n,this.stack=r}static is(e){return e instanceof t||e instanceof Error&&typeof e.kind=="string"&&typeof e.listenerCount=="number"}};M.ListenerLeakError=gt;var Gt=class extends gt{static{s(this,"ListenerRefusalError")}constructor(e,n,r,i,o){super(e,n,r,i,o),this.name="ListenerRefusalError"}};M.ListenerRefusalError=Gt;var Ta=0,Ze=class{static{s(this,"UniqueContainer")}constructor(e){this.value=e,this.id=Ta++}},ka=2,Fs=s((t,e)=>{if(t instanceof Ze)e(t);else for(let n=0;n0||this._options?.leakWarningThreshold?new Ir(e?.onListenerError??mt.onUnexpectedError,this._options?.leakWarningThreshold??pt,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new Ht(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Ss){let e=this._listeners;queueMicrotask(()=>{Fs(e,n=>n.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,n,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let c=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=c[1]/this._size>.3?"dominated":"popular",f=new Gt(d,`${l}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||mt.onUnexpectedError)(f),le.Disposable.None}if(this._disposed)return le.Disposable.None;n&&(e=e.bind(n));let i=new Ze(e),o,u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=Xe.create(),o=this._leakageMon.check(i.stack,this._size+1)),Ss&&(i.stack=u??Xe.create()),this._listeners?this._listeners instanceof Ze?(this._deliveryQueue??=new Kt,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let a=(0,le.toDisposable)(()=>{o?.(),this._removeListener(i)});return Wr(a,r),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let n=this._listeners,r=n.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;let i=this._deliveryQueue.current===this;if(this._size*ka<=n.length){let o=0;for(let u=0;u0}};M.Emitter=re;var xa=s(()=>new Kt,"createEventDeliveryQueue");M.createEventDeliveryQueue=xa;var Kt=class{static{s(this,"EventDeliveryQueuePrivate")}constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Sr=class extends re{static{s(this,"AsyncEmitter")}async fireAsync(e,n,r){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new Ms.LinkedList),Fs(this._listeners,i=>this._asyncDeliveryQueue.push([i.value,e]));this._asyncDeliveryQueue.size>0&&!n.isCancellationRequested;){let[i,o]=this._asyncDeliveryQueue.shift(),u=[],a={...o,token:n,waitUntil:s(l=>{if(Object.isFrozen(u))throw new Error("waitUntil can NOT be called asynchronous");r&&(l=r(l,i)),u.push(l)},"waitUntil")};try{i(a)}catch(l){(0,mt.onUnexpectedError)(l);continue}Object.freeze(u),await Promise.allSettled(u).then(l=>{for(let c of l)c.status==="rejected"&&(0,mt.onUnexpectedError)(c.reason)})}}};M.AsyncEmitter=Sr;var Vt=class extends re{static{s(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new Ms.LinkedList,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}};M.PauseableEmitter=Vt;var Rr=class extends Vt{static{s(this,"DebounceEmitter")}constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}};M.DebounceEmitter=Rr;var Or=class extends re{static{s(this,"MicrotaskEmitter")}constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(n=>super.fire(n)),this._queuedEvents=[]}))}};M.MicrotaskEmitter=Or;var Qt=class{static{s(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new re({onWillAddFirstListener:s(()=>this.onFirstListenerAdd(),"onWillAddFirstListener"),onDidRemoveLastListener:s(()=>this.onLastListenerRemove(),"onDidRemoveLastListener")})}get event(){return this.emitter.event}add(e){let n={event:e,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);let r=s(()=>{this.hasListeners&&this.unhook(n);let i=this.events.indexOf(n);this.events.splice(i,1)},"dispose");return(0,le.toDisposable)((0,va.createSingleCallFunction)(r))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(n=>this.emitter.fire(n))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(let e of this.events)e.listener?.dispose();this.events=[]}};M.EventMultiplexer=Qt;var Dr=class{static{s(this,"DynamicListEventMultiplexer")}constructor(e,n,r,i){this._store=new le.DisposableStore;let o=this._store.add(new Qt),u=this._store.add(new le.DisposableMap);function a(l){u.set(l,o.add(i(l)))}s(a,"addItem");for(let l of e)a(l);this._store.add(n(l=>{a(l)})),this._store.add(r(l=>{u.deleteAndDispose(l)})),this.event=o.event}dispose(){this._store.dispose()}};M.DynamicListEventMultiplexer=Dr;var Mr=class{static{s(this,"EventBufferer")}constructor(){this.data=[]}wrapEvent(e,n,r){return(i,o,u)=>e(a=>{let l=this.data[this.data.length-1];if(!n){l?l.buffers.push(()=>i.call(o,a)):i.call(o,a);return}let c=l;if(!c){i.call(o,n(r,a));return}c.items??=[],c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??=r?c.items.reduce(n,r):c.items.reduce(n),i.call(o,c.reducedResult)})},void 0,u)}bufferEvents(e){let n={buffers:new Array};this.data.push(n);let r=e();return this.data.pop(),n.buffers.forEach(i=>i()),r}};M.EventBufferer=Mr;var Fr=class{static{s(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=$t.None,this.inputEventListener=le.Disposable.None,this.emitter=new re({onDidAddFirstListener:s(()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},"onDidAddFirstListener"),onDidRemoveLastListener:s(()=>{this.listening=!1,this.inputEventListener.dispose()},"onDidRemoveLastListener")}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}};M.Relay=Fr;var Ur=class{static{s(this,"ValueWithChangeEvent")}static const(e){return new qr(e)}constructor(e){this._value=e,this._onDidChange=new re,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};M.ValueWithChangeEvent=Ur;var qr=class{static{s(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=$t.None}};function Pa(t,e,n){let r=new le.DisposableMap,i=new Set(t());for(let u of i)r.set(u,n(u));let o=new le.DisposableStore;return o.add(e(()=>{let u=t(),a=(0,ya.diffSets)(i,u);for(let l of a.removed)r.deleteAndDispose(l);for(let l of a.added)r.set(l,n(l));i=new Set(u)})),o.add(r),o}s(Pa,"trackSetChanges");function Wr(t,e){e instanceof le.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}s(Wr,"addToDisposables");function Ds(t,e){if(e instanceof le.DisposableStore)e.delete(t);else if(Array.isArray(e)){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}t.dispose()}s(Ds,"disposeAndRemove")});var Br=U(Le=>{"use strict";g();Object.defineProperty(Le,"__esModule",{value:!0});Le.CancellationTokenPool=Le.CancellationTokenSource=Le.CancellationToken=void 0;Le.cancelOnDispose=Sa;var Us=jr(),Ia=Ut(),qs=Object.freeze(function(t,e){let n=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(n)}}}),Yt;(function(t){function e(n){return n===t.None||n===t.Cancelled||n instanceof Je?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}s(e,"isCancellationToken"),t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Us.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:qs})})(Yt||(Le.CancellationToken=Yt={}));var Je=class{static{s(this,"MutableToken")}constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?qs:(this._emitter||(this._emitter=new Us.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},_t=class{static{s(this,"CancellationTokenSource")}constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Je),this._token}cancel(){this._token?this._token instanceof Je&&this._token.cancel():this._token=Yt.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Je&&this._token.dispose():this._token=Yt.None}};Le.CancellationTokenSource=_t;function Sa(t){let e=new _t;return t.add({dispose(){e.cancel()}}),e.token}s(Sa,"cancelOnDispose");var zr=class{static{s(this,"CancellationTokenPool")}constructor(){this._source=new _t,this._listeners=new Ia.DisposableStore,this._total=0,this._cancelled=0,this._isDone=!1}get token(){return this._source.token}add(e){if(this._isDone)return;if(this._total++,e.isCancellationRequested){this._cancelled++,this._check();return}let n=e.onCancellationRequested(()=>{n.dispose(),this._cancelled++,this._check()});this._listeners.add(n)}_check(){!this._isDone&&this._total>0&&this._total===this._cancelled&&(this._isDone=!0,this._listeners.dispose(),this._source.cancel())}dispose(){this._listeners.dispose(),this._source.dispose()}};Le.CancellationTokenPool=zr});var bt=U(C=>{"use strict";g();var Ra=C&&C.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Oa=C&&C.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Da=C&&C.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i=Ma&&t<=Ua||t>=Fa&&t<=qa}s(Ae,"isWindowsDeviceRoot");function Xt(t,e,n,r){let i="",o=0,u=-1,a=0,l=0;for(let c=0;c<=t.length;++c){if(c2){let d=i.lastIndexOf(n);d===-1?(i="",o=0):(i=i.slice(0,d),o=i.length-1-i.lastIndexOf(n)),u=c,a=0;continue}else if(i.length!==0){i="",o=0,u=c,a=0;continue}}e&&(i+=i.length>0?`${n}..`:"..",o=2)}else i.length>0?i+=`${n}${t.slice(u+1,c)}`:i=t.slice(u+1,c),o=c-u-1;u=c,a=0}else l===$e&&a!==-1?++a:a=-1}return i}s(Xt,"normalizeString");function za(t){return t?`${t[0]==="."?"":"."}${t}`:""}s(za,"formatExt");function Ws(t,e){ja(e,"pathObject");let n=e.dir||e.root,r=e.base||`${e.name||""}${za(e.ext)}`;return n?n===e.root?`${n}${r}`:`${n}${t}${r}`:r}s(Ws,"_format");C.win32={resolve(...t){let e="",n="",r=!1;for(let i=t.length-1;i>=-1;i--){let o;if(i>=0){if(o=t[i],G(o,`paths[${i}]`),o.length===0)continue}else e.length===0?o=et.cwd():(o=et.env[`=${e}`]||et.cwd(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===ce)&&(o=`${e}\\`));let u=o.length,a=0,l="",c=!1,d=o.charCodeAt(0);if(u===1)S(d)&&(a=1,c=!0);else if(S(d))if(c=!0,S(o.charCodeAt(1))){let f=2,y=f;for(;f2&&S(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(r){if(e.length>0)break}else if(n=`${o.slice(a)}\\${n}`,r=c,c&&e.length>0)break}return n=Xt(n,!r,"\\",S),r?`${e}\\${n}`:`${e}${n}`||"."},normalize(t){G(t,"path");let e=t.length;if(e===0)return".";let n=0,r,i=!1,o=t.charCodeAt(0);if(e===1)return $r(o)?"\\":t;if(S(o))if(i=!0,S(t.charCodeAt(1))){let a=2,l=a;for(;a2&&S(t.charCodeAt(2))&&(i=!0,n=3));let u=n0&&S(t.charCodeAt(e-1))&&(u+="\\"),!i&&r===void 0&&t.includes(":")){if(u.length>=2&&Ae(u.charCodeAt(0))&&u.charCodeAt(1)===Ne)return`.\\${u}`;let a=t.indexOf(":");do if(a===e-1||S(t.charCodeAt(a+1)))return`.\\${u}`;while((a=t.indexOf(":",a+1))!==-1)}return r===void 0?i?`\\${u}`:u:i?`${r}\\${u}`:`${r}${u}`},isAbsolute(t){G(t,"path");let e=t.length;if(e===0)return!1;let n=t.charCodeAt(0);return S(n)||e>2&&Ae(n)&&t.charCodeAt(1)===Ne&&S(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,n;for(let o=0;o0&&(e===void 0?e=n=u:e+=`\\${u}`)}if(e===void 0)return".";let r=!0,i=0;if(typeof n=="string"&&S(n.charCodeAt(0))){++i;let o=n.length;o>1&&S(n.charCodeAt(1))&&(++i,o>2&&(S(n.charCodeAt(2))?++i:r=!1))}if(r){for(;i=2&&(e=`\\${e.slice(i)}`)}return C.win32.normalize(e)},relative(t,e){if(G(t,"from"),G(e,"to"),t===e)return"";let n=C.win32.resolve(t),r=C.win32.resolve(e);if(n===r||(t=n.toLowerCase(),e=r.toLowerCase(),t===e))return"";if(n.length!==t.length||r.length!==e.length){let $=n.split("\\"),H=r.split("\\");$[$.length-1]===""&&$.pop(),H[H.length-1]===""&&H.pop();let X=$.length,de=H.length,ue=Xue?H.slice(Q).join("\\"):X>ue?"..\\".repeat(X-1-Q)+"..":"":"..\\".repeat(X-Q)+H.slice(Q).join("\\")}let i=0;for(;ii&&t.charCodeAt(o-1)===ce;)o--;let u=o-i,a=0;for(;aa&&e.charCodeAt(l-1)===ce;)l--;let c=l-a,d=ud){if(e.charCodeAt(a+y)===ce)return r.slice(a+y+1);if(y===2)return r.slice(a+y)}u>d&&(t.charCodeAt(i+y)===ce?f=y:y===2&&(f=3)),f===-1&&(f=0)}let D="";for(y=i+f+1;y<=o;++y)(y===o||t.charCodeAt(y)===ce)&&(D+=D.length===0?"..":"\\..");return a+=f,D.length>0?`${D}${r.slice(a,l)}`:(r.charCodeAt(a)===ce&&++a,r.slice(a,l))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=C.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===ce){if(e.charCodeAt(1)===ce){let n=e.charCodeAt(2);if(n!==Wa&&n!==$e)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Ae(e.charCodeAt(0))&&e.charCodeAt(1)===Ne&&e.charCodeAt(2)===ce)return`\\\\?\\${e}`;return e},dirname(t){G(t,"path");let e=t.length;if(e===0)return".";let n=-1,r=0,i=t.charCodeAt(0);if(e===1)return S(i)?t:".";if(S(i)){if(n=r=1,S(t.charCodeAt(1))){let a=2,l=a;for(;a2&&S(t.charCodeAt(2))?3:2,r=n);let o=-1,u=!0;for(let a=e-1;a>=r;--a)if(S(t.charCodeAt(a))){if(!u){o=a;break}}else u=!1;if(o===-1){if(n===-1)return".";o=n}return t.slice(0,o)},basename(t,e){e!==void 0&&G(e,"suffix"),G(t,"path");let n=0,r=-1,i=!0,o;if(t.length>=2&&Ae(t.charCodeAt(0))&&t.charCodeAt(1)===Ne&&(n=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let u=e.length-1,a=-1;for(o=t.length-1;o>=n;--o){let l=t.charCodeAt(o);if(S(l)){if(!i){n=o+1;break}}else a===-1&&(i=!1,a=o+1),u>=0&&(l===e.charCodeAt(u)?--u===-1&&(r=o):(u=-1,r=a))}return n===r?r=a:r===-1&&(r=t.length),t.slice(n,r)}for(o=t.length-1;o>=n;--o)if(S(t.charCodeAt(o))){if(!i){n=o+1;break}}else r===-1&&(i=!1,r=o+1);return r===-1?"":t.slice(n,r)},extname(t){G(t,"path");let e=0,n=-1,r=0,i=-1,o=!0,u=0;t.length>=2&&t.charCodeAt(1)===Ne&&Ae(t.charCodeAt(0))&&(e=r=2);for(let a=t.length-1;a>=e;--a){let l=t.charCodeAt(a);if(S(l)){if(!o){r=a+1;break}continue}i===-1&&(o=!1,i=a+1),l===$e?n===-1?n=a:u!==1&&(u=1):n!==-1&&(u=-1)}return n===-1||i===-1||u===0||u===1&&n===i-1&&n===r+1?"":t.slice(n,i)},format:Ws.bind(null,"\\"),parse(t){G(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let n=t.length,r=0,i=t.charCodeAt(0);if(n===1)return S(i)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(S(i)){if(r=1,S(t.charCodeAt(1))){let f=2,y=f;for(;f0&&(e.root=t.slice(0,r));let o=-1,u=r,a=-1,l=!0,c=t.length-1,d=0;for(;c>=r;--c){if(i=t.charCodeAt(c),S(i)){if(!l){u=c+1;break}continue}a===-1&&(l=!1,a=c+1),i===$e?o===-1?o=c:d!==1&&(d=1):o!==-1&&(d=-1)}return a!==-1&&(o===-1||d===0||d===1&&o===a-1&&o===u+1?e.base=e.name=t.slice(u,a):(e.name=t.slice(u,o),e.base=t.slice(u,a),e.ext=t.slice(o,a))),u>0&&u!==r?e.dir=t.slice(0,u-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var Ba=(()=>{if(fe){let t=/\\/g;return()=>{let e=et.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>et.cwd()})();C.posix={resolve(...t){let e="",n=!1;for(let r=t.length-1;r>=0&&!n;r--){let i=t[r];G(i,`paths[${r}]`),i.length!==0&&(e=`${i}/${e}`,n=i.charCodeAt(0)===Z)}if(!n){let r=Ba();e=`${r}/${e}`,n=r.charCodeAt(0)===Z}return e=Xt(e,!n,"/",$r),n?`/${e}`:e.length>0?e:"."},normalize(t){if(G(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Z,n=t.charCodeAt(t.length-1)===Z;return t=Xt(t,!e,"/",$r),t.length===0?e?"/":n?"./":".":(n&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return G(t,"path"),t.length>0&&t.charCodeAt(0)===Z},join(...t){if(t.length===0)return".";let e=[];for(let n=0;n0&&e.push(r)}return e.length===0?".":C.posix.normalize(e.join("/"))},relative(t,e){if(G(t,"from"),G(e,"to"),t===e||(t=C.posix.resolve(t),e=C.posix.resolve(e),t===e))return"";let n=1,r=t.length,i=r-n,o=1,u=e.length-o,a=ia){if(e.charCodeAt(o+c)===Z)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else i>a&&(t.charCodeAt(n+c)===Z?l=c:c===0&&(l=0));let d="";for(c=n+l+1;c<=r;++c)(c===r||t.charCodeAt(c)===Z)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+l)}`},toNamespacedPath(t){return t},dirname(t){if(G(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Z,n=-1,r=!0;for(let i=t.length-1;i>=1;--i)if(t.charCodeAt(i)===Z){if(!r){n=i;break}}else r=!1;return n===-1?e?"/":".":e&&n===1?"//":t.slice(0,n)},basename(t,e){e!==void 0&&G(e,"suffix"),G(t,"path");let n=0,r=-1,i=!0,o;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let u=e.length-1,a=-1;for(o=t.length-1;o>=0;--o){let l=t.charCodeAt(o);if(l===Z){if(!i){n=o+1;break}}else a===-1&&(i=!1,a=o+1),u>=0&&(l===e.charCodeAt(u)?--u===-1&&(r=o):(u=-1,r=a))}return n===r?r=a:r===-1&&(r=t.length),t.slice(n,r)}for(o=t.length-1;o>=0;--o)if(t.charCodeAt(o)===Z){if(!i){n=o+1;break}}else r===-1&&(i=!1,r=o+1);return r===-1?"":t.slice(n,r)},extname(t){G(t,"path");let e=-1,n=0,r=-1,i=!0,o=0;for(let u=t.length-1;u>=0;--u){let a=t[u];if(a==="/"){if(!i){n=u+1;break}continue}r===-1&&(i=!1,r=u+1),a==="."?e===-1?e=u:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||r===-1||o===0||o===1&&e===r-1&&e===n+1?"":t.slice(e,r)},format:Ws.bind(null,"/"),parse(t){G(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let n=t.charCodeAt(0)===Z,r;n?(e.root="/",r=1):r=0;let i=-1,o=0,u=-1,a=!0,l=t.length-1,c=0;for(;l>=r;--l){let d=t.charCodeAt(l);if(d===Z){if(!a){o=l+1;break}continue}u===-1&&(a=!1,u=l+1),d===$e?i===-1?i=l:c!==1&&(c=1):i!==-1&&(c=-1)}if(u!==-1){let d=o===0&&n?1:o;i===-1||c===0||c===1&&i===u-1&&i===o+1?e.base=e.name=t.slice(d,u):(e.name=t.slice(d,i),e.base=t.slice(d,u),e.ext=t.slice(i,u))}return o>0?e.dir=t.slice(0,o-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};C.posix.win32=C.win32.win32=C.win32;C.posix.posix=C.win32.posix=C.posix;C.normalize=fe?C.win32.normalize:C.posix.normalize;C.isAbsolute=fe?C.win32.isAbsolute:C.posix.isAbsolute;C.join=fe?C.win32.join:C.posix.join;C.resolve=fe?C.win32.resolve:C.posix.resolve;C.relative=fe?C.win32.relative:C.posix.relative;C.dirname=fe?C.win32.dirname:C.posix.dirname;C.basename=fe?C.win32.basename:C.posix.basename;C.extname=fe?C.win32.extname:C.posix.extname;C.format=fe?C.win32.format:C.posix.format;C.parse=fe?C.win32.parse:C.posix.parse;C.toNamespacedPath=fe?C.win32.toNamespacedPath:C.posix.toNamespacedPath;C.sep=fe?C.win32.sep:C.posix.sep;C.delimiter=fe?C.win32.delimiter:C.posix.delimiter});var js=U(me=>{"use strict";g();Object.defineProperty(me,"__esModule",{value:!0});me.WeakCachedFunction=me.CachedFunction=me.LRUCachedFunction=me.Cache=void 0;me.identity=Jt;var $a=Br(),Hr=class{static{s(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new $a.CancellationTokenSource,n=this.task(e.token);return this.result={promise:n,dispose:s(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};me.Cache=Hr;function Jt(t){return t}s(Jt,"identity");var Gr=class{static{s(this,"LRUCachedFunction")}constructor(e,n){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=Jt):(this._fn=n,this._computeKey=e.getCacheKey)}get(e){let n=this._computeKey(e);return this.lastArgKey!==n&&(this.lastArgKey=n,this.lastCache=this._fn(e)),this.lastCache}};me.LRUCachedFunction=Gr;var Kr=class{static{s(this,"CachedFunction")}get cachedValues(){return this._map}constructor(e,n){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=Jt):(this._fn=n,this._computeKey=e.getCacheKey)}get(e){let n=this._computeKey(e);if(this._map2.has(n))return this._map2.get(n);let r=this._fn(e);return this._map.set(e,r),this._map2.set(n,r),r}};me.CachedFunction=Kr;var Vr=class{static{s(this,"WeakCachedFunction")}constructor(e,n){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=Jt):(this._fn=n,this._computeKey=e.getCacheKey)}get(e){let n=this._computeKey(e);if(this._map.has(n))return this._map.get(n);let r=this._fn(e);return this._map.set(n,r),r}};me.WeakCachedFunction=Vr});var tn=U(en=>{"use strict";g();Object.defineProperty(en,"__esModule",{value:!0});en.Lazy=void 0;var Se;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(Se||(Se={}));var Qr=class{static{s(this,"Lazy")}constructor(e){this.executor=e,this._state=Se.Uninitialized}get hasValue(){return this._state===Se.Completed}get value(){if(this._state===Se.Uninitialized){this._state=Se.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=Se.Completed}}else if(this._state===Se.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};en.Lazy=Qr});var rn=U(_=>{"use strict";g();Object.defineProperty(_,"__esModule",{value:!0});_.Ellipsis=_.InvisibleCharacters=_.AmbiguousCharacters=_.noBreakWhitespace=_.UTF8_BOM_CHARACTER=_.UNUSUAL_LINE_TERMINATORS=_.GraphemeIterator=_.CodePointIterator=void 0;_.isFalsyOrWhitespace=Ga;_.format=Va;_.format2=Ya;_.htmlAttributeEncodeValue=Za;_.escape=Xa;_.escapeRegExpCharacters=$s;_.count=Ja;_.truncate=el;_.truncateMiddle=tl;_.trim=nl;_.ltrim=Hs;_.rtrim=Gs;_.convertSimple2RegExpPattern=rl;_.createRegExp=il;_.regExpLeadsToEndlessLoop=sl;_.joinStrings=ol;_.splitLines=ul;_.splitLinesIncludeSeparators=al;_.indexOfPattern=ll;_.firstNonWhitespaceIndex=Ks;_.getLeadingWhitespace=cl;_.lastNonWhitespaceIndex=fl;_.getIndentationLength=hl;_.replaceAsync=dl;_.compare=ml;_.compareSubstring=Vs;_.compareIgnoreCase=pl;_.compareSubstringIgnoreCase=yt;_.isAsciiDigit=gl;_.isLowerAsciiLetter=Zr;_.isUpperAsciiLetter=_l;_.equalsIgnoreCase=Qs;_.equals=bl;_.startsWithIgnoreCase=Cl;_.endsWithIgnoreCase=yl;_.commonPrefixLength=vl;_.commonSuffixLength=wl;_.isHighSurrogate=ei;_.isLowSurrogate=nn;_.computeCodePoint=ti;_.getNextCodePoint=Ys;_.nextCharLength=Zs;_.prevCharLength=Xs;_.getCharContainingOffset=Ll;_.charCount=Nl;_.containsRTL=Tl;_.isBasicASCII=xl;_.containsUnusualLineTerminators=Pl;_.isFullWidthCharacter=Il;_.isEmojiImprecise=Js;_.lcut=Sl;_.rcut=Rl;_.forAnsiStringParts=Fl;_.removeAnsiEscapeCodes=t1;_.removeAnsiEscapeCodesFromPrompt=ql;_.startsWithUTF8BOM=n1;_.stripUTF8BOM=Wl;_.fuzzyContains=jl;_.containsUppercaseCharacter=zl;_.uppercaseFirstLetter=Bl;_.getNLines=$l;_.singleLetterHash=Hl;_.getGraphemeBreakType=Gl;_.getLeftDeleteOffset=Vl;_.multibyteAwareBtoa=Xl;var Ha=js(),zs=tn();function Ga(t){return!t||typeof t!="string"?!0:t.trim().length===0}s(Ga,"isFalsyOrWhitespace");var Ka=/{(\d+)}/g;function Va(t,...e){return e.length===0?t:t.replace(Ka,function(n,r){let i=parseInt(r,10);return isNaN(i)||i<0||i>=e.length?n:e[i]})}s(Va,"format");var Qa=/{([^}]+)}/g;function Ya(t,e){return Object.keys(e).length===0?t:t.replace(Qa,(n,r)=>e[r]??n)}s(Ya,"format2");function Za(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}s(Za,"htmlAttributeEncodeValue");function Xa(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}s(Xa,"escape");function $s(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}s($s,"escapeRegExpCharacters");function Ja(t,e){let n=0,r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length);return n}s(Ja,"count");function el(t,e,n=_.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${n}`}s(el,"truncate");function tl(t,e,n=_.Ellipsis){if(t.length<=e)return t;let r=Math.ceil(e/2)-n.length/2,i=Math.floor(e/2)-n.length/2;return`${t.substr(0,r)}${n}${t.substr(t.length-i)}`}s(tl,"truncateMiddle");function nl(t,e=" "){let n=Hs(t,e);return Gs(n,e)}s(nl,"trim");function Hs(t,e){if(!t||!e)return t;let n=e.length,r=0;if(n===1){let i=e.charCodeAt(0);for(;r0&&t.charCodeAt(o-1)===u;)o--;return t.substring(0,o)}let i=r;for(;i>0&&t.endsWith(e,i);)i-=n;return t.substring(0,i)}s(Gs,"rtrim");function rl(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}s(rl,"convertSimple2RegExpPattern");function il(t,e,n={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=$s(t)),n.wholeWord&&(/\B/.test(t.charAt(0))||(t="\\b"+t),/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"));let r="";return n.global&&(r+="g"),n.matchCase||(r+="i"),n.multiline&&(r+="m"),n.unicode&&(r+="u"),new RegExp(t,r)}s(il,"createRegExp");function sl(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}s(sl,"regExpLeadsToEndlessLoop");function ol(t,e){return t.filter(n=>n!=null&&n!==!1).join(e)}s(ol,"joinStrings");function ul(t){return t.split(/\r\n|\r|\n/)}s(ul,"splitLines");function al(t){let e=[],n=t.split(/(\r\n|\r|\n)/);for(let r=0;r=0;n--){let r=t.charCodeAt(n);if(r!==32&&r!==9)return n}return-1}s(fl,"lastNonWhitespaceIndex");function hl(t){let e=Ks(t);return e===-1?t.length:e}s(hl,"getIndentationLength");function dl(t,e,n){let r=[],i=0;for(let o of t.matchAll(e)){if(r.push(t.slice(i,o.index)),o.index===void 0)throw new Error("match.index should be defined");i=o.index+o[0].length,r.push(n(o[0],...o.slice(1),o.index,t,o.groups))}return r.push(t.slice(i)),Promise.all(r).then(o=>o.join(""))}s(dl,"replaceAsync");function ml(t,e){return te?1:0}s(ml,"compare");function Vs(t,e,n=0,r=t.length,i=0,o=e.length){for(;nc)return 1}let u=r-n,a=o-i;return ua?1:0}s(Vs,"compareSubstring");function pl(t,e){return yt(t,e,0,t.length,0,e.length)}s(pl,"compareIgnoreCase");function yt(t,e,n=0,r=t.length,i=0,o=e.length){for(;n=128||c>=128)return Vs(t.toLowerCase(),e.toLowerCase(),n,r,i,o);Zr(l)&&(l-=32),Zr(c)&&(c-=32);let d=l-c;if(d!==0)return d}let u=r-n,a=o-i;return ua?1:0}s(yt,"compareSubstringIgnoreCase");function gl(t){return t>=48&&t<=57}s(gl,"isAsciiDigit");function Zr(t){return t>=97&&t<=122}s(Zr,"isLowerAsciiLetter");function _l(t){return t>=65&&t<=90}s(_l,"isUpperAsciiLetter");function Qs(t,e){return t.length===e.length&&yt(t,e)===0}s(Qs,"equalsIgnoreCase");function bl(t,e,n){return t===e||!!n&&t!==void 0&&e!==void 0&&Qs(t,e)}s(bl,"equals");function Cl(t,e){let n=e.length;return n<=t.length&&yt(t,e,0,n)===0}s(Cl,"startsWithIgnoreCase");function yl(t,e){let n=t.length,r=n-e.length;return r>=0&&yt(t,e,r,n)===0}s(yl,"endsWithIgnoreCase");function vl(t,e){let n=Math.min(t.length,e.length),r;for(r=0;r1){let r=t.charCodeAt(e-2);if(ei(r))return ti(r,n)}return n}s(El,"getPrevCodePoint");var tt=class{static{s(this,"CodePointIterator")}get offset(){return this._offset}constructor(e,n=0){this._str=e,this._len=e.length,this._offset=n}setOffset(e){this._offset=e}prevCodePoint(){let e=El(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=Ys(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};_.CodePointIterator=tt;var nt=class{static{s(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,n=0){this._iterator=new tt(e,n)}nextGraphemeLength(){let e=Ct.getInstance(),n=this._iterator,r=n.offset,i=e.getGraphemeBreakType(n.nextCodePoint());for(;!n.eol();){let o=n.offset,u=e.getGraphemeBreakType(n.nextCodePoint());if(Bs(i,u)){n.setOffset(o);break}i=u}return n.offset-r}prevGraphemeLength(){let e=Ct.getInstance(),n=this._iterator,r=n.offset,i=e.getGraphemeBreakType(n.prevCodePoint());for(;n.offset>0;){let o=n.offset,u=e.getGraphemeBreakType(n.prevCodePoint());if(Bs(u,i)){n.setOffset(o);break}i=u}return r-n.offset}eol(){return this._iterator.eol()}};_.GraphemeIterator=nt;function Zs(t,e){return new nt(t,e).nextGraphemeLength()}s(Zs,"nextCharLength");function Xs(t,e){return new nt(t,e).prevGraphemeLength()}s(Xs,"prevCharLength");function Ll(t,e){e>0&&nn(t.charCodeAt(e))&&e--;let n=e+Zs(t,e);return[n-Xs(t,n),n]}s(Ll,"getCharContainingOffset");function Nl(t){let e=new nt(t),n=0;for(;!e.eol();)n++,e.nextGraphemeLength();return n}s(Nl,"charCount");var Yr;function Al(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}s(Al,"makeContainsRtl");function Tl(t){return Yr||(Yr=Al()),Yr.test(t)}s(Tl,"containsRTL");var kl=/^[\t\n\r\x20-\x7E]*$/;function xl(t){return kl.test(t)}s(xl,"isBasicASCII");_.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function Pl(t){return _.UNUSUAL_LINE_TERMINATORS.test(t)}s(Pl,"containsUnusualLineTerminators");function Il(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}s(Il,"isFullWidthCharacter");function Js(t){return t>=127462&&t<=127487||t===8986||t===8987||t===9200||t===9203||t>=9728&&t<=10175||t===11088||t===11093||t>=127744&&t<=128591||t>=128640&&t<=128764||t>=128992&&t<=129008||t>=129280&&t<=129535||t>=129648&&t<=129782}s(Js,"isEmojiImprecise");function Sl(t,e,n=""){let r=t.trimStart();if(r.lengthe){u=!0;break}o=i.lastIndex,i.lastIndex+=1}if(!u)return r;if(o===0)return n;let a=r.substring(0,o).trimEnd();return a.length!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,Dl=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,Ml=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,e1=new RegExp("(?:"+[Ol.source,Dl.source,Ml.source].join("|")+")","g");function*Fl(t){let e=0;for(let n of t.matchAll(e1))e!==n.index&&(yield{isCode:!1,str:t.substring(e,n.index)}),yield{isCode:!0,str:n[0]},e=n.index+n[0].length;e!==t.length&&(yield{isCode:!1,str:t.substring(e)})}s(Fl,"forAnsiStringParts");function t1(t){return t&&(t=t.replace(e1,"")),t}s(t1,"removeAnsiEscapeCodes");var Ul=/\\\[.*?\\\]/g;function ql(t){return t1(t).replace(Ul,"")}s(ql,"removeAnsiEscapeCodesFromPrompt");_.UTF8_BOM_CHARACTER="\uFEFF";function n1(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}s(n1,"startsWithUTF8BOM");function Wl(t){return n1(t)?t.substr(1):t}s(Wl,"stripUTF8BOM");function jl(t,e){if(!t||!e||t.length0&&n>=0);return n===-1?t:(t[n-1]==="\r"&&n--,t.substr(0,n))}s($l,"getNLines");function Hl(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}s(Hl,"singleLetterHash");function Gl(t){return Ct.getInstance().getGraphemeBreakType(t)}s(Gl,"getGraphemeBreakType");function Bs(t,e){return t===0?e!==5&&e!==7:t===2&&e===3?!1:t===4||t===2||t===3||e===4||e===2||e===3?!0:!(t===8&&(e===8||e===9||e===11||e===12)||(t===11||t===9)&&(e===9||e===10)||(t===12||t===10)&&e===10||e===5||e===13||e===7||t===1||t===13&&e===14||t===6&&e===6)}s(Bs,"breakBetweenGraphemeBreakType");var Ct=class t{static{s(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=Kl()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let n=this._data,r=n.length/3,i=1;for(;i<=r;)if(en[3*i+1])i=2*i+1;else return n[3*i+2];return 0}};function Kl(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}s(Kl,"getGraphemeBreakRawData");function Vl(t,e){if(t===0)return 0;let n=Ql(t,e);if(n!==void 0)return n;let r=new tt(e,t);return r.prevCodePoint(),r.offset}s(Vl,"getLeftDeleteOffset");function Ql(t,e){let n=new tt(e,t),r=n.prevCodePoint();for(;Yl(r)||r===65039||r===8419;){if(n.offset===0)return;r=n.prevCodePoint()}if(!Js(r))return;let i=n.offset;return i>0&&n.prevCodePoint()===8205&&(i=n.offset),i}s(Ql,"getOffsetBeforeLastEmojiComponent");function Yl(t){return 127995<=t&&t<=127999}s(Yl,"isEmojiModifier");_.noBreakWhitespace="\xA0";var Xr=class t{static{s(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new zs.Lazy(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new Ha.LRUCachedFunction(e=>{let n=e.split(",");function r(f){let y=new Map;for(let D=0;D!f.startsWith("_")&&Object.hasOwn(u,f));a.length===0&&(a=["_default"]);let l;for(let f of a){let y=r(u[f]);l=o(l,y)}let c=r(u._common),d=i(c,l);return new t(d)})}static getInstance(e){return t.cache.get(Array.from(e).join(","))}static{this._locales=new zs.Lazy(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let n=0;n{"use strict";g();Object.defineProperty(V,"__esModule",{value:!0});V.isPathSeparator=Te;V.toSlashes=r1;V.toPosixPath=e2;V.getRoot=t2;V.isUNC=n2;V.isValidBasename=o2;V.isEqual=u2;V.isEqualOrParent=a2;V.isWindowsDriveLetter=ni;V.sanitizeFilePath=l2;V.removeTrailingPathSeparator=i1;V.isRootOrDriveLetter=c2;V.hasDriveLetter=ri;V.getDriveLetter=f2;V.indexOfPath=h2;V.parseLineAndColumnAware=d2;V.randomPath=g2;var K=bt(),Re=ze(),sn=rn(),Jl=fr();function Te(t){return t===47||t===92}s(Te,"isPathSeparator");function r1(t){return t.replace(/[\\/]/g,K.posix.sep)}s(r1,"toSlashes");function e2(t){return t.indexOf("/")===-1&&(t=r1(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}s(e2,"toPosixPath");function t2(t,e=K.posix.sep){if(!t)return"";let n=t.length,r=t.charCodeAt(0);if(Te(r)){if(Te(t.charCodeAt(1))&&!Te(t.charCodeAt(2))){let o=3,u=o;for(;o\|]/g,i2=/[/]/g,s2=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function o2(t,e=Re.isWindows){let n=e?r2:i2;return!(!t||t.length===0||/^\s+$/.test(t)||(n.lastIndex=0,n.test(t))||e&&s2.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}s(o2,"isValidBasename");function u2(t,e,n){let r=t===e;return!n||r?r:!t||!e?!1:(0,sn.equalsIgnoreCase)(t,e)}s(u2,"isEqual");function a2(t,e,n,r=!1){let i=r?K.posix.sep:K.sep;if(t===e)return!0;if(!t||!e||((t.indexOf("..")>=0||e.indexOf("..")>=0)&&(t=r?K.posix.normalize(t):(0,K.normalize)(t),e=r?K.posix.normalize(e):(0,K.normalize)(e)),e.length>t.length))return!1;if(n){if(!(0,sn.startsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;let u=e.length;return e.charAt(e.length-1)===i&&u--,t.charAt(u)===i}return e.charAt(e.length-1)!==i&&(e+=i),t.indexOf(e)===0}s(a2,"isEqualOrParent");function ni(t){return t>=65&&t<=90||t>=97&&t<=122}s(ni,"isWindowsDriveLetter");function l2(t,e){return Re.isWindows&&t.endsWith(":")&&(t+=K.sep),(0,K.isAbsolute)(t)||(t=(0,K.join)(e,t)),t=(0,K.normalize)(t),i1(t)}s(l2,"sanitizeFilePath");function i1(t){return Re.isWindows?(t=(0,sn.rtrim)(t,K.sep),t.endsWith(":")&&(t+=K.sep)):(t=(0,sn.rtrim)(t,K.sep),t||(t=K.sep)),t}s(i1,"removeTrailingPathSeparator");function c2(t){let e=(0,K.normalize)(t);return Re.isWindows?t.length>3?!1:ri(e)&&(t.length===2||e.charCodeAt(2)===92):e===K.posix.sep}s(c2,"isRootOrDriveLetter");function ri(t,e=Re.isWindows){return e?ni(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}s(ri,"hasDriveLetter");function f2(t,e=Re.isWindows){return ri(t,e)?t[0]:void 0}s(f2,"getDriveLetter");function h2(t,e,n){return e.length>t.length?-1:t===e?0:(n&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}s(h2,"indexOfPath");function d2(t){let e=t.split(":"),n,r,i;for(let o of e){let u=Number(o);(0,Jl.isNumber)(u)?r===void 0?r=u:i===void 0&&(i=u):n=n?[n,o].join(":"):o}if(!n)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:n,line:r!==void 0?r:void 0,column:i!==void 0?i:r!==void 0?1:void 0}}s(d2,"parseLineAndColumnAware");var m2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",p2="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function g2(t,e,n=8){let r="";for(let o=0;o{"use strict";g();var _2=he&&he.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),b2=he&&he.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C2=he&&he.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i0?` Found '${n[0][0]}' at index ${n[0].index} (${n.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${r} (len:${t.scheme.length})`)}if(t.path){if(t.authority){if(!v2.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(w2.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}s(E2,"_validateUri");function L2(t,e){return!t&&!e?"file":t}s(L2,"_schemeFix");function N2(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==pe&&(e=pe+e):e=pe;break}return e}s(N2,"_referenceResolution");var W="",pe="/",A2=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,an=class t{static{s(this,"URI")}static isUri(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,n,r,i,o,u=!1){typeof e=="object"?(this.scheme=e.scheme||W,this.authority=e.authority||W,this.path=e.path||W,this.query=e.query||W,this.fragment=e.fragment||W):(this.scheme=L2(e,u),this.authority=n||W,this.path=N2(this.scheme,r||W),this.query=i||W,this.fragment=o||W,E2(this,u))}get fsPath(){return ln(this,!1)}with(e){if(!e)return this;let{scheme:n,authority:r,path:i,query:o,fragment:u}=e;return n===void 0?n=this.scheme:n===null&&(n=W),r===void 0?r=this.authority:r===null&&(r=W),i===void 0?i=this.path:i===null&&(i=W),o===void 0?o=this.query:o===null&&(o=W),u===void 0?u=this.fragment:u===null&&(u=W),n===this.scheme&&r===this.authority&&i===this.path&&o===this.query&&u===this.fragment?this:new Oe(n,r,i,o,u)}static parse(e,n=!1){let r=A2.exec(e);return r?new Oe(r[2]||W,on(r[4]||W),on(r[5]||W),on(r[7]||W),on(r[9]||W),n):new Oe(W,W,W,W,W)}static file(e){let n=W;if(un.isWindows&&(e=e.replace(/\\/g,pe)),e[0]===pe&&e[1]===pe){let r=e.indexOf(pe,2);r===-1?(n=e.substring(2),e=pe):(n=e.substring(2,r),e=e.substring(r)||pe)}return new Oe("file",n,e,W,W)}static from(e,n){return new Oe(e.scheme,e.authority,e.path,e.query,e.fragment,n)}static joinPath(e,...n){if(!e.path)throw new Error(`[UriError]: cannot call joinPath on URI without path: ${e.toString()}`);let r;return un.isWindows&&e.scheme==="file"?r=t.file(o1.win32.join(ln(e,!0),...n)).path:r=o1.posix.join(e.path,...n),e.with({path:r})}toString(e=!1){return ii(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let n=new Oe(e);return n._formatted=e.external??null,n._fsPath=e._sep===l1?e.fsPath??null:null,n}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};he.URI=an;function T2(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}s(T2,"isUriComponents");var l1=un.isWindows?1:void 0,Oe=class extends an{static{s(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=ln(this,!1)),this._fsPath}toString(e=!1){return e?ii(this,!0):(this._formatted||(this._formatted=ii(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=l1),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},c1={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function u1(t,e,n){let r,i=-1;for(let o=0;o=97&&u<=122||u>=65&&u<=90||u>=48&&u<=57||u===45||u===46||u===95||u===126||e&&u===47||n&&u===91||n&&u===93||n&&u===58)i!==-1&&(r+=encodeURIComponent(t.substring(i,o)),i=-1),r!==void 0&&(r+=t.charAt(o));else{r===void 0&&(r=t.substr(0,o));let a=c1[u];a!==void 0?(i!==-1&&(r+=encodeURIComponent(t.substring(i,o)),i=-1),r+=a):i===-1&&(i=o)}}return i!==-1&&(r+=encodeURIComponent(t.substring(i))),r!==void 0?r:t}s(u1,"encodeURIComponentFast");function k2(t){let e;for(let n=0;n1&&t.scheme==="file"?n=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?n=t.path.substr(1):n=t.path[1].toLowerCase()+t.path.substr(2):n=t.path,un.isWindows&&(n=n.replace(/\//g,"\\")),n}s(ln,"uriToFsPath");function ii(t,e){let n=e?k2:u1,r="",{scheme:i,authority:o,path:u,query:a,fragment:l}=t;if(i&&(r+=i,r+=":"),(o||i==="file")&&(r+=pe,r+=pe),o){let c=o.indexOf("@");if(c!==-1){let d=o.substr(0,c);o=o.substr(c+1),c=d.lastIndexOf(":"),c===-1?r+=n(d,!1,!1):(r+=n(d.substr(0,c),!1,!1),r+=":",r+=n(d.substr(c+1),!1,!0)),r+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?r+=n(o,!1,!0):(r+=n(o.substr(0,c),!1,!0),r+=o.substr(c))}if(u){if(u.length>=3&&u.charCodeAt(0)===47&&u.charCodeAt(2)===58){let c=u.charCodeAt(1);c>=65&&c<=90&&(u=`/${String.fromCharCode(c+32)}:${u.substr(3)}`)}else if(u.length>=2&&u.charCodeAt(1)===58){let c=u.charCodeAt(0);c>=65&&c<=90&&(u=`${String.fromCharCode(c+32)}:${u.substr(2)}`)}r+=n(u,!0,!1)}return a&&(r+="?",r+=n(a,!1,!1)),l&&(r+="#",r+=e?l:u1(l,!1,!1)),r}s(ii,"_asFormatted");function f1(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+f1(t.substr(3)):t}}s(f1,"decodeURIComponentGraceful");var a1=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function on(t){return t.match(a1)?t.replace(a1,e=>f1(e)):t}s(on,"percentDecode")});var g1=U(O=>{"use strict";g();var x2=O&&O.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),P2=O&&O.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ci=O&&O.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;im1(t,n))}s(S2,"matchesSomeScheme");O.connectionTokenCookieName="vscode-tkn";O.connectionTokenQueryName="tkn";var ai=class{static{s(this,"RemoteAuthoritiesImpl")}constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,n){this._serverRootPath=ui.posix.join(n??"/",p1(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return ui.posix.join(this._serverRootPath,_e.vscodeRemoteResource)}set(e,n,r){this._hosts[e]=n,this._ports[e]=r}setConnectionToken(e,n){this._connectionTokens[e]=n}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return I2.onUnexpectedExternalError(a),e}let n=e.authority,r=this._hosts[n];r&&r.indexOf(":")!==-1&&r.indexOf("[")===-1&&(r=`[${r}]`);let i=this._ports[n],o=this._connectionTokens[n],u=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(u+=`&${O.connectionTokenQueryName}=${encodeURIComponent(o)}`),He.URI.from({scheme:oi.isWeb?this._preferredWebSchema:_e.vscodeRemoteResource,authority:`${r}:${i}`,path:this._remoteResourcesPath,query:u})}};O.RemoteAuthorities=new ai;function p1(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}s(p1,"getServerProductSegment");O.builtinExtensionsPath="vs/../../extensions";O.nodeModulesPath="vs/../../node_modules";O.nodeModulesAsarPath="vs/../../node_modules.asar";O.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";O.VSCODE_AUTHORITY="vscode-app";var li=class t{static{s(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=O.VSCODE_AUTHORITY}asBrowserUri(e){let n=this.toUri(e);return this.uriToBrowserUri(n)}uriToBrowserUri(e){return e.scheme===_e.vscodeRemote?O.RemoteAuthorities.rewrite(e):e.scheme===_e.file&&(oi.isNative||oi.webWorkerOrigin===`${_e.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:_e.vscodeFileResource,authority:e.authority||t.FALLBACK_AUTHORITY,query:null,fragment:null}):e}asFileUri(e){let n=this.toUri(e);return this.uriToFileUri(n)}uriToFileUri(e){return e.scheme===_e.vscodeFileResource?e.with({scheme:_e.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(He.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let n=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(n))return He.URI.joinPath(He.URI.parse(n,!0),e);let r=ui.join(n,e);return He.URI.file(r)}throw new Error("Cannot determine URI for module id!")}};O.FileAccess=new li;O.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});O.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var d1;(function(t){let e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);t.CoopAndCoep=Object.freeze(e.get("3"));let n="vscode-coi";function r(o){let u;typeof o=="string"?u=new URL(o).searchParams:o instanceof URL?u=o.searchParams:He.URI.isUri(o)&&(u=new URL(o.toString(!0)).searchParams);let a=u?.get(n);if(a)return e.get(a)}s(r,"getHeadersFromQuery"),t.getHeadersFromQuery=r;function i(o,u,a){if(!globalThis.crossOriginIsolated)return;let l=u&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(n,l):o[n]=l}s(i,"addSearchParam"),t.addSearchParam=i})(d1||(O.COI=d1={}))});var v1=U(p=>{"use strict";g();var R2=p&&p.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),O2=p&&p.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C1=p&&p.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;irt.getRoot(r).length&&r[r.length-1]===n}else{let r=e.path;return r.length>1&&r.charCodeAt(r.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,n=se.sep){return(0,p.hasTrailingPathSeparator)(e,n)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,n=se.sep){let r=!1;if(e.scheme===De.Schemas.file){let i=be(e);r=i!==void 0&&i.length===rt.getRoot(i).length&&i[i.length-1]===n}else{n="/";let i=e.path;r=i.length===1&&i.charCodeAt(i.length-1)===47}return!r&&!(0,p.hasTrailingPathSeparator)(e,n)?e.with({path:e.path+"/"}):e}};p.ExtUri=it;p.extUri=new it(()=>!1);p.extUriBiasedIgnorePathCase=new it(t=>t.scheme===De.Schemas.file?!y1.isLinux:!0);p.extUriIgnorePathCase=new it(t=>!0);p.isEqual=p.extUri.isEqual.bind(p.extUri);p.isEqualOrParent=p.extUri.isEqualOrParent.bind(p.extUri);p.getComparisonKey=p.extUri.getComparisonKey.bind(p.extUri);p.basenameOrAuthority=p.extUri.basenameOrAuthority.bind(p.extUri);p.basename=p.extUri.basename.bind(p.extUri);p.extname=p.extUri.extname.bind(p.extUri);p.dirname=p.extUri.dirname.bind(p.extUri);p.joinPath=p.extUri.joinPath.bind(p.extUri);p.normalizePath=p.extUri.normalizePath.bind(p.extUri);p.relativePath=p.extUri.relativePath.bind(p.extUri);p.resolvePath=p.extUri.resolvePath.bind(p.extUri);p.isAbsolutePath=p.extUri.isAbsolutePath.bind(p.extUri);p.isEqualAuthority=p.extUri.isEqualAuthority.bind(p.extUri);p.hasTrailingPathSeparator=p.extUri.hasTrailingPathSeparator.bind(p.extUri);p.removeTrailingPathSeparator=p.extUri.removeTrailingPathSeparator.bind(p.extUri);p.addTrailingPathSeparator=p.extUri.addTrailingPathSeparator.bind(p.extUri);function D2(t,e){let n=[];for(let r=0;ru===r?!1:(0,p.isEqualOrParent)(i,e(o)))||n.push(t[r])}return n}s(D2,"distinctParents");var b1;(function(t){t.META_DATA_LABEL="label",t.META_DATA_DESCRIPTION="description",t.META_DATA_SIZE="size",t.META_DATA_MIME="mime";function e(n){let r=new Map;n.path.substring(n.path.indexOf(";")+1,n.path.lastIndexOf(";")).split(";").forEach(u=>{let[a,l]=u.split(":");a&&l&&r.set(a,l)});let o=n.path.substring(0,n.path.indexOf(";"));return o&&r.set(t.META_DATA_MIME,o),r}s(e,"parseMetaData"),t.parseMetaData=e})(b1||(p.DataUri=b1={}));function M2(t,e,n){if(e){let r=t.path;return r&&r[0]!==se.posix.sep&&(r=se.posix.sep+r),t.with({scheme:n,authority:e,path:r})}return t.with({scheme:n})}s(M2,"toLocalResource")});var w1=U(cn=>{"use strict";g();Object.defineProperty(cn,"__esModule",{value:!0});cn.MicrotaskDelay=void 0;cn.MicrotaskDelay=Symbol("MicrotaskDelay")});var P1=U(h=>{"use strict";g();Object.defineProperty(h,"__esModule",{value:!0});h.AsyncReader=h.AsyncReaderEndOfStream=h.CancelableAsyncIterableProducer=h.AsyncIterableProducer=h.AsyncIterableSource=h.AsyncIterableObject=h.LazyStatefulPromise=h.StatefulPromise=h.Promises=h.DeferredPromise=h.IntervalCounter=h.TaskSequentializer=h.GlobalIdleValue=h.AbstractIdleValue=h._runWhenIdle=h.runWhenGlobalIdle=h.ThrottledWorker=h.RunOnceWorker=h.ProcessTimeRunOnceScheduler=h.RunOnceScheduler=h.IntervalTimer=h.TimeoutTimer=h.TaskQueue=h.ResourceQueue=h.LimitedQueue=h.Queue=h.Limiter=h.AutoOpenBarrier=h.Barrier=h.ThrottledDelayer=h.Delayer=h.SequencerByKey=h.Sequencer=h.Throttler=void 0;h.isThenable=N1;h.createCancelablePromise=A1;h.raceCancellation=T1;h.raceCancellationError=W2;h.rejectIfNotCanceled=j2;h.notCancellablePromise=z2;h.raceCancellablePromises=B2;h.raceTimeout=k1;h.asPromise=$2;h.promiseWithResolvers=x1;h.timeout=Pi;h.disposableTimeout=K2;h.sequence=V2;h.first=Q2;h.firstParallel=Y2;h.installFakeRunWhenIdle=Z2;h.retry=X2;h.createCancelableAsyncIterableProducer=J2;h.cancellableIterable=ec;h.createTimeout=tc;var xi=Br(),oe=Ue(),wt=jr(),Me=Ut(),E1=v1(),F2=ze(),U2=w1(),q2=tn();function N1(t){return!!t&&typeof t.then=="function"}s(N1,"isThenable");function A1(t){let e=new xi.CancellationTokenSource,n=t(e.token),r=!1,i=new Promise((o,u)=>{let a=e.token.onCancellationRequested(()=>{r=!0,a.dispose(),u(new oe.CancellationError)});Promise.resolve(n).then(l=>{a.dispose(),e.dispose(),r?(0,Me.isDisposable)(l)&&l.dispose():o(l)},l=>{a.dispose(),e.dispose(),u(l)})});return new class{cancel(){e.cancel(),e.dispose()}then(o,u){return i.then(o,u)}catch(o){return this.then(void 0,o)}finally(o){return i.finally(o)}}}s(A1,"createCancelablePromise");function T1(t,e,n){return new Promise((r,i)=>{let o=e.onCancellationRequested(()=>{o.dispose(),r(n)});t.then(r,i).finally(()=>o.dispose())})}s(T1,"raceCancellation");function W2(t,e){return new Promise((n,r)=>{let i=e.onCancellationRequested(()=>{i.dispose(),r(new oe.CancellationError)});t.then(n,r).finally(()=>i.dispose())})}s(W2,"raceCancellationError");function j2(t){if(!(0,oe.isCancellationError)(t))return Promise.reject(t)}s(j2,"rejectIfNotCanceled");function z2(t){return new Promise((e,n)=>{t.then(e,n)})}s(z2,"notCancellablePromise");function B2(t){let e=-1,n=t.map((i,o)=>i.then(u=>(e=o,u))),r=Promise.race(n);return r.cancel=()=>{t.forEach((i,o)=>{o!==e&&i.cancel&&i.cancel()})},r.finally(()=>{r.cancel()}),r}s(B2,"raceCancellablePromises");function k1(t,e,n){let r,i=setTimeout(()=>{r?.(void 0),n?.()},e);return Promise.race([t.finally(()=>clearTimeout(i)),new Promise(o=>r=o)])}s(k1,"raceTimeout");function $2(t){return new Promise((e,n)=>{let r=t();N1(r)?r.then(e,n):e(r)})}s($2,"asPromise");function x1(){let t,e;return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}s(x1,"promiseWithResolvers");var fn=class{static{s(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new xi.CancellationTokenSource}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let n=s(()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let r=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,r},"onComplete");this.queuedPromise=new Promise(r=>{this.activePromise.then(n,n).then(r)})}return new Promise((n,r)=>{this.queuedPromise.then(n,r)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((n,r)=>{this.activePromise.then(i=>{this.activePromise=null,n(i)},i=>{this.activePromise=null,r(i)})})}dispose(){this.cancellationTokenSource.cancel()}};h.Throttler=fn;var fi=class{static{s(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};h.Sequencer=fi;var hi=class{static{s(this,"SequencerByKey")}constructor(){this.promiseMap=new Map}queue(e,n){let i=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(n).finally(()=>{this.promiseMap.get(e)===i&&this.promiseMap.delete(e)});return this.promiseMap.set(e,i),i}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}};h.SequencerByKey=hi;var H2=s((t,e)=>{let n=!0,r=setTimeout(()=>{n=!1,e()},t);return{isTriggered:s(()=>n,"isTriggered"),dispose:s(()=>{clearTimeout(r),n=!1},"dispose")}},"timeoutDeferred"),G2=s(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:s(()=>e,"isTriggered"),dispose:s(()=>{e=!1},"dispose")}},"microtaskDeferred"),hn=class{static{s(this,"Delayer")}constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,n=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((i,o)=>{this.doResolve=i,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let i=this.task;return this.task=null,i()}}));let r=s(()=>{this.deferred=null,this.doResolve?.(null)},"fn");return this.deferred=n===U2.MicrotaskDelay?G2(r):H2(n,r),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new oe.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};h.Delayer=hn;var di=class{static{s(this,"ThrottledDelayer")}constructor(e){this.delayer=new hn(e),this.throttler=new fn}trigger(e,n){return this.delayer.trigger(()=>this.throttler.queue(e),n)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};h.ThrottledDelayer=di;var dn=class{static{s(this,"Barrier")}constructor(){this._isOpen=!1,this._promise=new Promise((e,n)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};h.Barrier=dn;var mi=class extends dn{static{s(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};h.AutoOpenBarrier=mi;function Pi(t,e){return e?new Promise((n,r)=>{let i=setTimeout(()=>{o.dispose(),n()},t),o=e.onCancellationRequested(()=>{clearTimeout(i),o.dispose(),r(new oe.CancellationError)})}):A1(n=>Pi(t,n))}s(Pi,"timeout");function K2(t,e=0,n){let r=setTimeout(()=>{t(),n&&i.dispose()},e),i=(0,Me.toDisposable)(()=>{clearTimeout(r),n?.delete(i)});return n?.add(i),i}s(K2,"disposableTimeout");function V2(t){let e=[],n=0,r=t.length;function i(){return n!!r,n=null){let r=0,i=t.length,o=s(()=>{if(r>=i)return Promise.resolve(n);let u=t[r++];return Promise.resolve(u()).then(l=>e(l)?Promise.resolve(l):o())},"loop");return o()}s(Q2,"first");function Y2(t,e=r=>!!r,n=null){if(t.length===0)return Promise.resolve(n);let r=t.length,i=s(()=>{r=-1;for(let o of t)o.cancel?.()},"finish");return new Promise((o,u)=>{for(let a of t)a.then(l=>{--r>=0&&e(l)?(i(),o(l)):r===0&&o(n)}).catch(l=>{--r>=0&&(i(),u(l))})})}s(Y2,"firstParallel");var mn=class{static{s(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new wt.Emitter}whenIdle(){return this.size>0?wt.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((n,r)=>{this.outstandingPromises.push({factory:e,c:n,e:r}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}};h.Limiter=mn;var pn=class extends mn{static{s(this,"Queue")}constructor(){super(1)}};h.Queue=pn;var pi=class{static{s(this,"LimitedQueue")}constructor(){this.sequentializer=new _n,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};h.LimitedQueue=pi;var gi=class{static{s(this,"ResourceQueue")}constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new ke;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,n=E1.extUri){let r=n.getComparisonKey(e);return this.queues.get(r)?.size??0}queueFor(e,n,r=E1.extUri){let i=r.getComparisonKey(e),o=this.queues.get(i);if(!o){o=new pn;let u=this.drainListenerCount++,a=wt.Event.once(o.onDrained)(()=>{o?.dispose(),this.queues.delete(i),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(u),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new Me.DisposableMap),this.drainListeners.set(u,a),this.queues.set(i,o)}return o.queue(n)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}};h.ResourceQueue=gi;var _i=class{static{s(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let n=new ke;return this._pendingTasks.push({task:e,deferred:n,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),n.p}scheduleSkipIfCleared(e){let n=new ke;return this._pendingTasks.push({task:e,deferred:n,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),n.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new oe.BugIndicatingError;this._runningTask=e.task;try{let n=await e.task();e.deferred.complete(n)}catch(n){e.deferred.error(n)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let n of e)n.setUndefinedWhenCleared?n.deferred.complete(void 0):n.deferred.error(new oe.CancellationError)}};h.TaskQueue=_i;var bi=class{static{s(this,"TimeoutTimer")}constructor(e,n){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof n=="number"&&this.setIfNotSet(e,n)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,n){if(this._isDisposed)throw new oe.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},n)}setIfNotSet(e,n){if(this._isDisposed)throw new oe.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},n))}};h.TimeoutTimer=bi;var Ci=class{static{s(this,"IntervalTimer")}constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,n,r=globalThis){if(this.isDisposed)throw new oe.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let i=r.setInterval(()=>{e()},n);this.disposable=(0,Me.toDisposable)(()=>{r.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};h.IntervalTimer=Ci;var Et=class{static{s(this,"RunOnceScheduler")}constructor(e,n){this.timeoutToken=void 0,this.runner=e,this.timeout=n,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};h.RunOnceScheduler=Et;var yi=class{static{s(this,"ProcessTimeRunOnceScheduler")}constructor(e,n){n%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${n}ms is not a multiple of 1000ms.`),this.runner=e,this.timeout=n,this.counter=0,this.intervalToken=void 0,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=void 0)}schedule(e=this.timeout){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(e/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==void 0}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=void 0,this.runner?.())}};h.ProcessTimeRunOnceScheduler=yi;var vi=class extends Et{static{s(this,"RunOnceWorker")}constructor(e,n){super(e,n),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){let e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}};h.RunOnceWorker=vi;var wi=class extends Me.Disposable{static{s(this,"ThrottledWorker")}constructor(e,n){super(),this.options=e,this.handler=n,this.pendingWork=[],this.throttler=this._register(new Me.MutableDisposable),this.disposed=!1,this.lastExecutionTime=0}get pending(){return this.pendingWork.length}work(e){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+e.length>this.options.maxBufferedWork)return!1}else if(this.pending+e.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(let r of e)this.pendingWork.push(r);let n=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||n>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-n,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(e=this.options.throttleDelay){this.throttler.value=new Et(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};h.ThrottledWorker=wi;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?h._runWhenIdle=(e,n,r)=>{(0,F2.setTimeout0)(()=>{if(i)return;let o=Date.now()+15;n(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,o-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:h._runWhenIdle=(e,n,r)=>{let i=e.requestIdleCallback(n,typeof r=="number"?{timeout:r}:void 0),o=!1;return{dispose(){o||(o=!0,e.cancelIdleCallback(i))}}},h.runWhenGlobalIdle=(e,n)=>(0,h._runWhenIdle)(globalThis,e,n)})();function Z2(t){let e=h._runWhenIdle,n=h.runWhenGlobalIdle;return h._runWhenIdle=t,h.runWhenGlobalIdle=(r,i)=>t(globalThis,r,i),(0,Me.toDisposable)(()=>{h._runWhenIdle=e,h.runWhenGlobalIdle=n})}s(Z2,"installFakeRunWhenIdle");var gn=class{static{s(this,"AbstractIdleValue")}constructor(e,n){this._didRun=!1,this._executor=()=>{try{this._value=n()}catch(r){this._error=r}finally{this._didRun=!0}},this._handle=(0,h._runWhenIdle)(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}};h.AbstractIdleValue=gn;var Ei=class extends gn{static{s(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};h.GlobalIdleValue=Ei;async function X2(t,e,n){let r;for(let i=0;ir?.(),"cancel"),promise:n},n.then(()=>this.doneRunning(e),()=>this.doneRunning(e)),n}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){let e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{let{promise:n,resolve:r,reject:i}=x1();this._queued={run:e,promise:n,promiseResolve:r,promiseReject:i}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}};h.TaskSequentializer=_n;var Li=class{static{s(this,"IntervalCounter")}constructor(e,n=()=>Date.now()){this.interval=e,this.nowFn=n,this.lastIncrementTime=0,this.value=0}increment(){let e=this.nowFn();return e-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=e,this.value=0),this.value++,this.value}};h.IntervalCounter=Li;var ke=class t{static{s(this,"DeferredPromise")}static fromPromise(e){let n=new t;return n.settleWith(e),n}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,n)=>{this.completeCallback=e,this.errorCallback=n})}complete(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.completeCallback(e),this.outcome={outcome:0,value:e},n()})}error(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.errorCallback(e),this.outcome={outcome:1,value:e},n()})}settleWith(e){return e.then(n=>this.complete(n),n=>this.error(n))}cancel(){return this.error(new oe.CancellationError)}};h.DeferredPromise=ke;var L1;(function(t){async function e(r){let i,o=await Promise.all(r.map(u=>u.then(a=>a,a=>{i||(i=a)})));if(typeof i<"u")throw i;return o}s(e,"settled"),t.settled=e;function n(r){return new Promise(async(i,o)=>{try{await r(i,o)}catch(u){o(u)}})}s(n,"withAsyncBody"),t.withAsyncBody=n})(L1||(h.Promises=L1={}));var bn=class{static{s(this,"StatefulPromise")}get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then(n=>(this._value=n,this._isResolved=!0,n),n=>{throw this._error=n,this._isResolved=!0,n})}requireValue(){if(!this._isResolved)throw new oe.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};h.StatefulPromise=bn;var Ni=class{static{s(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new q2.Lazy(()=>new bn(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};h.LazyStatefulPromise=Ni;var Cn=class t{static{s(this,"AsyncIterableObject")}static fromArray(e){return new t(n=>{n.emitMany(e)})}static fromPromise(e){return new t(async n=>{n.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async n=>{await Promise.all(e.map(async r=>n.emitOne(await r)))})}static merge(e){return new t(async n=>{await Promise.all(e.map(async r=>{for await(let i of r)n.emitOne(i)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new wt.Emitter,queueMicrotask(async()=>{let r={emitOne:s(i=>this.emitOne(i),"emitOne"),emitMany:s(i=>this.emitMany(i),"emitMany"),reject:s(i=>this.reject(i),"reject")};try{await Promise.resolve(e(r)),this.resolve()}catch(i){this.reject(i)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:s(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,n){return new t(async r=>{for await(let i of e)r.emitOne(n(i))})}map(e){return t.map(this,e)}static filter(e,n){return new t(async r=>{for await(let i of e)n(i)&&r.emitOne(i)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,n=>!!n)}coalesce(){return t.coalesce(this)}static async toPromise(e){let n=[];for await(let r of e)n.push(r);return n}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};h.AsyncIterableObject=Cn;function J2(t){let e=new xi.CancellationTokenSource,n=t(e.token);return new vn(e,async r=>{let i=e.token.onCancellationRequested(()=>{i.dispose(),e.dispose(),r.reject(new oe.CancellationError)});try{for await(let o of n){if(e.token.isCancellationRequested)return;r.emitOne(o)}i.dispose(),e.dispose()}catch(o){i.dispose(),e.dispose(),r.reject(o)}})}s(J2,"createCancelableAsyncIterableProducer");var Ai=class{static{s(this,"AsyncIterableSource")}constructor(e){this._deferred=new ke,this._asyncIterable=new Cn(i=>{if(n){i.reject(n);return}return r&&i.emitMany(r),this._errorFn=o=>i.reject(o),this._emitOneFn=o=>i.emitOne(o),this._emitManyFn=o=>i.emitMany(o),this._deferred.p},e);let n,r;this._errorFn=i=>{n||(n=i)},this._emitOneFn=i=>{r||(r=[]),r.push(i)},this._emitManyFn=i=>{r?i.forEach(o=>r.push(o)):r=i.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}};h.AsyncIterableSource=Ai;function ec(t,e){let n=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await T1(n.next(),e)||{done:!0,value:void 0}},throw:n.throw?.bind(n),return:n.return?.bind(n),[Symbol.asyncIterator](){return this}}}s(ec,"cancellableIterable");var Ti=class{static{s(this,"ProducerConsumer")}constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let n=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(n,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let n of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(n,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new oe.BugIndicatingError("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,n){n.ok?e.complete(n.value):e.error(n.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new ke;return this._unsatisfiedConsumers.push(e),e.p}}},yn=class t{static{s(this,"AsyncIterableProducer")}constructor(e,n){this._onReturn=n,this._producerConsumer=new Ti,this._iterator={next:s(()=>this._producerConsumer.consume(),"next"),return:s(()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),"return"),throw:s(async r=>(this._finishError(r),{done:!0,value:void 0}),"throw")},queueMicrotask(async()=>{let r=e({emitOne:s(i=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}}),"emitOne"),emitMany:s(i=>{for(let o of i)this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}})},"emitMany"),reject:s(i=>this._finishError(i),"reject")});if(!this._producerConsumer.hasFinalValue)try{await r,this._finishOk()}catch(i){this._finishError(i)}})}static fromArray(e){return new t(n=>{n.emitMany(e)})}static fromPromise(e){return new t(async n=>{n.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async n=>{await Promise.all(e.map(async r=>n.emitOne(await r)))})}static merge(e){return new t(async n=>{await Promise.all(e.map(async r=>{for await(let i of r)n.emitOne(i)}))})}static{this.EMPTY=t.fromArray([])}static map(e,n){return new t(async r=>{for await(let i of e)r.emitOne(n(i))})}static tee(e){let n,r,i=new ke,o=s(async()=>{if(!(!n||!r))try{for await(let l of e)n.emitOne(l),r.emitOne(l)}catch(l){n.reject(l),r.reject(l)}finally{i.complete()}},"start"),u=new t(async l=>(n=l,o(),i.p)),a=new t(async l=>(r=l,o(),i.p));return[u,a]}map(e){return t.map(this,e)}static coalesce(e){return t.filter(e,n=>!!n)}coalesce(){return t.coalesce(this)}static filter(e,n){return new t(async r=>{for await(let i of e)n(i)&&r.emitOne(i)})}filter(e){return t.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};h.AsyncIterableProducer=yn;var vn=class extends yn{static{s(this,"CancelableAsyncIterableProducer")}constructor(e,n){super(n),this._source=e}cancel(){this._source.cancel()}};h.CancelableAsyncIterableProducer=vn;h.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var ki=class{static{s(this,"AsyncReader")}get endOfStream(){return this._buffer.length===0&&this._atEnd}constructor(e){this._source=e,this._buffer=[],this._atEnd=!1}async read(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?h.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,n){do{let r=await this.peek();if(r===h.AsyncReaderEndOfStream||!e(r))break;await this.read(),await n(r)}while(!0)}readBufferedOrThrow(){let e=this.peekBufferedOrThrow();return this._buffer.shift(),e}async consumeToEnd(){for(;!this.endOfStream;)await this.read()}async peek(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?h.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return h.AsyncReaderEndOfStream;throw new oe.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await k1(this._extendBuffer(),e),this._atEnd)return h.AsyncReaderEndOfStream;if(this._buffer.length!==0)return this._buffer[0]}_extendBuffer(){return this._atEnd?Promise.resolve():(this._extendBufferPromise||(this._extendBufferPromise=(async()=>{let{value:e,done:n}=await this._source.next();this._extendBufferPromise=void 0,n?this._atEnd=!0:this._buffer.push(e)})()),this._extendBufferPromise)}};h.AsyncReader=ki;function tc(t,e){let n=setTimeout(e,t);return(0,Me.toDisposable)(()=>clearTimeout(n))}s(tc,"createTimeout")});var I1=U(wn=>{"use strict";g();Object.defineProperty(wn,"__esModule",{value:!0});wn.Position=void 0;var Ii=class t{static{s(this,"Position")}constructor(e,n){this.lineNumber=e,this.column=n}with(e=this.lineNumber,n=this.column){return e===this.lineNumber&&n===this.column?this:new t(e,n)}delta(e=0,n=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+n))}equals(e){return t.equals(this,e)}static equals(e,n){return!e&&!n?!0:!!e&&!!n&&e.lineNumber===n.lineNumber&&e.column===n.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,n){return e.lineNumber{"use strict";g();Object.defineProperty(En,"__esModule",{value:!0});En.Range=void 0;var S1=I1(),Si=class t{static{s(this,"Range")}constructor(e,n,r,i){e>r||e===r&&n>i?(this.startLineNumber=r,this.startColumn=i,this.endLineNumber=e,this.endColumn=n):(this.startLineNumber=e,this.startColumn=n,this.endLineNumber=r,this.endColumn=i)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.columne.endColumn)}static strictContainsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.column<=e.startColumn||n.lineNumber===e.endLineNumber&&n.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumn<=e.startColumn||n.endLineNumber===e.endLineNumber&&n.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,n){let r,i,o,u;return n.startLineNumbere.endLineNumber?(o=n.endLineNumber,u=n.endColumn):n.endLineNumber===e.endLineNumber?(o=n.endLineNumber,u=Math.max(n.endColumn,e.endColumn)):(o=e.endLineNumber,u=e.endColumn),new t(r,i,o,u)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,n){let r=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,u=e.endColumn,a=n.startLineNumber,l=n.startColumn,c=n.endLineNumber,d=n.endColumn;return rc?(o=c,u=d):o===c&&(u=Math.min(u,d)),r>o||r===o&&i>u?null:new t(r,i,o,u)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,n){return!e&&!n?!0:!!e&&!!n&&e.startLineNumber===n.startLineNumber&&e.startColumn===n.startColumn&&e.endLineNumber===n.endLineNumber&&e.endColumn===n.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new S1.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new S1.Position(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,n){return new t(this.startLineNumber,this.startColumn,e,n)}setStartPosition(e,n){return new t(e,n,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,n=e){return new t(e.lineNumber,e.column,n.lineNumber,n.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,n){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};En.Range=Si});g();g();g();g();g();g();var st=class t{static{s(this,"Position")}constructor(e,n){this.lineNumber=e,this.column=n}with(e=this.lineNumber,n=this.column){return e===this.lineNumber&&n===this.column?this:new t(e,n)}delta(e=0,n=0){return this.with(this.lineNumber+e,this.column+n)}equals(e){return t.equals(this,e)}static equals(e,n){return!e&&!n?!0:!!e&&!!n&&e.lineNumber===n.lineNumber&&e.column===n.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,n){return e.lineNumberr||e===r&&n>i?(this.startLineNumber=r,this.startColumn=i,this.endLineNumber=e,this.endColumn=n):(this.startLineNumber=e,this.startColumn=n,this.endLineNumber=r,this.endColumn=i)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.columne.endColumn)}static strictContainsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.column<=e.startColumn||n.lineNumber===e.endLineNumber&&n.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumn<=e.startColumn||n.endLineNumber===e.endLineNumber&&n.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,n){let r,i,o,u;return n.startLineNumbere.endLineNumber?(o=n.endLineNumber,u=n.endColumn):n.endLineNumber===e.endLineNumber?(o=n.endLineNumber,u=Math.max(n.endColumn,e.endColumn)):(o=e.endLineNumber,u=e.endColumn),new t(r,i,o,u)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,n){let r=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,u=e.endColumn,a=n.startLineNumber,l=n.startColumn,c=n.endLineNumber,d=n.endColumn;return rc?(o=c,u=d):o===c&&(u=Math.min(u,d)),r>o||r===o&&i>u?null:new t(r,i,o,u)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,n){return!e&&!n?!0:!!e&&!!n&&e.startLineNumber===n.startLineNumber&&e.startColumn===n.startColumn&&e.endLineNumber===n.endLineNumber&&e.endColumn===n.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new st(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new st(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,n){return new t(this.startLineNumber,this.startColumn,e,n)}setStartPosition(e,n){return new t(e,n,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,n=e){return new t(e.lineNumber,e.column,n.lineNumber,n.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,n){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};var Rn=250,In=4,Q1=/\w{2}/,Sn=class{static{s(this,"InlineApproximateTokenizer")}tokenLength(e){return Math.ceil(e.length/In)}},Y1="o200k_base",Tt=class{static{s(this,"NaiveChunker")}constructor(e=Y1){this.tokenizer=new Sn}getTokenCount(e){return this.tokenizer.tokenLength(e)}chunkFile(e,n,r={},i){let{maxTokenLength:o=Rn,removeEmptyLines:u=!0}=r,a=[];for(let l of this._processLinesIntoChunks(e,n,o,!0,u,i)){if(i?.isCancellationRequested)return[];(!u||l.text.length>0&&Q1.test(l.text))&&a.push(l)}return a}*_processLinesIntoChunks(e,n,r,i,o,u){let a=Z1(n),l=[],c=0,d,f=!0;for(let D=0;D0?1:0;if(Math.ceil((c+X+H.length)/In)>r&&l.length>0){let ue=this.finalizeChunk(e,l,i,d??"",!1,f);ue&&(yield ue),l.length=0,c=0,d=void 0,f=!1}if(d===void 0||d.length>0){let ue=$.match(/^\s+/),Q=ue?ue[0]:"";d=d?J1(d,Q):Q}l.push({text:H,lineNumber:D}),c+=(l.length>1?1:0)+H.length}let y=this.finalizeChunk(e,l,i,d??"",!0,f);y&&(yield y)}finalizeChunk(e,n,r,i,o,u){if(!n.length)return;let a=r?n.map(c=>c.text.substring(i.length)).join(` `):n.map(c=>c.text).join(` `),l=n[n.length-1];return{file:e,text:a,rawText:a,isFullFile:u&&o,range:new At(n[0].lineNumber+1,1,l.lineNumber+1,l.text.length+1)}}};function Z1(t){let e=[],n="";for(let r=0;r